當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。