@Test public void testFence2() throws Exception { byte[] fenceId = "test_table".getBytes(Charsets.UTF_8); TransactionAware readFence1 = VisibilityFence.create(fenceId); TransactionContext readTxContext1 = new TransactionContext(new InMemoryTxSystemClient(txManager), readFence1); readTxContext1.start(); TransactionAware readFence2 = VisibilityFence.create(fenceId); TransactionContext readTxContext2 = new TransactionContext(new InMemoryTxSystemClient(txManager), readFence2); readTxContext2.start(); TransactionAware readFence3 = VisibilityFence.create(fenceId); TransactionContext readTxContext3 = new TransactionContext(new InMemoryTxSystemClient(txManager), readFence3); readTxContext3.start(); TransactionAware writeFence = new WriteFence(fenceId); TransactionContext writeTxContext = new TransactionContext(new InMemoryTxSystemClient(txManager), writeFence); writeTxContext.start(); readTxContext1.finish(); try { writeTxContext.finish(); Assert.fail("Expected transaction to fail"); } catch (TransactionConflictException e) { writeTxContext.abort(); } writeTxContext.start(); readTxContext3.finish(); try { writeTxContext.finish(); Assert.fail("Expected transaction to fail"); } catch (TransactionConflictException e) { writeTxContext.abort(); } writeTxContext.start(); writeTxContext.finish(); try { readTxContext2.finish(); Assert.fail("Expected transaction to fail"); } catch (TransactionConflictException e) { readTxContext2.abort(); } readTxContext2 = new TransactionContext(new InMemoryTxSystemClient(txManager), readFence2); readTxContext2.start(); readTxContext2.finish(); }
public static TransactionAware create(byte[] fenceId) { return new ReadFence(fenceId); }
VisibilityFence { public static TransactionAware create(byte[] fenceId) { return new ReadFence(fenceId); } }
VisibilityFence { public static TransactionAware create(byte[] fenceId) { return new ReadFence(fenceId); } private  VisibilityFence(); }
VisibilityFence { public static TransactionAware create(byte[] fenceId) { return new ReadFence(fenceId); } private  VisibilityFence(); static TransactionAware create(byte[] fenceId); static FenceWait prepareWait(byte[] fenceId, TransactionSystemClient txClient); }
VisibilityFence { public static TransactionAware create(byte[] fenceId) { return new ReadFence(fenceId); } private  VisibilityFence(); static TransactionAware create(byte[] fenceId); static FenceWait prepareWait(byte[] fenceId, TransactionSystemClient txClient);  }