From: Bryan T. <tho...@us...> - 2007-02-19 19:00:58
|
Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/journal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30034/src/test/com/bigdata/journal Modified Files: TestTxRunState.java TestTransactionServer.java TestRootBlockView.java TestReadOnlyTx.java StressTestConcurrent.java TestConflictResolution.java TestTx.java Log Message: Some more work on transaction support, including an api change that makes ITx an internal api and presents just a timestamp to clients. This removes the potential for misuse of prepare/commit by the clients and sets us up for an ITransactionManager api. Index: TestConflictResolution.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestConflictResolution.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestConflictResolution.java 19 Feb 2007 01:05:39 -0000 1.2 --- TestConflictResolution.java 19 Feb 2007 19:00:18 -0000 1.3 *************** *** 56,59 **** --- 56,102 ---- /** * Tests of write-write conflict resolution. + * <p> + * Write-write conflicts either result in successful reconcilation via + * state-based conflict resolution or an abort of the transaction that is + * validating. The tests in this suite verify that write-write conflicts can be + * detected and provide versions of those tests where the conflict can and can + * not be validated and verify the end state in each case. + * <p> + * State-based validation requires transparency at the object level, including + * the ability to deserialize versions into objects, to compare objects for + * consistency, to merge data into the most recent version where possible and + * according to data type specific rules, and to destructively merge objects + * when the conflict arises on <em>identity</em> rather than state. + * <p> + * An example of an identity based conflict is when two objects are created that + * represent URIs in an RDF graph. Since the lexicon for an RDF graph generally + * requires uniqueness those objects must be merged into a single object since + * they have the same identity. For an RDFS store validation on the lexicon or + * statements ALWAYS succeeds since they are always consistent. + * + * @todo Verify that we can handle the bank account example (this is state-based + * conflict resolution altogether requiring that we carry a richer + * representation of state in the objects and then use that additional + * state to validate and resolve some kinds of data type specific + * conflicts). + * + * @todo Do tests that verify that multiple conflicts are correctly detected and + * resolved. + * + * @todo Verify that we can handle examples in which we have to traverse an + * object graph during conflict resolution. (Really, two object graphs: a + * readOnly view of the ground state for the transaction and the + * readWriteTx that we are trying to validate.) This last issue is by far + * the trickyest and may require support for concurrent modification of + * the transaction indices during traveral (or more simply of reading from + * a fused view of the resolved and unconflicting entries in the + * read-write tx index views). + * + * @todo Destructive merging of objects in a graph can propagate changes other + * objects. Unless the data structures provide for encapsulation, e.g., by + * defining objects that serve as collectors for the link set members in a + * given segment, that change could propagate beyond the segment in which + * it is detected. If changes can propagate in that manner then care MUST + * be taken to ensure that validation terminates. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> *************** *** 111,117 **** */ ! ITx tx1 = journal.newTx(); ! ITx tx2 = journal.newTx(); /* --- 154,160 ---- */ ! final long tx1 = journal.newTx(); ! final long tx2 = journal.newTx(); /* *************** *** 120,130 **** */ ! tx1.getIndex(name).insert(k1, v1a); ! tx2.getIndex(name).insert(k1, v1b); ! tx1.prepare(); ! ! tx1.commit(); /* --- 163,171 ---- */ ! journal.getIndex(name,tx1).insert(k1, v1a); ! journal.getIndex(name,tx2).insert(k1, v1b); ! journal.commit(tx1); /* *************** *** 134,143 **** assertEquals(v1a,(byte[])journal.getIndex(name).lookup(k1)); try { ! tx2.prepare(); fail("Expecting: "+ValidationError.class); } catch(ValidationError ex) { System.err.println("Ignoring expected exception: "+ex); ! assertTrue(tx2.isAborted()); } --- 175,186 ---- assertEquals(v1a,(byte[])journal.getIndex(name).lookup(k1)); + final ITx tmp = journal.getTx(tx2); + try { ! journal.commit(tx2); fail("Expecting: "+ValidationError.class); } catch(ValidationError ex) { System.err.println("Ignoring expected exception: "+ex); ! assertTrue(tmp.isAborted()); } *************** *** 188,194 **** */ ! ITx tx1 = journal.newTx(); ! ITx tx2 = journal.newTx(); /* --- 231,237 ---- */ ! final long tx1 = journal.newTx(); ! final long tx2 = journal.newTx(); /* *************** *** 197,207 **** */ ! tx1.getIndex(name).insert(k1, v1a); ! tx2.getIndex(name).insert(k1, v1b); ! tx1.prepare(); ! ! tx1.commit(); /* --- 240,248 ---- */ ! journal.getIndex(name,tx1).insert(k1, v1a); ! journal.getIndex(name,tx2).insert(k1, v1b); ! journal.commit(tx1); /* *************** *** 211,220 **** assertEquals(v1a,(byte[])journal.getIndex(name).lookup(k1)); ! tx2.prepare(); ! ! // @todo the indices should probably become read only at this point. ! assertEquals(v1c,(byte[])tx2.getIndex(name).lookup(k1)); ! ! tx2.commit(); /* --- 252,256 ---- assertEquals(v1a,(byte[])journal.getIndex(name).lookup(k1)); ! journal.commit(tx2); /* *************** *** 228,293 **** } ! /** ! * The concurrency control algorithm must not permit two transactions to ! * prepare at the same time since that violates the basic rules of ! * serializability. ! * ! * @todo javadoc and move into schedules test suite or its own test suite. ! */ ! public void test_serializability() { ! ! Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); ! ! String name = "abc"; ! ! final byte[] k1 = new byte[] { 1 }; ! ! final byte[] v1a = new byte[] { 1 }; ! final byte[] v1b = new byte[] { 2 }; ! ! { ! ! /* ! * register an index and commit the journal. ! */ ! ! journal.registerIndex(name, new UnisolatedBTree(journal)); ! ! journal.commit(); ! ! } ! ! /* ! * Create two transactions. ! */ ! ! ITx tx1 = journal.newTx(); ! ! ITx tx2 = journal.newTx(); ! ! /* ! * Write a value under the same key on the same index in both ! * transactions. ! */ ! ! tx1.getIndex(name).insert(k1, v1a); ! ! tx2.getIndex(name).insert(k1, v1b); ! ! tx1.prepare(); ! ! try { ! tx2.prepare(); ! fail("Expecting: "+IllegalStateException.class); ! } catch(IllegalStateException ex) { ! System.err.println("Ignoring expected exception: "+ex); ! } ! ! journal.close(); ! ! } ! /** * Helper class used to resolve a predicted conflict to a known value. --- 264,329 ---- } ! // /** ! // * The concurrency control algorithm must not permit two transactions to ! // * prepare at the same time since that violates the basic rules of ! // * serializability. ! // * ! // * @todo javadoc and move into schedules test suite or its own test suite. ! // */ ! // public void test_serializability() { ! // ! // Properties properties = getProperties(); ! // ! // Journal journal = new Journal(properties); ! // ! // String name = "abc"; ! // ! // final byte[] k1 = new byte[] { 1 }; ! // ! // final byte[] v1a = new byte[] { 1 }; ! // final byte[] v1b = new byte[] { 2 }; ! // ! // { ! // ! // /* ! // * register an index and commit the journal. ! // */ ! // ! // journal.registerIndex(name, new UnisolatedBTree(journal)); ! // ! // journal.commit(); ! // ! // } ! // ! // /* ! // * Create two transactions. ! // */ ! // ! // final long tx1 = journal.newTx(); ! // ! // final long tx2 = journal.newTx(); ! // ! // /* ! // * Write a value under the same key on the same index in both ! // * transactions. ! // */ ! // ! // journal.getIndex(name,tx1).insert(k1, v1a); ! // ! // journal.getIndex(name,tx2).insert(k1, v1b); ! // ! // tx1.prepare(); ! // ! // try { ! // tx2.prepare(); ! // fail("Expecting: "+IllegalStateException.class); ! // } catch(IllegalStateException ex) { ! // System.err.println("Ignoring expected exception: "+ex); ! // } ! // ! // journal.close(); ! // ! // } ! // /** * Helper class used to resolve a predicted conflict to a known value. Index: TestTxRunState.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTxRunState.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestTxRunState.java 17 Feb 2007 21:34:12 -0000 1.2 --- TestTxRunState.java 19 Feb 2007 19:00:18 -0000 1.3 *************** *** 51,58 **** --- 51,65 ---- import java.util.Properties; + import com.bigdata.isolation.UnisolatedBTree; + import com.bigdata.objndx.IIndex; + /** * Test suite for the state machine governing the transaction {@link RunState} * transitions. * + * @todo refactor to test both {@link Tx} and the as yet to be written + * read-committed transaction class (ideally they will share a base class + * which encapsulates the state transaction mechanisms). + * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ *************** *** 439,441 **** --- 446,706 ---- } + /** + * Verifies that access to, and operations on, a named indices is denied + * after a PREPARE. + * + * @throws IOException + */ + public void test_runStateMachine_prepared_correctRejection() + throws IOException { + + final Properties properties = getProperties(); + + Journal journal = new Journal(properties); + + String name = "abc"; + + { + + journal.registerIndex(name, new UnisolatedBTree(journal)); + + journal.commit(); + + } + + final long tx0 = journal.newTx(); + + ITx tmp = journal.getTx(tx0); + + assertNotNull(tmp); + + IIndex ndx = journal.getIndex(name,tx0); + + assertNotNull(ndx); + + // commit the journal. + journal.commit(tx0); + + /* + * Verify that you can not access a named index after 'prepare'. + */ + try { + journal.getIndex(name,tx0); + fail("Expecting: " + IllegalStateException.class); + } catch (IllegalStateException ex) { + System.err.println("Ignoring expected exception: " + ex); + } + + /* + * Verify that operations on an pre-existing index reference are now + * denied. + */ + try { + ndx.lookup(new byte[] { 1 }); + fail("Expecting: " + IllegalStateException.class); + } catch (IllegalStateException ex) { + System.err.println("Ignoring expected exception: " + ex); + } + try { + ndx.contains(new byte[] { 1 }); + fail("Expecting: " + IllegalStateException.class); + } catch (IllegalStateException ex) { + System.err.println("Ignoring expected exception: " + ex); + } + try { + ndx.remove(new byte[] { 1 }); + fail("Expecting: " + IllegalStateException.class); + } catch (IllegalStateException ex) { + System.err.println("Ignoring expected exception: " + ex); + } + try { + ndx.insert(new byte[] { 1 }, new byte[] { 2 }); + fail("Expecting: " + IllegalStateException.class); + } catch (IllegalStateException ex) { + System.err.println("Ignoring expected exception: " + ex); + } + + assertFalse(tmp.isActive()); + assertTrue(tmp.isPrepared()); + assertFalse(tmp.isAborted()); + assertFalse(tmp.isCommitted()); + assertFalse(tmp.isComplete()); + + assertFalse(journal.activeTx.containsKey(tmp.getStartTimestamp())); + assertFalse(journal.preparedTx.containsKey(tmp.getStartTimestamp())); + assertNull(journal.getTx(tmp.getStartTimestamp())); + + journal.close(); + + } + + // /** + // * Verifies that access to, and operations on, a named indices is denied + // * after an ABORT. + // * + // * @throws IOException + // */ + // public void test_runStateMachine_aborted_correctRejection() + // throws IOException { + // + // final Properties properties = getProperties(); + // + // Journal journal = new Journal(properties); + // + // String name = "abc"; + // + // { + // + // journal.registerIndex(name, new UnisolatedBTree(journal)); + // + // journal.commit(); + // + // } + // + // ITx tx0 = journal.newTx(); + // + // IIndex ndx = tx0.getIndex(name); + // + // assertNotNull(ndx); + // + // tx0.abort(); + // + // /* + // * Verify that you can not access a named index. + // */ + // try { + // tx0.getIndex(name); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // + // /* + // * Verify that operations on an pre-existing index reference are now + // * denied. + // */ + // try { + // ndx.lookup(new byte[] { 1 }); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // try { + // ndx.contains(new byte[] { 1 }); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // try { + // ndx.remove(new byte[] { 1 }); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // try { + // ndx.insert(new byte[] { 1 }, new byte[] { 2 }); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // + // assertFalse(tx0.isActive()); + // assertFalse(tx0.isPrepared()); + // assertTrue (tx0.isAborted()); + // assertFalse(tx0.isCommitted()); + // assertTrue (tx0.isComplete()); + // + // assertFalse(journal.activeTx.containsKey(tx0.getStartTimestamp())); + // assertFalse(journal.preparedTx.containsKey(tx0.getStartTimestamp())); + // assertNull(journal.getTx(tx0.getStartTimestamp())); + // + // journal.close(); + // + // } + // + // /** + // * Verifies that access to, and operations on, a named indices is denied + // * after a COMMIT. + // * + // * @throws IOException + // */ + // public void test_runStateMachine_commit_correctRejection() + // throws IOException { + // + // final Properties properties = getProperties(); + // + // Journal journal = new Journal(properties); + // + // String name = "abc"; + // + // { + // + // journal.registerIndex(name, new UnisolatedBTree(journal)); + // + // journal.commit(); + // + // } + // + // ITx tx0 = journal.newTx(); + // + // IIndex ndx = tx0.getIndex(name); + // + // assertNotNull(ndx); + // + // tx0.prepare(); + // tx0.commit(); + // + // /* + // * Verify that you can not access a named index. + // */ + // try { + // tx0.getIndex(name); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // + // /* + // * Verify that operations on an pre-existing index reference are now + // * denied. + // */ + // try { + // ndx.lookup(new byte[] { 1 }); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // try { + // ndx.contains(new byte[] { 1 }); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // try { + // ndx.remove(new byte[] { 1 }); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // try { + // ndx.insert(new byte[] { 1 }, new byte[] { 2 }); + // fail("Expecting: " + IllegalStateException.class); + // } catch (IllegalStateException ex) { + // System.err.println("Ignoring expected exception: " + ex); + // } + // + // assertFalse(tx0.isActive()); + // assertFalse(tx0.isPrepared()); + // assertFalse(tx0.isAborted()); + // assertTrue(tx0.isCommitted()); + // assertTrue(tx0.isComplete()); + // + // assertFalse(journal.activeTx.containsKey(tx0.getStartTimestamp())); + // assertFalse(journal.preparedTx.containsKey(tx0.getStartTimestamp())); + // assertNull(journal.getTx(tx0.getStartTimestamp())); + // + // journal.close(); + // + // } + } Index: TestTx.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTx.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TestTx.java 17 Feb 2007 21:34:12 -0000 1.16 --- TestTx.java 19 Feb 2007 19:00:18 -0000 1.17 *************** *** 57,79 **** * Test suite for fully-isolated read-write transactions. * ! * @todo Test suite for transaction isolation with respect to the underlying ! * journal. The tests in this suite are designed to verify isolation of ! * changes within the scope of the transaction when compared to the last ! * committed state of the journal. This basically amounts to verifying ! * that operations read through the transaction scope object index into ! * the journal scope object index. ! * ! * @todo Do stress test with writes, reads, and deletes. [...1731 lines suppressed...] - // throws RuntimeException { - // - // if( randomData != null ) { - // - // fail("Already invoked once."); - // - // } - // - // System.err.println("Random resolution of conflict."); - // - // randomData = getRandomData(journal); - // - // tx.write(id, randomData); - // - // } - // - // } - } --- 1438,1440 ---- Index: StressTestConcurrent.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/StressTestConcurrent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StressTestConcurrent.java 19 Feb 2007 01:05:39 -0000 1.1 --- StressTestConcurrent.java 19 Feb 2007 19:00:18 -0000 1.2 *************** *** 48,51 **** --- 48,67 ---- package com.bigdata.journal; + import java.util.Collection; + import java.util.HashSet; + import java.util.Iterator; + import java.util.List; + import java.util.Properties; + import java.util.Random; + import java.util.concurrent.Callable; + import java.util.concurrent.ExecutionException; + import java.util.concurrent.ExecutorService; + import java.util.concurrent.Executors; + import java.util.concurrent.Future; + import java.util.concurrent.TimeUnit; + + import com.bigdata.isolation.UnisolatedBTree; + import com.bigdata.objndx.IIndex; + /** * Stress tests for concurrent transaction processing. *************** *** 63,71 **** } ! public void test_concurrentClients() { ! fail("write tests"); } } --- 79,253 ---- } ! /** ! * A stress test with a small pool of concurrent clients. ! */ ! public void test_concurrentClients() throws InterruptedException { ! ! Properties properties = getProperties(); ! Journal journal = new Journal(properties); ! ! final String name = "abc"; ! ! { ! journal.registerIndex(name, new UnisolatedBTree(journal)); ! ! journal.commit(); ! } ! ! try { ! ! /* ! * FIXME This is Ok with one concurrent client, but it will fail ! * with more than one concurrent client. The underlying problem is ! * that we are not serializing transactions. Once a transaction ! * begins to prepare, concurrent transactions that seek to prepare ! * must block until the transaction either aborts or commits. This ! * can be implemented by a queue of committers. Note that concurrent ! * transactions may always abort while they are running. Also note ! * that a transaction that is read only does not need to synchronize ! * since it will have an empty write set. We could also detect ! * transactions with empty write sets (no touched indices) and ! * shortcut the prepare/commit for those transactions as well. ! */ ! doConcurrentClientTest(journal,name,1,100); ! ! } finally { ! ! journal.close(); ! ! } ! ! } ! ! /** ! * A stress test with a pool of concurrent clients. ! * ! * @param journal ! * The database. ! * ! * @param name ! * The name of the index on which the transactions will ! * operation. ! * ! * @param nclients ! * The #of concurrent clients. ! * ! * @param ntx ! * The #of transactions to execute. ! * ! * @todo can this also be a correctness test if we choose the ! * read/write/delete operations carefully and maintain a ground truth ! * index? ! */ ! public void doConcurrentClientTest(Journal journal, String name, int nclients, int ntx) ! throws InterruptedException ! { ! ! ExecutorService executorService = Executors.newFixedThreadPool( ! nclients, Executors.defaultThreadFactory()); ! ! final long timeout = 5; ! ! Collection<Callable<Long>> tasks = new HashSet<Callable<Long>>(); ! ! for(int i=0; i<ntx; i++) { ! ! tasks.add(new Task(journal, journal.newTx(), name)); ! ! } ! ! /* ! * @todo this will fail since we are not serializing transactions in ! * prepare->commit. ! */ ! List<Future<Long>> results = executorService.invokeAll(tasks, timeout, TimeUnit.SECONDS); ! ! /* ! * @todo validate results - all execute, valid commit times, no errors. ! * ! * @todo if write-write conflicts can result, then those should be ! * acceptable errors and the task could just be retried. ! */ ! ! Iterator<Future<Long>> itr = results.iterator(); ! ! while(itr.hasNext()) { ! ! Future<Long> future = itr.next(); ! ! assertFalse(future.isCancelled()); ! ! try { ! ! assertNotSame(0L,future.get()); ! ! } catch(ExecutionException ex ) { ! ! // @todo validation errors should be allowed here. ! ! fail("Not expecting: "+ex, ex); ! ! } ! ! } } + + // @todo change to IJournal + public static class Task implements Callable<Long> { + + private final Journal journal; + private final long tx; + private final IIndex ndx; + final Random r = new Random(); + + public Task(Journal journal,long tx, String name) { + this.journal = journal; + + this.tx = tx; + + this.ndx = journal.getIndex(name,tx); + + } + + /** + * Executes random operations in the transaction. + * + * @return The commit time of the transaction. + */ + public Long call() throws Exception { + + // Random operations on the named index(s). + + for (int i = 0; i < 100; i++) { + + byte[] key = new byte[4]; + + r.nextBytes(key); + + if (r.nextInt(100) > 10) { + + byte[] val = new byte[5]; + + r.nextBytes(val); + + ndx.insert(key, val); + + } else { + + ndx.remove(key); + + } + + } + + // commit. + return journal.commit(tx); + + } + + } + } Index: TestTransactionServer.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTransactionServer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestTransactionServer.java 8 Nov 2006 15:18:12 -0000 1.1 --- TestTransactionServer.java 19 Feb 2007 19:00:18 -0000 1.2 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.journal; + import com.bigdata.journal.TransactionServer.IsolationEnum; + import junit.framework.TestCase; *************** *** 84,89 **** } - final int segment1 = 1; - /** * Test verifies some correctness for determination of transaction ground --- 86,89 ---- *************** *** 106,118 **** * @todo This is bootstrapping a ground state, which is a bit kludgy. */ ! final long t0 = server.startTx(segment1, false, false); server.commitTx(t0); // @todo verify groundState for new transactions is t0. ! final long t1 = server.startTx(segment1, false, false); ! final long t2 = server.startTx(segment1, false, false); server.commitTx(t1); // @todo verify groundState for new transactions is t1. ! final long t3 = server.startTx(segment1, false, false); server.commitTx(t2); /* --- 106,118 ---- * @todo This is bootstrapping a ground state, which is a bit kludgy. */ ! final long t0 = server.startTx(IsolationEnum.ReadWrite); server.commitTx(t0); // @todo verify groundState for new transactions is t0. ! final long t1 = server.startTx(IsolationEnum.ReadWrite); ! final long t2 = server.startTx(IsolationEnum.ReadWrite); server.commitTx(t1); // @todo verify groundState for new transactions is t1. ! final long t3 = server.startTx(IsolationEnum.ReadWrite); server.commitTx(t2); /* *************** *** 122,126 **** * no longer an active groundState. */ ! final long t4 = server.startTx(segment1, false, false); server.commitTx(t3); /* --- 122,126 ---- * no longer an active groundState. */ ! final long t4 = server.startTx(IsolationEnum.ReadWrite); server.commitTx(t3); /* Index: TestRootBlockView.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestRootBlockView.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TestRootBlockView.java 17 Feb 2007 21:34:12 -0000 1.8 --- TestRootBlockView.java 19 Feb 2007 19:00:18 -0000 1.9 *************** *** 110,115 **** assertEquals("segmentId", segmentId, rootBlock.getSegmentId()); assertEquals("nextOffset", nextOffset, rootBlock.getNextOffset()); ! assertEquals("firstTxId", firstTxId, rootBlock.getFirstTxId()); ! assertEquals("lastTxId", lastTxId, rootBlock.getLastTxId()); assertEquals("commitCounter", commitCounter, rootBlock.getCommitCounter()); assertEquals("commitTimestamp", commitTimestamp, rootBlock.getCommitTimestamp()); --- 110,115 ---- assertEquals("segmentId", segmentId, rootBlock.getSegmentId()); assertEquals("nextOffset", nextOffset, rootBlock.getNextOffset()); ! assertEquals("firstTxId", firstTxId, rootBlock.getFirstTxCommitTime()); ! assertEquals("lastTxId", lastTxId, rootBlock.getLastTxCommitTime()); assertEquals("commitCounter", commitCounter, rootBlock.getCommitCounter()); assertEquals("commitTimestamp", commitTimestamp, rootBlock.getCommitTimestamp()); *************** *** 125,130 **** assertEquals("segmentId", segmentId, rootBlock.getSegmentId()); assertEquals("nextOffset", nextOffset, rootBlock.getNextOffset()); ! assertEquals("firstTxId", firstTxId, rootBlock.getFirstTxId()); ! assertEquals("lastTxId", lastTxId, rootBlock.getLastTxId()); assertEquals("commitCounter", commitCounter, rootBlock.getCommitCounter()); assertEquals("commitTimestamp", commitTimestamp, rootBlock.getCommitTimestamp()); --- 125,130 ---- assertEquals("segmentId", segmentId, rootBlock.getSegmentId()); assertEquals("nextOffset", nextOffset, rootBlock.getNextOffset()); ! assertEquals("firstTxId", firstTxId, rootBlock.getFirstTxCommitTime()); ! assertEquals("lastTxId", lastTxId, rootBlock.getLastTxCommitTime()); assertEquals("commitCounter", commitCounter, rootBlock.getCommitCounter()); assertEquals("commitTimestamp", commitTimestamp, rootBlock.getCommitTimestamp()); Index: TestReadOnlyTx.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestReadOnlyTx.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestReadOnlyTx.java 19 Feb 2007 01:05:39 -0000 1.2 --- TestReadOnlyTx.java 19 Feb 2007 19:00:18 -0000 1.3 *************** *** 111,117 **** */ ! ITx tx1 = journal.newTx(true); ! IIndex ndx = tx1.getIndex(name); assertNotNull(ndx); --- 111,117 ---- */ ! final long tx1 = journal.newTx(true); ! IIndex ndx = journal.getIndex(name,tx1); assertNotNull(ndx); *************** *** 126,132 **** } ! tx1.prepare(); ! ! tx1.commit(); } --- 126,130 ---- } ! journal.commit(tx1); } *************** *** 139,145 **** */ ! ITx tx1 = journal.newTx(true); ! IIndex ndx = tx1.getIndex(name); assertNotNull(ndx); --- 137,143 ---- */ ! final long tx1 = journal.newTx(true); ! IIndex ndx = journal.getIndex(name,tx1); assertNotNull(ndx); *************** *** 154,158 **** } ! tx1.abort(); } --- 152,156 ---- } ! journal.abort(tx1); } |