Package edu.brown.catalog.special

Examples of edu.brown.catalog.special.CountedStatement


            this.countedStmts[partition] = new ArrayList<CountedStatement>();
            QueryEstimate est = this.query_estimates[partition];
            for (int i = 0, cnt = est.getStmtIdsCount(); i < cnt; i++) {
                Statement catalog_stmt = this.catalogContext.getStatementById(est.getStmtIds(i));
                assert(catalog_stmt != null) : "Invalid Statement id '" + est.getStmtIds(i) + "'";
                this.countedStmts[partition].add(new CountedStatement(catalog_stmt, est.getStmtCounters(i)));
            } // FOR
        }
        return (this.countedStmts[partition]);
    }
View Full Code Here


        CountedStatement[] ret = this.neworder_countedstmts.get(index);
        if (ret == null) {
            // There's a race condition here, but who cares...
            ret = new CountedStatement[this.neworder_prefetchables.length];
            for (int i = 0; i < ret.length; i++) {
                ret[i] = new CountedStatement(this.neworder_prefetchables[i], i);
            } // FOR
            this.neworder_countedstmts.set(index, ret);
        }
        return (ret);
    }
View Full Code Here

                      "Checking whether we can create our own. [nextStatements=%s]",
                      this.next_statements));
           
            // We're allow to create the vertices that we know are missing
            if (this.learning_enabled && this.next_statements.size() == 1) {
                CountedStatement cntStmt = CollectionUtil.first(this.next_statements);
                MarkovVertex v = new MarkovVertex(cntStmt.statement,
                                                  MarkovVertex.Type.QUERY,
                                                  cntStmt.counter,
                                                  this.stmt_partitions,
                                                  this.past_partitions);
View Full Code Here

        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

   
    public CountedStatement getCountedStatement() {
        if (this.counted_stmt == null) {
            synchronized (this) {
                if (this.counted_stmt == null) {
                    this.counted_stmt = new CountedStatement((Statement)this.catalog_item, this.counter);
                }
            } // SYNCH
        }
        return (this.counted_stmt);
    }
View Full Code Here

        // Makes a list of ByteStrings containing the ParameterSets that we need
        // to send over to the remote sites so that they can execute our
        // prefetchable queries
        Object proc_params[] = procParams.toArray();
        for (int i = 0; i < prefetchParams.length; i++) {
            CountedStatement counted_stmt = prefetchable.get(i);
            if (debug.val)
                LOG.debug(String.format("%s - Building ParameterSet for prefetchable query %s",
                          ts, counted_stmt));
            Object stmt_params[] = new Object[counted_stmt.statement.getParameters().size()];
View Full Code Here

     */
    protected boolean canExecute(AbstractTransaction ts0, List<CountedStatement> queries0,
                                 AbstractTransaction ts1, List<CountedStatement> queries1) {
        ParameterSet params0 = ts0.getProcedureParameters();
        ParameterSet params1 = ts1.getProcedureParameters();
        CountedStatement stmt0, stmt1;
        StatementCache cache0, cache1;
        Map<StmtParameter, SortedSet<ParameterMapping>> mappings0, mappings1;
       
        if (params0 == null) {
            LOG.error(String.format("The ParameterSet for %s is null.", ts0));
View Full Code Here

        catalog_stmt.setPrefetchable(true);
        catalog_proc.setPrefetchable(true);
       
        final ParameterSet params = new ParameterSet(this.proc_params);
        final EstimatorState estState = new MarkovEstimatorState.Factory(catalogContext).makeObject();
        estState.addPrefetchableStatement(new CountedStatement(catalog_stmt, 0));

        // Hard-code ParameterMapping
        int mappings[][] = {
            // StmtParameter -> ProcParameter
            { 0, 1 },
View Full Code Here

            result[i] = new ArrayList<CountedStatement>();
            QueryEstimate query_est = estimates.get(i);
            for (Pair<Integer, Integer> p : query_est.statements) {
                Statement stmt =  catalogContext.getStatementById(p.getFirst());
                assert(stmt != null) : "Invalid Statement id '" + p.getFirst() + "'";
                result[i].add(new CountedStatement(stmt, p.getSecond()));
            } // FOR
        } // FOR
        return (result);
    }
View Full Code Here

TOP

Related Classes of edu.brown.catalog.special.CountedStatement

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.