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
ATLAS-3219: New REST APIs for serviceType. #54
base: master
Are you sure you want to change the base?
Conversation
@ZepHakase22 - instead of adding new REST endpoints (for /servicetype/{serviceType}), I suggest to recognize "serviceType" parameter in FilterUtil.getPredicateFromSearchFilter(SearchFilter filter) so that all methods that use SearchFilter will apply this filter. |
@mneethiraj - It was exactly what I did but it works only for
how you can see here in the code. But if you want to maintain compatibility with the other REST APIs, that is how the ones for guid and name are made, you need to work in another way, because these APIs refer to the cache. Furthermore, DELETE, obviously needs a separate code.
|
@mneethiraj -In my opinion you are right because I can't understand why we have a cache for the name, a cache for the guid and now also a cache for the serviceType. I did this only to mantain the compatibility with the existing code. |
@mneethiraj - I looked more closely at the code and we could: 1) limit the rest api for the four types one for the post, one for the put, one for the update and one for the cache and then use the predicates. 2) limit to a single cache instead of having a cache for the guid one for the name and one for the service type. If you agree I could start this task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to refrain from updating AtlasTypeRegistry and *TypeDefStore classes to support filtering for a specific service-type. Changes in ServiceFitler.java and FilterUtil.java should be enough to enable filtering for a service-type in /typedefs/headers and /typedefs REST API endpoints. Note that these APIs already support filtering for specific type-category (entity/classification/struct/enum/relationship).
bq. Furthermore, DELETE, obviously needs a separate code.
|
@mneethiraj - I didn't understand if you propose to add new REST APIs by type |
@mneethiraj - Regarding the DELETE you are proposing the fact of not implementing it for the serviceType because moving the work on the client only works if you use the ATLAS API. If for example I use json scripts and curl I have to do all the work from the application client. |
bq. moving the work on the client only works if you use the ATLAS API. If for example I use json scripts and curl I have to do all the work from the application client |
As I suggested earlier, please avoid updating AtlasTypeRegistry and *TypeDefStore for this enhancement. If we notice performance issues, we can consider a subsequent update. Let's keep this simple for now - by only adding FilterUtil.getServiceTypePredicate() |
I agree absolutely. I don't want to create a complex Rest system to access however the customer wants. I only think that access by service type is much more useful than access by guid foto example because I have on hands soon the types I need. |
@mneethiraj - any way the ATLAS-3180 pull request does exactly what you say. |
@ZepHakase22 - yes, you are right. The changes in pull request for ATLAS-3180 (#49) looks good. I will merge that patch shortly. Thanks! |
Guys, what is serviceType? There is not a single piece of docs about it |
serviceType is a grouping of type-defs in Atlas. For example: all type-defs for Hive (hive_db, hive_table, hive_column, hive_process, ..) will have serviceType as 'hive'. This enables Atlas UI to filter type-defs list for specific serviceTypes. |
This pull request supersedes the pull request ATLAS-3180.
The new basic attribute serviceType, introduced by Atlas Team, has no use if it is not searchable ina any way. This pull request solves this problem by adding the following REST APIs.
GET / typedef / servicetype / {servicetype}
GET / typedefs / headers? Servicetype = {serviceType}
GET / typedefs? Servicetype = {servicetype}
GET / enumdef / servicetype / {servicetype}
GET / entitydef / servicetype / {servicetype}
GET / structdef / servicetype / {servicetype}
GET / relationshipdef / servicetype / {servicetype}
DELETE / typedef / servicetype / {servicetype}
The APIs were tested on ATLAS 2.0 and on the new SNAPSHOT 3.0