Search in sources :

Example 31 with Window

use of com.yahoo.bullet.parsing.Window in project bullet-core by yahoo.

the class TumblingTest method testNotClosedOnStrategyClosed.

@Test
public void testNotClosedOnStrategyClosed() {
    Window window = makeTumblingWindow(Integer.MAX_VALUE);
    ClosableStrategy strategy = new ClosableStrategy();
    Tumbling tumbling = new Tumbling(strategy, window, config);
    Assert.assertFalse(tumbling.initialize().isPresent());
    Assert.assertFalse(tumbling.isClosed());
    Assert.assertFalse(tumbling.isClosedForPartition());
    strategy.setClosed(true);
    Assert.assertFalse(tumbling.isClosed());
    Assert.assertFalse(tumbling.isClosedForPartition());
}
Also used : Window(com.yahoo.bullet.parsing.Window) Test(org.testng.annotations.Test)

Example 32 with Window

use of com.yahoo.bullet.parsing.Window in project bullet-core by yahoo.

the class TumblingTest method make.

private Tumbling make(int length, int minimumWindow) {
    config.set(BulletConfig.WINDOW_MIN_EMIT_EVERY, minimumWindow);
    config.validate();
    Window window = makeTumblingWindow(length);
    return new Tumbling(strategy, window, config);
}
Also used : Window(com.yahoo.bullet.parsing.Window)

Aggregations

Window (com.yahoo.bullet.parsing.Window)32 Test (org.testng.annotations.Test)24 BulletConfig (com.yahoo.bullet.common.BulletConfig)6 Query (com.yahoo.bullet.parsing.Query)6 Aggregation (com.yahoo.bullet.parsing.Aggregation)5 MockStrategy (com.yahoo.bullet.aggregations.MockStrategy)2 Meta (com.yahoo.bullet.result.Meta)2 Arrays.asList (java.util.Arrays.asList)2 Collections.singletonList (java.util.Collections.singletonList)2 List (java.util.List)2 Map (java.util.Map)2 AdditiveTumbling (com.yahoo.bullet.windowing.AdditiveTumbling)1 Basic (com.yahoo.bullet.windowing.Basic)1 Reactive (com.yahoo.bullet.windowing.Reactive)1 Tumbling (com.yahoo.bullet.windowing.Tumbling)1