java.lang.Object
org.odpi.openmetadata.adapters.connectors.lineageinsight.openlineage.OpenLineageRunHistory

public class OpenLineageRunHistory extends Object
OpenLineageRunHistory is the in-memory model of a window of OpenLineage events read from a log store. It groups the events by job (into runs) and by dataset (into writes, reads and data quality results) so that the analysis services can work with a job's run series or a dataset's write series directly.
  • Constructor Details

    • OpenLineageRunHistory

      public OpenLineageRunHistory()
  • Method Details

    • key

      public OpenLineageRunHistory.Key key(String namespace, String name)
      Return the key for a job or dataset. The same key is returned each time the same namespace and name are passed, so the many records of a job or dataset share one key (and its strings) rather than each holding a copy.
      Parameters:
      namespace - namespace
      name - name
      Returns:
      shared key
    • shared

      public String shared(String value)
      Return the shared copy of a value that takes few distinct values (an event type or a status, for example), so that each record does not hold its own copy. It is not for values that are different in every record.
      Parameters:
      value - value or null
      Returns:
      shared copy or null
    • getJob

      Return the history of a job, creating it if this is the first event for the job.
      Parameters:
      job - job identity
      Returns:
      job history
    • getDataSet

      Return the history of a dataset, creating it if this is the first event for the dataset.
      Parameters:
      dataset - dataset identity
      Returns:
      dataset history
    • getJobs

      Return the jobs seen.
      Returns:
      map
    • getDataSets

      Return the datasets seen.
      Returns:
      map
    • countEvent

      public void countEvent(Date eventTime)
      Record that an event has been added.
      Parameters:
      eventTime - time of the event
    • recordEventSummary

      public void recordEventSummary(int count, Date earliest, Date latest)
      Record the number of events in the window, and the times of the first and last, when the history is built from a digest rather than event by event.
      Parameters:
      count - number of events
      earliest - time of the first event (null if there were none)
      latest - time of the last event (null if there were none)
    • recordJobCount

      public void recordJobCount(int count)
      Record the number of jobs in the window, when the history does not hold an entry for each of them.
      Parameters:
      count - number of jobs
    • recordDataSetCount

      public void recordDataSetCount(int count)
      Record the number of datasets in the window, when the history does not hold an entry for each of them.
      Parameters:
      count - number of datasets
    • getJobCount

      public int getJobCount()
      Return the number of jobs in the window. This is the number of jobs in the history unless a larger count was recorded because the history holds only the jobs its reader was asked for.
      Returns:
      count
    • getDataSetCount

      public int getDataSetCount()
      Return the number of datasets in the window. This is the number of datasets in the history unless a larger count was recorded because the history holds only the datasets its reader was asked for.
      Returns:
      count
    • countUnreadableEvent

      public void countUnreadableEvent()
      Record that a stored event could not be read - for a file-based log store, an event file that is not an OpenLineage run event in JSON.
    • getEventCount

      public int getEventCount()
      Return the number of events in the history.
      Returns:
      count
    • getUnreadableEvents

      public int getUnreadableEvents()
      Return the number of stored events that could not be read.
      Returns:
      count
    • getEarliestEvent

      public Date getEarliestEvent()
      Return the time of the earliest event in the history.
      Returns:
      date or null
    • getLatestEvent

      public Date getLatestEvent()
      Return the time of the latest event in the history.
      Returns:
      date or null