Class OSSUnityCatalogInsideCatalogSyncBase
java.lang.Object
org.odpi.openmetadata.adapters.connectors.unitycatalog.sync.OSSUnityCatalogInsideCatalogSyncBase
- Direct Known Subclasses:
OSSUnityCatalogInsideCatalogSyncFunctions
,OSSUnityCatalogInsideCatalogSyncRegisteredModels
,OSSUnityCatalogInsideCatalogSyncSchema
,OSSUnityCatalogInsideCatalogSyncTables
,OSSUnityCatalogInsideCatalogSyncVolumes
,OSSUnityCatalogServerSyncCatalog
Common functions for the synchronizing between Egeria and Unity Catalog.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AuditLog
protected final String
protected final String
protected final String
protected final String
protected final String
protected final CatalogIntegratorContext
protected final UnityCatalogDeployedImplementationType
protected final OpenMetadataAccess
protected final PropertyHelper
protected final PermittedSynchronization
protected final OSSUnityCatalogResourceConnector
protected final String
-
Constructor Summary
ConstructorDescriptionOSSUnityCatalogInsideCatalogSyncBase
(String connectorName, CatalogIntegratorContext context, String catalogName, String catalogGUID, String catalogQualifiedName, Map<String, String> ucFullNameToEgeriaGUID, PermittedSynchronization targetPermittedSynchronization, OSSUnityCatalogResourceConnector ucConnector, String ucServerEndpoint, UnityCatalogDeployedImplementationType deployedImplementationType, Map<String, String> templates, Map<String, Object> configurationProperties, List<String> excludeNames, List<String> includeNames, AuditLog auditLog) Set up the schema synchronizer. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPropertyFacet
(String parentGUID, String parentQualifiedName, BasicElementProperties basicElementProperties, Map<String, String> facetProperties) Create the property facet for an Egeria element.protected void
deleteElementInEgeria
(MemberElement memberElement) Delete an element from open metadata.protected Date
getDateFromLong
(long valueFromUC) Convert the long value returned by UC into a date (or null).protected ExternalIdentifierProperties
getExternalIdentifierProperties
(ElementBase ucElement, String schemaName, String elementName, String id, PermittedSynchronization instanceSynchronizationDirection) Populate and return the external identifier properties for a UC Schema.protected String
getPathNameFromStorageLocation
(String storageLocation) Convert the US format for the storage location into a proper pathname.protected String
getQualifiedName
(String fullName) Return the qualified name of an element using UnityCatalog's full name.protected String
getUCCatalogFromMember
(MemberElement memberElement) Extract the comment for a UC element from the description attribute in an egeria element.protected String
getUCCommentFomMember
(MemberElement memberElement) Extract the comment for a UC element from the description attribute in an egeria element.protected String
getUCNameFromMember
(MemberElement memberElement) Extract the name of a UC element from the name attribute in an egeria element (which is the full name).getUCPropertiesFromMember
(MemberElement memberElement) Extract the properties for a UC element from the additionalProperties attribute in an egeria element.protected String
getUCSchemaFromMember
(MemberElement memberElement) Extract the schema name for a UC element from the description attribute in an egeria element.protected String
getUCStorageLocationFromMember
(MemberElement memberElement) Extract the storage location from theprotected boolean
noMismatchInExternalIdentifier
(String thirdPartyExternalIdentifier, MemberElement memberElement) Check that the name of the third party element has not changed with respect to Egeria.protected abstract IntegrationIterator
Review all the elements for the subtype stored in Egeria.protected abstract void
refreshUnityCatalog
(IntegrationIterator iterator) Review all the elements for the subtype stored in UC.
-
Field Details
-
connectorName
-
context
-
catalogGUID
-
catalogTypeName
-
catalogQualifiedName
-
catalogName
-
targetPermittedSynchronization
-
ucConnector
-
ucServerEndpoint
-
deployedImplementationType
-
templates
-
configurationProperties
-
auditLog
-
openMetadataAccess
-
excludeNames
-
includeNames
-
ucFullNameToEgeriaGUID
-
propertyHelper
-
-
Constructor Details
-
OSSUnityCatalogInsideCatalogSyncBase
public OSSUnityCatalogInsideCatalogSyncBase(String connectorName, CatalogIntegratorContext context, String catalogName, String catalogGUID, String catalogQualifiedName, Map<String, String> ucFullNameToEgeriaGUID, PermittedSynchronization targetPermittedSynchronization, OSSUnityCatalogResourceConnector ucConnector, String ucServerEndpoint, UnityCatalogDeployedImplementationType deployedImplementationType, Map<String, String> templates, Map<String, Object> configurationProperties, List<String> excludeNames, List<String> includeNames, AuditLog auditLog) Set up the schema synchronizer.- Parameters:
connectorName
- name of this connectorcontext
- context for the connectorcatalogName
- the catalog target namecatalogGUID
- guid of the catalogcatalogQualifiedName
- name of the catalogucFullNameToEgeriaGUID
- map of full names from UC to the GUID of the entity in Egeria.targetPermittedSynchronization
- the policy that controls the direction of metadata exchangeucConnector
- connector for accessing UCdeployedImplementationType
- technology typeucServerEndpoint
- the server endpoint used to constructing the qualified namestemplates
- templates supplied through the catalog targetconfigurationProperties
- configuration properties supplied through the catalog targetexcludeNames
- list of catalogs to ignore (and include all others)includeNames
- list of catalogs to include (and ignore all others) - overrides excludeCatalogsauditLog
- logging destination
-
-
Method Details
-
refreshEgeria
protected abstract IntegrationIterator refreshEgeria() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedExceptionReview all the elements for the subtype stored in Egeria.- Returns:
- MetadataCollectionIterator
- Throws:
InvalidParameterException
- parameter errorPropertyServerException
- repository errorUserNotAuthorizedException
- security error
-
refreshUnityCatalog
protected abstract void refreshUnityCatalog(IntegrationIterator iterator) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Review all the elements for the subtype stored in UC.- Parameters:
iterator
- Metadata collection iterator- Throws:
InvalidParameterException
- parameter errorPropertyServerException
- repository errorUserNotAuthorizedException
- security error
-
getDateFromLong
Convert the long value returned by UC into a date (or null).- Parameters:
valueFromUC
- long- Returns:
- date
-
getQualifiedName
Return the qualified name of an element using UnityCatalog's full name.- Parameters:
fullName
- dotted name- Returns:
- qualified name
-
deleteElementInEgeria
protected void deleteElementInEgeria(MemberElement memberElement) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Delete an element from open metadata.- Parameters:
memberElement
- element to delete- Throws:
InvalidParameterException
- parameter errorPropertyServerException
- repository errorUserNotAuthorizedException
- authorization error
-
getExternalIdentifierProperties
protected ExternalIdentifierProperties getExternalIdentifierProperties(ElementBase ucElement, String schemaName, String elementName, String id, PermittedSynchronization instanceSynchronizationDirection) Populate and return the external identifier properties for a UC Schema.- Parameters:
ucElement
- values from Unity Catalog elementschemaName
- name of the schema- Returns:
- external identifier properties
-
addPropertyFacet
protected void addPropertyFacet(String parentGUID, String parentQualifiedName, BasicElementProperties basicElementProperties, Map<String, String> facetProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedExceptionCreate the property facet for an Egeria element. This holds the vendor specific properties for the element.- Parameters:
parentGUID
- the parent (and anchor) unique nameparentQualifiedName
- qualifiedName of the parent elementbasicElementProperties
- common properties of an elementfacetProperties
- these are the specialist property for the linked element.- Throws:
InvalidParameterException
PropertyServerException
UserNotAuthorizedException
-
noMismatchInExternalIdentifier
protected boolean noMismatchInExternalIdentifier(String thirdPartyExternalIdentifier, MemberElement memberElement) Check that the name of the third party element has not changed with respect to Egeria.- Parameters:
thirdPartyExternalIdentifier
- id from Unity CatalogmemberElement
- element from Egeria- Returns:
- boolean
-
getUCCatalogFromMember
Extract the comment for a UC element from the description attribute in an egeria element.- Parameters:
memberElement
- element from Egeria- Returns:
- comment for UC
-
getUCSchemaFromMember
Extract the schema name for a UC element from the description attribute in an egeria element.- Parameters:
memberElement
- element from Egeria- Returns:
- comment for UC
-
getUCNameFromMember
Extract the name of a UC element from the name attribute in an egeria element (which is the full name).- Parameters:
memberElement
- element from Egeria- Returns:
- name for UC
-
getUCCommentFomMember
Extract the comment for a UC element from the description attribute in an egeria element.- Parameters:
memberElement
- element from Egeria- Returns:
- comment for UC
-
getUCPropertiesFromMember
Extract the properties for a UC element from the additionalProperties attribute in an egeria element.- Parameters:
memberElement
- element from Egeria- Returns:
- properties for UC
-
getUCStorageLocationFromMember
Extract the storage location from the- Parameters:
memberElement
- elements from egeria- Returns:
- storage location (may be null
-
getPathNameFromStorageLocation
Convert the US format for the storage location into a proper pathname.- Parameters:
storageLocation
- storage location from UC- Returns:
- pathname
-