Package org.voltdb

Examples of org.voltdb.SQLStmt


                batch[i] = new SQLStmt[query_batch[i].size()];
                args[i] = new ParameterSet[query_batch[i].size()];
                for (int ii = 0; ii < batch[i].length; ii++) {
                    QueryTrace query_trace = query_batch[i].get(ii);
                    assertNotNull(query_trace);
                    batch[i][ii] = new SQLStmt(query_trace.getCatalogItem(catalogContext.database));
                    args[i][ii] = VoltProcedure.getCleanParams(batch[i][ii], query_trace.getParams());
                } // FOR
            } // FOR
        }
       
View Full Code Here


     * testBatchHashCode
     */
    public void testBatchHashCode() throws Exception {
        final List<SQLStmt> statements = new ArrayList<SQLStmt>();
        for (Statement catalog_stmt : catalog_proc.getStatements()) {
            statements.add(new SQLStmt(catalog_stmt));
            statements.add(new SQLStmt(catalog_stmt));
            statements.add(new SQLStmt(catalog_stmt));
        } // FOR
        int num_stmts = statements.size();
        assert(num_stmts > 0);

        Random rand = new Random();
        for (int x = 0; x < 100; x++) {
        Map<Integer, BatchPlanner> batchPlanners = new HashMap<Integer, BatchPlanner>(100);
        SQLStmt batches[][] = new SQLStmt[10][];
        int hashes[] = new int[batches.length];
        for (int i = 0; i < batches.length; i++) {
            int batch_size = i + 1;
            batches[i] = new SQLStmt[batch_size];
            Collections.shuffle(statements, rand);
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);
       
View Full Code Here

        this.batchStmts = new SQLStmt[TARGET_REPEAT * TARGET_STMTS.length];
        this.batchParams = new ParameterSet[this.batchStmts.length];
        this.batchCtrs = new int[this.batchStmts.length];
        for (int i = 0; i < this.batchStmts.length; ) {
            for (int j = 0; j < catalog_stmts.length; j++) {
                this.batchStmts[i] = new SQLStmt(catalog_stmts[j]);
                this.batchCtrs[i] = i;
               
                // Generate random input parameters for the Statement but make sure that
                // the W_IDs always point to our BASE_PARTITION
                Object params[] = this.randomStatementParameters(catalog_stmts[j]);
View Full Code Here

        } // FOR

        assertNotNull(catalogContext.paramMappings);
       
        this.prefetcher = new PrefetchQueryPlanner(catalogContext, p_estimator);
        SQLStmt[] batchStmts = {new SQLStmt(catalog_stmt)};
        this.prefetcher.addPlanner(catalog_proc, estState.getPrefetchableStatements(), batchStmts);
       
        for (int i = 0; i < NUM_SITES; i++) {
            this.hstore_sites[i] = new MockHStoreSite(i, catalogContext, HStoreConf.singleton());
            this.coordinators[i] = this.hstore_sites[i].initHStoreCoordinator();
View Full Code Here

        this.prefetchResult = CatalogUtil.getVoltTable(outputCols);
        Object row[] = VoltTableUtil.getRandomRow(this.prefetchResult);
        row[0] = new Long(999999);
        this.prefetchResult.addRow(row);
        for (int i = 0; i < this.prefetchParamsHash.length; i++) {
            this.prefetchBatch[i] = new SQLStmt(this.catalog_stmt);
            this.prefetchParamsHash[i] = this.prefetchParams[i].hashCode();
            this.prefetchStmtCounters[i] = PREFETCH_STMT_COUNTER;
        } // FOR

        Partition catalog_part = catalogContext.getPartitionById(BASE_PARTITION);
View Full Code Here

                                          this.prefetchParamsHash[0],
                                          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++) {
View Full Code Here

                                          this.prefetchFragment.getFragmentId(0),
                                          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);
       
View Full Code Here

                                          this.prefetchParamsHash[0],
                                          this.prefetchResult);
       
        Collection<Column> outputCols = PlanNodeUtil.getOutputColumnsForStatement(catalog_stmt);
       
        SQLStmt nextBatch[] = {
            this.prefetchBatch[0],
            this.prefetchBatch[0]
        };
        ParameterSet nextParams[] = {
            new ParameterSet(12345l, BASE_PARTITION+1),
View Full Code Here

                                          REMOTE_PARTITION,
                                          this.prefetchParamsHash[0],
                                          this.prefetchResult);
       
        // Now if we add in the same query again, it should automatically pick up the result
        SQLStmt nextBatch[] = {
            new SQLStmt(this.getStatement(this.catalog_proc, "getItemInfo")),
            new SQLStmt(this.catalog_stmt)
        };
        ParameterSet nextParams[] = {
            new ParameterSet(12345l),
            new ParameterSet(this.prefetchParams[0].toArray())
        };
View Full Code Here

TOP

Related Classes of org.voltdb.SQLStmt

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.