Package org.voltdb.catalog

Examples of org.voltdb.catalog.Statement


     * For the given Vertex type, return a unique Vertex instance
     * @param type
     * @return
     */
    public static MarkovVertex getSpecialVertex(Database catalog_db, MarkovVertex.Type type) {
        Statement catalog_stmt = MarkovUtil.getSpecialStatement(catalog_db, type);
        assert(catalog_stmt != null);

        MarkovVertex v = new MarkovVertex(catalog_stmt, type);
       
        if (type == MarkovVertex.Type.ABORT) {
View Full Code Here


     * @return
     */
    public static Set<Statement> getStatements(Collection<MarkovVertex> vertices) {
        Set<Statement> ret = new HashSet<Statement>();
        for (MarkovVertex v : vertices) {
            Statement catalog_stmt = v.getCatalogItem();
            assert(catalog_stmt != null);
            ret.add(catalog_stmt);
        } // FOR
        return (ret);
    }
View Full Code Here

        for (MarkovVertex v : path) {
            if (v.isQueryVertex() == false) continue;
            if (trace.val)
                LOG.trace(String.format("%s - R:%s / W:%s", v, read_p, write_p));
           
            Statement catalog_stmt = v.getCatalogItem();
            QueryType qtype = QueryType.get(catalog_stmt.getQuerytype());
            switch (qtype) {
                case SELECT:
                    read_p.addAll(v.getPartitions());
                    break;
                case INSERT:
View Full Code Here

            new_touched_partitions.clear();
            for (; start <= stop; start++) {
                MarkovVertex v = actual.get(start);
                assert (v != null);

                Statement catalog_stmt = v.getCatalogItem();
                QueryType qtype = QueryType.get(catalog_stmt.getQuerytype());
                Penalty ptype = (qtype == QueryType.SELECT ? Penalty.RETURN_READ_PARTITION : Penalty.RETURN_WRITE_PARTITION);
                for (Integer p : v.getPartitions()) {
                    // Check if we read/write at any partition that was
                    // previously declared as done
                    if (this.done_partitions.contains(p)) {
View Full Code Here

            if (this.cache_stmtVertices.containsKey(catalog_stmt) == false)
                this.cache_stmtVertices.put(catalog_stmt, new HashSet<MarkovVertex>());
        } // FOR
        for (MarkovVertex v : this.getVertices()) {
            if (v.isQueryVertex()) {
                Statement catalog_stmt = v.getCatalogItem();
                this.cache_stmtVertices.get(catalog_stmt).add(v);
            }
        } // FOR
    }
View Full Code Here

                sb.append("\n").append(schema).append("\n");
            }
        }
        // Statement
        else if (catalog_obj instanceof Statement) {
            Statement catalog_stmt = (Statement)catalog_obj;
            SQLFormatter f = new SQLFormatter(catalog_stmt.getSqltext());
            sb.append(StringUtil.SINGLE_LINE);
            sb.append("\n").append(f.format()).append("\n");
        }

        return (sb.toString());
View Full Code Here

        for (QueryTrace query_trace : txn_trace.getQueries()) {
            PartitionSet partitions = new PartitionSet();
            pest.getAllPartitions(partitions, query_trace, base_partition);
            assert(partitions != null);
            assert(!partitions.isEmpty());
            Statement catalog_stmnt = query_trace.getCatalogItem(this.getDatabase());

            int queryInstanceIndex = query_instance_counters.get(catalog_stmnt).getAndIncrement();
            MarkovVertex v = null;
            synchronized (previous) {
                v = this.getVertex(catalog_stmnt, partitions, past_partitions, queryInstanceIndex);
View Full Code Here

        List<String> keys = new ArrayList<String>();
        keys.add(catalog_obj.getName());
       
        // Add the SQL statements
        if (catalog_obj instanceof Statement) {
            Statement catalog_stmt = (Statement)catalog_obj;
            keys.add(catalog_stmt.getSqltext());
        }
       
        for (String k : keys) {
            k = k.toLowerCase();
            if (!this.name_node_xref.containsKey(k)) {
                this.name_node_xref.put(k, new HashSet<DefaultMutableTreeNode>());
            }
            this.name_node_xref.get(k).add(node);
        } // FOR
       
        if (catalog_obj instanceof Statement) {
            Statement catalog_stmt = (Statement)catalog_obj;
            try {
                AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
                for (Integer guid : PlanNodeUtil.getAllPlanColumnGuids(root)) {
                    if (this.plannode_node_xref.containsKey(guid) == false) {
                        this.plannode_node_xref.put(guid, new HashSet<DefaultMutableTreeNode>());
View Full Code Here

     * @param catalog_tables
     */
    public static PredicatePairs extractFragmentPredicates(final PlanFragment catalog_frag,
                                                     final boolean convert_params,
                                                     final Collection<Table> catalog_tables) throws Exception {
        final Statement catalog_stmt = (Statement) catalog_frag.getParent();
        final Database catalog_db = CatalogUtil.getDatabase(catalog_stmt);
        // if (catalog_frag.guid == 279) LOG.setLevel(Level.DEBUG);

        // We need to be clever about what we're doing here
        // We always have to examine the fragment (rather than just the entire
View Full Code Here

            // we scale things appropriately for the txn outside of this loop
            int query_weight = (this.use_query_weights ? query_trace.getWeight() : 1);
            query_idx++;
            if (debug.val)
                LOG.debug("Examining " + query_trace + " from " + txn_trace);
            final Statement catalog_stmt = query_trace.getCatalogItem(catalogContext.database);
            assert (catalog_stmt != null);

            // If we have a filter and that filter doesn't want us to look at
            // this query, then we will just skip it and check the other ones
            if (filter != null && filter.apply(query_trace) != Filter.FilterResult.ALLOW) {
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.