Package edu.brown.workload

Examples of edu.brown.workload.Workload


    protected void setUp() throws Exception {
        super.setUp(ProjectType.TPCC);
       
        if (workload == null) {
            File file = this.getWorkloadFile(ProjectType.TPCC);
            workload = new Workload(catalog);
            Filter filter = new ProcedureNameFilter(false).include(TARGET_PROCEDURE.getSimpleName())
                                         .attach(new ProcedureLimitFilter(WORKLOAD_XACT_LIMIT));
            workload.load(file, catalog_db, filter);
        }
       
View Full Code Here


        super.setUp(ProjectType.TPCC);
        this.addPartitions(NUM_PARTITIONS);
       
        if (workload == null) {
            workload_file = this.getWorkloadFile(ProjectType.TPCC);
            workload = new Workload(catalog);
           
            ((Workload)workload).load(workload_file, catalog_db, new ProcedureLimitFilter(WORKLOAD_XACT_LIMIT));
            assert(workload.getTransactionCount() > 0) : "No transaction loaded from workload";
            assertEquals(WORKLOAD_XACT_LIMIT, workload.getTransactionCount());
        }
View Full Code Here

       
        if (workload == null) {
            catalog_proc = this.getProcedure(TARGET_PROCEDURE);
           
            File file = this.getWorkloadFile(ProjectType.TPCC);
            workload = new Workload(catalog);

            // Check out this beauty:
            // (1) Filter by procedure name
            // (2) Filter on partitions that start on our BASE_PARTITION
            // (3) Filter to only include multi-partition txns
View Full Code Here

           
            // All Multi-Partition Txn Workload
            ProcedureNameFilter multi_filter = new ProcedureNameFilter(false);
            multi_filter.include(MULTIPARTITION_PROCEDURES);
            multi_filter.attach(new ProcedureLimitFilter(WORKLOAD_XACT_LIMIT));
            multip_workload = new Workload(catalog);
            ((Workload)multip_workload).load(f, catalog_db, multi_filter);
            assert(multip_workload.getTransactionCount() > 0);

            // All Single-Partition Txn Workload
            ProcedureNameFilter single_filter = new ProcedureNameFilter(false);
            single_filter.include(SINGLEPARTITION_PROCEDURES);
            single_filter.attach(new ProcedureLimitFilter(WORKLOAD_XACT_LIMIT));
            singlep_workload = new Workload(catalog);
            ((Workload)singlep_workload).load(f, catalog_db, single_filter);
            assert(singlep_workload.getTransactionCount() > 0);
           
            // Workload Statistics
            f = this.getStatsFile(ProjectType.TM1);
View Full Code Here

    public void testWeightedTxnEstimation() throws Exception {
        int num_txns = 20;
        int num_intervals = 5;
       
        // Make a workload that has the same transaction in it multiple times
        Workload new_workload = new Workload(catalog);
        TransactionTrace multip_txn = CollectionUtil.first(multip_workload);
        Procedure catalog_proc = multip_txn.getCatalogItem(catalog_db);
        for (int i = 0; i < num_txns; i++) {
            TransactionTrace clone = (TransactionTrace)multip_txn.clone();
            clone.setTransactionId(i);
            clone.setTimestamps(new Long((i/5)*1000), new Long((i/5)*1000 + 100));
//            System.err.println(clone.debug(catalog_db) + "\n");
            new_workload.addTransaction(catalog_proc, clone);
        } // FOR
        assertEquals(num_txns, new_workload.getTransactionCount());
        TimeIntervalCostModel<SingleSitedCostModel> orig_costModel = new TimeIntervalCostModel<SingleSitedCostModel>(catalogContext, SingleSitedCostModel.class, num_intervals);
        double cost0 = orig_costModel.estimateWorkloadCost(catalogContext, new_workload);
       
        // 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
//        System.err.println("+++++++++++++++++++++++++++++++++++++++++++++");
        new_workload = new Workload(catalog);
        for (int i = 0; i < num_txns/5; i++) {
            TransactionTrace clone = (TransactionTrace)multip_txn.clone();
            clone.setTransactionId(i);
            clone.setTimestamps(new Long((i*5)*1000), new Long((i*5)*1000 + 100));
            clone.setWeight(5);
//            System.err.println(clone.debug(catalog_db) + "\n");
            new_workload.addTransaction(catalog_proc, clone);
        } // FOR
       
        TimeIntervalCostModel<SingleSitedCostModel> new_costModel = new TimeIntervalCostModel<SingleSitedCostModel>(catalogContext, SingleSitedCostModel.class, num_intervals);
        double cost1 = new_costModel.estimateWorkloadCost(catalogContext, new_workload);
        assert(cost1 > 0);
View Full Code Here

            File file = this.getParameterMappingsFile(ProjectType.TM1);
            correlations = new ParameterMappingsSet();
            correlations.load(file, catalogContext.database);

            file = this.getWorkloadFile(ProjectType.TM1);
            workload = new Workload(catalogContext.catalog);

            // Check out this beauty:
            // (1) Filter by procedure name
            // (2) Filter on partitions that start on our BASE_PARTITION
            // (3) Filter to only include multi-partition txns
View Full Code Here

            File file = this.getParameterMappingsFile(ProjectType.TPCC);
            correlations = new ParameterMappingsSet();
            correlations.load(file, catalogContext.database);

            file = this.getWorkloadFile(ProjectType.TPCC);
            workload = new Workload(catalogContext.catalog);

            // Check out this beauty:
            // (1) Filter by procedure name
            // (2) Filter on partitions that start on our BASE_PARTITION
            // (3) Filter to only include multi-partition txns
View Full Code Here

       
        if (workload == null) {
            catalog_proc = this.getProcedure(TARGET_PROCEDURE);
           
            File file = this.getWorkloadFile(ProjectType.TPCC);
            workload = new Workload(catalog);
            Filter filter = new ProcedureNameFilter(false)
                    .include(TARGET_PROCEDURE.getSimpleName())
                    .attach(new ProcedureLimitFilter(WORKLOAD_XACT_LIMIT));
            workload.load(file, catalog_db, filter);
            assert(workload.getTransactionCount() > 0);
View Full Code Here

        ThreadUtil.setMaxGlobalThreads(1);
       
        // Super hack! Walk back the directories and find out workload directory
        if (workload == null) {
            File workload_file = this.getWorkloadFile(ProjectType.TM1);
            workload = new Workload(catalogContext.catalog);
           
            // Workload Filter
            ProcedureNameFilter filter = new ProcedureNameFilter(false);
            long total = 0;
            for (String proc_name : TARGET_PROCEDURES) {
View Full Code Here

TOP

Related Classes of edu.brown.workload.Workload

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.