Package edu.brown.hstore.callbacks

Examples of edu.brown.hstore.callbacks.LocalPrepareCallback


    public DistributedState(HStoreSite hstore_site) {
        CatalogContext catalogContext = hstore_site.getCatalogContext();
        this.notified_prepare = new BitSet(catalogContext.numberOfPartitions);
        this.sent_parameters = new BitSet(catalogContext.numberOfSites);
       
        this.prepare_callback = new LocalPrepareCallback(hstore_site);
        this.finish_callback = new LocalFinishCallback(hstore_site);
       
        this.rpc_transactionInit = new ProtoRpcController[catalogContext.numberOfSites];
        this.rpc_transactionWork = new ProtoRpcController[catalogContext.numberOfSites];
        // this.rpc_transactionPrepare = new ProtoRpcController[catalogContext.numberOfSites];
View Full Code Here


        estDonePartitions.remove(this.partitionId);
       
        // Make sure that we only tell partitions that we actually touched, otherwise they will
        // be stuck waiting for a finish request that will never come!
        DonePartitionsNotification notify = new DonePartitionsNotification();
        LocalPrepareCallback callback = null;
        for (int partition : estDonePartitions.values()) {
            // Only mark the txn done at this partition if the Estimate says we were done
            // with it after executing this batch and it's a partition that we've locked.
            if (donePartitions.contains(partition) || touchedPartitions.contains(partition) == false)
                continue;
View Full Code Here

            // We will send a prepare message to all of our remote HStoreSites
            // The coordinator needs to be smart enough to know whether a txn
            // has already been marked as prepared at a partition (i.e., it's gotten
            // responses).
            PartitionSet partitions = ts.getPredictTouchedPartitions();
            LocalPrepareCallback callback = ts.getPrepareCallback();
            this.hstore_coordinator.transactionPrepare(ts, callback, partitions);
            if (hstore_conf.site.exec_profiling) this.profiler.network_time.stopIfStarted();
            ts.getDonePartitions().addAll(partitions);
        }
        // -------------------------------
        // ABORT: Distributed Transaction
        // -------------------------------
        else {
            // Send back the result to the client right now, since there's no way
            // that we're magically going to be able to recover this and get them a result
            // This has to come before the network messages above because this will clean-up the
            // LocalTransaction state information
            this.hstore_site.responseSend(ts, cresponse);
           
            // Send a message all the partitions involved that the party is over
            // and that they need to abort the transaction. We don't actually care when we get the
            // results back because we'll start working on new txns right away.
            // Note that when we call transactionFinish() right here this thread will then go on
            // to invoke HStoreSite.transactionFinish() for us. That means when it returns we will
            // have successfully aborted the txn at least at all of the local partitions at this site.
            if (hstore_conf.site.txn_profiling && ts.profiler != null) ts.profiler.startPostFinish();
            LocalFinishCallback callback = ts.getFinishCallback();
            callback.init(ts, status);
            if (hstore_conf.site.exec_profiling) this.profiler.network_time.start();
            try {
                this.hstore_coordinator.transactionFinish(ts, status, callback);
            } finally {
                if (hstore_conf.site.exec_profiling) this.profiler.network_time.stopIfStarted();
View Full Code Here

TOP

Related Classes of edu.brown.hstore.callbacks.LocalPrepareCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.