Class LovelaceOpenLineageAnalysisServiceBase
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.frameworks.opengovernance.GovernanceActionServiceConnector
org.odpi.openmetadata.frameworks.opengovernance.GeneralGovernanceActionService
org.odpi.openmetadata.adapters.connectors.lineageinsight.openlineage.LovelaceOpenLineageAnalysisServiceBase
- All Implemented Interfaces:
AuditLoggingComponent,SecureConnectorExtension,VirtualConnectorExtension,GovernanceActionService
- Direct Known Subclasses:
LovelaceOpenLineageDataQualitySummaryService,LovelaceOpenLineageDataScopeService,LovelaceOpenLineageRunProfilerService
LovelaceOpenLineageAnalysisServiceBase is the common base for the Lovelace services that analyse a historical
OpenLineage log store. It locates the log store (from the openLineageLogStore action target, or the
logStoreDirectory request parameter), reads the events in the analysis window into an OpenLineageRunHistory,
hands the history to the subclass and records the completion status. It also provides the lookup of the
processes and data assets that the OpenLineage cataloguer created (or matched) for the jobs and datasets,
using the same identity rules as the cataloguer - a job is a DeployedSoftwareComponent and a dataset is a
DataAsset whose resourceName and namespacePath are the OpenLineage name and namespace.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected Dateprotected Dateprotected DateFields inherited from class org.odpi.openmetadata.frameworks.opengovernance.GeneralGovernanceActionService
governanceContextFields inherited from class org.odpi.openmetadata.frameworks.opengovernance.GovernanceActionServiceConnector
governanceServiceName, propertyHelperFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAnalysisProperties(Map<String, String> properties) Add the standard analysis properties to a map.protected abstract intanalyse(OpenLineageRunHistory history) Perform the analysis on the history read from the log store.protected OpenMetadataRootElementfindDataAsset(OpenLineageRunHistory.Key dataset) Find the element that represents an OpenLineage dataset, using the same rules as the cataloguer (see OpenLineageDataSetResolver): the first of the physical elements that describe the dataset - an asset, or a schema attribute such as a relational table - or, if there are none, an abstraction (tabular data set or collection) that is the dataset itself.protected OpenMetadataRootElementfindProcess(OpenLineageRunHistory.JobHistory jobHistory) Find the element that holds the run metrics of an OpenLineage job, using the same rules as the cataloguer.protected StringformatDate(Date date) Format a date for messages and properties (ISO-8601, UTC).protected StringformatDuration(long millis) Describe a duration in milliseconds in human terms.protected abstract StringReturn a short description of what the service produces, for the completion message.protected doublegetWindowDays(OpenLineageRunHistory history) Return the length of the analysis window in days, bounded by the events actually seen.protected voidAdd a double value to a string map, rounded to two decimal places.protected voidAdd a long value to a string map.voidstart()Read the log store and run the analysis.Methods inherited from class org.odpi.openmetadata.frameworks.opengovernance.GeneralGovernanceActionService
disconnect, getActionTarget, getAllActionTargets, getProperty, setGovernanceContextMethods inherited from class org.odpi.openmetadata.frameworks.opengovernance.GovernanceActionServiceConnector
getArrayRequestParameter, getBooleanRequestParameter, getConnectorComponentDescription, getIntRequestParameter, getLongRequestParameter, getStringRequestParameter, handleUnexpectedException, setAuditLog, setGovernanceServiceName, validateContextMethods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCamelToCanonicalCase, fromCanonicalToCamelCase, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getSecretsCollectionName, getSecretsLocation, getSecretsProvider, getStringConfigurationProperty, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingElement, throwMissingEndpointAddress, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toStringMethods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, refreshStatistics, setStatisticProperty, setStatisticTimestamp
-
Field Details
-
ANALYSIS_TIME_PROPERTY
- See Also:
-
ANALYSIS_WINDOW_START_PROPERTY
- See Also:
-
ANALYSIS_WINDOW_END_PROPERTY
- See Also:
-
ANALYSIS_SERVICE_PROPERTY
- See Also:
-
windowStart
-
windowEnd
-
analysisTime
-
-
Constructor Details
-
LovelaceOpenLineageAnalysisServiceBase
public LovelaceOpenLineageAnalysisServiceBase()
-
-
Method Details
-
analyse
protected abstract int analyse(OpenLineageRunHistory history) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Perform the analysis on the history read from the log store.- Parameters:
history- events in the analysis window, grouped by job and dataset- Returns:
- number of elements updated
- Throws:
InvalidParameterException- invalid parameterPropertyServerException- repository problemUserNotAuthorizedException- security problem
-
getAnalysisDescription
Return a short description of what the service produces, for the completion message.- Returns:
- description
-
start
Read the log store and run the analysis.- Overrides:
startin classGeneralGovernanceActionService- Throws:
ConnectorCheckedException- there is a problem within the governance action service.UserNotAuthorizedException- the connector was disconnected before/during start
-
findProcess
protected OpenMetadataRootElement findProcess(OpenLineageRunHistory.JobHistory jobHistory) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Find the element that holds the run metrics of an OpenLineage job, using the same rules as the cataloguer. For a step of a governance action process (reported by the governance action publisher) this is the GovernanceActionProcessStep, since each step runs separately (see OpenLineageGovernanceActionResolver). Otherwise it is the job's process: the DeployedSoftwareComponent the cataloguer created, the process named by the legacy job naming, or the single process whose resourceName and namespacePath are the job's name and namespace.- Parameters:
jobHistory- history of the job- Returns:
- element or null if there is no unique element for the job
- Throws:
InvalidParameterException- invalid parameterPropertyServerException- repository problemUserNotAuthorizedException- security problem
-
findDataAsset
protected OpenMetadataRootElement findDataAsset(OpenLineageRunHistory.Key dataset) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Find the element that represents an OpenLineage dataset, using the same rules as the cataloguer (see OpenLineageDataSetResolver): the first of the physical elements that describe the dataset - an asset, or a schema attribute such as a relational table - or, if there are none, an abstraction (tabular data set or collection) that is the dataset itself.- Parameters:
dataset- dataset identity- Returns:
- element or null if there is no element for the dataset
- Throws:
InvalidParameterException- invalid parameterPropertyServerException- repository problemUserNotAuthorizedException- security problem
-
formatDate
Format a date for messages and properties (ISO-8601, UTC).- Parameters:
date- date (may be null)- Returns:
- string
-
formatDuration
Describe a duration in milliseconds in human terms.- Parameters:
millis- milliseconds- Returns:
- string such as "2 hours 5 minutes"
-
addAnalysisProperties
Add the standard analysis properties to a map.- Parameters:
properties- map to fill
-
getWindowDays
Return the length of the analysis window in days, bounded by the events actually seen.- Parameters:
history- history- Returns:
- days (at least 1)
-
put
Add a long value to a string map.- Parameters:
map- mapkey- keyvalue- value
-
put
Add a double value to a string map, rounded to two decimal places.- Parameters:
map- mapkey- keyvalue- value
-