Package edu.brown.workload

Examples of edu.brown.workload.QueryTrace


       
        Statement catalog_stmt = this.getStatement(catalog_proc, "GetData");
        Object query_params[] = new Object[] { 1l, 1l, 4l, 0l, 5l };
       
        TransactionTrace txn_trace = new TransactionTrace(1001l, catalog_proc, txn_params);
        QueryTrace query_trace = new QueryTrace(catalog_stmt, query_params, 0);
        txn_trace.addQuery(query_trace);
        txn_trace.stop();
       
        p_estimator.getAllPartitions(partitions, txn_trace);
        assertNotNull(partitions);
View Full Code Here


                // return (element.getCatalogItemName().equals("neworder") ?
                // FilterResult.PASS : FilterResult.SKIP);
                return (FilterResult.ALLOW);
                // But filter queries
            } else if (element instanceof QueryTrace) {
                QueryTrace query = (QueryTrace) element;
                return (this.stmt_cache.contains(CatalogKey.createKey(query.getCatalogItem(this.catalog_db))) ? FilterResult.ALLOW : FilterResult.SKIP);
            }
            return (FilterResult.HALT);
        }
View Full Code Here

            for (int i = 0; i < query_batch.length; i++) {
                query_batch[i] = txn_trace.getBatchQueries(i);
                batch[i] = new SQLStmt[query_batch[i].size()];
                args[i] = new ParameterSet[query_batch[i].size()];
                for (int ii = 0; ii < batch[i].length; ii++) {
                    QueryTrace query_trace = query_batch[i].get(ii);
                    assertNotNull(query_trace);
                    batch[i][ii] = new SQLStmt(query_trace.getCatalogItem(catalogContext.database));
                    args[i][ii] = VoltProcedure.getCleanParams(batch[i][ii], query_trace.getParams());
                } // FOR
            } // FOR
        }
       
        VoltProcedure volt_proc = ClassUtil.newInstance(TARGET_PROCEDURE, new Object[0], new Class<?>[0]);
View Full Code Here

       
        final TransactionTrace orig_txn = (TransactionTrace)multip_txn.clone();
        List<QueryTrace> clone_queries = new ArrayList<QueryTrace>();
        for (int i = 0; i < num_dupes; i++) {
            for (QueryTrace query_trace : multip_txn.getQueries()) {
                QueryTrace clone_query = (QueryTrace)query_trace.clone();
                clone_queries.add(clone_query);
            } // FOR
        } // FOR
        orig_txn.setQueries(clone_queries);
        new_workload.addTransaction(catalog_proc, orig_txn);
        assertEquals(1, new_workload.getTransactionCount());
        assertEquals(multip_txn.getQueryCount() * num_dupes, orig_txn.getQueryCount());
       
        // We now want to calculate the cost of this new workload
        final SingleSitedCostModel orig_costModel = new SingleSitedCostModel(catalogContext);
        final double orig_cost = orig_costModel.estimateWorkloadCost(catalogContext, new_workload);
        assert(orig_cost > 0);
        TransactionCacheEntry orig_txnEntry = orig_costModel.getTransactionCacheEntry(orig_txn);
        assertNotNull(orig_txnEntry);
        assertEquals(orig_txn.getQueryCount(), orig_txnEntry.getExaminedQueryCount());
//        System.err.println(orig_txnEntry.debug());
//        System.err.println("=========================================");
       
        // Now change make a new workload that has the same multi-partition transaction
        // but this time it only has one but with a transaction weight
        // We should get back the exact same cost
        new_workload = new Workload(catalogContext.catalog);
        final TransactionTrace new_txn = (TransactionTrace)multip_txn.clone();
        clone_queries = new ArrayList<QueryTrace>();
        for (QueryTrace query_trace : multip_txn.getQueries()) {
            QueryTrace clone_query = (QueryTrace)query_trace.clone();
            clone_query.setWeight(num_dupes);
            clone_queries.add(clone_query);
        } // FOR
        new_txn.setQueries(clone_queries);
        new_workload.addTransaction(catalog_proc, new_txn);
        assertEquals(1, new_workload.getTransactionCount());
View Full Code Here

            TransactionCacheEntry txn_entry = cost_model.getTransactionCacheEntry(txn_trace);
            assertNotNull(txn_entry);
//            expected_touched.put(txn_entry.getExecutionPartition());
           
            for (QueryCacheEntry query_entry : cost_model.getQueryCacheEntries(txn_trace)) {
                QueryTrace query_trace = txn_trace.getQueries().get(query_entry.getQueryIdx());
                assertNotNull(query_trace);
                assertNotNull(query_trace.getCatalogItemName());
                Boolean should_be_invalid = (query_trace.getCatalogItemName().equals(invalid_stmt.getName()) ? true :
                                            (query_trace.getCatalogItemName().equals(valid_stmt.getName()) ? false : null));
                assertNotNull(should_be_invalid);
                assertEquals(should_be_invalid.booleanValue(), query_entry.isInvalid());
               
                if (should_be_invalid) {
                    assert(query_entry.getAllPartitions().isEmpty());
View Full Code Here

TOP

Related Classes of edu.brown.workload.QueryTrace

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.