Package edu.brown.hstore.txns

Examples of edu.brown.hstore.txns.LocalTransaction


      AntiCacheManager manager = hstore_sites[0].getAntiCacheManager();
        short block_ids[] = new short[]{ 1111 };
        int tuple_offsets[] = new int[]{0};
        int partition_id = 0;
        this.hstore_conf.site.anticache_profiling = false;
        LocalTransaction txn = MockHStoreSite.makeLocalTransaction(hstore_sites[0]);

        assertTrue(manager.queue(txn, partition_id, catalog_tbl, block_ids, tuple_offsets));

    }
View Full Code Here


        short block_ids[] = new short[]{ 1111 };
        int tuple_offsets[] = new int[]{0};
         // different from the base partition. This means the exception was
        // thrown by a remote site
        this.hstore_conf.site.anticache_profiling = false;
        LocalTransaction txn = MockHStoreSite.makeLocalTransaction(hstore_sites[0]);
  txn.setOldTransactionId(txn.getTransactionId()); //workaround
        int partition_id = CollectionUtil.first(this.hstore_sites[1].getLocalPartitionIds());

        assertTrue(manager.queue(txn, partition_id, catalog_tbl, block_ids, tuple_offsets));
        latch.await();
View Full Code Here

        short block_ids[] = new short[]{ 1111 };
        int tuple_offsets[] = new int[]{0};
         // different from the base partition. This means the exception was
        // thrown by a remote site
        this.hstore_conf.site.anticache_profiling = false;
        LocalTransaction txn = MockHStoreSite.makeLocalTransaction(hstore_sites[0]);
  txn.setOldTransactionId(txn.getTransactionId()); //workaround
        int dest_id = CollectionUtil.first(this.hstore_sites[1].getLocalPartitionIds());
        final int sender_id = hstore_sites[0].getSiteId();
        hstore_sites[sender_id].getCoordinator().setUnevictCallback(callback);
       
       
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,
                    new Object[catalog_proc.getParameters().size()]);
        return (ts);
View Full Code Here

    /**
     * testAllProcedures
     */
    public void testAllProcedures() throws Exception {
        for (Procedure proc0 : catalogContext.getRegularProcedures()) {
            LocalTransaction txn0 = this.createTransaction(proc0);
            Collection<Table> tables0 = CatalogUtil.getReferencedTables(proc0);
            for (Table tbl : tables0) {
                if (proc0.getReadonly()) {
                    txn0.markTableRead(BASE_PARTITION, tbl);
                } else {
                    txn0.markTableWritten(BASE_PARTITION, tbl);
                }
            } // FOR

            System.err.println(proc0.getName() + " -> " + tables0);
           
            for (Procedure proc1 : catalogContext.getRegularProcedures()) {
                LocalTransaction txn1 = this.createTransaction(proc1);
                Collection<Table> tables1 = CatalogUtil.getReferencedTables(proc1);
                for (Table tbl : tables1) {
                    if (proc1.getReadonly()) {
                        txn1.markTableRead(BASE_PARTITION, tbl);
                    } else {
                        txn1.markTableWritten(BASE_PARTITION, tbl);
                    }
                } // FOR
               
                // XXX: This test is not really useful because we're not actually
                // trying to guess whether there is a conflict. We're just throwing
View Full Code Here

        this.txnInitializer.getNewTxnObservable().addObserver(newTxnObserver);
       
        boolean result = latch.await(10000, TimeUnit.MILLISECONDS);
        assertTrue(result);
       
        LocalTransaction ts = lastTxn.get();
        assertNotNull(ts);
        assertFalse(ts.isPredictSinglePartition());
       
        EstimatorState estState = ts.getEstimatorState();
        assertNotNull(estState);
        assertEquals(MarkovEstimatorState.class, estState.getClass());
        assertTrue(estState.isInitialized());
       
        Estimate est = estState.getInitialEstimate();
View Full Code Here

    @Test
    public void testReadWriteConflicts() throws Exception {
        Procedure proc = this.getProcedure(neworder.class);
        Collection<Table> tables = CatalogUtil.getReferencedTables(proc);
       
        LocalTransaction ts0 = new LocalTransaction(this.hstore_site);
        ts0.testInit(NEXT_TXN_ID++,
                     BASE_PARTITION,
                     catalogContext.getPartitionSetSingleton(BASE_PARTITION),
                     proc,
                     new Object[0]);
       
        LocalTransaction ts1 = new LocalTransaction(this.hstore_site);
        ts1.testInit(NEXT_TXN_ID++,
                     BASE_PARTITION,
                     catalogContext.getPartitionSetSingleton(BASE_PARTITION),
                     proc,
                     new Object[0]);
       
View Full Code Here

    @Test
    public void testWriteWriteConflicts() throws Exception {
        Procedure proc = this.getProcedure(neworder.class);
        Collection<Table> tables = CatalogUtil.getReferencedTables(proc);
       
        LocalTransaction ts0 = new LocalTransaction(this.hstore_site);
        ts0.testInit(NEXT_TXN_ID++,
                     BASE_PARTITION,
                     catalogContext.getPartitionSetSingleton(BASE_PARTITION),
                     proc,
                     new Object[0]);
       
        LocalTransaction ts1 = new LocalTransaction(this.hstore_site);
        ts1.testInit(NEXT_TXN_ID++,
                     BASE_PARTITION,
                     catalogContext.getPartitionSetSingleton(BASE_PARTITION),
                     proc,
                     new Object[0]);
       
View Full Code Here

    // INIT QUEUES
    // ----------------------------------------------------------------------------

    private boolean initTransaction(AbstractTransaction nextTxn) {
        if (hstore_conf.site.txn_profiling && nextTxn instanceof LocalTransaction) {
            LocalTransaction localTxn = (LocalTransaction)nextTxn;
            if (localTxn.profiler != null) localTxn.profiler.startQueueLock();
        }
       
        PartitionCountingCallback<AbstractTransaction> callback = nextTxn.getInitCallback();
        assert(callback.isInitialized()) :
View Full Code Here

     */
    protected void queueTransactionInit(AbstractTransaction ts) {
        if (debug.val)
            LOG.debug(String.format("Adding %s to initialization queue", ts));
        if (hstore_conf.site.txn_profiling && ts instanceof LocalTransaction) {
            LocalTransaction localTxn = (LocalTransaction)ts;
            if (localTxn.profiler != null) localTxn.profiler.startInitQueue();
        }
        this.initQueue.add(ts);
}
View Full Code Here

TOP

Related Classes of edu.brown.hstore.txns.LocalTransaction

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.