use of org.apache.nifi.controller.druid.MockDruidTranquilityController in project nifi by apache.
the class PutDruidRecordTest method setUp.
@Before
public void setUp() throws Exception {
runner = TestRunners.newTestRunner(PutDruidRecord.class);
druidTranquilityController = new MockDruidTranquilityController(2, 3);
recordReader = new MockRecordParser();
recordWriter = new MockRecordWriter(null, true, 2);
runner.addControllerService("reader", recordReader);
runner.enableControllerService(recordReader);
runner.addControllerService("writer", recordWriter);
runner.enableControllerService(recordWriter);
runner.addControllerService("tranquility", druidTranquilityController);
runner.setProperty(druidTranquilityController, DruidTranquilityController.DATASOURCE, "test");
runner.setProperty(druidTranquilityController, DruidTranquilityController.ZOOKEEPER_CONNECTION_STRING, "localhost:2181");
runner.setProperty(druidTranquilityController, DruidTranquilityController.AGGREGATOR_JSON, "[{\"type\": \"count\", \"name\": \"count\"}]");
runner.setProperty(druidTranquilityController, DruidTranquilityController.DIMENSIONS_LIST, "dim1,dim2");
runner.assertValid(druidTranquilityController);
runner.enableControllerService(druidTranquilityController);
runner.setProperty(PutDruidRecord.RECORD_READER_FACTORY, "reader");
runner.setProperty(PutDruidRecord.RECORD_WRITER_FACTORY, "writer");
runner.setProperty(PutDruidRecord.DRUID_TRANQUILITY_SERVICE, "tranquility");
}
Aggregations