Class OpenLineageRunHistory
java.lang.Object
org.odpi.openmetadata.adapters.connectors.lineageinsight.openlineage.OpenLineageRunHistory
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA data quality assertion evaluated against a dataset.static enumThe parts of a history that an analysis works from.static classThe writes, reads and assertions seen for a dataset.static classThe runs seen for a job.static final recordIdentity of a job or dataset in OpenLineage.static final recordA read of a dataset by a run.static classThe events seen for a single run of a job.static final recordA test reported by the test run facet.static final recordA write to a dataset by a run. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcountEvent(Date eventTime) Record that an event has been added.voidRecord 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.getDataSet(OpenLineageRunHistory.Key dataset) Return the history of a dataset, creating it if this is the first event for the dataset.intReturn the number of datasets in the window.Return the datasets seen.Return the time of the earliest event in the history.intReturn the number of events in the history.Return the history of a job, creating it if this is the first event for the job.intReturn the number of jobs in the window.getJobs()Return the jobs seen.Return the time of the latest event in the history.intReturn the number of stored events that could not be read.Return the key for a job or dataset.voidrecordDataSetCount(int count) Record the number of datasets in the window, when the history does not hold an entry for each of them.voidrecordEventSummary(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.voidrecordJobCount(int count) Record the number of jobs in the window, when the history does not hold an entry for each of them.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.
-
Constructor Details
-
OpenLineageRunHistory
public OpenLineageRunHistory()
-
-
Method Details
-
key
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- namespacename- name- Returns:
- shared key
-
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
Record that an event has been added.- Parameters:
eventTime- time of the event
-
recordEventSummary
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 eventsearliest- 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
Return the time of the earliest event in the history.- Returns:
- date or null
-
getLatestEvent
Return the time of the latest event in the history.- Returns:
- date or null
-