You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/06/11 20:38:05 UTC

[GitHub] [incubator-gobblin] autumnust commented on a change in pull request #3033: [GOBBLIN-1185]Enable datasetCleaner to emit kafka event and add config field in Ver…

autumnust commented on a change in pull request #3033:
URL: https://github.com/apache/incubator-gobblin/pull/3033#discussion_r439057712



##########
File path: gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/DatasetCleaner.java
##########
@@ -88,33 +94,43 @@
 
   public DatasetCleaner(FileSystem fs, Properties props) throws IOException {
 
-    State state = new State(props);
+    Properties properties = new Properties();
+    properties.putAll(props);
+    // load dynamic configuration and add them to the job properties
+    Config propsAsConfig = ConfigUtils.propertiesToConfig(props);
+    DynamicConfigGenerator dynamicConfigGenerator =
+        DynamicConfigGeneratorFactory.createDynamicConfigGenerator(propsAsConfig);
+    Config dynamicConfig = dynamicConfigGenerator.generateDynamicConfig(propsAsConfig);
+    for (Map.Entry<String, ConfigValue> entry : dynamicConfig.entrySet()) {
+      properties.put(entry.getKey(), entry.getValue().unwrapped().toString());

Review comment:
       Does it work in this way ? It seems it will only get the top-level key and here it just convert the ConfigValue into a string which could itself be a hierarchical config. 
   

##########
File path: gobblin-modules/gobblin-kafka-09/src/test/java/org/apache/gobblin/kafka/writer/Kafka09DataWriterTest.java
##########
@@ -84,7 +84,7 @@ public void testStringSerialization()
     _kafkaTestHelper.provisionTopic(topic);
     Properties props = new Properties();
     props.setProperty(KafkaWriterConfigurationKeys.KAFKA_TOPIC, topic);
-    props.setProperty(KafkaWriterConfigurationKeys.KAFKA_PRODUCER_CONFIG_PREFIX+"bootstrap.servers", "localhost:" + _kafkaTestHelper.getKafkaServerPort());
+    props.setProperty(KafkaWriterConfigurationKeys.KAFKA_PRODUCER_CONFIG_PREFIX+"bootstrap.servers", "127.0.0.1:" + _kafkaTestHelper.getKafkaServerPort());

Review comment:
       why this change? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org