Package org.apache.beam.sdk.metrics
Class Lineage
java.lang.Object
org.apache.beam.sdk.metrics.Lineage
Standard collection of metrics used to record source and sinks information for lineage tracking.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given fqn as lineage.void
add
(String system, @Nullable String subtype, Iterable<String> segments, @Nullable String lastSegmentSep) Add a FQN (fully-qualified name) to Lineage.void
Add a FQN (fully-qualified name) to Lineage.void
Add a FQN (fully-qualified name) to Lineage.static Lineage
getSinks()
Lineage
representing sinks.static Lineage
Lineage
representing sources and optionally side inputs.query
(MetricResults results, Lineage.Type type) QueryBoundedTrie
metrics fromMetricResults
.query
(MetricResults results, Lineage.Type type, String truncatedMarker) QueryBoundedTrie
metrics fromMetricResults
.static String
wrapSegment
(String value) Wrap segment to valid segment name.
-
Field Details
-
LINEAGE_NAMESPACE
- See Also:
-
-
Method Details
-
getSources
Lineage
representing sources and optionally side inputs. -
getSinks
Lineage
representing sinks. -
add
public void add(String system, @Nullable String subtype, Iterable<String> segments, @Nullable String lastSegmentSep) Add a FQN (fully-qualified name) to Lineage. Segments will be processed viagetFQNParts(java.lang.String, java.lang.String, java.lang.Iterable<java.lang.String>, java.lang.String)
. -
add
Add a FQN (fully-qualified name) to Lineage. Segments will be processed viagetFQNParts(java.lang.String, java.lang.String, java.lang.Iterable<java.lang.String>, java.lang.String)
. -
add
Add a FQN (fully-qualified name) to Lineage. Segments will be processed viagetFQNParts(java.lang.String, java.lang.String, java.lang.Iterable<java.lang.String>, java.lang.String)
. -
add
Adds the given fqn as lineage.- Parameters:
rollupSegments
- should be an iterable of strings whose concatenation is a valid Dataplex FQN which is already escaped.In particular, this means they will often have trailing delimiters.
-
query
QueryBoundedTrie
metrics fromMetricResults
.- Parameters:
results
- FQNs from the result.type
- sources or sinks.truncatedMarker
- the marker to use to represent truncated FQNs.- Returns:
- A flat representation of all FQNs. If the FQN was truncated then it has a trailing truncatedMarker.
-
query
QueryBoundedTrie
metrics fromMetricResults
.- Parameters:
results
- FQNs from the resulttype
- sources or sinks- Returns:
- A flat representation of all FQNs. If the FQN was truncated then it has a trailing '*'.
-
wrapSegment
Wrap segment to valid segment name.It escapes reserved characters
- Reserved characters are backtick, colon, whitespace (space, \t, \n) and dot.
- Only segments containing reserved characters must be escaped.
- Segments cannot be escaped partially (i.e. “bigquery:com`.`google.test”).
- Segments must be escaped using backticks (a.k.a. graves).
- Backticks must be escaped using backtick (i.e. bigquery:`test``test`) and the segment itself must be escaped as well.
-