use of io.cdap.cdap.internal.io.ASMDatumWriterFactory in project cdap by cdapio.
the class MetricsTestBase method init.
@Before
public void init() throws IOException, UnsupportedTypeException {
cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
cConf.set(Constants.Metrics.TOPIC_PREFIX, TOPIC_PREFIX);
cConf.setInt(Constants.Metrics.MESSAGING_TOPIC_NUM, 10);
cConf.setInt(Constants.Metrics.QUEUE_SIZE, 1000);
// Set it to really short delay for faster test
cConf.setLong(Constants.Metrics.PROCESSOR_MAX_DELAY_MS, 5);
injector = Guice.createInjector(getModules());
messagingService = injector.getInstance(MessagingService.class);
if (messagingService instanceof Service) {
((Service) messagingService).startAndWait();
}
metricValueType = TypeToken.of(MetricValues.class);
schema = new ReflectionSchemaGenerator().generate(metricValueType.getType());
recordWriter = new ASMDatumWriterFactory(new ASMFieldAccessorFactory()).create(metricValueType, schema);
}
use of io.cdap.cdap.internal.io.ASMDatumWriterFactory in project cdap by caskdata.
the class MetricsTestBase method init.
@Before
public void init() throws IOException, UnsupportedTypeException {
cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
cConf.set(Constants.Metrics.TOPIC_PREFIX, TOPIC_PREFIX);
cConf.setInt(Constants.Metrics.MESSAGING_TOPIC_NUM, 10);
cConf.setInt(Constants.Metrics.QUEUE_SIZE, 1000);
// Set it to really short delay for faster test
cConf.setLong(Constants.Metrics.PROCESSOR_MAX_DELAY_MS, 5);
injector = Guice.createInjector(getModules());
messagingService = injector.getInstance(MessagingService.class);
if (messagingService instanceof Service) {
((Service) messagingService).startAndWait();
}
metricValueType = TypeToken.of(MetricValues.class);
schema = new ReflectionSchemaGenerator().generate(metricValueType.getType());
recordWriter = new ASMDatumWriterFactory(new ASMFieldAccessorFactory()).create(metricValueType, schema);
}
Aggregations