-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add base proxy behind elastic search to support other search engines * Add support for Apache Atlas DSL search * Add new proxy with the Apache Atlas as backend * Add document to describing Apache Atlas search methods * Update setup.py
- Loading branch information
Showing
11 changed files
with
652 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Atlas search investigation | ||
There are several approaches to integrate searching within [Apache Atlas](https://atlas.apache.org/ "Apache Atlas"), we describe multiple options below: | ||
|
||
- Use REST API's | ||
|
||
Directly using the Atlas API's is quick to implement and easy to setup for administrators. Atlas uses a search engine | ||
underwater (embedded Solr) to perform search queries, thus in theory this method should scale up. Disadvantages are that | ||
we are limited to the REST api that Atlas offers, we could potentially add functionality via pull requests and extend | ||
the search capabilities. The [advanced search](https://atlas.apache.org/Search-Advanced.html "Apache Atlas Advanced Search") | ||
provides a DSL which contains basic forms of aggregation and arithmetic. | ||
|
||
- Use Data Builder to fill Elasticsearch from Atlas | ||
|
||
Adopting Atlas within the Data Builder to fill Elasticsearch is a relatively straightforward way of staying | ||
compatible with the Neo4j database. It could either be pulling data from Atlas or being pushed by Kafka. This method | ||
requires a setup of Elasticsearch and Airflow, which increases the amount of infrastructure and maintenance. | ||
Another disadvantage is that with a big inflow of metadata this method might not scale as well as the other methods. | ||
|
||
- Use underlying Solr or Elasticsearch from Apache Atlas | ||
|
||
Within Atlas there is the possibility to open up either Solr or the experimental Elasticsearch. It depends on janusgraph | ||
(the behind the scenes graph database) which populates the search engine. Therefore the search engine would not be compatible with | ||
the data builder setup. Adoption of such a search engine would require either new queries, some kind of transformer | ||
within the search engine, or changes within Atlas itself. | ||
|
||
## Discussion | ||
Both the REST API approach and the data builder approach can be implemented and be configurable. Both approaches have | ||
their own benefits, the data builder together provides a more fine-tuned search whereas the Atlas REST API comes out | ||
of the box with Atlas. The last approach of using the underlying search engine from Atlas provides direct access | ||
to all the meta data with a decent search API. However, integration would be less straight forward as the indexes would | ||
differ from the data builders search engine loader. | ||
|
||
|
||
The focus is initially to implement the REST API approach and afterwards potentially implement an Atlas data extractor | ||
and importer within the Amundsen Data Builder. So that administrators have more flexibility in combining data sources. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ typing==3.6.4 | |
Werkzeug==0.14.1 | ||
wheel==0.31.1 | ||
mypy==0.660 | ||
atlasclient==0.1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from threading import Lock | ||
|
||
from flask import current_app | ||
|
||
from search_service import config | ||
from search_service.proxy.base import BaseProxy | ||
from werkzeug.utils import import_string | ||
|
||
_proxy_client = None | ||
_proxy_client_lock = Lock() | ||
|
||
|
||
def get_proxy_client() -> BaseProxy: | ||
""" | ||
Provides singleton proxy client based on the config | ||
:return: Proxy instance of any subclass of BaseProxy | ||
""" | ||
global _proxy_client | ||
|
||
if _proxy_client: | ||
return _proxy_client | ||
|
||
with _proxy_client_lock: | ||
if _proxy_client: | ||
return _proxy_client | ||
else: | ||
# Gather all the configuration to create a Proxy Client | ||
host = current_app.config[config.PROXY_ENDPOINT] | ||
user = current_app.config[config.PROXY_USER] | ||
password = current_app.config[config.PROXY_PASSWORD] | ||
|
||
client = import_string(current_app.config[config.PROXY_CLIENT]) | ||
_proxy_client = client(host=host, index=None, user=user, password=password) | ||
|
||
return _proxy_client |
Oops, something went wrong.