Package edu.brown.hstore.txns

Examples of edu.brown.hstore.txns.MapReduceTransaction


    protected void unblockTransactionCallback() {
        if (debug.val)
            LOG.debug(ts + " is ready to execute. Passing to HStoreSite " +
                    "<Switching to the 'reduce' phase>.......");
       
        MapReduceTransaction mr_ts = (MapReduceTransaction)this.ts;
        mr_ts.setReducePhase();
        assert(mr_ts.isReducePhase());
        mr_ts.resetTransaction();
       
        if (hstore_site.getHStoreConf().site.mr_reduce_blocking){
            if (debug.val)
                LOG.debug(ts + ": $$$ normal reduce blocking execution way");
            // calling this hstore_site.transactionStart function will block the executing engine on each partition
View Full Code Here


        // PartitionExecutor object pool. This will be the handle that is used all
        // throughout this txn's lifespan to keep track of what it does
        LocalTransaction ts = null;
        try {
            if (this.isMapReduce[procId]) {
                ts = new MapReduceTransaction(this.hstore_site);
            } else {
                ts = new LocalTransaction(this.hstore_site);
            }
            assert(ts.isInitialized() == false);
        } catch (Throwable ex) {
View Full Code Here

            throw new RuntimeException(ex);
        }
        assert(procParams != null) :
            "The parameters object is null for new txn from client #" + client_handle;
       
        MapReduceTransaction ts = new MapReduceTransaction(hstore_site);
       
        // We should never already have a transaction handle for this txnId
        AbstractTransaction dupe = this.inflight_txns.put(txn_id, ts);
        assert(dupe == null) : "Trying to create multiple transaction handles for " + dupe;

        ts.init(txn_id, initiateTime, client_handle, base_partition, catalog_proc, procParams);
        if (debug.val)
            LOG.debug(String.format("Created new MapReduceTransaction state %s from remote partition %d",
                      ts, base_partition));
        return (ts);
    }
View Full Code Here

        long txn_id = request.getTransactionId();
        if (debug.val)
            LOG.debug(String.format("Got %s for txn #%d",
                      request.getClass().getSimpleName(), txn_id));
       
        MapReduceTransaction mr_ts = hstore_site.getTransaction(txn_id);
        assert(mr_ts != null);
        if (debug.val)
            LOG.debug(String.format("TXN: %s, [Stage], [Site] %d",mr_ts,hstore_site.getSiteId()));
      
       
        mr_ts.initTransactionReduceWrapperCallback(callback);
       
        if(!this.hstore_site.getLocalPartitionIds().contains(mr_ts.getBasePartition()))
            mr_ts.setReducePhase();
       
        assert(mr_ts.isReducePhase());
       
        if (debug.val)
            LOG.debug("After init initTransactionReduceWrapperCallback.......");
       
        /*
         * Here we would like to start MapReduce Transaction on the remote partition except the base partition of it.
         * This is to avoid the double invoke for remote task.
         * */
        if(hstore_site.getHStoreConf().site.mr_reduce_blocking) {
            for (int partition : hstore_site.getLocalPartitionIds()) {
                if (partition != mr_ts.getBasePartition()) {
                    LocalTransaction ts = mr_ts.getLocalTransaction(partition);
                    hstore_site.transactionStart(ts);
                }
            } // FOR
        } else {
            // non-blocking way of execution for Reduce
            mr_ts.markBasePartitionReduceExec();
            hstore_site.getMapReduceHelper().queue(mr_ts);
        }
       
    }
View Full Code Here

            LOG.debug(String.format("Got %s for txn #%d",
                                   request.getClass().getSimpleName(), txn_id));

        // The mr_ts handle will be null if this HStoreSite is not where the
        // base partition for the original MRTransaction
        MapReduceTransaction mr_ts = hstore_site.getTransaction(txn_id);
        if (mr_ts == null) {
            mr_ts = hstore_site.getTransactionInitializer()
                               .createMapReduceTransaction(txn_id,
                                                           EstTime.currentTimeMillis(),
                                                           request.getClientHandle(),
                                                           request.getBasePartition(),
                                                           request.getProcedureId(),
                                                           request.getParams().asReadOnlyByteBuffer());
        }
        assert(mr_ts.isMapPhase());
        mr_ts.initTransactionMapWrapperCallback(callback);

        /*
         * Here we would like to start MapReduce Transaction on the remote partition except the base partition of it.
         * This is to avoid the double invoke for remote task.
         * */
        for (int partition : hstore_site.getLocalPartitionIds()) {
            if (partition != mr_ts.getBasePartition()) {
                LocalTransaction ts = mr_ts.getLocalTransaction(partition);
                hstore_site.transactionStart(ts);
            }
        } // FOR
    }
View Full Code Here

       
        // If this is a MapReduceTransaction handle, we actually want to get the
        // inner LocalTransaction handle for this partition. The MapReduceTransaction
        // is just a placeholder
        if (ts instanceof MapReduceTransaction) {
            MapReduceTransaction mr_ts = (MapReduceTransaction)ts;
            ts = mr_ts.getLocalTransaction(this.partitionId);
            assert(ts != null) :
                "Unexpected null LocalTransaction handle from " + mr_ts;
        }
       
        ExecutionMode before_mode = this.currentExecMode;
View Full Code Here

TOP

Related Classes of edu.brown.hstore.txns.MapReduceTransaction

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.