use of org.apache.gobblin.writer.DataWriterBuilder in project incubator-gobblin by apache.
the class WriterInitializerFactory method newSingleInstance.
private static WriterInitializer newSingleInstance(State state, WorkUnitStream workUnits, int branches, int branchId) {
Preconditions.checkNotNull(state);
String writerBuilderKey = ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_BUILDER_CLASS, branches, branchId);
String writerBuilderClass = state.getProp(writerBuilderKey, ConfigurationKeys.DEFAULT_WRITER_BUILDER_CLASS);
DataWriterBuilder dataWriterBuilder;
try {
dataWriterBuilder = (DataWriterBuilder) Class.forName(writerBuilderClass).newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
return dataWriterBuilder.getInitializer(state, workUnits, branches, branchId);
}
Aggregations