Package edu.brown.utils

Examples of edu.brown.utils.PartitionSet


        Collection<AbstractTransaction> added = this.loadQueue(10);
        assertEquals(added.size(), this.queue.size());
       
        LocalTransaction toOffer = new LocalTransaction(this.hstore_site);
        Long txnId = this.idManager.getNextUniqueTransactionId();
        toOffer.testInit(txnId, 0, new PartitionSet(1), this.catalog_proc);
        assertFalse(this.queue.contains(toOffer));
       
        Set<AbstractTransaction> found = new HashSet<AbstractTransaction>();
        for (AbstractTransaction txn : this.queue) {
            if (found.isEmpty()) this.queue.offer(toOffer, false);
View Full Code Here


            // Ok so where's what going on here. We need to send back
            // an abort message, so we're going use the builder that we've been
            // working on and send out the bomb back to the base partition tells it that this
            // transaction is kaput at this HStoreSite.
            this.builder.clearPartitions();
            PartitionSet partitions = this.getPartitions();
            for (int partition : partitions.values()) {
                assert(this.hstore_site.isLocalPartition(partition));
                this.builder.addPartitions(partition);
            } // FOR

            assert(this.builder.getPartitionsList() != null) :
View Full Code Here

           
            // Make sure that it identifies that we are a distributed transaction and
            // that we expect to touch both the W_ID partition and the REMOTE_W_ID partition
            Estimate est = state.getInitialEstimate();
            assertNotNull(est);
            PartitionSet partitions = est.getTouchedPartitions(thresholds);
            assertEquals(2, partitions.size());
            for (int expected : new int[]{ w_id, remote_w_id }) {
                expected = hasher.hash(expected);
                assertTrue(Integer.toString(expected) + "->" + partitions, partitions.contains(expected));
            } // FOR
            assertEquals(hasher.hash(w_id), state.getBasePartition());
            txn_id++;
        } // FOR
    }
View Full Code Here

            // We have to inject at least one path through the system first
            // so that it knows what Statements it should be considering
            if (first) {
                assertEquals(estimate.toString(), 0, estimate.getMarkovPath().size());
                Histogram<Statement> stmtCounter = new ObjectHistogram<Statement>();
                PartitionSet allPartitions = new PartitionSet();
                for (QueryTrace qt : tt.getQueries()) {
                    Statement stmt = qt.getCatalogItem(catalogContext.database);
                    int stmtCnt = (int)stmtCounter.get(stmt, 0);
                    PartitionSet partitions = new PartitionSet();
                    p_estimator.getAllPartitions(partitions, qt, BASE_PARTITION);
                   
                    MarkovVertex next_v = new MarkovVertex(stmt,
                                                           MarkovVertex.Type.QUERY,
                                                           stmtCnt,
View Full Code Here

        assertEquals(start, CollectionUtil.first(path));
        assertEquals(commit, CollectionUtil.last(path));
        assertFalse(path.contains(abort));
       
        // All of the vertices should only have the base partition in their partition set
        PartitionSet touched_partitions = new PartitionSet();
        for (MarkovVertex v : path) {
            touched_partitions.addAll(v.getPartitions());
        } // FOR
//        System.err.println("Expected Partitions: " + multip_partitions);
//        System.err.println("Touched Partitions:  " + touched_partitions);
//        System.err.println("MULTI-PARTITION PATH: " + path);
View Full Code Here

       
        return (traces);
    }

    private AbstractTransaction createTransaction(TransactionTrace txn_trace) throws Exception {
        PartitionSet partitions = new PartitionSet();
        int base_partition = p_estimator.getBasePartition(txn_trace);
        p_estimator.getAllPartitions(partitions, txn_trace);
        LocalTransaction ts = new LocalTransaction(this.hstore_site);
        ts.testInit(txn_trace.getTransactionId(),
                    base_partition,
View Full Code Here

    public void testNonConflictingReadOnly() throws Exception {
        // Quickly check that two read-only txns are non-conflicting
        // even without a txn estimate
        Procedure proc = this.getProcedure(slev.class);
        int basePartition = 0;
        PartitionSet partitions = catalogContext.getAllPartitionIds();
       
        LocalTransaction ts0 = new LocalTransaction(this.hstore_site);
        Object params0[] = new Object[]{ 0, 1, 2 };
        ts0.testInit(10000l, basePartition, partitions, proc, params0);
       
View Full Code Here

     */
    public void testNonConflictingDisparateTables() throws Exception {
        // Quickly check that two read-only txns are non-conflicting
        // even without a txn estimate
        int basePartition = 0;
        PartitionSet partitions = catalogContext.getAllPartitionIds();

        Procedure proc0 = this.getProcedure(paymentByCustomerId.class);
        LocalTransaction ts0 = new LocalTransaction(this.hstore_site);
        Object params0[] = new Object[]{ 0, 1, 2 };
        ts0.testInit(10000l, basePartition, partitions, proc0, params0);
View Full Code Here

    // ----------------------------------------------------------------------------------
    // HELPER METHODS
    // ----------------------------------------------------------------------------------

    private LocalTransaction createTransaction(Procedure catalog_proc) throws Exception {
        PartitionSet partitions = new PartitionSet(BASE_PARTITION);
        LocalTransaction ts = new LocalTransaction(this.hstore_site);
        ts.testInit(this.nextTxnId++,
                    BASE_PARTITION,
                    partitions,
                    catalog_proc,
View Full Code Here

                LocalTransaction copy = new LocalTransaction(hstore_site);
                copy.init(ts.getTransactionId(),
                          ts.getInitiateTime(),
                          ts.getClientHandle(),
                          ts.getBasePartition(),
                          new PartitionSet(ts.getPredictTouchedPartitions()),
                          ts.isPredictReadOnly(),
                          ts.isPredictAbortable(),
                          ts.getProcedure(),
                          ts.getProcedureParameters(),
                          null);
View Full Code Here

TOP

Related Classes of edu.brown.utils.PartitionSet

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.