Class OpenLineageDataSetResolver
java.lang.Object
org.odpi.openmetadata.frameworks.integration.openlineage.OpenLineageDataSetResolver
OpenLineageDataSetResolver finds every element in open metadata that describes an OpenLineage dataset. The
dataset's namespace names the server (for example postgres://host:5432) and its name the resource within it (for
example sales.public.orders). The matches are divided into two lists:
- Physical elements describe the physical landscape - the database table, topic or file itself. These are the elements that the lineage from OpenLineage events is attached to.
- Abstractions - TabularDataSet and TabularDataSetCollection assets - are views over the physical data (for example the data sets of digital products). They are linked to the physical elements with DataSetContent rather than carrying lineage themselves.
- the qualified name, for datasets in the "egeria" namespace;
- the resourceName and namespacePath properties, which hold the OpenLineage name and namespace for elements catalogued from OpenLineage events or by connectors that follow the OpenLineage naming conventions;
- the endpoints of the connections of the elements catalogued by Egeria's technology connectors:
- relational tables (postgres, mssql, oracle and db2 namespaces with a {database}.{schema}.{table} name): the database's endpoint (a JDBC URL naming the host, port and database) leads to the RelationalDatabase or DeployedDatabaseSchema asset, and the table is the RelationalTable schema attribute that the JDBC integration connector catalogued beneath it ({databaseQN}::{schema}::{table} or {schemaQN}::{table});
- relational schemas ({database}.{schema} name, as used for the endpoint of a tabular data set collection): the DeployedDatabaseSchema;
- Kafka topics: the topic whose endpoint names the topic and whose connection's bootstrap servers include the broker;
- files (the file namespace, with or without a host): the data stores whose pathName is the dataset
name, and the data sets (such as a DataFileCollection, which has no pathName) whose resourceName is the
dataset name. How the host is treated is set with
OpenLineageFileMatching. By default it is ignored, because the same files are often seen from many machines. Each machine may also see the files beneath a different mount point, so with FILE_SYSTEM matching the dataset name is also tried with the localMountPoint at its start replaced by the canonicalMountPoint (and the reverse) for each catalogued FileSystem that has both. With HOST_NAME matching, a dataset in a namespace that names a host is not matched by its path name at all; - Unity Catalog tables: the table named {deployedImplementationType}::{server URL}::{full name} by the Unity Catalog connectors.
The physical elements are ranked so that the first one is the element to use: elements catalogued by technology connectors come before elements that were created from OpenLineage events (whose qualified name is {typeName}::{namespace}::{name}), and within each group the oldest comes first.
Results are cached for a short time because the same datasets appear in every run of a job.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn element that describes an OpenLineage dataset.static final recordThe elements that describe an OpenLineage dataset. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe element's endpoint names the dataset's database server and database, and the element is (or is a view over) the schema named in the dataset.static final StringThe element's endpoint names the dataset's database server and database, and the element is (or is a view over) the table named in the dataset.static final StringThe element is a topic whose endpoint names the dataset's topic and whose bootstrap servers include the broker.static final StringThe element's resourceName and namespacePath are the dataset's OpenLineage name and namespace.static final StringThe element is a data store whose pathName is the dataset's name.static final StringThe dataset is in the egeria namespace and its name is the element's qualified name.static final StringThe element is a data set whose resourceName is the name of a dataset in the file namespace (for example a DataFileCollection that represents the files in a directory).static final StringThe element is the Unity Catalog table named by the dataset.static final StringThe dataset is itself a view over physical data (an abstraction), and the element is the physical data that the abstraction's own endpoint leads to. -
Constructor Summary
ConstructorsConstructorDescriptionOpenLineageDataSetResolver(ConnectorContextBase context, String sourceName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidForget a cached resolution, for example because an element has been created for the dataset.Return how datasets in the file namespace are matched to the catalogued files, folders and data sets.static StringgetOpenLineageQualifiedName(String typeName, String namespace, String name) Return the qualified name that elements created from OpenLineage events are given.booleanisAbstraction(ElementControlHeader elementHeader) Is the element an abstraction over physical data (a TabularDataSet or TabularDataSetCollection)?Find every element that describes an OpenLineage dataset.voidsetFileMatching(OpenLineageFileMatching fileMatching) Set up how datasets in the file namespace are matched to the catalogued files, folders and data sets.
-
Field Details
-
MATCHED_BY_QUALIFIED_NAME
The dataset is in the egeria namespace and its name is the element's qualified name.- See Also:
-
MATCHED_BY_OPENLINEAGE_IDENTITY
The element's resourceName and namespacePath are the dataset's OpenLineage name and namespace.- See Also:
-
MATCHED_BY_PATH_NAME
The element is a data store whose pathName is the dataset's name.- See Also:
-
MATCHED_BY_RESOURCE_NAME
The element is a data set whose resourceName is the name of a dataset in the file namespace (for example a DataFileCollection that represents the files in a directory).- See Also:
-
MATCHED_BY_ENDPOINT_AND_SCHEMA
The element's endpoint names the dataset's database server and database, and the element is (or is a view over) the schema named in the dataset.- See Also:
-
MATCHED_BY_ENDPOINT_AND_TABLE
The element's endpoint names the dataset's database server and database, and the element is (or is a view over) the table named in the dataset.- See Also:
-
MATCHED_BY_ENDPOINT_AND_TOPIC
The element is a topic whose endpoint names the dataset's topic and whose bootstrap servers include the broker.- See Also:
-
MATCHED_BY_UNITY_CATALOG_NAME
The element is the Unity Catalog table named by the dataset.- See Also:
-
MATCHED_THROUGH_DATA_SET_ENDPOINT
The dataset is itself a view over physical data (an abstraction), and the element is the physical data that the abstraction's own endpoint leads to.- See Also:
-
-
Constructor Details
-
OpenLineageDataSetResolver
Constructor.- Parameters:
context- context of the calling connector or governance servicesourceName- name of the caller (for logging and property helper calls)
-
-
Method Details
-
setFileMatching
Set up how datasets in the file namespace are matched to the catalogued files, folders and data sets. The cached resolutions are discarded because they may have been made with different matching.- Parameters:
fileMatching- matching to use (null for the default, which ignores the host)
-
getFileMatching
Return how datasets in the file namespace are matched to the catalogued files, folders and data sets.- Returns:
- matching in use
-
getOpenLineageQualifiedName
Return the qualified name that elements created from OpenLineage events are given.- Parameters:
typeName- open metadata type of the elementnamespace- OpenLineage namespacename- OpenLineage name- Returns:
- qualified name
-
isAbstraction
Is the element an abstraction over physical data (a TabularDataSet or TabularDataSetCollection)?- Parameters:
elementHeader- header of the element- Returns:
- boolean
-
resolve
public OpenLineageDataSetResolver.ResolvedDataSet resolve(String namespace, String name) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Find every element that describes an OpenLineage dataset.- Parameters:
namespace- dataset namespacename- dataset name- Returns:
- resolved dataset (the lists are empty if nothing matches)
- Throws:
InvalidParameterException- invalid parameterPropertyServerException- repository problemUserNotAuthorizedException- security problem
-
forget
Forget a cached resolution, for example because an element has been created for the dataset.- Parameters:
namespace- dataset namespacename- dataset name
-