Only instantiate topic-specific configStore object when topic.name is available
Closes from autumnust/master
@@ -137,11 +137,13 @@ public class HiveRegistrationPolicyBase implements HiveRegistrationPolicy {
// Get Topic-specific config object doesn't require any runtime-set properties in prop object, safe to initialize
// in constructor.
+ if (this.props.getProperties().containsKey(KafkaSource.TOPIC_NAME)) {
Timer.Context context = this.metricContext.timer(CONFIG_FOR_TOPIC_TIMER).time();
configForTopic =
ConfigStoreUtils.getConfigForTopic(this.props.getProperties(), KafkaSource.TOPIC_NAME, this.configClient);
context.close();
}
+ }
/**
* This method first tries to obtain the database name from {@link #HIVE_DATABASE_NAME}.
