use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class RESTPubSubTest method testGetPublisher.
@Test
public void testGetPublisher() 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);
Publisher publisher = pubSub.getPublisher();
Assert.assertNotNull(publisher);
Assert.assertTrue(publisher instanceof RESTQueryPublisher);
config.set(BulletConfig.PUBSUB_CONTEXT_NAME, "QUERY_PROCESSING");
pubSub = new RESTPubSub(config);
publisher = pubSub.getPublisher();
Assert.assertNotNull(publisher);
Assert.assertTrue(publisher instanceof RESTResultPublisher);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class AggregationOperationsTest method testDistinctStrategy.
@Test
public void testDistinctStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.GROUP);
aggregation.setFields(singletonMap("field", "foo"));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), GroupBy.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class AggregationOperationsTest method testGroupAllStrategy.
@Test
public void testGroupAllStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.GROUP);
aggregation.setAttributes(singletonMap(GroupOperation.OPERATIONS, singletonList(singletonMap(GroupOperation.OPERATION_TYPE, GroupOperation.GroupOperationType.COUNT.getName()))));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), GroupAll.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class AggregationOperationsTest method testRawStrategy.
@Test
public void testRawStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), Raw.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class AggregationOperationsTest method testDistributionStrategy.
@Test
public void testDistributionStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.DISTRIBUTION);
aggregation.setFields(singletonMap("field", "foo"));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), Distribution.class);
}
Aggregations