Search in sources :

Example 1 with WatermarkIdlePolicy

use of cz.o2.proxima.time.WatermarkIdlePolicy in project proxima-platform by O2-Czech-Republic.

the class BoundedOutOfOrdernessWatermarkEstimatorTest method testIdlePolicy.

@Test
public void testIdlePolicy() {
    WatermarkIdlePolicy idlePolicy = mock(WatermarkIdlePolicy.class);
    BoundedOutOfOrdernessWatermarkEstimator estimator = BoundedOutOfOrdernessWatermarkEstimator.newBuilder().withWatermarkIdlePolicy(idlePolicy).build();
    StreamElement element = element(now);
    estimator.update(element);
    verify(idlePolicy, times(1)).update(element);
    estimator.idle();
    verify(idlePolicy, times(1)).idle(now);
}
Also used : WatermarkIdlePolicy(cz.o2.proxima.time.WatermarkIdlePolicy) StreamElement(cz.o2.proxima.storage.StreamElement) Test(org.junit.Test)

Example 2 with WatermarkIdlePolicy

use of cz.o2.proxima.time.WatermarkIdlePolicy in project proxima-platform by O2-Czech-Republic.

the class NotProgressingWatermarkIdlePolicyTest method testFactory.

@Test
public void testFactory() {
    WatermarkIdlePolicyFactory factory = new NotProgressingWatermarkIdlePolicy.Factory();
    WatermarkIdlePolicy policy = factory.create(Collections.emptyMap());
    assertNotNull(policy);
    assertEquals(NotProgressingWatermarkIdlePolicy.class, policy.getClass());
}
Also used : WatermarkIdlePolicyFactory(cz.o2.proxima.time.WatermarkIdlePolicyFactory) WatermarkIdlePolicy(cz.o2.proxima.time.WatermarkIdlePolicy) WatermarkIdlePolicyFactory(cz.o2.proxima.time.WatermarkIdlePolicyFactory) Test(org.junit.Test)

Aggregations

WatermarkIdlePolicy (cz.o2.proxima.time.WatermarkIdlePolicy)2 Test (org.junit.Test)2 StreamElement (cz.o2.proxima.storage.StreamElement)1 WatermarkIdlePolicyFactory (cz.o2.proxima.time.WatermarkIdlePolicyFactory)1