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/09/23 19:49:14 UTC

[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3111: [GOBBLIN-1271] add MultiEventMetadataGenerator

sv2000 commented on a change in pull request #3111:
URL: https://github.com/apache/incubator-gobblin/pull/3111#discussion_r493850096



##########
File path: gobblin-runtime/src/test/java/org/apache/gobblin/runtime/DummyEventMetadataGenerator.java
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.runtime;
+
+import java.util.Map;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.apache.gobblin.metrics.event.EventName;
+import org.apache.gobblin.runtime.api.EventMetadataGenerator;
+
+
+public class DummyEventMetadataGenerator implements EventMetadataGenerator {

Review comment:
       Can this class be defined as a static nested class inside MultiEventMetadataGeneratorTest?

##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/MultiEventMetadataGenerator.java
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.runtime.api;
+
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.base.Splitter;
+import com.google.common.collect.Maps;
+
+import avro.shaded.com.google.common.collect.Lists;
+
+import org.apache.gobblin.metrics.event.EventName;
+import org.apache.gobblin.runtime.JobContext;
+import org.apache.gobblin.util.ClassAliasResolver;
+
+
+/**
+ * A class to add metadata from multi {@link EventMetadataGenerator}.
+ * {@link EventMetadataGenerator}s are supposed to be provided by a comma separated string.
+ * If multiple {@link EventMetadataGenerator}s add the same metadata, the one comes later will take precedence.

Review comment:
       the one comes -> the one that comes

##########
File path: gobblin-runtime/src/test/java/org/apache/gobblin/runtime/DummyEventMetadataGenerator2.java
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.runtime;
+
+import java.util.Map;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.apache.gobblin.metrics.event.EventName;
+import org.apache.gobblin.runtime.JobContext;
+import org.apache.gobblin.runtime.api.EventMetadataGenerator;
+
+
+public class DummyEventMetadataGenerator2 implements EventMetadataGenerator {

Review comment:
       Same comment as above.

##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java
##########
@@ -221,17 +220,9 @@ public MetricContext apply(JobMetrics input) {
       JobExecutionEventSubmitter jobExecutionEventSubmitter = new JobExecutionEventSubmitter(this.eventSubmitter);
       this.mandatoryJobListeners.add(new JobExecutionEventSubmitterListener(jobExecutionEventSubmitter));
 
-      String eventMetadatadataGeneratorClassName =
+      this.multiEventMetadataGenerator = new MultiEventMetadataGenerator(

Review comment:
       Can we add a getStringList() method  in PropertiesUtils class (similar to ConfigUtils) and pass the list to MultiEventMetadataGenerator's constructor?

##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/MultiEventMetadataGenerator.java
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.runtime.api;
+
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.base.Splitter;
+import com.google.common.collect.Maps;
+
+import avro.shaded.com.google.common.collect.Lists;
+
+import org.apache.gobblin.metrics.event.EventName;
+import org.apache.gobblin.runtime.JobContext;
+import org.apache.gobblin.util.ClassAliasResolver;
+
+
+/**
+ * A class to add metadata from multi {@link EventMetadataGenerator}.

Review comment:
       multi -> multiple, and {@link EventMetadataGenerator} -> {@link EventMetadataGenerator}s.




----------------------------------------------------------------
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