@VisibleForTesting
public void initialize(SourceState state) throws IOException {
this.updateProvider = UpdateProviderFactory.create(state);
this.metricContext = Instrumented.getMetricContext(state, HiveSource.class);
this.eventSubmitter = new EventSubmitter.Builder(this.metricContext, EventConstants.CONVERSION_NAMESPACE).build();
this.avroSchemaManager = new AvroSchemaManager(getSourceFs(state), state);
this.workunits = Lists.newArrayList();
this.watermarker =
GobblinConstructorUtils.invokeConstructor(HiveSourceWatermarkerFactory.class,
state.getProp(HIVE_SOURCE_WATERMARKER_FACTORY_CLASS_KEY, DEFAULT_HIVE_SOURCE_WATERMARKER_FACTORY_CLASS))
.createFromState(state);
EventSubmitter.submit(Optional.of(this.eventSubmitter), EventConstants.CONVERSION_SETUP_EVENT);
this.datasetFinder = GobblinConstructorUtils.invokeConstructor(HiveDatasetFinder.class,
state.getProp(HIVE_SOURCE_DATASET_FINDER_CLASS_KEY, DEFAULT_HIVE_SOURCE_DATASET_FINDER_CLASS), getSourceFs(state), state.getProperties(),
this.eventSubmitter);
int maxLookBackDays = state.getPropAsInt(HIVE_SOURCE_MAXIMUM_LOOKBACK_DAYS_KEY, DEFAULT_HIVE_SOURCE_MAXIMUM_LOOKBACK_DAYS);
this.maxLookBackTime = new DateTime().minusDays(maxLookBackDays).getMillis();
this.ignoreDataPathIdentifierList = COMMA_BASED_SPLITTER.splitToList(state.getProp(HIVE_SOURCE_IGNORE_DATA_PATH_IDENTIFIER_KEY,
DEFAULT_HIVE_SOURCE_IGNORE_DATA_PATH_IDENTIFIER));
silenceHiveLoggers();
}