Examples of testInit()


Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

    private Collection<AbstractTransaction> loadQueue(int num_txns) throws InterruptedException {
        Collection<AbstractTransaction> added = new TreeSet<AbstractTransaction>();
        for (long i = 0; i < num_txns; i++) {
            LocalTransaction txn = new LocalTransaction(this.hstore_site);
            Long txnId = this.idManager.getNextUniqueTransactionId();
            txn.testInit(txnId, 0, new PartitionSet(1), this.catalog_proc);
           
            // I think that we need to do this...
            this.queue.noteTransactionRecievedAndReturnLastSafeTxnId(txn.getTransactionId());
           
            boolean ret = this.queue.offer(txn, false);
View Full Code Here

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

        // We should be able to get them back in the right order
        Collection<AbstractTransaction> added = new TreeSet<AbstractTransaction>();
        for (long i = 0; i < NUM_TXNS; i++) {
            LocalTransaction txn = new LocalTransaction(this.hstore_site);
            Long txnId = this.idManager.getNextUniqueTransactionId();
            txn.testInit(txnId, 0, new PartitionSet(1), this.catalog_proc);
            added.add(txn);
        } // FOR
        List<AbstractTransaction> shuffled = new ArrayList<AbstractTransaction>(added);
        Collections.shuffle(shuffled, random);
       
View Full Code Here

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

        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

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

    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,
                    partitions,
                    txn_trace.getCatalogItem(catalogContext.database),
                    txn_trace.getParams());
        return (ts);
View Full Code Here

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

        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);
       
        LocalTransaction ts1 = new LocalTransaction(this.hstore_site);
        Object params1[] = new Object[]{ 0, 1, 2 };
        ts1.testInit(10001l, basePartition, partitions, proc, params1);
       
View Full Code Here

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

        Object params0[] = new Object[]{ 0, 1, 2 };
        ts0.testInit(10000l, basePartition, partitions, proc, params0);
       
        LocalTransaction ts1 = new LocalTransaction(this.hstore_site);
        Object params1[] = new Object[]{ 0, 1, 2 };
        ts1.testInit(10001l, basePartition, partitions, proc, params1);
       
        boolean ret = this.checker.hasConflictBefore(ts0, ts1, basePartition);
        assertFalse(ret);
    }
   
View Full Code Here

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

        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);
       
        Procedure proc1 = this.getProcedure(UpdateNewOrder.class);
        LocalTransaction ts1 = new LocalTransaction(this.hstore_site);
        Object params1[] = new Object[]{ 0, 0 };
        ts1.testInit(10001l, basePartition, partitions, proc1, params1);
View Full Code Here

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

        ts0.testInit(10000l, basePartition, partitions, proc0, params0);
       
        Procedure proc1 = this.getProcedure(UpdateNewOrder.class);
        LocalTransaction ts1 = new LocalTransaction(this.hstore_site);
        Object params1[] = new Object[]{ 0, 0 };
        ts1.testInit(10001l, basePartition, partitions, proc1, params1);
       
        boolean ret = this.checker.hasConflictBefore(ts0, ts1, basePartition);
        assertFalse(ret);
    }
   
View Full Code Here

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

    // ----------------------------------------------------------------------------------

    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

Examples of edu.brown.hstore.txns.LocalTransaction.testInit()

    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]);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.