Package org.voltdb.catalog

Examples of org.voltdb.catalog.Statement


    }

    protected String getTransactionTraceSignature(Procedure catalog_proc, TransactionTrace txn_trace, Integer interval) {
        SortedSet<String> queries = new TreeSet<String>();
        for (QueryTrace query_trace : txn_trace.getQueries()) {
            Statement catalog_stmt = query_trace.getCatalogItem(catalog_db);
            queries.add(this.getQueryTraceSignature(catalog_stmt, query_trace));
        } // FOR
       
        String signature = catalog_proc.getName() + "->";
        if (interval != null) signature += "INT[" + interval + "]";
View Full Code Here


                public void process(TransactionTrace txn_trace) {
                    Procedure catalog_proc = txn_trace.getCatalogItem(catalog_db);
                    if (target_procedures.contains(catalog_proc) == false) return;
                    duplicates.clear();           
                    for (QueryTrace query_trace : txn_trace.getQueries()) {
                        Statement catalog_stmt = query_trace.getCatalogItem(catalog_db);
                        String param_hashes = getQueryTraceSignature(catalog_stmt, query_trace);
                        duplicates.add(catalog_stmt, param_hashes, query_trace);
                    } // FOR (query)
                   
                    // If this TransactionTrace has duplicate queries, then we will want to consturct
View Full Code Here

                    return (proc);
                }
            }; // Nasty...
           
            // Use a temporary query trace to wrap the "insert" of each tuple
            Statement catalog_stmt = this.stats_load_stmts.get(table_key);
            if (catalog_stmt == null) {
                catalog_stmt = catalog_proc.getStatements().add("INSERT_" + catalog_tbl.getName());
                catalog_stmt.setQuerytype(QueryType.INSERT.getValue());
                this.stats_load_stmts.put(table_key, catalog_stmt);

                // TERRIBLE HACK!
                // 2011-01-25 :: Why do I need to do this??
//                String stmt_key = CatalogKey.createKey(catalog_stmt);
View Full Code Here

                if (catalog_proc == null) {
                    LOG.warn("Invalid procedure name to exclude '" + name + "'");
                    continue;
                }
                   
                Statement catalog_stmt = catalog_proc.getStatements().getIgnoreCase(splits[1]);
                if (catalog_stmt != null) {
                    calculator.ignoreStatement(catalog_stmt);
                } else {
                    LOG.warn("Invalid statement name to exclude '" + name + "'");
                }
View Full Code Here

            return (ret);
        }
       
        private void populateProcedure(Procedure proc0) {
            for (ConflictPair cp : ConflictSetUtil.getAllConflictPairs(proc0)) {
                Statement stmt0 = cp.getStatement0();
                Statement stmt1 = cp.getStatement1();
                Procedure proc1 = stmt1.getParent();
                LOG.debug(String.format("%s -> %s+%s", cp, stmt0, stmt1));
               
                for (Table tbl : CatalogUtil.getReferencedTables(stmt0)) {
                    Vertex v0 = this.getVertex(proc0, tbl);
                    if (v0 == null) {
View Full Code Here

                if (catalog_proc == null) {
                    LOG.warn("Invalid procedure name to exclude '" + name + "'");
                    continue;
                }
                   
                Statement catalog_stmt = catalog_proc.getStatements().getIgnoreCase(splits[1]);
                if (catalog_stmt != null) {
                    calculator.ignoreStatement(catalog_stmt);
                } else {
                    LOG.warn("Invalid statement name to exclude '" + name + "'");
                }
View Full Code Here

     * @throws Exception
     */
    public void getAllPartitions(final PartitionSet partitions,
                                 final QueryTrace query,
                                 final int base_partition) throws Exception {
        Statement catalog_stmt = query.getCatalogItem(this.catalogContext.database);
        this.getAllPartitions(partitions, catalog_stmt, query.getParams(), base_partition);
    }
View Full Code Here

     * @return
     * @throws Exception
     */
    public Map<String, PartitionSet> getTablePartitions(final QueryTrace query,
                                                        final int base_partition) throws Exception {
        Statement catalog_stmt = query.getCatalogItem(this.catalogContext.database);
        return (this.getTablePartitions(catalog_stmt, query.getParams(), base_partition));
    }
View Full Code Here

        PartitionEstimator.CacheEntry cache_entry = this.cache_fragmentEntries.get(frag_key);
        if (cache_entry == null) {
            synchronized (this) {
                cache_entry = this.cache_fragmentEntries.get(frag_key);
                if (cache_entry == null) {
                    Statement catalog_stmt = (Statement) catalog_frag.getParent();
                    this.generateCache(catalog_stmt);
                    cache_entry = this.cache_fragmentEntries.get(frag_key);
                }
            } // SYNCHRONIZED
        }
View Full Code Here

                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }

                // add the statement to the catalog
                Statement catalogStmt = procedure.getStatements().add(f.getName());
               
                // compile the statement
                try {
                    StatementCompiler.compile(compiler, hsql, catalog, db, estimates, catalogStmt, stmt.getText(), info.singlePartition);
                } catch (VoltCompiler.VoltCompilerException e) {
                    e.printStackTrace();
                    String msg = shortName + "." + f.getName() + ": " + e.getMessage();
                    throw compiler.new VoltCompilerException(msg);
                }

                // If this Field has a Prefetchable annotation or the Statement was
                // identified as prefetchable in the project XML, then we will want to
                // set the "prefetchable" flag in the catalog for the Statement + Procedure
                if (f.getAnnotation(Prefetchable.class) != null ||
                    procedureDescriptor.m_prefetchable.contains(catalogStmt.getName())) {
                    catalogStmt.setPrefetchable(true);
                    procedure.setPrefetchable(true);
                }
                // If this Field has a Deferrable annotation or the Statement was
                // identified as deferrable in the project XML, then we will want to
                // set the "deferrable" flag in the catalog for the Statement + Procedure
                if (f.getAnnotation(Deferrable.class) != null) {
                    catalogStmt.setDeferrable(true);
                    procedure.setDeferrable(true);
                }

                // if a single stmt is not read only, then the proc is not read
                // only
                if (catalogStmt.getReadonly() == false)
                    procHasWriteStmts = true;
            }
        }

        // set the read onlyness of a proc
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.