kennknowles commented on code in PR #36781:
URL: https://github.com/apache/beam/pull/36781#discussion_r2775146001


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/Lineage.java:
##########
@@ -17,51 +17,131 @@
  */
 package org.apache.beam.sdk.metrics;
 
+import static 
org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkNotNull;
+
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ServiceLoader;
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.regex.Pattern;
 import org.apache.beam.sdk.annotations.Internal;
+import org.apache.beam.sdk.lineage.LineageRegistrar;
 import org.apache.beam.sdk.metrics.Metrics.MetricsFlag;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.options.PipelineOptionsFactory;
+import org.apache.beam.sdk.util.common.ReflectHelpers;
+import org.apache.beam.sdk.values.KV;
 import 
org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.annotations.VisibleForTesting;
 import 
org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Splitter;
-import 
org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableList;
+import 
org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.Lists;
+import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.Sets;
 import org.checkerframework.checker.nullness.qual.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Standard collection of metrics used to record source and sinks information 
for lineage tracking.
  */
-public class Lineage {
-
+public abstract class Lineage {

Review Comment:
   Let's avoid the "abstract base class with actual functionality" antipattern. 
At a glance, I'm not sure which of these patterns you want:
   
   Interface that has multiple implementations. (in other words, the interface 
represents a choice) In this case make it an interface.
   Concrete class that is mostly the same but has one part intended for 
"override".  In this case, pass in a small object encapsulating just the 
modifiable functionality.
   
   You can also do both. In this case, I think that makes sense. Lineage would 
be an interface, implemented by MetricsLineage, and you can put all this 
utility code somewhere to be used by Lineage implementations, but keep it 
cleanly separated from the interface.



##########
sdks/java/core/src/main/java/org/apache/beam/sdk/lineage/package-info.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+/**
+ * Lineage tracking support for Apache Beam pipelines.
+ *
+ * <p>This package provides a plugin mechanism to support different lineage 
implementations through
+ * the {@link org.apache.beam.sdk.lineage.LineageRegistrar} interface. Lineage 
implementations can
+ * be registered and discovered at runtime to track data lineage information 
during pipeline
+ * execution.
+ *
+ * <p>For lineage capabilities, see {@link 
org.apache.beam.sdk.metrics.Lineage}.
+ */
+@DefaultAnnotation(NonNull.class)

Review Comment:
   This is default throughout the project. No need here.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to