//read from one buffer and one source partition
DatabusSubscription sub2 =
new DatabusSubscription(PhysicalSource.MASTER_PHISYCAL_SOURCE,
new PhysicalPartition(101, "multBufferTest2"),
new LogicalSourceId(new LogicalSource(2, "srcName2"), (short)2)
);
DbusFilter filter2 = t._eventBuffer.constructFilters(Arrays.asList(sub2));
assertNotNull(filter2);
CheckpointMult cpMult2 = new CheckpointMult();
Checkpoint cp101 = new Checkpoint();
cp101.init();
cp101.setConsumptionMode(DbusClientMode.ONLINE_CONSUMPTION);
cp101.setWindowScn(10L);
cp101.setWindowOffset(-1);
cpMult2.addCheckpoint(pp101, cp101);
DbusEventBufferBatchReadable reader2 =
t._eventBuffer.getDbusEventBufferBatchReadable(cpMult2, Arrays.asList(pk2), statsColls1);
eventsRead = reader2.streamEvents(false, 1000000, Channels.newChannel(baos),
Encoding.BINARY, filter2).getNumEventsStreamed();
assertEquals(eventsRead, 6); //1 events + 1 eop + 3events + 1 eop
baos.reset();
statsCol1.reset();statsCol2.reset();
//read all partitions for a source
DatabusSubscription sub3 =
new DatabusSubscription(PhysicalSource.MASTER_PHISYCAL_SOURCE,
PhysicalPartition.ANY_PHYSICAL_PARTITION,
LogicalSourceId.createAllPartitionsWildcard(new LogicalSource(2, "srcName2"))
);
DbusFilter filter3 = t._eventBuffer.constructFilters(Arrays.asList(sub3));
assertNotNull(filter3);