Package org.voltdb

Examples of org.voltdb.ParameterSet


            String.format("Mismatched %s - Expected[%d] != Actual[%s]", ts, txn_id, ts.getTransactionId());
       
        // Deserialize embedded ParameterSets and store it in the RemoteTransaction handle
        // This way we only do it once per HStoreSite. This will also force us to avoid having
        // to do it for local work
        ParameterSet parameterSets[] = new ParameterSet[request.getParamsCount()]; // TODO: Cache!
        for (int i = 0; i < parameterSets.length; i++) {
            ByteString paramData = request.getParams(i);
            if (paramData != null && paramData.isEmpty() == false) {
                final FastDeserializer fds = new FastDeserializer(paramData.asReadOnlyByteBuffer());
                if (trace.val)
View Full Code Here


     * @param queries1
     * @return
     */
    protected boolean canExecute(AbstractTransaction ts0, List<CountedStatement> queries0,
                                 AbstractTransaction ts1, List<CountedStatement> queries1) {
        ParameterSet params0 = ts0.getProcedureParameters();
        ParameterSet params1 = ts1.getProcedureParameters();
        CountedStatement stmt0, stmt1;
        StatementCache cache0, cache1;
        Map<StmtParameter, SortedSet<ParameterMapping>> mappings0, mappings1;
       
        if (params0 == null) {
View Full Code Here

            // Get the ParameterSet array for this WorkFragment
            // It can either be attached to the AbstractTransaction handle if it came
            // over the wire directly from the txn's base partition, or it can be attached
            // as for prefetch WorkFragments
            ParameterSet parameters[] = null;
            if (fragment.getPrefetch()) {
                parameters = ts.getPrefetchParameterSets();
                ts.markExecPrefetchQuery(this.partitionId);
                if (trace.val && ts.isSysProc() == false)
                    LOG.trace(ts + " - Prefetch Parameters:\n" + StringUtil.join("\n", parameters));
View Full Code Here

        for (int i = 0; i < fragmentCount; i++) {
            if (fragment.getStmtIgnore(i)) {
                fragmentCount--;
            }
        } // FOR
        final ParameterSet parameters[] = tmp_fragmentParams.getParameterSet(fragmentCount);
        assert(parameters.length == fragmentCount);
       
        // Construct data given to the EE to execute this work fragment
        this.tmp_EEdependencies.clear();
        long fragmentIds[] = tmp_fragmentIds.getArray(fragmentCount);
View Full Code Here

    public void testReplicatedTableTouchedPartitions() throws Exception {
        Procedure catalog_proc = this.getProcedure(neworder.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "getItemInfo");
       
        SQLStmt batch[] = { new SQLStmt(catalog_stmt) };
        ParameterSet params[] = new ParameterSet[]{
                VoltProcedure.getCleanParams(batch[0], new Object[]{ new Long(1) })
        };
        PartitionSet partitions = new PartitionSet(0);
       
        // Check to make sure that if we do a SELECT on a replicated table, that
View Full Code Here

                Object params[] = this.randomStatementParameters(catalog_stmts[j]);
                for (int k = 0; k < TARGET_STMTS_W_IDS[j].length; k++) {
                    int idx = TARGET_STMTS_W_IDS[j][k];
                    params[idx] = BASE_PARTITION;
                } // FOR
                this.batchParams[i] = new ParameterSet(params);
                i += 1;
            } // FOR
        } // FOR
       
        for (int i = 0; i < this.batchStmts.length; i++) {
View Full Code Here

        Procedure catalog_proc = this.getProcedure(TARGET_PREFETCH_PROCEDURE);
        Statement catalog_stmt = this.getStatement(catalog_proc, TARGET_PREFETCH_STATEMENT);
        catalog_stmt.setPrefetchable(true);
        catalog_proc.setPrefetchable(true);
       
        final ParameterSet params = new ParameterSet(this.proc_params);
        final EstimatorState estState = new MarkovEstimatorState.Factory(catalogContext).makeObject();
        estState.addPrefetchableStatement(new CountedStatement(catalog_stmt, 0));

        // Hard-code ParameterMapping
        int mappings[][] = {
View Full Code Here

                                          this.prefetchResult);
       
        // Now if we add in the same query again with the same parameters, it
        // should automatically pick up the prefetched result in the right location.
        SQLStmt nextBatch[] = new SQLStmt[numInvocations];
        ParameterSet nextParams[] = new ParameterSet[nextBatch.length];
        VoltTable nextResults[] = new VoltTable[nextBatch.length];
        int nextCounters[] = new int[nextBatch.length];
        Collection<Column> outputCols = PlanNodeUtil.getOutputColumnsForStatement(this.catalog_stmt);
        for (int i = 0; i < numInvocations; i++) {
            nextBatch[i] = this.prefetchBatch[0];
            nextCounters[i] = i;
            if (i == expectedOffset) {
                nextParams[i] = new ParameterSet(this.prefetchParams[0].toArray());
                nextResults[i] = this.prefetchResult;
            } else {
                nextParams[i] = new ParameterSet(i, BASE_PARTITION);
                nextResults[i] = CatalogUtil.getVoltTable(outputCols);
                Object row[] = VoltTableUtil.getRandomRow(nextResults[i]);
                row[0] = new Long(i);
                nextResults[i].addRow(row);
            }
View Full Code Here

                                          REMOTE_PARTITION,
                                          this.prefetchParamsHash[0],
                                          this.prefetchResult);
       
        SQLStmt nextBatch[] = this.prefetchBatch;
        ParameterSet nextParams[] = new ParameterSet[nextBatch.length];
        VoltTable nextResults[] = new VoltTable[nextBatch.length];
        int nextCounters[] = new int[nextBatch.length];
        Collection<Column> outputCols = PlanNodeUtil.getOutputColumnsForStatement(this.catalog_stmt);
       
        // Now if we add in the same query again with the same parameters, it
        // should automatically pick up the prefetched result in the right location.
        for (int batch = 0; batch < numBatches; batch++) {
            nextCounters[0] = batch;
            if (batch == expectedOffset) {
                nextParams[0] = new ParameterSet(this.prefetchParams[0].toArray());
                nextResults[0] = this.prefetchResult;
            } else {
                nextParams[0] = new ParameterSet(batch, BASE_PARTITION);
                nextResults[0] = CatalogUtil.getVoltTable(outputCols);
            }
            this.ts.initFirstRound(undoToken, nextBatch.length);
           
            BatchPlanner nextPlanner = new BatchPlanner(nextBatch, this.catalog_proc, p_estimator);
View Full Code Here

       
        SQLStmt nextBatch[] = {
            this.prefetchBatch[0],
            this.prefetchBatch[0]
        };
        ParameterSet nextParams[] = {
            new ParameterSet(12345l, BASE_PARTITION+1),
            new ParameterSet(12345l, BASE_PARTITION+1),
        };
        int nextCounters[] = new int[]{ 0, 1 };
        VoltTable nextResults[] = {
            CatalogUtil.getVoltTable(outputCols),
            CatalogUtil.getVoltTable(outputCols),
View Full Code Here

TOP

Related Classes of org.voltdb.ParameterSet

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.