Class OpenLineageDataSetResolver

java.lang.Object
org.odpi.openmetadata.frameworks.integration.openlineage.OpenLineageDataSetResolver

public class OpenLineageDataSetResolver extends Object
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 matches come from:
  • 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.
An abstraction that is the dataset itself (for example a tabular data set collection named in the egeria namespace) is also resolved through its own endpoint to the physical element it is a view over.

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.

  • Field Details

    • MATCHED_BY_QUALIFIED_NAME

      public static final String 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

      public static final String MATCHED_BY_OPENLINEAGE_IDENTITY
      The element's resourceName and namespacePath are the dataset's OpenLineage name and namespace.
      See Also:
    • MATCHED_BY_PATH_NAME

      public static final String MATCHED_BY_PATH_NAME
      The element is a data store whose pathName is the dataset's name.
      See Also:
    • MATCHED_BY_RESOURCE_NAME

      public static final String 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

      public static final String 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

      public static final String 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

      public static final String 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

      public static final String MATCHED_BY_UNITY_CATALOG_NAME
      The element is the Unity Catalog table named by the dataset.
      See Also:
    • MATCHED_THROUGH_DATA_SET_ENDPOINT

      public static final String 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

      public OpenLineageDataSetResolver(ConnectorContextBase context, String sourceName)
      Constructor.
      Parameters:
      context - context of the calling connector or governance service
      sourceName - name of the caller (for logging and property helper calls)
  • Method Details

    • setFileMatching

      public void setFileMatching(OpenLineageFileMatching fileMatching)
      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

      public OpenLineageFileMatching getFileMatching()
      Return how datasets in the file namespace are matched to the catalogued files, folders and data sets.
      Returns:
      matching in use
    • getOpenLineageQualifiedName

      public static String getOpenLineageQualifiedName(String typeName, String namespace, String name)
      Return the qualified name that elements created from OpenLineage events are given.
      Parameters:
      typeName - open metadata type of the element
      namespace - OpenLineage namespace
      name - OpenLineage name
      Returns:
      qualified name
    • isAbstraction

      public boolean isAbstraction(ElementControlHeader elementHeader)
      Is the element an abstraction over physical data (a TabularDataSet or TabularDataSetCollection)?
      Parameters:
      elementHeader - header of the element
      Returns:
      boolean
    • resolve

      Find every element that describes an OpenLineage dataset.
      Parameters:
      namespace - dataset namespace
      name - dataset name
      Returns:
      resolved dataset (the lists are empty if nothing matches)
      Throws:
      InvalidParameterException - invalid parameter
      PropertyServerException - repository problem
      UserNotAuthorizedException - security problem
    • forget

      public void forget(String namespace, String name)
      Forget a cached resolution, for example because an element has been created for the dataset.
      Parameters:
      namespace - dataset namespace
      name - dataset name