Package edu.brown.utils

Examples of edu.brown.utils.PartitionEstimator


     * Default Constructor
     *
     * @param catalog_db
     */
    public SingleSitedCostModel(CatalogContext catalogContext) {
        this(catalogContext, new PartitionEstimator(catalogContext)); // FIXME
    }
View Full Code Here


        args.require(
            ArgumentsParser.PARAM_CATALOG,
            ArgumentsParser.PARAM_WORKLOAD,
            ArgumentsParser.PARAM_MARKOV_OUTPUT
        );
        final PartitionEstimator p_estimator = new PartitionEstimator(args.catalogContext, args.hasher);
        Class<? extends MarkovGraphsContainer> containerClass = MarkovGraphsContainer.class;
       
        // Check whether we are generating the global graphs or the clustered versions
        Boolean global = args.getBooleanParam(ArgumentsParser.PARAM_MARKOV_GLOBAL);
        if (global != null && global == true) {
            containerClass = GlobalMarkovGraphsContainer.class;

        // TPCCMarkovGraphsContainer
        } else if (args.catalog_type == ProjectType.TPCC) {
            containerClass = TPCCMarkovGraphsContainer.class;
        // SEATSMarkovGraphsContainer
        } else if (args.catalog_type == ProjectType.SEATS) {
            containerClass = SEATSMarkovGraphsContainer.class;
        // AuctionMarkMarkovGraphsContainer
        } else if (args.catalog_type == ProjectType.AUCTIONMARK) {
            containerClass = AuctionMarkMarkovGraphsContainer.class;
        }
        assert(containerClass != null);
       
        Map<Integer, MarkovGraphsContainer> markovs_map = null;

        // Check whether we want to update an existing collection of MarkovGraphsContainers
        if (args.hasParam(ArgumentsParser.PARAM_MARKOV)) {
            File path = args.getFileParam(ArgumentsParser.PARAM_MARKOV);
            markovs_map = MarkovGraphsContainerUtil.load(args.catalogContext, path);
            MarkovGraphsContainerUtil.setHasher(markovs_map, p_estimator.getHasher());
        }
       
        if (markovs_map == null) {
            markovs_map = MarkovGraphsContainerUtil.createMarkovGraphsContainers(args.catalogContext,
                                                                                 args.workload,
View Full Code Here

            for (int i = 0; i < num_threads; i++) {
                thread_markovs[i] = m;
            } // FOR
        }

        final PartitionEstimator p_estimator = new PartitionEstimator(args.catalogContext);
        final MarkovCostModel thread_costmodels[][] = new MarkovCostModel[num_threads][num_partitions];
        final ProfileMeasurement profilers[] = new ProfileMeasurement[num_threads];
        final LinkedBlockingDeque<Pair<Integer, TransactionTrace>> queues[] = (LinkedBlockingDeque<Pair<Integer, TransactionTrace>>[]) new LinkedBlockingDeque<?>[num_threads];
        for (int i = 0; i < num_threads; i++) {
            profilers[i] = new ProfileMeasurement("ESTIMATION");
            queues[i] = new LinkedBlockingDeque<Pair<Integer, TransactionTrace>>();
        } // FOR
        LOG.info(String.format("Estimating the accuracy of the MarkovGraphs using %d transactions [threads=%d]", args.workload.getTransactionCount(), num_threads));
        LOG.info("THRESHOLDS: " + args.thresholds);

        // QUEUING THREAD
        final AtomicBoolean queued_all = new AtomicBoolean(false);
        runnables.add(new Runnable() {
            @Override
            public void run() {
                List<TransactionTrace> all_txns = new ArrayList<TransactionTrace>(args.workload.getTransactions());
                Collections.shuffle(all_txns);
                int ctr = 0;
                for (TransactionTrace txn_trace : all_txns) {
                    // Make sure it goes to the right base partition
                    int partition = HStoreConstants.NULL_PARTITION_ID;
                    try {
                        partition = p_estimator.getBasePartition(txn_trace);
                    } catch (Exception ex) {
                        throw new RuntimeException(ex);
                    }
                    assert(partition != HStoreConstants.NULL_PARTITION_ID) : "Failed to get base partition for " + txn_trace + "\n" + txn_trace.debug(args.catalog_db);
                    if (base_partition != HStoreConstants.NULL_PARTITION_ID && base_partition != partition)
View Full Code Here

            this.addFeatureClass(fclass);
        } // FOR
    }
   
    public FeatureExtractor(CatalogContext catalogContext, Class<? extends AbstractFeature>...feature_classes) {
        this(catalogContext, new PartitionEstimator(catalogContext), feature_classes);
    }
View Full Code Here

        project_catalogs.put(type, cc);
        catalogContext = cc;
        catalog = catalogContext.catalog;
        catalog_db = catalogContext.database;
       
        p_estimator = new PartitionEstimator(catalogContext);
        assertNotNull(p_estimator);
        project_p_estimators.put(type, p_estimator);
    }
View Full Code Here

        m_hstoreConf = HStoreConf.singleton(true);

        if (catalog != null && m_hstoreConf.client.txn_hints) {
            m_catalog = catalog;
            m_catalogContext = new CatalogContext(m_catalog);
            m_pEstimator = new PartitionEstimator(m_catalogContext);
            m_partitionSiteXref = CatalogUtil.getPartitionSiteXrefArray(m_catalog);
    }

        m_distributer = new Distributer(
                expectedOutgoingMessageSize,
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp(ProjectType.TM1);
        this.addPartitions(NUM_PARTITIONS);
       
        PartitionEstimator p_estimator = new PartitionEstimator(catalogContext);
        this.executor = new MockPartitionExecutor(LOCAL_PARTITION, catalogContext, p_estimator);
        assertNotNull(this.executor);
       
        // Setup a BatchPlanner for ourselves here
        Procedure catalog_proc = this.getProcedure(TARGET_PROCEDURE);
View Full Code Here

   
    @Override
    protected void setUp() throws Exception {
        super.setUp(ProjectType.TM1);
        this.addPartitions(NUM_PARTITIONS);
        p_estimator = new PartitionEstimator(catalogContext, new DefaultHasher(catalogContext, NUM_PARTITIONS));
    }
View Full Code Here

TOP

Related Classes of edu.brown.utils.PartitionEstimator

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.