@Test public void testBasic() throws Exception { TypeLayer tl = new TypeLayer(new StringEncoder()); MockTransactionBase tt = new MockTransactionBase("r1,cf1:cq1,v1", "r1,cf1:cq2,v2", "r1,cf1:cq3,9", "r2,cf2:7,12", "r2,cf2:8,13", "13,9:17,20", "13,9:18,20", "13,9:19,20", "13,9:20,20"); TypedTransactionBase ttx = tl.wrap(tt); Assert.assertEquals(Bytes.of("12"), ttx.get(Bytes.of("r2"), new Column("cf2", "7"))); Assert.assertNull(ttx.get(Bytes.of("r2"), new Column("cf2", "9"))); Map<Column, Bytes> map = ttx.get(Bytes.of("r2"), ImmutableSet.of(new Column("cf2", "7"), new Column("cf2", "8"))); Assert.assertEquals(2, map.size()); Assert.assertEquals("12", map.get(new Column("cf2", "7")).toString()); Assert.assertEquals("13", map.get(new Column("cf2", "8")).toString()); map = ttx.get(Bytes.of("r6"), ImmutableSet.of(new Column("cf2", "7"), new Column("cf2", "8"))); Assert.assertEquals(0, map.size()); ttx.set(Bytes.of("r6"), new Column("cf2", "7"), Bytes.of("3")); Assert.assertEquals(MockTransactionBase.toRCVM("r6,cf2:7,3"), tt.setData); tt.setData.clear(); Map<Bytes, Map<Column, Bytes>> map2 = ttx.get(ImmutableSet.of(Bytes.of("r1"), Bytes.of("r2")), ImmutableSet.of(new Column("cf1", "cq1"), new Column("cf2", "8"))); Assert.assertEquals(MockTransactionBase.toRCVM("r1,cf1:cq1,v1", "r2,cf2:8,13"), map2); ttx.delete(Bytes.of("r6"), new Column("cf2", "7")); Assert.assertEquals(MockTransactionBase.toRCM("r6,cf2:7"), tt.deletes); tt.deletes.clear(); ttx.setWeakNotification(Bytes.of("r6"), new Column("cf2", "8")); Assert.assertEquals(MockTransactionBase.toRCM("r6,cf2:8"), tt.weakNotifications); tt.weakNotifications.clear(); }
public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); }
TypeLayer { public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); } }
TypeLayer { public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); } TypeLayer(Encoder encoder); }
TypeLayer { public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); } TypeLayer(Encoder encoder); CFB bc(); TypedSnapshot wrap(Snapshot snap); TypedTransactionBase wrap(TransactionBase tx); TypedTransaction wrap(Transaction tx); }
TypeLayer { public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); } TypeLayer(Encoder encoder); CFB bc(); TypedSnapshot wrap(Snapshot snap); TypedTransactionBase wrap(TransactionBase tx); TypedTransaction wrap(Transaction tx);  }