DbusEventBufferMult { public DbusEventBufferAppendable getDbusEventBufferAppendable(PhysicalPartition pPartition) { return getOneBuffer(pPartition); } DbusEventBufferMult();  DbusEventBufferMult(PhysicalSourceStaticConfig [] pConfigs,
                             DbusEventBuffer.StaticConfig config,
                             DbusEventFactory eventFactory); DbusEventBuffer getOneBuffer(LogicalSource lSource,
                                       LogicalPartition lPartition); DbusEventBuffer getOneBuffer( PhysicalPartition pPartition); void resetBuffer(PhysicalPartition pPartition, long prevScn); DbusEventBufferAppendable getDbusEventBufferAppendable(PhysicalPartition pPartition); DbusEventBufferAppendable getDbusEventBufferAppendable(int lSrcId); DbusEventBufferAppendable getDbusEventBufferAppendable(LogicalSource lSource); DbusEventBufferAppendable getDbusEventBufferAppendable(LogicalSource lSource,
                                                                LogicalPartition lPartition); DbusEventBuffer getDbusEventBuffer(LogicalSource lSource); DbusEventBufferBatchReadable getDbusEventBufferBatchReadable(CheckpointMult cpMult,
            Set<PhysicalPartitionKey> ppartKeys, StatsCollectors<DbusEventsStatisticsCollector> statsCollectors); DbusEventBufferBatchReadable getDbusEventBufferBatchReadable(Collection<Integer> ids,
		  CheckpointMult cpMult, StatsCollectors<DbusEventsStatisticsCollector> statsCollector); DbusEventBufferBatchReadable getDbusEventBufferBatchReadable(
         CheckpointMult cpMult,
         Collection<PhysicalPartitionKey> physicalPartitions,
         StatsCollectors<DbusEventsStatisticsCollector> statsCollector); PhysicalPartition getPhysicalPartition(int srcId ); PhysicalPartition getPhysicalPartition(int srcId, LogicalPartition lPartition ); Iterable<DbusEventBuffer> bufIterable(); synchronized DbusEventBuffer addNewBuffer(PhysicalSourceStaticConfig pConfig,
                                                   DbusEventBuffer.StaticConfig config); synchronized void removeBuffer(PhysicalPartitionKey pKey, PhysicalSource pSource); synchronized void removeBuffer(PhysicalSourceStaticConfig pConfig); synchronized void deallocateRemovedBuffers(boolean now); synchronized void close(); void assertBuffers(); synchronized void addBuffer(PhysicalSourceStaticConfig pConfig, DbusEventBuffer buf); Set<PhysicalSource> getPhysicalSourcesForPartition(PhysicalPartition pPart); DbusFilter constructFilters(Collection<DatabusSubscription> subs); NavigableSet<PhysicalPartitionKey> getAllPhysicalPartitionKeys(); void setDropOldEvents(boolean val); int bufsNum(); void startAllEvents(); void endAllEvents(long seq, long nTime, DbusEventsStatisticsCollector stats); void clearAll(); synchronized void saveBufferMetaInfo(boolean infoOnly); void validateRelayBuffers(); void rollbackAllBuffers(); static final String MODULE; static final Logger LOG; static final String PERF_MODULE; static final Logger PERF_LOG; static final String BAK_DIRNAME_SUFFIX; }
@Test public void testGetBuffer() throws InvalidConfigException { createBufMult(); addEvents(); Integer pPartitionId = 100; PhysicalPartition pPartition = new PhysicalPartition(pPartitionId, "multBufferTest1"); DbusEventBufferAppendable buf = _eventBufferMult.getDbusEventBufferAppendable(pPartition); assertNotNull(buf,"cannot get by pPartition" + pPartition); buf = _eventBufferMult.getDbusEventBufferAppendable(pPartition); assertNotNull(buf,"cannot get by pPartition" + pPartition); int lSrcId = 1; buf = _eventBufferMult.getDbusEventBufferAppendable(lSrcId); assertNotNull(buf,"cannot get by lSrcId" + lSrcId); lSrcId = 2; LogicalSource lSource = new LogicalSource(lSrcId, "srcName2"); DbusEventBufferAppendable buf1 = _eventBufferMult.getDbusEventBufferAppendable(lSource); assertNotNull(buf1, "cannot get buffer by lSource " + lSource); assertTrue(buf1 == buf, "buf and buf1 should be the same buffer"); LogicalPartition lPartition = new LogicalPartition((short)1); buf1 = _eventBufferMult.getDbusEventBufferAppendable(lSource, lPartition); assertNotNull(buf1, "cannot get buffer by lSource " + lSource + ";lPartition =" + lPartition); assertTrue(buf1 == buf, "buf and buf1 should be the same buffer"); lPartition = new LogicalPartition((short)2); buf1 = _eventBufferMult.getDbusEventBufferAppendable(lSource, lPartition); assertNotNull(buf1, "cannot get buffer by lSource " + lSource + ";lPartition =" + lPartition); assertTrue(buf1 != buf, "buf and buf1 should not be the same buffer"); DbusEventBufferAppendable buf2 = _eventBufferMult.getDbusEventBufferAppendable(12); assertNotNull(buf2, "cannot get buffer by lSourceid " + 12); assertTrue(buf2 != buf, "buf and buf2 should not be the same buffer"); assertTrue(buf1 == buf2, "buf2 and buf1 should be the same buffer"); }