use of cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiterTest.TestTracker in project proxima-platform by O2-Czech-Republic.
the class DirectDataOperatorTest method testLimiterDataAccessor.
@Test
public void testLimiterDataAccessor() {
repo.reloadConfig(true, ConfigFactory.load("test-limiter.conf").withFallback(ConfigFactory.load("test-reference.conf")).resolve());
DirectDataOperator direct = repo.getOrCreateOperator(DirectDataOperator.class);
DirectAttributeFamilyDescriptor family = direct.getFamilyByName("event-storage-stream");
Optional<CommitLogReader> maybeReader = family.getCommitLogReader();
assertTrue(maybeReader.isPresent());
CommitLogReader reader = maybeReader.get();
assertTrue("Expected reader of class LimitedCommitLogReader, got " + reader.getClass(), reader instanceof LimitedCommitLogReader);
LimitedCommitLogReader limitedReader = (LimitedCommitLogReader) reader;
ThroughputLimiter limiter = limitedReader.getLimiter();
assertNotNull(limiter);
assertTrue(limiter instanceof GlobalWatermarkThroughputLimiter);
GlobalWatermarkThroughputLimiter watermarkLimiter = (GlobalWatermarkThroughputLimiter) limiter;
GlobalWatermarkTracker tracker = watermarkLimiter.getTracker();
assertTrue(tracker instanceof TestTracker);
TestTracker testTracker = (TestTracker) tracker;
assertEquals(2, testTracker.getTestConf());
}
Aggregations