当前位置: 首页>>代码示例>>Java>>正文


Java ParameterSet类代码示例

本文整理汇总了Java中org.voltdb.ParameterSet的典型用法代码示例。如果您正苦于以下问题:Java ParameterSet类的具体用法?Java ParameterSet怎么用?Java ParameterSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ParameterSet类属于org.voltdb包,在下文中一共展示了ParameterSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.voltdb.ParameterSet; //导入依赖的package包/类
private void init(Class<? extends VoltProcedure> volt_proc, String stmt_name, Object raw_args[]) {
    this.catalog_proc = this.getProcedure(volt_proc);
    assertNotNull(this.catalog_proc);
    this.catalog_stmt = this.catalog_proc.getStatements().get(stmt_name);
    assertNotNull(this.catalog_stmt);
    
    CatalogMap<PlanFragment> fragments = null;
    if (this.catalog_stmt.getQuerytype() == QueryType.INSERT.getValue()) {
        fragments = this.catalog_stmt.getFragments();
    } else {
        assert(this.catalog_stmt.getHas_multisited());
        fragments = this.catalog_stmt.getMs_fragments();
    }

    // Create a SQLStmt batch
    this.batch = new SQLStmt[] { new SQLStmt(this.catalog_stmt, fragments) };
    this.args = new ParameterSet[] { VoltProcedure.getCleanParams(this.batch[0], raw_args) };
    this.stmtCounters = new int[]{ 0 };
}
 
开发者ID:s-store,项目名称:s-store,代码行数:20,代码来源:TestBatchPlanner.java

示例2: setUp

import org.voltdb.ParameterSet; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    super.setUp(this.builder);
    this.addPartitions(NUM_PARTITIONS);
    this.catalog_proc = this.getProcedure(TARGET_PROCEDURE);
    
    this.batch = new SQLStmt[this.catalog_proc.getStatements().size()];
    this.args = new ParameterSet[this.batch.length];
    this.stmtCounters = new int[this.batch.length];
    int i = 0;
    for (Statement catalog_stmt : this.catalog_proc.getStatements()) {
        this.batch[i] = new SQLStmt(catalog_stmt);
        this.args[i] = ParameterSet.EMPTY;
        this.stmtCounters[i] = i;
        i++;
    } // FOR

    VoltProcedure volt_proc = ClassUtil.newInstance(TARGET_PROCEDURE, new Object[0], new Class<?>[0]);
    assert(volt_proc != null);
    this.executor = new MockPartitionExecutor(BASE_PARTITION, catalogContext, p_estimator);
    volt_proc.init(this.executor, catalog_proc, BackendTarget.NONE);
    
    this.planner = new BatchPlanner(this.batch, this.catalog_proc, p_estimator);
}
 
开发者ID:s-store,项目名称:s-store,代码行数:25,代码来源:TestBatchPlannerComplex.java

示例3: init

import org.voltdb.ParameterSet; //导入依赖的package包/类
public MapReduceTransaction init(Long txn_id,
                                 long initiateTime,
                                 long client_handle,
                                 int base_partition,
                                 Procedure catalog_proc,
                                 ParameterSet params) {
    this.init(
              batch_id, 
              txn_id,
              initiateTime,
              client_handle,
              base_partition,
              hstore_site.getCatalogContext().getAllPartitionIds(),
              false,
              true,
              catalog_proc,
              params,
              null);
    LOG.info("Invoked MapReduceTransaction.init() -> " + this);
    assert(this.map_callback.isInitialized()) : "Unexpected error for " + this;
    //assert(this.sendData_callback.isInitialized()) : "Unexpected error for " + this;
    return (this);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:24,代码来源:MapReduceTransaction.java

示例4: convertPrefetchParameters

import org.voltdb.ParameterSet; //导入依赖的package包/类
protected static void convertPrefetchParameters(AbstractTransaction ts, FastDeserializer fd) {
    if (debug.val)
        LOG.debug(String.format("%s - Converting raw prefetch parameter bytes into ParameterSets", ts));
    
    List<ByteString> rawParams = ts.getPrefetchRawParameterSets(); 
    int num_parameters = rawParams.size();
    ParameterSet params[] = new ParameterSet[num_parameters]; 
    for (int i = 0; i < params.length; i++) {
        fd.setBuffer(rawParams.get(i).asReadOnlyByteBuffer());
        try {
            params[i] = fd.readObject(ParameterSet.class);
        } catch (IOException ex) {
            String msg = "Failed to deserialize pre-fetch ParameterSet at offset #" + i;
            throw new ServerFaultException(msg, ex, ts.getTransactionId());
        }
        if (debug.val)
            LOG.debug(String.format("%s - Prefetch ParameterSet [%02d] -> %s",
                      ts, i, params[i]));
    } // FOR
    ts.attachPrefetchParameters(params);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:22,代码来源:PrefetchQueryUtil.java

示例5: constructDistributePartitionedTableAggregatorFragment

import org.voltdb.ParameterSet; //导入依赖的package包/类
private SynthesizedPlanFragment constructDistributePartitionedTableAggregatorFragment() {
    SystemProcedureExecutionContext context = this.getSystemProcedureExecutionContext();
    assert (context != null);
    int partition_id = context.getPartitionExecutor().getPartitionId();
    LOG.trace("constructDistributePartitionedTableAggregatorFragment - partition : " + partition_id);

    int result_dependency_id = getNextDependencyId();
    SynthesizedPlanFragment plan_fragment = new SynthesizedPlanFragment();
    plan_fragment.fragmentId = SysProcFragmentId.PF_restoreDistributePartitionedTableResults;
    plan_fragment.multipartition = false;
    plan_fragment.outputDependencyIds = new int[] { result_dependency_id };
    plan_fragment.inputDependencyIds = getPlanDependencyIds();
    setRootDependencyId(result_dependency_id);
    ParameterSet params = new ParameterSet();
    params.setParameters(result_dependency_id);
    plan_fragment.parameters = params;
    return plan_fragment;
}
 
开发者ID:s-store,项目名称:s-store,代码行数:19,代码来源:PartitionedTableSaveFileState.java

示例6: executeQueryPlanFragmentsAndGetResults

import org.voltdb.ParameterSet; //导入依赖的package包/类
/** Run multiple query plan fragments */
public VoltTable[] executeQueryPlanFragmentsAndGetResults(long[] planFragmentIds,
                                                                   int numFragmentIds,
                                                                   int[] input_depIds,
                                                                   int[] output_depIds,
                                                                   ParameterSet[] parameterSets,
                                                                   int numParameterSets,
                                                                   long txnId, long lastCommittedTxnId,
                                                                   long undoQuantumToken) throws EEException {
    DependencySet dset = this.executeQueryPlanFragmentsAndGetDependencySet(
            planFragmentIds, numFragmentIds,
            input_depIds,
            output_depIds,
            parameterSets, numParameterSets, txnId, lastCommittedTxnId, undoQuantumToken);
    assert(dset != null);
    return (dset.dependencies);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:18,代码来源:ExecutionEngine.java

示例7: constructLoadReplicatedTableAggregatorFragment

import org.voltdb.ParameterSet; //导入依赖的package包/类
private SynthesizedPlanFragment constructLoadReplicatedTableAggregatorFragment() {
    SystemProcedureExecutionContext context = this.getSystemProcedureExecutionContext();
    assert (context != null);
    int partition_id = context.getPartitionExecutor().getPartitionId();
    LOG.trace("constructLoadReplicatedTableAggregatorFragment - partition : " + partition_id);

    int result_dependency_id = getNextDependencyId();

    SynthesizedPlanFragment plan_fragment = new SynthesizedPlanFragment();
    plan_fragment.fragmentId = SysProcFragmentId.PF_restoreLoadReplicatedTableResults;
    plan_fragment.multipartition = false;
    plan_fragment.outputDependencyIds = new int[] { result_dependency_id };
    plan_fragment.inputDependencyIds = getPlanDependencyIds();
    setRootDependencyId(result_dependency_id);
    ParameterSet params = new ParameterSet();
    params.setParameters(result_dependency_id);
    plan_fragment.parameters = params;
    return plan_fragment;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:ReplicatedTableSaveFileState.java

示例8: performSnapshotDigestScanWork

import org.voltdb.ParameterSet; //导入依赖的package包/类
private final VoltTable[] performSnapshotDigestScanWork(String path) {
    SynthesizedPlanFragment[] pfs = new SynthesizedPlanFragment[2];

    pfs[0] = new SynthesizedPlanFragment();
    pfs[0].fragmentId = SysProcFragmentId.PF_snapshotDigestScan;
    pfs[0].outputDependencyIds = new int[] { DEP_snapshotDigestScan };
    pfs[0].multipartition = true;
    ParameterSet params = new ParameterSet();
    params.setParameters(path);
    pfs[0].parameters = params;

    pfs[1] = new SynthesizedPlanFragment();
    pfs[1].fragmentId = SysProcFragmentId.PF_snapshotDigestScanResults;
    pfs[1].outputDependencyIds = new int[] { DEP_snapshotDigestScanResults };
    pfs[1].inputDependencyIds = new int[] { DEP_snapshotDigestScan };
    pfs[1].multipartition = false;
    pfs[1].parameters = new ParameterSet();

    VoltTable[] results;
    results = executeSysProcPlanFragments(pfs, DEP_snapshotDigestScanResults);
    return results;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:23,代码来源:SnapshotScan.java

示例9: performDiskFreeScanWork

import org.voltdb.ParameterSet; //导入依赖的package包/类
private final VoltTable[] performDiskFreeScanWork(String path) {
    SynthesizedPlanFragment[] pfs = new SynthesizedPlanFragment[2];

    pfs[0] = new SynthesizedPlanFragment();
    pfs[0].fragmentId = SysProcFragmentId.PF_hostDiskFreeScan;
    pfs[0].outputDependencyIds = new int[] { DEP_hostDiskFreeScan };
    pfs[0].multipartition = true;
    ParameterSet params = new ParameterSet();
    params.setParameters(path);
    pfs[0].parameters = params;

    pfs[1] = new SynthesizedPlanFragment();
    pfs[1].fragmentId = SysProcFragmentId.PF_hostDiskFreeScanResults;
    pfs[1].outputDependencyIds = new int[] { DEP_hostDiskFreeScanResults };
    pfs[1].inputDependencyIds = new int[] { DEP_hostDiskFreeScan };
    pfs[1].multipartition = false;
    pfs[1].parameters = new ParameterSet();

    VoltTable[] results;
    results = executeSysProcPlanFragments(pfs, DEP_hostDiskFreeScanResults);
    return results;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:23,代码来源:SnapshotScan.java

示例10: run

import org.voltdb.ParameterSet; //导入依赖的package包/类
public VoltTable[] run() {
    // Blast that mofo and get the catalog for the client
    final SynthesizedPlanFragment pfs[] = new SynthesizedPlanFragment[1];
    final ParameterSet params = new ParameterSet();
    pfs[0] = new SynthesizedPlanFragment();
    pfs[0].fragmentId = SysProcFragmentId.PF_getCatalog;
    pfs[0].inputDependencyIds = new int[] { };
    pfs[0].outputDependencyIds = new int[] { SysProcFragmentId.PF_getCatalog };
    pfs[0].multipartition = false;
    pfs[0].nonExecSites = false;
    pfs[0].destPartitionId = this.partitionId;
    pfs[0].parameters = params;
    pfs[0].last_task = true;
    
    return executeSysProcPlanFragments(pfs, SysProcFragmentId.PF_getCatalog);
}
 
开发者ID:s-store,项目名称:s-store,代码行数:17,代码来源:GetCatalog.java

示例11: getIOStatsData

import org.voltdb.ParameterSet; //导入依赖的package包/类
private VoltTable[] getIOStatsData(long interval, final long now) {
    VoltTable[] results;
    SynthesizedPlanFragment pfs[] = new SynthesizedPlanFragment[2];
    // create a work fragment to gather initiator data from each of the sites.
    pfs[1] = new SynthesizedPlanFragment();
    pfs[1].fragmentId = SysProcFragmentId.PF_ioData;
    pfs[1].outputDependencyIds = new int[]{ DEP_ioData };
    pfs[1].inputDependencyIds = new int[]{};
    pfs[1].multipartition = true;
    pfs[1].parameters = new ParameterSet();
    pfs[1].parameters.setParameters((byte)interval, now);

    // create a work fragment to aggregate the results.
    // Set the MULTIPARTITION_DEPENDENCY bit to require a dependency from every site.
    pfs[0] = new SynthesizedPlanFragment();
    pfs[0].fragmentId = SysProcFragmentId.PF_ioDataAggregator;
    pfs[0].outputDependencyIds = new int[]{ DEP_ioDataAggregator };
    pfs[0].inputDependencyIds = new int[]{DEP_ioData};
    pfs[0].multipartition = false;
    pfs[0].parameters = new ParameterSet();

    // distribute and execute these fragments providing pfs and id of the
    // aggregator's output dependency table.
    results = executeSysProcPlanFragments(pfs, DEP_ioDataAggregator);
    return results;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:27,代码来源:Statistics.java

示例12: getInitiatorData

import org.voltdb.ParameterSet; //导入依赖的package包/类
private VoltTable[] getInitiatorData(long interval, final long now) {
    VoltTable[] results;
    SynthesizedPlanFragment pfs[] = new SynthesizedPlanFragment[2];
    // create a work fragment to gather initiator data from each of the sites.
    pfs[1] = new SynthesizedPlanFragment();
    pfs[1].fragmentId = SysProcFragmentId.PF_initiatorData;
    pfs[1].outputDependencyIds = new int[]{ DEP_initiatorData };
    pfs[1].inputDependencyIds = new int[]{};
    pfs[1].multipartition = true;
    pfs[1].parameters = new ParameterSet();
    pfs[1].parameters.setParameters((byte)interval, now);

    // create a work fragment to aggregate the results.
    // Set the MULTIPARTITION_DEPENDENCY bit to require a dependency from every site.
    pfs[0] = new SynthesizedPlanFragment();
    pfs[0].fragmentId = SysProcFragmentId.PF_initiatorAggregator;
    pfs[0].outputDependencyIds = new int[]{ DEP_initiatorAggregator };
    pfs[0].inputDependencyIds = new int[]{DEP_initiatorData};
    pfs[0].multipartition = false;
    pfs[0].parameters = new ParameterSet();

    // distribute and execute these fragments providing pfs and id of the
    // aggregator's output dependency table.
    results = executeSysProcPlanFragments(pfs, DEP_initiatorAggregator);
    return results;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:27,代码来源:Statistics.java

示例13: getTableData

import org.voltdb.ParameterSet; //导入依赖的package包/类
private VoltTable[] getTableData(long interval, final long now) {
    VoltTable[] results;
    SynthesizedPlanFragment pfs[] = new SynthesizedPlanFragment[2];
    // create a work fragment to gather table data from each of the sites.
    pfs[1] = new SynthesizedPlanFragment();
    pfs[1].fragmentId = SysProcFragmentId.PF_tableData;
    pfs[1].outputDependencyIds = new int[]{ DEP_tableData };
    pfs[1].inputDependencyIds = new int[]{};
    pfs[1].multipartition = true;
    pfs[1].parameters = new ParameterSet();
    pfs[1].parameters.setParameters((byte)interval, now);

    // create a work fragment to aggregate the results.
    // Set the MULTIPARTITION_DEPENDENCY bit to require a dependency from every site.
    pfs[0] = new SynthesizedPlanFragment();
    pfs[0].fragmentId = SysProcFragmentId.PF_tableAggregator;
    pfs[0].outputDependencyIds = new int[]{ DEP_tableAggregator };
    pfs[0].inputDependencyIds = new int[]{DEP_tableData};
    pfs[0].multipartition = false;
    pfs[0].parameters = new ParameterSet();

    // distribute and execute these fragments providing pfs and id of the
    // aggregator's output dependency table.
    results = executeSysProcPlanFragments(pfs, DEP_tableAggregator);
    return results;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:27,代码来源:Statistics.java

示例14: setUp

import org.voltdb.ParameterSet; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    super.setUp(ProjectType.VOTER);
    this.addPartitions(NUM_PARTITIONS);

    this.proc = this.getProcedure(Vote.class);
    this.batch = new SQLStmt[this.proc.getStatements().size()-1];
    this.args = new ParameterSet[this.batch.length];
    int i = 0;
    for (Statement stmt : this.proc.getStatements()) {
        // Skip the INSERT query because that's the only one where
        // the partitioning parameter actually matters
        if (stmt.getQuerytype() == QueryType.INSERT.getValue()) continue;
        
        Object params[] = this.randomStatementParameters(stmt);
        this.batch[i] = new SQLStmt(stmt);
        this.args[i] = new ParameterSet(params);
        i += 1;
    } // FOR
    
    this.planner = new BatchPlanner(this.batch, proc, p_estimator);
    this.plannerDebug = this.planner.getDebugContext();
}
 
开发者ID:s-store,项目名称:s-store,代码行数:24,代码来源:TestBatchPlannerCaching.java

示例15: testReplicatedInsert

import org.voltdb.ParameterSet; //导入依赖的package包/类
/**
 * testReplicatedInsert
 */
public void testReplicatedInsert() throws Exception {
    Object params[] = new Object[]{ 9999, "FUCK", "YO", "COUCH" };
    Procedure proc = this.getProcedure("InsertCountry");
    Statement stmt = CollectionUtil.first(proc.getStatements()); 
    this.batch = new SQLStmt[]{ new SQLStmt(stmt) };
    this.args = new ParameterSet[]{ new ParameterSet(params) };
    
    BatchPlanner planner = new BatchPlanner(batch, catalog_proc, p_estimator);
    this.touched_partitions.clear();
    PartitionSet partitions = catalogContext.getPartitionSetSingleton(BASE_PARTITION);
    BatchPlan plan = planner.plan(TXN_ID,
                                  BASE_PARTITION,
                                  partitions,
                                  this.touched_partitions,
                                  this.args);
    assertNotNull(plan);
    assertTrue(plan.hasMisprediction());
    MispredictionException error = plan.getMisprediction();
    assertTrue(error.getPartitions().values().containsAll(catalogContext.getAllPartitionIds()));
}
 
开发者ID:s-store,项目名称:s-store,代码行数:24,代码来源:TestBatchPlannerComplex.java


注:本文中的org.voltdb.ParameterSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。