Record Class OpenLineageNamespace

java.lang.Object
java.lang.Record
org.odpi.openmetadata.frameworks.integration.openlineage.OpenLineageNamespace
Record Components:
scheme - canonical scheme, or null if the address has none (for example a Kafka bootstrap server host:port)
host - host name in lower case, or null
port - port number, or null if it is not known
database - database (or Oracle service) named in the address, or null
schema - database schema named in the address, or null

public record OpenLineageNamespace(String scheme, String host, String port, String database, String schema) extends Record
OpenLineageNamespace is the parsed form of the location of a data source. It is created either from an OpenLineage dataset namespace (for example postgres://db.example.com:5432, see the OpenLineage naming conventions) or from the network address of an Egeria endpoint (for example jdbc:postgresql://db.example.com:5432/sales), so that the two can be compared. Schemes are reduced to the OpenLineage spelling (postgresql becomes postgres, sqlserver becomes mssql) and missing ports are filled in with the technology's default port.
  • Field Details

    • EGERIA_NAMESPACE

      public static final String EGERIA_NAMESPACE
      Namespace for datasets that are identified by the qualified name of an element in open metadata.
      See Also:
  • Constructor Details

    • OpenLineageNamespace

      public OpenLineageNamespace(String scheme, String host, String port, String database, String schema)
      Creates an instance of a OpenLineageNamespace record class.
      Parameters:
      scheme - the value for the scheme record component
      host - the value for the host record component
      port - the value for the port record component
      database - the value for the database record component
      schema - the value for the schema record component
  • Method Details

    • getCanonicalScheme

      public static String getCanonicalScheme(String scheme)
      Return the spelling of a scheme used in the OpenLineage naming conventions.
      Parameters:
      scheme - scheme from a namespace or network address
      Returns:
      lower case, canonical scheme (null if scheme is null)
    • isOpenLineageNamespace

      public static boolean isOpenLineageNamespace(String value)
      Is the value shaped like an OpenLineage dataset namespace? This distinguishes the OpenLineage namespace stored in an asset's namespacePath from other uses of that property (such as a Unity Catalog catalog.schema prefix).
      Parameters:
      value - value to test
      Returns:
      boolean
    • fromNamespace

      public static OpenLineageNamespace fromNamespace(String namespace)
      Parse an OpenLineage dataset namespace such as postgres://host:5432, kafka://broker:9092 or file.
      Parameters:
      namespace - OpenLineage namespace
      Returns:
      parsed namespace (null if namespace is null)
    • fromNetworkAddress

      public static OpenLineageNamespace fromNetworkAddress(String networkAddress)
      Parse the network address of an Egeria endpoint. The recognized forms are the JDBC URLs used by Egeria's database templates, URLs with a scheme and authority, and plain host:port addresses (as used for Kafka bootstrap servers).
      Parameters:
      networkAddress - network address
      Returns:
      parsed address, or null if the address is not recognized
    • isSameServer

      public boolean isSameServer(OpenLineageNamespace other)
      Do the two locations describe the same server? The schemes must match when both are known, and the hosts and ports must match (after default ports are filled in).
      Parameters:
      other - other location
      Returns:
      boolean
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • scheme

      public String scheme()
      Returns the value of the scheme record component.
      Returns:
      the value of the scheme record component
    • host

      public String host()
      Returns the value of the host record component.
      Returns:
      the value of the host record component
    • port

      public String port()
      Returns the value of the port record component.
      Returns:
      the value of the port record component
    • database

      public String database()
      Returns the value of the database record component.
      Returns:
      the value of the database record component
    • schema

      public String schema()
      Returns the value of the schema record component.
      Returns:
      the value of the schema record component