use of org.apache.druid.testing.utils.EventSerializer in project druid by druid-io.
the class ITAutoCompactionLockContentionTest method setup.
@BeforeMethod
public void setup() throws Exception {
generatedTestConfig = new GeneratedTestConfig(Specs.PARSER_TYPE, getResourceAsString(Specs.INPUT_FORMAT_PATH));
fullDatasourceName = generatedTestConfig.getFullDatasourceName();
final EventSerializer serializer = jsonMapper.readValue(getResourceAsStream(Specs.SERIALIZER_PATH), EventSerializer.class);
streamGenerator = new WikipediaStreamEventStreamGenerator(serializer, 6, 100);
}
use of org.apache.druid.testing.utils.EventSerializer in project druid by druid-io.
the class AbstractStreamIndexingTest method doTestIndexDataStableState.
protected void doTestIndexDataStableState(@Nullable Boolean transactionEnabled, String serializerPath, String parserType, String specPath) throws Exception {
final EventSerializer serializer = jsonMapper.readValue(getResourceAsStream(serializerPath), EventSerializer.class);
final StreamGenerator streamGenerator = new WikipediaStreamEventStreamGenerator(serializer, EVENTS_PER_SECOND, CYCLE_PADDING_MS);
final GeneratedTestConfig generatedTestConfig = new GeneratedTestConfig(parserType, getResourceAsString(specPath));
try (final Closeable closer = createResourceCloser(generatedTestConfig);
final StreamEventWriter streamEventWriter = createStreamEventWriter(config, transactionEnabled)) {
final String taskSpec = generatedTestConfig.getStreamIngestionPropsTransform().apply(getResourceAsString(SUPERVISOR_SPEC_TEMPLATE_PATH));
LOG.info("supervisorSpec: [%s]\n", taskSpec);
// Start supervisor
generatedTestConfig.setSupervisorId(indexer.submitSupervisor(taskSpec));
LOG.info("Submitted supervisor");
// Start data generator
final long numWritten = streamGenerator.run(generatedTestConfig.getStreamName(), streamEventWriter, TOTAL_NUMBER_OF_SECOND, FIRST_EVENT_TIME);
verifyIngestedData(generatedTestConfig, numWritten);
}
}
Aggregations