Package org.voltdb.catalog

Examples of org.voltdb.catalog.StmtParameter


                    statement_node.add(paramRootNode);
                    for (StmtParameter param_cat : CatalogUtil.getSortedCatalogItems(statement_cat.getParameters(), "index")) {
                        DefaultMutableTreeNode param_node = new DefaultMutableTreeNode(new WrapperNode(param_cat) {
                            @Override
                            public String toString() {
                                 StmtParameter param_cat = (StmtParameter)this.getCatalogType();
                                 VoltType type = VoltType.get((byte)param_cat.getJavatype());
                                 return (super.toString() + " :: " + type.name());
                            }
                        });
                        paramRootNode.add(param_node);
                        buildSearchIndex(param_cat, param_node);
View Full Code Here


                        Column catalog_col = catalog_tbl.getColumns().get(column.getDisplayName());
                        assert (catalog_col != null) : "Invalid column name '" + column.getDisplayName() + "' for " + catalog_tbl;

                        AbstractExpression exp = column.getExpression();
                        if (exp instanceof ParameterValueExpression) {
                            StmtParameter catalog_param = catalog_stmt.getParameters().get(((ParameterValueExpression) exp).getParameterId());
                            cset.add(catalog_col, catalog_param, ExpressionType.COMPARE_EQUAL, catalog_stmt);
                        } else if (exp instanceof AbstractValueExpression) {
                            if (debug.val)
                                LOG.debug("Ignoring AbstractExpressionType type: " + exp);
                        } else {
View Full Code Here

                                     tbl, stmt.fullName()));
                        }
                        else {
                            // If there are no references, then there is nothing else that we
                            // we need to do here. The StmtParameter that we get back will be null
                            StmtParameter stmtParam = CollectionUtil.first(params);
                            cache.colParams.put(col, stmtParam);
                        }
                    } // FOR
                    tableParams.put(tbl, stmtParamOffsets.toArray(new StmtParameter[0]));
                } // FOR
View Full Code Here

                }
               
                boolean allEqual = true;
                for (Column col : cache0.colParams.keySet()) {
                    // If either StmtParameters are null, then that's a conflict!
                    StmtParameter param0 = cache0.colParams.get(col);
                    StmtParameter param1 = cache1.colParams.get(col);
                   
                    // It's ok if we're missing one of the parameters that we need if
                    // the values are still not the same. It's only a problem if they're
                    // all the same because we have no idea know whether they're
                    // actually the same or not
                    if (param0 == null || param1 == null) {
                        if (trace.val)
                            LOG.trace(String.format("%s - Missing StmtParameters for %s [param0=%s / param1=%s]",
                                      cp.fullName(), col.fullName(), param0, param1));
                        continue;
                    }
                   
                    // Similarly, if we don't have a ParameterMapping then there is nothing
                    // else we can do. Again, this is ok as long as at least one of the
                    // pkey values are different.
                    ParameterMapping pm0 = CollectionUtil.first(mappings0.get(param0));
                    ParameterMapping pm1 = CollectionUtil.first(mappings1.get(param1));
                    if (pm0 == null) {
                        if (trace.val)
                            LOG.trace(String.format("%s - No ParameterMapping for %s",
                                      cp.fullName(), param0.fullName()));
                        continue;
                    }
                    else if (pm1 == null) {
                        if (trace.val)
                            LOG.trace(String.format("%s - No ParameterMapping for %s",
                                      cp.fullName(), param1.fullName()));
                        continue;
                    }
                   
                    // If the values are not equal, then we can stop checking the
                    // other columns right away.
View Full Code Here

   
    /**
     * testBuildTargetParameters
     */
    public void testBuildTargetParameters() throws Exception {
        StmtParameter catalog_param = catalog_stmt.getParameters().get(1);
        assertNotNull(catalog_param);
        Column catalog_col = PlanNodeUtil.getColumnForStmtParameter(catalog_param);
        assertNotNull(catalog_col);
        Collection<Column> columns = CollectionUtil.addAll(new HashSet<Column>(), catalog_col);
        summarizer = new WorkloadSummarizer(catalog_db, p_estimator, mappings, catalog_db.getProcedures(), columns);
View Full Code Here

        } // (txn)
//        System.err.println(StringUtil.repeat("+", 100));

        // We then tell the WorkloadSummarizer that only care about the column that is mapped to the second query
        // parameter. All of the queries should then be collapsed into a single weighted query
        StmtParameter catalog_param = catalog_stmt.getParameters().get(1);
        assertNotNull(catalog_param);
        Column catalog_col = PlanNodeUtil.getColumnForStmtParameter(catalog_param);
        assertNotNull(catalog_col);
        Collection<Column> columns = CollectionUtil.addAll(new HashSet<Column>(), catalog_col);
        summarizer = new WorkloadSummarizer(catalog_db, p_estimator, mappings, catalog_db.getProcedures(), columns);
View Full Code Here

        assertEquals(NUM_TRANSACTIONS*NUM_QUERIES, pruned.getQueryCount());
//        System.err.println(StringUtil.repeat("+", 100));

        // We then tell the WorkloadSummarizer that only care about the column that is mapped to the second
        // parameter. All of the queries should then be collapsed into a single weighted query
        StmtParameter catalog_param = catalog_stmt.getParameters().get(1);
        assertNotNull(catalog_param);
        Column catalog_col = PlanNodeUtil.getColumnForStmtParameter(catalog_param);
        assertNotNull(catalog_col);
        Collection<Column> columns = CollectionUtil.addAll(new HashSet<Column>(), catalog_col);
        summarizer = new WorkloadSummarizer(catalog_db, p_estimator, mappings, catalog_db.getProcedures(), columns);
View Full Code Here

//        System.err.println(StringUtil.repeat("+", 100));

        // We then tell the WorkloadSummarizer that only care about the column that is mapped to the second
        // parameter. All of the queries and transactions should then be collapsed into a single weighted transaction
        // with a single weight query
        StmtParameter catalog_param = catalog_stmt.getParameters().get(1);
        assertNotNull(catalog_param);
        Column catalog_col = PlanNodeUtil.getColumnForStmtParameter(catalog_param);
        assertNotNull(catalog_col);
        Collection<Column> columns = CollectionUtil.addAll(new HashSet<Column>(), catalog_col);
        summarizer = new WorkloadSummarizer(catalog_db, p_estimator, mappings, catalog_db.getProcedures(), columns);
View Full Code Here

                   
                    Statement catalog_stmt = catalog_proc.getStatements().getIgnoreCase(stmtPair.getFirst());
                    assert(catalog_stmt != null) :
                        "Invalid Statement name '" + stmtPair.getFirst() + "' for ParameterMappings " +
                    "for Procedure '" + procName + "'";
                    StmtParameter catalog_stmtParam = catalog_stmt.getParameters().get(stmtPair.getSecond().intValue());
                    assert(catalog_stmtParam != null) :
                        "Invalid StmtParameter for '" + catalog_stmt.fullName() + "' at offset " + stmtPair.getSecond();
                   
                    // HACK: This assumes that the ProcParameter is not an array
                    // and that we want to map the first invocation of the Statement
View Full Code Here

       
        // Input Parameters
        // We will need to update the system catalogs with this new information
        // If this is an ad hoc query then there won't be any parameters
        for (ParameterInfo param : plan.parameters) {
            StmtParameter catalogParam = catalogStmt.getParameters().add(String.valueOf(param.index));
            catalogParam.setJavatype(param.type.getValue());
            catalogParam.setIndex(param.index);
        }

        // Output Columns
        int index = 0;
        for (Integer colguid : plan.columns) {
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.StmtParameter

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.