Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add apache-atlas-rest-connector #7852

Merged
merged 5 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ type system, frameworks, APIs, event payloads and interchange protocols to enabl
engines and platforms to exchange metadata in order to get the best
value from data, whilst ensuring it is properly governed.

This git repository contains the core Egeria code and resources. This includes the build for Egeria's runtimes.
The project is built using `gradle`. Clone or download the contents of this repository.
You will also need the [Java 17 SDK installed](https://adoptium.net/).
Then run the following gradle command from the top-level directory to build the code and run the tests.

```bash
./gradlew clean build
```

Once you see the "Build Successful" message, go to the `open-metadata-distributions` directory.
There are three choices of assembly to use:

* `open-metadata-assemblies` contains all of the Egeria runtimes. This is the assembly that is used in our standard [Docker containers](https://hub.docker.com/r/odpi/egeria).
* `omag-server-platform` contains just the [OMAG Server Platform](https://egeria-project.org/concepts/omag-server-platform/) runtime.
* `egeria-ui-application` contains the Egeria UI REST Services application.

Change into the directory for the assembly you need and then look in `build/unpacked`.
There you will see the built and assembled libraries and associated content.

Details on how to run Egeria can be found on [our website](https://egeria-project.org/education/tutorials/omag-server-tutorial/overview/).

## Egeria governance

This project aims to operate in a transparent, accessible way for the benefit of the Egeria community.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ dependencies {
implementation project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-archive-connectors:open-metadata-archive-file-connector')
implementation project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-archive-connectors:open-metadata-archive-directory-connector')
implementation project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:spring-rest-client-connector')
implementation project(':open-metadata-implementation:adapters:open-connectors:system-connectors:apache-atlas-rest-connector')
implementation project(':open-metadata-implementation:adapters:open-connectors:secrets-store-connectors:env-variable-secrets-store-connector')
implementation project(':open-metadata-implementation:access-services:asset-catalog:asset-catalog-client')
implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-client')
implementation project(':open-metadata-implementation:access-services:asset-lineage:asset-lineage-client')
Expand Down Expand Up @@ -209,6 +211,8 @@ distributions {
from { project(':open-metadata-implementation:adapters:open-connectors:governance-daemon-connectors:open-lineage-connectors:open-lineage-janus-connector').jar }
from { project(':open-metadata-resources:open-metadata-samples:open-metadata-security-samples').jar }
from { project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:spring-rest-client-connector').jar }
from { project(':open-metadata-implementation:adapters:open-connectors:secrets-store-connectors:env-variable-secrets-store-connector').jar }
from { project(':open-metadata-implementation:adapters:open-connectors:system-connectors:apache-atlas-rest-connector').jar }
from { project(':open-metadata-resources:open-metadata-samples:governance-services-sample').jar }
fileMode = 0755
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ dependencies {
implementation project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-archive-connectors:open-metadata-archive-directory-connector')
implementation project(':open-metadata-resources:open-metadata-samples:open-metadata-security-samples')
implementation project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:spring-rest-client-connector')
implementation project(':open-metadata-implementation:adapters:open-connectors:system-connectors:apache-atlas-rest-connector')
implementation project(':open-metadata-implementation:adapters:open-connectors:secrets-store-connectors:env-variable-secrets-store-connector')
implementation project(':open-metadata-resources:open-metadata-samples:access-services-samples:asset-management-samples:asset-create-avro-sample')
implementation project(':open-metadata-resources:open-metadata-samples:access-services-samples:asset-management-samples:asset-create-csv-sample')
implementation project(':open-metadata-resources:open-metadata-samples:access-services-samples:asset-management-samples:asset-reader-avro-sample')
Expand Down Expand Up @@ -154,6 +156,8 @@ distributions {
from { project(':open-metadata-implementation:adapters:open-connectors:governance-daemon-connectors:open-lineage-connectors:open-lineage-janus-connector').jar }
from { project(':open-metadata-resources:open-metadata-samples:open-metadata-security-samples').jar }
from { project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:spring-rest-client-connector').jar }
from { project(':open-metadata-implementation:adapters:open-connectors:secrets-store-connectors:env-variable-secrets-store-connector').jar }
from { project(':open-metadata-implementation:adapters:open-connectors:system-connectors:apache-atlas-rest-connector').jar }
from { project(':open-metadata-resources:open-metadata-samples:governance-services-sample').jar }
fileMode = 0755
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Java.

* **[secrets-store-connectors](secrets-store-connectors)** provides connectors to access secrets (passwords, certificates etc) at runtime.

* **[system-connectors](system-connectors)** provides connectors to access data and function from different systems.

In addition, there is the **[connector-configuration-factory](connector-configuration-factory)**
that creates **Connection** objects to configure these connectors.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class JDBCResourceConnectorProvider extends ConnectorProviderBase
/*
* Unique identifier of the connector for the audit log.
*/
private static final int connectorComponentId = 660;
private static final int connectorComponentId = 662;

/*
* Unique identifier for the connector type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# The Apache Atlas Integration Connector

The Apache Atlas integration connector publishes glossary terms to Apache Atlas.
The Apache Atlas integration connector publishes glossary terms, assets and lineage to Apache Atlas.

## Deployment and configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
compileOnly project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:rest-client-connectors-api')
compileOnly project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:rest-client-factory')
compileOnly project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:spring-rest-client-connector')
compileOnly project(':open-metadata-implementation:adapters:open-connectors:system-connectors:apache-atlas-rest-connector')
testImplementation project(':open-metadata-implementation:frameworks:audit-log-framework')
testImplementation project(':open-metadata-implementation:repository-services:repository-services-apis')
testImplementation project(':open-metadata-test:open-metadata-ut')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,28 @@
import org.odpi.openmetadata.accessservices.assetmanager.events.AssetManagerOutTopicEvent;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc.ApacheAtlasAuditCode;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc.ApacheAtlasErrorCode;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.modules.ApacheHiveIntegrationModule;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.modules.ApacheKafkaIntegrationModule;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.modules.AtlasGlossaryIntegrationModule;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.modules.ApacheHiveIntegrationModule;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.modules.AtlasLineageIntegrationModule;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.modules.RDBMSIntegrationModule;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.modules.RegisteredIntegrationModule;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasAttributeDef;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasCardinality;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasEntityDef;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasPropagateTags;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasRelationshipCategory;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasRelationshipDef;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasRelationshipEndDef;
import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasTypesDef;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.ApacheAtlasRESTConnector;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.ApacheAtlasRESTProvider;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.properties.AtlasAttributeDef;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.properties.AtlasCardinality;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.properties.AtlasEntityDef;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.properties.AtlasPropagateTags;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.properties.AtlasRelationshipCategory;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.properties.AtlasRelationshipDef;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.properties.AtlasRelationshipEndDef;
import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.properties.AtlasTypesDef;
import org.odpi.openmetadata.frameworks.connectors.Connector;
import org.odpi.openmetadata.frameworks.connectors.ConnectorBroker;
import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException;
import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException;
import org.odpi.openmetadata.frameworks.connectors.properties.EndpointProperties;
import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection;
import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader;
import org.odpi.openmetadata.frameworks.integration.contextmanager.PermittedSynchronization;
import org.odpi.openmetadata.integrationservices.catalog.connector.CatalogIntegratorConnector;
Expand All @@ -42,7 +47,7 @@ public class ApacheAtlasIntegrationConnector extends CatalogIntegratorConnector
{
private String targetRootURL = null;
private CatalogIntegratorContext myContext = null;
private ApacheAtlasRESTClient atlasClient = null;
private ApacheAtlasRESTConnector atlasClient = null;
private AtlasLineageIntegrationModule lineageIntegrationModule = null;

private final Map<String, List<RegisteredIntegrationModule>> moduleMap = new HashMap<>();
Expand Down Expand Up @@ -122,12 +127,24 @@ public void start() throws ConnectorCheckedException
/*
* Create the client that calls Apache Atlas.
*/
atlasClient = new ApacheAtlasRESTClient(connectorName,
"Apache Atlas",
targetRootURL,
connectionProperties.getUserId(),
connectionProperties.getClearPassword(),
auditLog);
Connection atlasConnection = new Connection(connectionBean);

atlasConnection.setConnectorType(new ApacheAtlasRESTProvider().getConnectorType());
ConnectorBroker connectorBroker = new ConnectorBroker(auditLog);

Connector newConnector = connectorBroker.getConnector(atlasConnection);

if (newConnector instanceof ApacheAtlasRESTConnector apacheAtlasRESTConnector)
{
this.atlasClient = apacheAtlasRESTConnector;
this.atlasClient.start();
}
else
{
throw new ConnectorCheckedException(ApacheAtlasErrorCode.NULL_ATLAS_CLIENT.getMessageDefinition(connectorName),
this.getClass().getName(),
methodName);
}

/*
* Ensure the correlation types are properly defined in Apache Atlas.
Expand Down Expand Up @@ -358,7 +375,7 @@ public void processEvent(AssetManagerOutTopicEvent event)
* @param atlasClient client for Apache Atlas
* @throws PropertyServerException unable to connect to Apache Atlas
*/
private void setupCorrelationTypes(ApacheAtlasRESTClient atlasClient) throws PropertyServerException
private void setupCorrelationTypes(ApacheAtlasRESTConnector atlasClient) throws PropertyServerException
{
final String serviceType = "open_metadata_ecosystem";
final String entityDescription = "Information used in synchronizing Apache Atlas metadata with external catalogs via the Open Metadata Ecosystem supported by Egeria.";
Expand Down Expand Up @@ -574,6 +591,7 @@ public void disconnect() throws ConnectorCheckedException
auditLog.logMessage(methodName, ApacheAtlasAuditCode.CONNECTOR_STOPPING.getMessageDefinition(connectorName, targetRootURL));
}

atlasClient.disconnect();
super.disconnect();
}
}
Loading
Loading