Package org.voltdb.catalog

Examples of org.voltdb.catalog.Statement


   
    /**
     * testSelectMaterializedView
     */
    public void testSelectMaterializedView() throws Exception {
        Statement stmt = null;
        int stmt_index = -1;
        for (int i = 0; i < this.batch.length; i++) {
            Statement s = this.batch[i].getStatement();
            for (Table tbl : CatalogUtil.getReferencedTables(s)) {
                if (tbl.getMaterializer() != null) {
                    stmt = s;
                    stmt_index = i;
                    break;
View Full Code Here


   
    /**
     * testSelectReplicated
     */
    public void testSelectReplicated() throws Exception {
        Statement stmt = null;
        int stmt_index = -1;
        for (int i = 0; i < this.batch.length; i++) {
            Statement s = this.batch[i].getStatement();
            boolean replicatedOnly = true;
            for (Table tbl : CatalogUtil.getReferencedTables(s)) {
                if (tbl.getIsreplicated() == false) {
                    replicatedOnly = false;
                    break;
View Full Code Here

    private void validateStmt(String procName, Class<? extends AbstractPlanNode> target) throws Exception {
        // Just make sure that our target query plan contains the proper plan node.
        // This in case somebody changes something and we don't actually
        // execute a query with the expected query plan
        Procedure proc = this.getProcedure(procName);
        Statement stmt = CollectionUtil.first(proc.getStatements());
        assertNotNull(stmt);
       
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(stmt, true);
        assertNotNull(root);
        Collection<?> scans = PlanNodeUtil.getPlanNodes(root, target);
View Full Code Here

            if (first) {
                assertEquals(estimate.toString(), 0, estimate.getMarkovPath().size());
                Histogram<Statement> stmtCounter = new ObjectHistogram<Statement>();
                PartitionSet allPartitions = new PartitionSet();
                for (QueryTrace qt : tt.getQueries()) {
                    Statement stmt = qt.getCatalogItem(catalogContext.database);
                    int stmtCnt = (int)stmtCounter.get(stmt, 0);
                    PartitionSet partitions = new PartitionSet();
                    p_estimator.getAllPartitions(partitions, qt, BASE_PARTITION);
                   
                    MarkovVertex next_v = new MarkovVertex(stmt,
View Full Code Here

    private List<CountedStatement> createQueryEstimate(TransactionTrace txn_trace, Statement start) {
        Histogram<Statement> stmtHistogram = new ObjectHistogram<Statement>();
        List<CountedStatement> queries = new ArrayList<CountedStatement>();
        boolean include = (start == null);
        for (QueryTrace q : txn_trace.getQueries()) {
            Statement stmt = q.getCatalogItem(catalogContext.database);
            if (include == false && stmt.equals(start) == false) continue;
            include = true;
            queries.add(new CountedStatement(stmt, (int)stmtHistogram.get(stmt, 0l)));
            stmtHistogram.put(stmt);
        } // FOR
        return (queries);
View Full Code Here

    /**
     * testColumnStmtParameters
     */
    public void testColumnStmtParameters() throws Exception {
        Procedure proc = this.getProcedure(neworder.class);
        Statement stmt = this.getStatement(proc, "getDistrict");
        StatementCache cache = this.checker.stmtCache.get(stmt);
        assertNotNull(stmt.fullName(), cache);
       
        Collection<Column> cols = CatalogUtil.getReferencedColumns(stmt);
        assertFalse(cols.isEmpty());
        // System.err.println(stmt.fullName() + " -> " + cols + "\n" + StringUtil.formatMaps(cache.colParams));
       
View Full Code Here

    /**
     * testStatementCache
     */
    public void testStatementCache() throws Exception {
        Procedure proc0 = this.getProcedure(slev.class);
        Statement stmt0 = this.getStatement(proc0, "GetStockCount");
        Procedure proc1 = this.getProcedure(neworder.class);
        Statement stmt1 = this.getStatement(proc1, "createOrderLine");
       
        // STMT0 is going to try to read to a table that STMT1 will write to
        // So we should be able to see that conflict
        StatementCache cache = this.checker.stmtCache.get(stmt0);
        assertNotNull(stmt0.fullName(), cache);
       
        ConflictPair cp = cache.conflicts.get(stmt1);
        assertNotNull(stmt0.fullName()+"->"+stmt1.fullName(), cp);
        assertTrue(cp.getAlwaysconflicting());
    }
View Full Code Here

    public void testCanExecuteNonConflicting() throws Exception {
        Procedure procs[] = {
            this.getProcedure(neworder.class),
            this.getProcedure(ostatByCustomerId.class),
        };
        Statement startStmts[] = {
            this.getStatement(procs[0], "updateStock"),
            null,
        };
        TransactionTrace traces[] = this.getTransactionTraces(procs, true);
       
View Full Code Here

    /**
     * testEqualParameters
     */
    public void testEqualParameters() throws Exception {
        Procedure catalog_proc = this.getProcedure(neworder.class);
        Statement catalog_stmt = CollectionUtil.first(catalog_proc.getStatements());
        assertNotNull(catalog_stmt);
        StmtParameter catalog_stmt_param = CollectionUtil.first(catalog_stmt.getParameters());
        assertNotNull(catalog_stmt_param);
       
        TransactionTrace txn_trace = CollectionUtil.first(workload.getTraces(catalog_proc));
        assertNotNull(txn_trace);
       
View Full Code Here

        } // FOR
       
        // BATCH PLANNER
        sb.append("\nPLANNER\n");
        for (int i = 0; i < planner.getBatchSize(); i++) {
            Statement stmt0 = planner.getStatements()[i];
            Statement stmt1 = batchStmts[i].getStatement();
            assert(stmt0.fullName().equals(stmt1.fullName())) :
                stmt0.fullName() + " != " + stmt1.fullName();
            sb.append(String.format("[%02d] %s\n     %s\n", i, stmt0.fullName(), stmt1.fullName()));
        } // FOR
       
        // PARAMETERS
        sb.append("\nBATCH PARAMETERS\n");
        ParameterMangler pm = ParameterMangler.singleton(ts.getProcedure());
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Statement

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.