Examples of DependencySet


Examples of org.voltdb.DependencySet

            // We can do this here because the only way that we're not read-only is if
            // we actually modify data at this partition
            ts.markExecutedWork(this.partitionId);
        }
       
        DependencySet result = null;
        boolean needs_profiling = false;
        if (ts.isExecLocal(this.partitionId)) {
            if (hstore_conf.site.txn_profiling && ((LocalTransaction)ts).profiler != null) {
                needs_profiling = true;
                ((LocalTransaction)ts).profiler.startExecEE();
View Full Code Here

Examples of org.voltdb.DependencySet

            } // FOR
            vt.addRow(row);
        } // FOR
       
        int dep_id = 10001;
        DependencySet result = new DependencySet(new int[]{ dep_id }, new VoltTable[]{ vt });
       
        RemoteTransaction ts = new RemoteTransaction(hstore_site);
        WorkResult partitionResult = executor.buildWorkResult(ts, result, Status.OK, null);
        assertNotNull(partitionResult);
        assertEquals(result.size(), partitionResult.getDepDataCount());
       
        assertEquals(1, partitionResult.getDepDataCount());
        for (int i = 0; i < partitionResult.getDepDataCount(); i++) {
            assertEquals(dep_id, partitionResult.getDepId(i));
           
View Full Code Here

Examples of org.voltdb.DependencySet

    public DependencySet executePlanFragment(Long txn_id,
                                             Map<Integer, List<VoltTable>> dependencies,
                                             int fragmentId,
                                             ParameterSet params,
                                             PartitionExecutor.SystemProcedureExecutionContext context) {
        DependencySet result = null;
        switch (fragmentId) {
            case DISTRIBUTE_ID: {
                VoltTable vt = new VoltTable(ResultsColumns);
                AntiCacheManagerProfiler profiler = hstore_site.getAntiCacheManager().getDebugContext().getProfiler(this.partitionId);
                assert(profiler != null);
                for (EvictionHistory eh : profiler.eviction_history) {
                    Object row[] = {
                        new TimestampType(),
                        this.hstore_site.getSiteId(),
                        this.hstore_site.getSiteName(),
                        this.partitionId,
                        eh.startTimestamp,
                        eh.stopTimestamp,
                        eh.tuplesEvicted,
                        eh.blocksEvicted,
                        eh.bytesEvicted,
                    };
                    vt.addRow(row);
                } // FOR
                result = new DependencySet(DISTRIBUTE_ID, vt);
                if (debug.val)
                    LOG.info(String.format("%s - Sending back result for partition %d",
                             hstore_site.getTransaction(txn_id), this.executor.getPartitionId()));
                break;
            }
            // Aggregate Results
            case AGGREGATE_ID:
                List<VoltTable> siteResults = dependencies.get(DISTRIBUTE_ID);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
               
                Pair<Integer, SortDirectionType> sortCol = Pair.of(3, SortDirectionType.ASC);
                @SuppressWarnings("unchecked")
                VoltTable vt = VoltTableUtil.sort(VoltTableUtil.union(siteResults), sortCol);
                result = new DependencySet(AGGREGATE_ID, vt);
                break;
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
        } // SWITCH
View Full Code Here

Examples of org.voltdb.DependencySet

    public DependencySet executePlanFragment(Long txn_id,
                                             Map<Integer, List<VoltTable>> dependencies,
                                             int fragmentId,
                                             ParameterSet params,
                                             PartitionExecutor.SystemProcedureExecutionContext context) {
        DependencySet result = null;
        switch (fragmentId) {
            // ----------------------------------------------------------------------------
            // COLLECT DATA
            // ----------------------------------------------------------------------------
            case DISTRIBUTE_ID: {
                VoltTable vt = new VoltTable(ACCESS_HISTORY);
                AntiCacheManagerProfiler profiler = hstore_site.getAntiCacheManager().getDebugContext().getProfiler(this.partitionId);
                assert(profiler != null);
                TimestampType timestamp = new TimestampType();
                for (AccessHistory eah : profiler.evictedaccess_history) {
                    String procName = catalogContext.getProcedureById(eah.procId).getName();
                    Object row[] = {
                            timestamp,
                            this.hstore_site.getSiteId(),
                            this.hstore_site.getSiteName(),
                            this.partitionId,
                            eah.txnId,
                            eah.startTimestamp,
                            procName,
                            eah.numBlocks,
                            eah.numTables,
                            eah.numTuples,
                        };
                        vt.addRow(row);
                } // FOR
                result = new DependencySet(DISTRIBUTE_ID, vt);
                if (debug.val)
                    LOG.info(String.format("%s - Sending back result for partition %d",
                             hstore_site.getTransaction(txn_id), this.executor.getPartitionId()));
                break;
            }
           
            // ----------------------------------------------------------------------------
            // AGGREGATE RESULTS
            // ----------------------------------------------------------------------------
            case AGGREGATE_ID: {
                List<VoltTable> siteResults = dependencies.get(DISTRIBUTE_ID);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
               
                Pair<Integer, SortDirectionType> sortCol = Pair.of(3, SortDirectionType.ASC);
                @SuppressWarnings("unchecked")
                VoltTable vt = VoltTableUtil.sort(VoltTableUtil.union(siteResults), sortCol);
                result = new DependencySet(AGGREGATE_ID, vt);
                break;
            }
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
View Full Code Here

Examples of org.voltdb.DependencySet

                    writer.close();
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
            } // FOR
            return new DependencySet(new int[] { (int)SysProcFragmentId.PF_dumpDistribute }, result);
           
        } else if (fragmentId == SysProcFragmentId.PF_dumpAggregate) {
            if (debug) LOG.debug("Aggregating results from loading fragments in txn #" + txn_id);
            return new DependencySet(new int[] { (int)SysProcFragmentId.PF_dumpAggregate }, result);
        }
        assert(false) : "Unexpected FragmentId " + fragmentId;
        return null;
    }
View Full Code Here

Examples of org.voltdb.DependencySet

    public DependencySet executePlanFragment(Long txn_id,
                                             Map<Integer, List<VoltTable>> dependencies,
                                             int fragmentId,
                                             ParameterSet params,
                                             PartitionExecutor.SystemProcedureExecutionContext context) {
        DependencySet result = null;
        switch (fragmentId) {
            // Perform Garbage Collection
            case SysProcFragmentId.PF_gcDistribute: {
                LOG.debug("Invoking garbage collector");
                this.gcTime.clear();
                this.gcTime.start();
                // System.gc();
                this.gcTime.stop();
               
                if (LOG.isDebugEnabled())
                    LOG.debug(String.format("Performed Garbage Collection at %s: %s",
                              this.executor.getHStoreSite().getSiteName(),
                              this.gcTime.debug()));
                VoltTable vt = new VoltTable(nodeResultsColumns);
                vt.addRow(this.executor.getHStoreSite().getSiteName(),
                          (int)this.gcTime.getTotalThinkTimeMS(),
                          new TimestampType());
                result = new DependencySet(SysProcFragmentId.PF_gcDistribute, vt);
                break;
            }
            // Aggregate Results
            case SysProcFragmentId.PF_gcAggregate:
                LOG.debug("Combining results");
                List<VoltTable> siteResults = dependencies.get(SysProcFragmentId.PF_gcDistribute);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
               
                VoltTable vt = VoltTableUtil.union(siteResults);
                result = new DependencySet(SysProcFragmentId.PF_gcAggregate, vt);
                break;
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
        } // SWITCH
View Full Code Here

Examples of org.voltdb.DependencySet

        // Create a mocked up dependency pair. Required by some tests
        VoltTable vt;
        vt = new VoltTable(new ColumnInfo[] {
                           new ColumnInfo("foo", VoltType.INTEGER)});
        vt.addRow(Integer.valueOf(1));
        return new DependencySet(outputDepId, vt);
    }
View Full Code Here

Examples of org.voltdb.DependencySet

    public DependencySet executePlanFragment(Long txn_id,
                                             Map<Integer, List<VoltTable>> dependencies,
                                             int fragmentId,
                                             ParameterSet params,
                                             PartitionExecutor.SystemProcedureExecutionContext context) {
        DependencySet result = null;
        switch (fragmentId) {
            case SysProcFragmentId.PF_quiesceDistribute: {
                LOG.debug("Clearing out work queue at partition " + executor.getPartitionId());
                executor.haltProcessing();
               
                // Clear out the QueueManager too if this is the first partition
                // at this site
                hstore_site.getTransactionQueueManager().clearQueues(executor.getPartitionId());
               
                VoltTable vt = new VoltTable(ResultsColumns);
                Object row[] = {
                    this.hstore_site.getSiteId(),
                    this.hstore_site.getSiteName(),
                    this.executor.getPartitionId(),
                    Status.OK.name(),
                    new TimestampType(),
                };
                vt.addRow(row);
                result = new DependencySet(SysProcFragmentId.PF_quiesceDistribute, vt);
                break;
            }
            // Aggregate Results
            case SysProcFragmentId.PF_quiesceAggregate:
                List<VoltTable> siteResults = dependencies.get(SysProcFragmentId.PF_quiesceDistribute);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
                VoltTable vt = VoltTableUtil.union(siteResults);
                result = new DependencySet(SysProcFragmentId.PF_quiesceAggregate, vt);
                break;
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
        } // SWITCH
View Full Code Here

Examples of org.voltdb.DependencySet

                      (lastExecuted != null  ? lastExecuted.longValue()  : VoltType.NULL_BIGINT),
                      (lastCommitted != null ? lastCommitted.longValue() : VoltType.NULL_BIGINT),
                      new TimestampType());
        } // FOR
       
        DependencySet result = new DependencySet(SysProcFragmentId.PF_execStatus, vt);
        return (result);
    }
View Full Code Here

Examples of org.voltdb.DependencySet

            table = ee.executeCustomPlanFragment(plan, outputDepId, inputDepId, txn_id,
                                          context.getLastCommittedTxnId(),
                                          ts.getLastUndoToken(this.partitionId));
        }

        return new DependencySet(new int[]{ outputDepId }, new VoltTable[]{ table });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.