You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Ashutosh Mestry <am...@hortonworks.com> on 2017/09/01 20:51:57 UTC
Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameter": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs
-----
addons/models/0010-base_model.json 7f64d85
addons/models/0011-user-profile_model.json PRE-CREATION
graphdb/titan0/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner/StandardIDPool.java PRE-CREATION
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java aa8e3f4
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5e
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a67
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e68835
repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccessHelper.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b40
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d418
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36e
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763
Diff: https://reviews.apache.org/r/62039/diff/1/
Testing
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
Thanks,
Ashutosh Mestry
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/#review184397
-----------------------------------------------------------
addons/models/0010-base_model.json
Lines 22 (patched)
<https://reviews.apache.org/r/62039/#comment260587>
Good idea to use a marker interface to identify internal types. I think it will be helpful to use a prefix as well, like '__internal'.
addons/models/0011-user-profile_model.json
Lines 1 (patched)
<https://reviews.apache.org/r/62039/#comment260589>
Consider adding these types to existing 0010-base_model.json, which has definitions for types that are essential for Atlas to function - like DataSet, Process.
addons/models/0011-user-profile_model.json
Lines 14 (patched)
<https://reviews.apache.org/r/62039/#comment260588>
'name' attribute is missing?
addons/models/0011-user-profile_model.json
Lines 42 (patched)
<https://reviews.apache.org/r/62039/#comment260590>
Is it necessary to have 'Referenceable' as a super-type for AtlasUserSavedSearch? The same for 'AtlasUserProfile' as well.
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java
Lines 39 (patched)
<https://reviews.apache.org/r/62039/#comment260591>
"AtlasBaseModelObject extends AtlasEntity"? This doesn't look right. Not all types derived from AtlasBaseModelObject will be an entity.
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java
Lines 56 (patched)
<https://reviews.apache.org/r/62039/#comment260592>
This should be:
Object objSavedSearches = entityWithExtInfo.getAttribute(PROPERTY_SAVED_SEARCHES);
if (objSavedSearches instanceof Collection) {
Collection collSavedSearches = (Collection)objSavedSearches;
for (Object objSavedSearch : objSavedSearches) {
if (objSavedSearch instanceof AtlasObjectId) {
AtlasObjectId objId = (AtlasObjectId)objSavedSearch;
AtlasEntity entSavedSearch = entityWithExtInfo.getReferredEntity(objId.getGuid());
if (entSavedSearch != null) {
this.savedSearches.add(new AtlasUserSavedSearch(savedSearch));
}
}
}
}
- Madhan Neethiraj
On Sept. 1, 2017, 10:01 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62039/
> -----------------------------------------------------------
>
> (Updated Sept. 1, 2017, 10:01 p.m.)
>
>
> Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2100
> https://issues.apache.org/jira/browse/ATLAS-2100
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Background**
> - The new search implementation allows for creation of complex queries.
> - This sub-feature allows for logged in user to persist search definitions created during a session.
> - These search definition once saved are available to the user on subsequent login.
>
> **Implementation**
> Following implementation approaches were attempted:
> - New types defined in the models json.
> - _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
> - _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
> - Added REST-layer filtering for internal types.
> - Modified _SearchFilter_ more capable.
>
> **_New Entities_**
> - _AtlasUserProfile_
> - _AtlasSavedSearch_
>
> **_UserProfileService_**
> - Interacts with the new entities and adds operations that are exposed by REST APIs.
>
> **_DiscoveryService_**
> - New methods added.
>
> **Retrieve list of all Saved Searches**
> ```
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> **Save Search**
> Save this to _savedSearch.json_:
> ```javascript
> {
> "name": "my_search1",
> "owerUserName": "admin",
> "guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
> "searchParameter": {
> "typeName": "hive_table",
> "excludeDeletedEntities": false,
> "limit": 25,
> "offset": 0,
> "entityFilters": {
> "condition": "AND",
> "criterion": [
> {
> "attributeName": "retention",
> "operator": "=",
> "attributeValue": "10"
> },
> {
> "condition": "OR",
> "criterion": [
> {
> "attributeName": "createTime",
> "operator": ">",
> "attributeValue": "1111111111"
> },
> {
> "attributeName": "lastAccessTime",
> "operator": "<=",
> "attributeValue": "2222222222"
> }
> ]
> }
> ]
> }
> }
> }
> ```
>
> ```javascript
> curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Update Saved Search**
> This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
>
> ```javascript
> curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Retrieve Saved Search**
> All searches for the logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> Specific search for logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
> ```
>
> Specific search for a specific user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
> ```
>
> **Delete Saved Search**
> ```javascript
> curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
> ```
>
> **REST APIs**
> Irrespective of the plumbing, REST APIs will hide the underlying implementation.
>
> _AtlasUserProfile_
>
> ```javascript
> {
> "username": "admin"
> "fullName" : "Admin Admin"
> "savedSearchParameters": [
> <array of _AtlasSavedSearch_>
> ]
> }
> ```
>
> _AtlasSavedSearch_
>
> ```javascript
> {
> "name": "my_search1",
> "ownerUserName": "admin",
> "searchParameters": <SearchParameter JSON here>
> }
> ```
>
>
> Diffs
> -----
>
> addons/models/0010-base_model.json 7f64d85
> addons/models/0011-user-profile_model.json PRE-CREATION
> intg/src/main/java/org/apache/atlas/AtlasErrorCode.java aa8e3f4
> intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5e
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a67
> repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e68835
> repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataAccessHelper.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b40
> repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d418
> repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
> webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3
> webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36e
> webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763
>
>
> Diff: https://reviews.apache.org/r/62039/diff/2/
>
>
> Testing
> -------
>
> **Deployment**
> - Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
> - Deploy _atlas.war_
>
> **Unit tests**
> Added unit tests for:
> - _UserProfileService_.
>
> **Functional testing**
> - Verification using CURL calls.
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
> On Sept. 14, 2017, 5:17 p.m., Sarath Subramanian wrote:
> > addons/models/0010-base_model.json
> > Lines 22 (patched)
> > <https://reviews.apache.org/r/62039/diff/4/?file=1821225#file1821225line38>
> >
> > consider removing "__" in name to be consistent with other typedef name
This was conscious decision to use the 2 underscores so that visually we know that the internal entities are separate than the 1st class entities.
- Ashutosh
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/#review185426
-----------------------------------------------------------
On Sept. 13, 2017, 9:34 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62039/
> -----------------------------------------------------------
>
> (Updated Sept. 13, 2017, 9:34 p.m.)
>
>
> Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2100
> https://issues.apache.org/jira/browse/ATLAS-2100
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Background**
> - The new search implementation allows for creation of complex queries.
> - This sub-feature allows for logged in user to persist search definitions created during a session.
> - These search definition once saved are available to the user on subsequent login.
>
> **Implementation**
> Following implementation approaches were attempted:
> - New types defined in the models json.
> - _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
> - _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
> - Added REST-layer filtering for internal types.
> - Modified _SearchFilter_ more capable.
>
> **_New Entities_**
> - _AtlasUserProfile_
> - _AtlasSavedSearch_
>
> **_UserProfileService_**
> - Interacts with the new entities and adds operations that are exposed by REST APIs.
>
> **_DiscoveryService_**
> - New methods added.
>
> **Retrieve list of all Saved Searches**
> ```
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> **Save Search**
> Save this to _savedSearch.json_:
> ```javascript
> {
> "name": "my_search1",
> "owerUserName": "admin",
> "guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
> "searchParameter": {
> "typeName": "hive_table",
> "excludeDeletedEntities": false,
> "limit": 25,
> "offset": 0,
> "entityFilters": {
> "condition": "AND",
> "criterion": [
> {
> "attributeName": "retention",
> "operator": "=",
> "attributeValue": "10"
> },
> {
> "condition": "OR",
> "criterion": [
> {
> "attributeName": "createTime",
> "operator": ">",
> "attributeValue": "1111111111"
> },
> {
> "attributeName": "lastAccessTime",
> "operator": "<=",
> "attributeValue": "2222222222"
> }
> ]
> }
> ]
> }
> }
> }
> ```
>
> ```javascript
> curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Update Saved Search**
> This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
>
> ```javascript
> curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Retrieve Saved Search**
> All searches for the logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> Specific search for logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
> ```
>
> Specific search for a specific user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
> ```
>
> **Delete Saved Search**
> ```javascript
> curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
> ```
>
> **REST APIs**
> Irrespective of the plumbing, REST APIs will hide the underlying implementation.
>
> _AtlasUserProfile_
>
> ```javascript
> {
> "username": "admin"
> "fullName" : "Admin Admin"
> "savedSearchParameters": [
> <array of _AtlasSavedSearch_>
> ]
> }
> ```
>
> _AtlasSavedSearch_
>
> ```javascript
> {
> "name": "my_search1",
> "ownerUserName": "admin",
> "searchParameters": <SearchParameter JSON here>
> }
> ```
>
>
> Diffs
> -----
>
> addons/models/0010-base_model.json 9ab4c44
> common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8
> intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f586
> intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5e
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a67
> repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e68835
> repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad0
> repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataAccessHelper.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataTransfer.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aea
> repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b40
> repository/src/test/java/org/apache/atlas/repository/orm/DataAccessHelperTest.java PRE-CREATION
> repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d418
> repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
> webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc96
> webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3
> webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36e
> webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763
>
>
> Diff: https://reviews.apache.org/r/62039/diff/4/
>
>
> Testing
> -------
>
> **Deployment**
> - Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
> - Deploy _atlas.war_
>
> **Unit tests**
> Added unit tests for:
> - _UserProfileService_.
>
> **Functional testing**
> - Verification using CURL calls.
> - Verification via UI to ensure that internal entities do not show up.
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Sarath Subramanian <sa...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/#review185426
-----------------------------------------------------------
addons/models/0010-base_model.json
Lines 22 (patched)
<https://reviews.apache.org/r/62039/#comment261735>
consider removing "__" in name to be consistent with other typedef name
- Sarath Subramanian
On Sept. 13, 2017, 2:34 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62039/
> -----------------------------------------------------------
>
> (Updated Sept. 13, 2017, 2:34 p.m.)
>
>
> Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2100
> https://issues.apache.org/jira/browse/ATLAS-2100
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Background**
> - The new search implementation allows for creation of complex queries.
> - This sub-feature allows for logged in user to persist search definitions created during a session.
> - These search definition once saved are available to the user on subsequent login.
>
> **Implementation**
> Following implementation approaches were attempted:
> - New types defined in the models json.
> - _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
> - _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
> - Added REST-layer filtering for internal types.
> - Modified _SearchFilter_ more capable.
>
> **_New Entities_**
> - _AtlasUserProfile_
> - _AtlasSavedSearch_
>
> **_UserProfileService_**
> - Interacts with the new entities and adds operations that are exposed by REST APIs.
>
> **_DiscoveryService_**
> - New methods added.
>
> **Retrieve list of all Saved Searches**
> ```
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> **Save Search**
> Save this to _savedSearch.json_:
> ```javascript
> {
> "name": "my_search1",
> "owerUserName": "admin",
> "guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
> "searchParameter": {
> "typeName": "hive_table",
> "excludeDeletedEntities": false,
> "limit": 25,
> "offset": 0,
> "entityFilters": {
> "condition": "AND",
> "criterion": [
> {
> "attributeName": "retention",
> "operator": "=",
> "attributeValue": "10"
> },
> {
> "condition": "OR",
> "criterion": [
> {
> "attributeName": "createTime",
> "operator": ">",
> "attributeValue": "1111111111"
> },
> {
> "attributeName": "lastAccessTime",
> "operator": "<=",
> "attributeValue": "2222222222"
> }
> ]
> }
> ]
> }
> }
> }
> ```
>
> ```javascript
> curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Update Saved Search**
> This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
>
> ```javascript
> curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Retrieve Saved Search**
> All searches for the logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> Specific search for logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
> ```
>
> Specific search for a specific user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
> ```
>
> **Delete Saved Search**
> ```javascript
> curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
> ```
>
> **REST APIs**
> Irrespective of the plumbing, REST APIs will hide the underlying implementation.
>
> _AtlasUserProfile_
>
> ```javascript
> {
> "username": "admin"
> "fullName" : "Admin Admin"
> "savedSearchParameters": [
> <array of _AtlasSavedSearch_>
> ]
> }
> ```
>
> _AtlasSavedSearch_
>
> ```javascript
> {
> "name": "my_search1",
> "ownerUserName": "admin",
> "searchParameters": <SearchParameter JSON here>
> }
> ```
>
>
> Diffs
> -----
>
> addons/models/0010-base_model.json 9ab4c44
> common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8
> intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f586
> intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5e
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a67
> repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e68835
> repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad0
> repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataAccessHelper.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataTransfer.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aea
> repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b40
> repository/src/test/java/org/apache/atlas/repository/orm/DataAccessHelperTest.java PRE-CREATION
> repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d418
> repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
> webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc96
> webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3
> webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36e
> webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763
>
>
> Diff: https://reviews.apache.org/r/62039/diff/4/
>
>
> Testing
> -------
>
> **Deployment**
> - Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
> - Deploy _atlas.war_
>
> **Unit tests**
> Added unit tests for:
> - _UserProfileService_.
>
> **Functional testing**
> - Verification using CURL calls.
> - Verification via UI to ensure that internal entities do not show up.
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/#review185523
-----------------------------------------------------------
Ship it!
Ship It!
- Madhan Neethiraj
On Sept. 16, 2017, 8:52 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62039/
> -----------------------------------------------------------
>
> (Updated Sept. 16, 2017, 8:52 p.m.)
>
>
> Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2100
> https://issues.apache.org/jira/browse/ATLAS-2100
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Background**
> - The new search implementation allows for creation of complex queries.
> - This sub-feature allows for logged in user to persist search definitions created during a session.
> - These search definition once saved are available to the user on subsequent login.
>
> **Implementation**
> Following implementation approaches were attempted:
> - New types defined in the models json.
> - _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
> - _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
> - Added REST-layer filtering for internal types.
> - Modified _SearchFilter_ more capable.
>
> **_New Entities_**
> - _AtlasUserProfile_
> - _AtlasSavedSearch_
>
> **_UserProfileService_**
> - Interacts with the new entities and adds operations that are exposed by REST APIs.
>
> **_DiscoveryService_**
> - New methods added.
>
> **Retrieve list of all Saved Searches**
> ```
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> **Save Search**
> Save this to _savedSearch.json_:
> ```javascript
> {
> "name": "my_search1",
> "owerUserName": "admin",
> "guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
> "searchParameters": {
> "typeName": "hive_table",
> "excludeDeletedEntities": false,
> "limit": 25,
> "offset": 0,
> "entityFilters": {
> "condition": "AND",
> "criterion": [
> {
> "attributeName": "retention",
> "operator": "=",
> "attributeValue": "10"
> },
> {
> "condition": "OR",
> "criterion": [
> {
> "attributeName": "createTime",
> "operator": ">",
> "attributeValue": "1111111111"
> },
> {
> "attributeName": "lastAccessTime",
> "operator": "<=",
> "attributeValue": "2222222222"
> }
> ]
> }
> ]
> }
> }
> }
> ```
>
> ```javascript
> curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Update Saved Search**
> This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
>
> ```javascript
> curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Retrieve Saved Search**
> All searches for the logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> Specific search for logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
> ```
>
> Specific search for a specific user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
> ```
>
> **Delete Saved Search**
> ```javascript
> curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
> ```
>
> **REST APIs**
> Irrespective of the plumbing, REST APIs will hide the underlying implementation.
>
> _AtlasUserProfile_
>
> ```javascript
> {
> "username": "admin"
> "fullName" : "Admin Admin"
> "savedSearchParameters": [
> <array of _AtlasSavedSearch_>
> ]
> }
> ```
>
> _AtlasSavedSearch_
>
> ```javascript
> {
> "name": "my_search1",
> "ownerUserName": "admin",
> "searchParameters": <SearchParameter JSON here>
> }
> ```
>
>
> Diffs
> -----
>
> addons/models/0010-base_model.json 9ab4c44f
> common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8f
> intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f5865
> intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5ef
> intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java c79b5b90
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a674
> repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e688350
> repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad06
> repository/src/main/java/org/apache/atlas/repository/ogm/AbstractDataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/ogm/AtlasSavedSearchDTO.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/ogm/AtlasUserProfileDTO.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/ogm/DTORegistry.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/ogm/DataAccess.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/ogm/DataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1d
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab
> repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b405
> repository/src/test/java/org/apache/atlas/TestModules.java af3189b9
> repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
> webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967
> webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3c
> webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea
> webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763a
>
>
> Diff: https://reviews.apache.org/r/62039/diff/7/
>
>
> Testing
> -------
>
> **Deployment**
> - Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
> - Deploy _atlas.war_
>
> **Unit tests**
> Added unit tests for:
> - _UserProfileService_.
>
> **Functional testing**
> - Verification using CURL calls.
> - Verification via UI to ensure that internal entities do not show up.
>
>
> File Attachments
> ----------------
>
> Patch for Master
> https://reviews.apache.org/media/uploaded/files/2017/09/15/ba9b07c2-5868-4f79-ad51-7d7c9ee39c44__ATLAS-2100-Master-DataAccess.patch
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
(Updated Sept. 16, 2017, 8:52 p.m.)
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- Addressed review comments (Thanks Madhan!)
- Additional unit tests.
- Minor refactoring.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameters": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs (updated)
-----
addons/models/0010-base_model.json 9ab4c44f
common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8f
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f5865
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5ef
intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java c79b5b90
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a674
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e688350
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad06
repository/src/main/java/org/apache/atlas/repository/ogm/AbstractDataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/ogm/AtlasSavedSearchDTO.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/ogm/AtlasUserProfileDTO.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/ogm/DTORegistry.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/ogm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/ogm/DataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1d
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b405
repository/src/test/java/org/apache/atlas/TestModules.java af3189b9
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3c
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763a
Diff: https://reviews.apache.org/r/62039/diff/7/
Changes: https://reviews.apache.org/r/62039/diff/6-7/
Testing
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
- Verification via UI to ensure that internal entities do not show up.
File Attachments
----------------
Patch for Master
https://reviews.apache.org/media/uploaded/files/2017/09/15/ba9b07c2-5868-4f79-ad51-7d7c9ee39c44__ATLAS-2100-Master-DataAccess.patch
Thanks,
Ashutosh Mestry
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/#review185515
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java
Lines 18 (patched)
<https://reviews.apache.org/r/62039/#comment261832>
"orm" ==> "ogm" - given the mapping is to a graph DB?
repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java
Lines 31 (patched)
<https://reviews.apache.org/r/62039/#comment261831>
Given entityType can change during life of the server (with a call to TypesREST API), we shouldn't cache it. Instead, we should dynamically retrieve from typeRegistry when needed.
- Madhan Neethiraj
On Sept. 15, 2017, 10:33 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62039/
> -----------------------------------------------------------
>
> (Updated Sept. 15, 2017, 10:33 p.m.)
>
>
> Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2100
> https://issues.apache.org/jira/browse/ATLAS-2100
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Background**
> - The new search implementation allows for creation of complex queries.
> - This sub-feature allows for logged in user to persist search definitions created during a session.
> - These search definition once saved are available to the user on subsequent login.
>
> **Implementation**
> Following implementation approaches were attempted:
> - New types defined in the models json.
> - _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
> - _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
> - Added REST-layer filtering for internal types.
> - Modified _SearchFilter_ more capable.
>
> **_New Entities_**
> - _AtlasUserProfile_
> - _AtlasSavedSearch_
>
> **_UserProfileService_**
> - Interacts with the new entities and adds operations that are exposed by REST APIs.
>
> **_DiscoveryService_**
> - New methods added.
>
> **Retrieve list of all Saved Searches**
> ```
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> **Save Search**
> Save this to _savedSearch.json_:
> ```javascript
> {
> "name": "my_search1",
> "owerUserName": "admin",
> "guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
> "searchParameters": {
> "typeName": "hive_table",
> "excludeDeletedEntities": false,
> "limit": 25,
> "offset": 0,
> "entityFilters": {
> "condition": "AND",
> "criterion": [
> {
> "attributeName": "retention",
> "operator": "=",
> "attributeValue": "10"
> },
> {
> "condition": "OR",
> "criterion": [
> {
> "attributeName": "createTime",
> "operator": ">",
> "attributeValue": "1111111111"
> },
> {
> "attributeName": "lastAccessTime",
> "operator": "<=",
> "attributeValue": "2222222222"
> }
> ]
> }
> ]
> }
> }
> }
> ```
>
> ```javascript
> curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Update Saved Search**
> This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
>
> ```javascript
> curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Retrieve Saved Search**
> All searches for the logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> Specific search for logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
> ```
>
> Specific search for a specific user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
> ```
>
> **Delete Saved Search**
> ```javascript
> curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
> ```
>
> **REST APIs**
> Irrespective of the plumbing, REST APIs will hide the underlying implementation.
>
> _AtlasUserProfile_
>
> ```javascript
> {
> "username": "admin"
> "fullName" : "Admin Admin"
> "savedSearchParameters": [
> <array of _AtlasSavedSearch_>
> ]
> }
> ```
>
> _AtlasSavedSearch_
>
> ```javascript
> {
> "name": "my_search1",
> "ownerUserName": "admin",
> "searchParameters": <SearchParameter JSON here>
> }
> ```
>
>
> Diffs
> -----
>
> addons/models/0010-base_model.json 9ab4c44f
> common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8f
> intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f5865
> intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5ef
> intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java c79b5b90
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a674
> repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e688350
> repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad06
> repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/AtlasSavedSearchDTO.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/AtlasUserProfileDTO.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1d
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab
> repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b405
> repository/src/test/java/org/apache/atlas/TestModules.java af3189b9
> repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d4180
> repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
> webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967
> webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3c
> webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea
> webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763a
>
>
> Diff: https://reviews.apache.org/r/62039/diff/6/
>
>
> Testing
> -------
>
> **Deployment**
> - Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
> - Deploy _atlas.war_
>
> **Unit tests**
> Added unit tests for:
> - _UserProfileService_.
>
> **Functional testing**
> - Verification using CURL calls.
> - Verification via UI to ensure that internal entities do not show up.
>
>
> File Attachments
> ----------------
>
> Patch for Master
> https://reviews.apache.org/media/uploaded/files/2017/09/15/ba9b07c2-5868-4f79-ad51-7d7c9ee39c44__ATLAS-2100-Master-DataAccess.patch
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/#review185511
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java
Lines 67 (patched)
<https://reviews.apache.org/r/62039/#comment261828>
Validate that no other search exists with the same name as the new one.
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java
Lines 77 (patched)
<https://reviews.apache.org/r/62039/#comment261829>
Add validation for the following:
- ownerName hasn't been updated
- if name was updated, ensure that another search with the new name doesn't exist
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
Line 75 (original), 87 (patched)
<https://reviews.apache.org/r/62039/#comment261827>
Please avoid white spaces such as these.
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
Lines 347 (patched)
<https://reviews.apache.org/r/62039/#comment261826>
"save" ==> "saved"
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
Lines 362 (patched)
<https://reviews.apache.org/r/62039/#comment261825>
"save" ==> "saved"
- Madhan Neethiraj
On Sept. 15, 2017, 10:33 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62039/
> -----------------------------------------------------------
>
> (Updated Sept. 15, 2017, 10:33 p.m.)
>
>
> Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2100
> https://issues.apache.org/jira/browse/ATLAS-2100
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Background**
> - The new search implementation allows for creation of complex queries.
> - This sub-feature allows for logged in user to persist search definitions created during a session.
> - These search definition once saved are available to the user on subsequent login.
>
> **Implementation**
> Following implementation approaches were attempted:
> - New types defined in the models json.
> - _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
> - _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
> - Added REST-layer filtering for internal types.
> - Modified _SearchFilter_ more capable.
>
> **_New Entities_**
> - _AtlasUserProfile_
> - _AtlasSavedSearch_
>
> **_UserProfileService_**
> - Interacts with the new entities and adds operations that are exposed by REST APIs.
>
> **_DiscoveryService_**
> - New methods added.
>
> **Retrieve list of all Saved Searches**
> ```
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> **Save Search**
> Save this to _savedSearch.json_:
> ```javascript
> {
> "name": "my_search1",
> "owerUserName": "admin",
> "guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
> "searchParameters": {
> "typeName": "hive_table",
> "excludeDeletedEntities": false,
> "limit": 25,
> "offset": 0,
> "entityFilters": {
> "condition": "AND",
> "criterion": [
> {
> "attributeName": "retention",
> "operator": "=",
> "attributeValue": "10"
> },
> {
> "condition": "OR",
> "criterion": [
> {
> "attributeName": "createTime",
> "operator": ">",
> "attributeValue": "1111111111"
> },
> {
> "attributeName": "lastAccessTime",
> "operator": "<=",
> "attributeValue": "2222222222"
> }
> ]
> }
> ]
> }
> }
> }
> ```
>
> ```javascript
> curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Update Saved Search**
> This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
>
> ```javascript
> curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
> ```
>
> **Retrieve Saved Search**
> All searches for the logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
> ```
>
> Specific search for logged in user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
> ```
>
> Specific search for a specific user:
> ```javascript
> curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
> ```
>
> **Delete Saved Search**
> ```javascript
> curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
> ```
>
> **REST APIs**
> Irrespective of the plumbing, REST APIs will hide the underlying implementation.
>
> _AtlasUserProfile_
>
> ```javascript
> {
> "username": "admin"
> "fullName" : "Admin Admin"
> "savedSearchParameters": [
> <array of _AtlasSavedSearch_>
> ]
> }
> ```
>
> _AtlasSavedSearch_
>
> ```javascript
> {
> "name": "my_search1",
> "ownerUserName": "admin",
> "searchParameters": <SearchParameter JSON here>
> }
> ```
>
>
> Diffs
> -----
>
> addons/models/0010-base_model.json 9ab4c44f
> common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8f
> intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f5865
> intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5ef
> intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java c79b5b90
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
> intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a674
> repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e688350
> repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad06
> repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/AtlasSavedSearchDTO.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/AtlasUserProfileDTO.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1d
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab
> repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b405
> repository/src/test/java/org/apache/atlas/TestModules.java af3189b9
> repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d4180
> repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
> webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967
> webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3c
> webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea
> webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763a
>
>
> Diff: https://reviews.apache.org/r/62039/diff/6/
>
>
> Testing
> -------
>
> **Deployment**
> - Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
> - Deploy _atlas.war_
>
> **Unit tests**
> Added unit tests for:
> - _UserProfileService_.
>
> **Functional testing**
> - Verification using CURL calls.
> - Verification via UI to ensure that internal entities do not show up.
>
>
> File Attachments
> ----------------
>
> Patch for Master
> https://reviews.apache.org/media/uploaded/files/2017/09/15/ba9b07c2-5868-4f79-ad51-7d7c9ee39c44__ATLAS-2100-Master-DataAccess.patch
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
(Updated Sept. 15, 2017, 10:33 p.m.)
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- Patch for master, few minor refactorings.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameters": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs
-----
addons/models/0010-base_model.json 9ab4c44f
common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8f
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f5865
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5ef
intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java c79b5b90
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a674
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e688350
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad06
repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/AtlasSavedSearchDTO.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/AtlasUserProfileDTO.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1d
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b405
repository/src/test/java/org/apache/atlas/TestModules.java af3189b9
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d4180
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3c
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763a
Diff: https://reviews.apache.org/r/62039/diff/6/
Testing
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
- Verification via UI to ensure that internal entities do not show up.
File Attachments (updated)
----------------
Patch for Master
https://reviews.apache.org/media/uploaded/files/2017/09/15/ba9b07c2-5868-4f79-ad51-7d7c9ee39c44__ATLAS-2100-Master-DataAccess.patch
Thanks,
Ashutosh Mestry
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
(Updated Sept. 15, 2017, 7:12 p.m.)
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- Updated documentation.
- Some refactoring.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description (updated)
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameters": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs (updated)
-----
addons/models/0010-base_model.json 9ab4c44f
common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8f
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f5865
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5ef
intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java c79b5b90
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a674
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e688350
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad06
repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/AtlasSavedSearchDTO.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/AtlasUserProfileDTO.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1d
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b405
repository/src/test/java/org/apache/atlas/TestModules.java af3189b9
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d4180
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3c
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763a
Diff: https://reviews.apache.org/r/62039/diff/6/
Changes: https://reviews.apache.org/r/62039/diff/5-6/
Testing
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
- Verification via UI to ensure that internal entities do not show up.
Thanks,
Ashutosh Mestry
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
(Updated Sept. 15, 2017, 6:32 p.m.)
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- Additional refactoring.
- Updated unit tests.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameter": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs (updated)
-----
addons/models/0010-base_model.json 9ab4c44f
common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8f
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f5865
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5ef
intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java c79b5b90
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a674
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e688350
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad06
repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/AtlasSavedSearchDTO.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/AtlasUserProfileDTO.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1d
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b405
repository/src/test/java/org/apache/atlas/TestModules.java af3189b9
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d4180
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3c
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763a
Diff: https://reviews.apache.org/r/62039/diff/5/
Changes: https://reviews.apache.org/r/62039/diff/4-5/
Testing
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
- Verification via UI to ensure that internal entities do not show up.
Thanks,
Ashutosh Mestry
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
(Updated Sept. 13, 2017, 9:34 p.m.)
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include: Updated testing section.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameter": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs
-----
addons/models/0010-base_model.json 9ab4c44
common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f586
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5e
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a67
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e68835
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad0
repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccessHelper.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransfer.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aea
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b40
repository/src/test/java/org/apache/atlas/repository/orm/DataAccessHelperTest.java PRE-CREATION
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d418
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc96
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36e
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763
Diff: https://reviews.apache.org/r/62039/diff/4/
Testing (updated)
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
- Verification via UI to ensure that internal entities do not show up.
Thanks,
Ashutosh Mestry
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
(Updated Sept. 13, 2017, 9:32 p.m.)
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- Internal types are now renamed to start with 2 underscores. Appropriate changes are made to handle name validation.
- Internal entities are excluded from being full text search indexed.
- Internal entities are excluded from Kafka notification on _ATLAS_ENTITIES_ topic.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameter": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs (updated)
-----
addons/models/0010-base_model.json 9ab4c44
common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b20f586
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5e
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a67
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e68835
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad0
repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccessHelper.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransfer.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java 2bf53a1
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aea
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b40
repository/src/test/java/org/apache/atlas/repository/orm/DataAccessHelperTest.java PRE-CREATION
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d418
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc96
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36e
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763
Diff: https://reviews.apache.org/r/62039/diff/4/
Changes: https://reviews.apache.org/r/62039/diff/3-4/
Testing
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
Thanks,
Ashutosh Mestry
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
(Updated Sept. 6, 2017, 6:01 a.m.)
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- Addressed review comments.
- Added _DTORegistry_.
- Near final implementation.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameter": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs (updated)
-----
addons/models/0010-base_model.json 7f64d85
common/src/main/java/org/apache/atlas/repository/Constants.java 62d74f8
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java aa8e3f4
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5e
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a67
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e68835
repository/src/main/java/org/apache/atlas/repository/orm/AbstractDataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DTORegistry.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransfer.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataTransferObject.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b40
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d418
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36e
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763
Diff: https://reviews.apache.org/r/62039/diff/3/
Changes: https://reviews.apache.org/r/62039/diff/2-3/
Testing
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
Thanks,
Ashutosh Mestry
Re: Review Request 62039: ATLAS-2100: UserProfile & SavedSearch
Implementation
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62039/
-----------------------------------------------------------
(Updated Sept. 1, 2017, 10:01 p.m.)
Review request for atlas, Apoorv Naik, keval bhatt, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- additional refactoring to reduce code.
Bugs: ATLAS-2100
https://issues.apache.org/jira/browse/ATLAS-2100
Repository: atlas
Description
-------
**Background**
- The new search implementation allows for creation of complex queries.
- This sub-feature allows for logged in user to persist search definitions created during a session.
- These search definition once saved are available to the user on subsequent login.
**Implementation**
Following implementation approaches were attempted:
- New types defined in the models json.
- _Data Access Layer_: This is semi-generic approach that needs some code per implementation.
- _AtlasEntity_ adapters: This implementation leverages existing type system to create new types. The model is a facade over _AtlasEntity_.
- Added REST-layer filtering for internal types.
- Modified _SearchFilter_ more capable.
**_New Entities_**
- _AtlasUserProfile_
- _AtlasSavedSearch_
**_UserProfileService_**
- Interacts with the new entities and adds operations that are exposed by REST APIs.
**_DiscoveryService_**
- New methods added.
**Retrieve list of all Saved Searches**
```
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
**Save Search**
Save this to _savedSearch.json_:
```javascript
{
"name": "my_search1",
"owerUserName": "admin",
"guid": "61613c37-cab8-4ee9-b3e7-590d0694f6e8",
"searchParameter": {
"typeName": "hive_table",
"excludeDeletedEntities": false,
"limit": 25,
"offset": 0,
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "retention",
"operator": "=",
"attributeValue": "10"
},
{
"condition": "OR",
"criterion": [
{
"attributeName": "createTime",
"operator": ">",
"attributeValue": "1111111111"
},
{
"attributeName": "lastAccessTime",
"operator": "<=",
"attributeValue": "2222222222"
}
]
}
]
}
}
}
```
```javascript
curl -g -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Update Saved Search**
This will work on existing saved search. Ensure that the parmeter has _guid_ property set.
```javascript
curl -g -X PUT -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/save" -d @../docs/savedSearch.json
```
**Retrieve Saved Search**
All searches for the logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved"
```
Specific search for logged in user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2"
```
Specific search for a specific user:
```javascript
curl -g -X GET -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/my_search2?user=admin"
```
**Delete Saved Search**
```javascript
curl -g -X DELETE -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://localhost:21000/api/atlas/v2/search/saved/0d0f75ef-b101-466f-843e-60196b81c98e"
```
**REST APIs**
Irrespective of the plumbing, REST APIs will hide the underlying implementation.
_AtlasUserProfile_
```javascript
{
"username": "admin"
"fullName" : "Admin Admin"
"savedSearchParameters": [
<array of _AtlasSavedSearch_>
]
}
```
_AtlasSavedSearch_
```javascript
{
"name": "my_search1",
"ownerUserName": "admin",
"searchParameters": <SearchParameter JSON here>
}
```
Diffs (updated)
-----
addons/models/0010-base_model.json 7f64d85
addons/models/0011-user-profile_model.json PRE-CREATION
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java aa8e3f4
intg/src/main/java/org/apache/atlas/model/AtlasBaseModelObject.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/SearchFilter.java 7dccf5e
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserProfile.java PRE-CREATION
intg/src/main/java/org/apache/atlas/model/profile/AtlasUserSavedSearch.java PRE-CREATION
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 8196a67
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 1e68835
repository/src/main/java/org/apache/atlas/repository/orm/DataAccess.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/orm/DataAccessHelper.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/userprofile/UserProfileService.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/util/FilterUtil.java 54d6b40
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java 728d418
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java PRE-CREATION
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 52258e3
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36e
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java 4a92763
Diff: https://reviews.apache.org/r/62039/diff/2/
Changes: https://reviews.apache.org/r/62039/diff/1-2/
Testing
-------
**Deployment**
- Copy _0010-base_model.json_ & _0011-user-profile_model.json_ to server location: _/usr/hdp/current/atlas-server/models_
- Deploy _atlas.war_
**Unit tests**
Added unit tests for:
- _UserProfileService_.
**Functional testing**
- Verification using CURL calls.
Thanks,
Ashutosh Mestry