use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class WindowingOperationsTest method testAdditiveTumblingWindow.
@Test
public void testAdditiveTumblingWindow() {
BulletConfig config = new BulletConfig();
Query query = new Query();
Window window = WindowUtils.makeWindow(Window.Unit.TIME, 1000, Window.Unit.ALL, null);
window.configure(config);
query.setWindow(window);
Aggregation aggregation = new Aggregation();
aggregation.setType(Aggregation.Type.GROUP);
query.setAggregation(aggregation);
Assert.assertEquals(WindowingOperations.findScheme(query, null, config).getClass(), AdditiveTumbling.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class WindowingOperationsTest method testOtherWindowsForcedToTumbling.
@Test
public void testOtherWindowsForcedToTumbling() {
BulletConfig config = new BulletConfig();
Query query = new Query();
Window window = WindowUtils.makeWindow(Window.Unit.TIME, 1000, Window.Unit.RECORD, 4);
window.configure(config);
query.setWindow(window);
Aggregation aggregation = new Aggregation();
aggregation.setType(Aggregation.Type.COUNT_DISTINCT);
query.setAggregation(aggregation);
Assert.assertEquals(WindowingOperations.findScheme(query, null, config).getClass(), Tumbling.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class WindowingOperationsTest method testRawReactiveWindow.
@Test
public void testRawReactiveWindow() {
BulletConfig config = new BulletConfig();
Query query = new Query();
Window window = WindowUtils.makeReactiveWindow();
window.configure(config);
query.setWindow(window);
Aggregation aggregation = new Aggregation();
aggregation.setType(Aggregation.Type.RAW);
query.setAggregation(aggregation);
Assert.assertEquals(WindowingOperations.findScheme(query, null, config).getClass(), Reactive.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class PubSubTest method testIllegalPubSubClassName.
@Test(expectedExceptions = PubSubException.class)
public void testIllegalPubSubClassName() throws PubSubException {
BulletConfig config = new BulletConfig(null);
config.set(BulletConfig.PUBSUB_CLASS_NAME, null);
try {
PubSub.from(config);
} catch (Exception e) {
Assert.assertEquals(e.getCause().getClass(), NullPointerException.class);
throw e;
}
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class RESTPubSubTest method testGetSubscribers.
@Test
public void testGetSubscribers() throws PubSubException {
BulletConfig config = new BulletConfig("src/test/resources/test_config.yaml");
config.set(BulletConfig.PUBSUB_CONTEXT_NAME, "QUERY_SUBMISSION");
RESTPubSub pubSub = new RESTPubSub(config);
List<Subscriber> subscribers = pubSub.getSubscribers(8);
Assert.assertNotNull(subscribers);
Assert.assertTrue(subscribers.get(0) instanceof RESTSubscriber);
Assert.assertTrue(subscribers.get(7) instanceof RESTSubscriber);
config.set(BulletConfig.PUBSUB_CONTEXT_NAME, "QUERY_PROCESSING");
pubSub = new RESTPubSub(config);
subscribers = pubSub.getSubscribers(8);
Assert.assertNotNull(subscribers);
Assert.assertTrue(subscribers.get(0) instanceof RESTSubscriber);
Assert.assertTrue(subscribers.get(7) instanceof RESTSubscriber);
}
Aggregations