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 2018/11/09 19:50:41 UTC
Review Request 69305: Soft/Hard Delete: REST API with Parameter-based
Choice
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/
-----------------------------------------------------------
Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
Bugs: ATLAS-2774
https://issues.apache.org/jira/browse/ATLAS-2774
Repository: atlas
Description
-------
**Approach**
- New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
- _SoftDeleteHandler_: Existing implementation.
- _HardDeleteHandler_: Existing implementation.
- _DefaultHandler_ which is initialized via _atlas-application.properties_.
- Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
- Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
- Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
**CURL**
Hard
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
```
Soft
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
```
Default: As initialized by application based on _atlas-application.properties_
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
```
Diffs
-----
common/src/main/java/org/apache/atlas/annotation/ConditionalOnAtlasProperty.java 427e3a8f8
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java c57e30ab5
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/HardDeleteHandlerV1.java edf1eed4c
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java bf16145a3
repository/src/test/java/org/apache/atlas/TestModules.java d3d30d5d9
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
Diff: https://reviews.apache.org/r/69305/diff/1/
Testing
-------
**Unit tests**
Additional unit tests.
**Functional tests**
Via REST APIs. (See above.)
Thanks,
Ashutosh Mestry
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Ashutosh Mestry <am...@hortonworks.com>.
> On Nov. 12, 2018, 11:30 p.m., Madhan Neethiraj wrote:
> > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
> > Lines 83 (patched)
> > <https://reviews.apache.org/r/69305/diff/2/?file=2107051#file2107051line83>
> >
> > replace isSoftDeleteHandler(SoftDeleteHandlerV1 softDeleteHandler) with:
> >
> >
> > DeleteHandlerV1 getDefaultDeleteHandler() {
> > try {
> > return ApplicationProperties.getClass(config, DELETE_HANDLER_V1_IMPLEMENTATION_PROPERTY, SoftDeleteHandlerV1.class.getName(), DeleteHandlerV1.class);
> > } catch (AtlasException e) {
> > throw new RuntimeException(e);
> > }
> > }
This returns class, which then needs to be instantiated. If some Spring feature is used, then it becomes automatic, whereas mine is string compare.
- Ashutosh
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210482
-----------------------------------------------------------
On Nov. 13, 2018, 1:25 a.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 13, 2018, 1:25 a.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
> ```
>
> Soft
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
>
> Diffs
> -----
>
> intg/src/main/java/org/apache/atlas/store/DeleteType.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/69305/diff/3/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> - Via REST APIs. (See above.)
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210482
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 41 (patched)
<https://reviews.apache.org/r/69305/#comment295183>
Instead of defining DELETE_TYPE enum here, consider adding in EntityREST.java, so that the possible values will be obvious to REST API users. Also rename DELETE_TYPE as DeleteType - as shown below:
public enum DeleteType {
DEFAULT,
SOFT,
HARD
}
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 64 (patched)
<https://reviews.apache.org/r/69305/#comment295194>
Given only 3 entries, consider avoding use of map; instead use 3 'final' members:
final SoftDeleteHandlerV1 softDeleteHandler;
final HardDeleteHandlerV1 hardDeleteHandler;
final DeleteHandlerV1 defaultDeleteHandler;
and initialize them in the constructor; and use 'switch/case' to pick appropriate handler to use.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 83 (patched)
<https://reviews.apache.org/r/69305/#comment295193>
replace isSoftDeleteHandler(SoftDeleteHandlerV1 softDeleteHandler) with:
DeleteHandlerV1 getDefaultDeleteHandler() {
try {
return ApplicationProperties.getClass(config, DELETE_HANDLER_V1_IMPLEMENTATION_PROPERTY, SoftDeleteHandlerV1.class.getName(), DeleteHandlerV1.class);
} catch (AtlasException e) {
throw new RuntimeException(e);
}
}
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
Lines 936 (patched)
<https://reviews.apache.org/r/69305/#comment295189>
is method by() needed anymore? If not, please remove.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
Lines 436 (patched)
<https://reviews.apache.org/r/69305/#comment295190>
replace null with DEFAULT - just as in other such places (#358, #441).
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java
Line 584 (original), 584 (patched)
<https://reviews.apache.org/r/69305/#comment295191>
replace null with DeleteMode.DEFAULT
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
Lines 246 (patched)
<https://reviews.apache.org/r/69305/#comment295192>
Consider using DeleteType enum as the type, instead of String. Also, consider specifying @DefaultValue("DEFAULT") here (reference - LineageREST.java).
Review & update other methods here for above.
- Madhan Neethiraj
On Nov. 9, 2018, 7:50 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 9, 2018, 7:50 p.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
> ```
>
> Soft
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/atlas/annotation/ConditionalOnAtlasProperty.java 427e3a8f8
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java c57e30ab5
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/HardDeleteHandlerV1.java edf1eed4c
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java bf16145a3
> repository/src/test/java/org/apache/atlas/TestModules.java d3d30d5d9
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/69305/diff/2/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> - Via REST APIs. (See above.)
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Ashutosh Mestry <am...@hortonworks.com>.
> On Nov. 10, 2018, 6:10 p.m., Madhan Neethiraj wrote:
> > repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java
> > Line 99 (original), 100 (patched)
> > <https://reviews.apache.org/r/69305/diff/1/?file=2106562#file2106562line100>
> >
> > If configuration explicity specifies SoftDeleteHandlerV1 (or HardDeleteHandlerV1), then DeleteHandlerDelegate will not be instantiated - right? In such case, the option provided in the delete call may not be honored. Please review and update.
The DeleteHandlerDelegate will always be instantiated. The defaultDeleteHandler within the delegate will get the value that is set by the configuration.
- Ashutosh
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210451
-----------------------------------------------------------
On Nov. 9, 2018, 7:50 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 9, 2018, 7:50 p.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
> ```
>
> Soft
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/atlas/annotation/ConditionalOnAtlasProperty.java 427e3a8f8
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java c57e30ab5
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/HardDeleteHandlerV1.java edf1eed4c
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java bf16145a3
> repository/src/test/java/org/apache/atlas/TestModules.java d3d30d5d9
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/69305/diff/1/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> Via REST APIs. (See above.)
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210451
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 71 (patched)
<https://reviews.apache.org/r/69305/#comment295120>
by() call modifies the state, which can cause incorrect behaviour when multiple delete requests, with different hard/soft delete option, execute simultaneously. Please review and update.
repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java
Line 99 (original), 100 (patched)
<https://reviews.apache.org/r/69305/#comment295121>
If configuration explicity specifies SoftDeleteHandlerV1 (or HardDeleteHandlerV1), then DeleteHandlerDelegate will not be instantiated - right? In such case, the option provided in the delete call may not be honored. Please review and update.
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
Lines 245 (patched)
<https://reviews.apache.org/r/69305/#comment295117>
Consider replacing 'Boolean hardDelete' with 'String deleteType', as it might be more intutive in dealing with default when no value is specified for this parameter (in AtlasEntityStore) - like:
if (deleteType == null) {
deleteType = deleteTypeFromCurrentConfig.
}
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
Lines 323 (patched)
<https://reviews.apache.org/r/69305/#comment295118>
Consider replacing 'Boolean hardDelete' with 'String deleteType'.
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
Lines 636 (patched)
<https://reviews.apache.org/r/69305/#comment295119>
Consider replacing 'Boolean hardDelete' with 'String deleteType'.
- Madhan Neethiraj
On Nov. 9, 2018, 7:50 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 9, 2018, 7:50 p.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
> ```
>
> Soft
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/atlas/annotation/ConditionalOnAtlasProperty.java 427e3a8f8
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java c57e30ab5
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/HardDeleteHandlerV1.java edf1eed4c
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java bf16145a3
> repository/src/test/java/org/apache/atlas/TestModules.java d3d30d5d9
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/69305/diff/1/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> Via REST APIs. (See above.)
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210486
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 39 (patched)
<https://reviews.apache.org/r/69305/#comment295203>
Given SoftDeleteHandlerV1 and HardDeleteHandlerV1 are injectable, consider getting instances via DI.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 43 (patched)
<https://reviews.apache.org/r/69305/#comment295201>
is initDefaultHandler() necessary? Why not move this initialization to the constructor and mark all the fields as 'final'?
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 50 (patched)
<https://reviews.apache.org/r/69305/#comment295200>
It is safe to have soft-delete as default (i.e. incase of unknown value):
defaultHandler = StringUtils.equals(defaultHandlerClassName, hardDeleteHandler.getClass().getName()) ? hardDeleteHandler : softDeleteHandler;
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 58 (patched)
<https://reviews.apache.org/r/69305/#comment295202>
Please review if null value should be handled here.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
Line 98 (original), 98 (patched)
<https://reviews.apache.org/r/69305/#comment295198>
Shouldn't DeleteHandlerV1 be replaced with DeleteHandlerDelegate here - just as in AtlasEntityStoreV2?
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
Lines 266 (patched)
<https://reviews.apache.org/r/69305/#comment295199>
Please move 'private' methods towards end of the file.
- Madhan Neethiraj
On Nov. 13, 2018, 1:25 a.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 13, 2018, 1:25 a.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
> ```
>
> Soft
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
>
> Diffs
> -----
>
> intg/src/main/java/org/apache/atlas/store/DeleteType.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/69305/diff/3/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> - Via REST APIs. (See above.)
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210526
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 39 (patched)
<https://reviews.apache.org/r/69305/#comment295238>
To be safe, only if configuration specifies hard handler, set default to that; else set default to 'soft'. Consider that case where the configuration is set to neither of built-in handlers.
Ideally we should simply create an instance of the specified handler class; but that might take some work, since the implementation would/might expect the typeRegistry to be passed in the constructor.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 42 (patched)
<https://reviews.apache.org/r/69305/#comment295239>
Move 'private' method towards end of the file.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
Lines 437 (patched)
<https://reviews.apache.org/r/69305/#comment295240>
Consider replacing null with DeleteType.DEFAULT - just as in other methods.
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
Lines 786 (patched)
<https://reviews.apache.org/r/69305/#comment295241>
Consider replacing null with DeleteType.DEFAULT.
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java
Line 289 (original), 289 (patched)
<https://reviews.apache.org/r/69305/#comment295242>
This change shouldn't be needed, given method with single argument continues to be supported.
- Madhan Neethiraj
On Nov. 13, 2018, 7:01 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 13, 2018, 7:01 p.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard: Entity
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=HARD'
> ```
>
> Soft: Entity
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=SOFT'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
> Hard: Relationship
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=HARD
> ```
>
> Soft: Relationship
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=SOFT
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade
> ```
>
>
> Diffs
> -----
>
> intg/src/main/java/org/apache/atlas/store/DeleteType.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java 44689516e
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportImportTestBase.java 4b253ffb7
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java 936586ba2
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java 6d6432f74
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/69305/diff/6/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> - Via REST APIs. (See above.)
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
>
> **Pre-commit**
> https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/800/
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210528
-----------------------------------------------------------
EntityGraphMapper.java also has reference to injected DeleteHandlerV1. Please update this as well, similar to AtlasEntityStoreV1 and AtlasRelationshipStoreV1.
It might be useful to make both SoftDeleteHandlerV1 and HardDeleteHandlerV1 as 'not injectable' (i.e. remove @Component) - so that they are not used inadvertently.
- Madhan Neethiraj
On Nov. 13, 2018, 11:24 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 13, 2018, 11:24 p.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard: Entity
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=HARD'
> ```
>
> Soft: Entity
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=SOFT'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
> Hard: Relationship
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=HARD
> ```
>
> Soft: Relationship
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=SOFT
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade
> ```
>
>
> Diffs
> -----
>
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java 44689516e
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportImportTestBase.java 4b253ffb7
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java 936586ba2
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java 6d6432f74
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
> webapp/src/test/java/org/apache/atlas/web/resources/AdminExportTest.java a8f82321b
>
>
> Diff: https://reviews.apache.org/r/69305/diff/7/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> - Via REST APIs. (See above.)
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
>
> **Pre-commit**
> https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/800/
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210529
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java
Lines 74 (patched)
<https://reviews.apache.org/r/69305/#comment295245>
For better troubleshooting, please add "ex" as the last argument to LOG method; this will print the stack trace.
- Madhan Neethiraj
On Nov. 13, 2018, 11:24 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 13, 2018, 11:24 p.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard: Entity
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=HARD'
> ```
>
> Soft: Entity
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=SOFT'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
> Hard: Relationship
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=HARD
> ```
>
> Soft: Relationship
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=SOFT
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade
> ```
>
>
> Diffs
> -----
>
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java 44689516e
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportImportTestBase.java 4b253ffb7
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java 936586ba2
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java 6d6432f74
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
> webapp/src/test/java/org/apache/atlas/web/resources/AdminExportTest.java a8f82321b
>
>
> Diff: https://reviews.apache.org/r/69305/diff/7/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> - Via REST APIs. (See above.)
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
>
> **Pre-commit**
> https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/800/
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/#review210532
-----------------------------------------------------------
Ship it!
Ship It!
- Madhan Neethiraj
On Nov. 14, 2018, 12:23 a.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69305/
> -----------------------------------------------------------
>
> (Updated Nov. 14, 2018, 12:23 a.m.)
>
>
> Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
>
>
> Bugs: ATLAS-2774
> https://issues.apache.org/jira/browse/ATLAS-2774
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Approach**
> - New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
> - _SoftDeleteHandler_: Existing implementation.
> - _HardDeleteHandler_: Existing implementation.
> - _DefaultHandler_ which is initialized via _atlas-application.properties_.
>
> - Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
> - Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
> - Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
>
> **CURL**
>
> Hard: Entity
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=HARD'
> ```
>
> Soft: Entity
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=SOFT'
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
> ```
>
> Hard: Relationship
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=HARD
> ```
>
> Soft: Relationship
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=SOFT
> ```
>
> Default: As initialized by application based on _atlas-application.properties_
> ```
> CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade
> ```
>
>
> Diffs
> -----
>
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java 44689516e
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java e8c8c0c8b
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportImportTestBase.java 4b253ffb7
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java 936586ba2
> repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
> repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
> webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
> webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
> webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java 6d6432f74
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
> webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
> webapp/src/test/java/org/apache/atlas/web/resources/AdminExportTest.java a8f82321b
>
>
> Diff: https://reviews.apache.org/r/69305/diff/8/
>
>
> Testing
> -------
>
> **Unit tests**
> Additional unit tests.
>
> **Functional tests**
> - Via REST APIs. (See above.)
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
> - Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
>
> **Pre-commit**
> https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/800/
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/
-----------------------------------------------------------
(Updated Nov. 14, 2018, 12:23 a.m.)
Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- Addressed review comments.
Bugs: ATLAS-2774
https://issues.apache.org/jira/browse/ATLAS-2774
Repository: atlas
Description
-------
**Approach**
- New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
- _SoftDeleteHandler_: Existing implementation.
- _HardDeleteHandler_: Existing implementation.
- _DefaultHandler_ which is initialized via _atlas-application.properties_.
- Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
- Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
- Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
**CURL**
Hard: Entity
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=HARD'
```
Soft: Entity
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=SOFT'
```
Default: As initialized by application based on _atlas-application.properties_
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
```
Hard: Relationship
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=HARD
```
Soft: Relationship
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=SOFT
```
Default: As initialized by application based on _atlas-application.properties_
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade
```
Diffs (updated)
-----
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java 44689516e
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java e8c8c0c8b
repository/src/test/java/org/apache/atlas/repository/impexp/ExportImportTestBase.java 4b253ffb7
repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java 936586ba2
repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java 6d6432f74
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
webapp/src/test/java/org/apache/atlas/web/resources/AdminExportTest.java a8f82321b
Diff: https://reviews.apache.org/r/69305/diff/8/
Changes: https://reviews.apache.org/r/69305/diff/7-8/
Testing
-------
**Unit tests**
Additional unit tests.
**Functional tests**
- Via REST APIs. (See above.)
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
**Pre-commit**
https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/800/
Thanks,
Ashutosh Mestry
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/
-----------------------------------------------------------
(Updated Nov. 13, 2018, 11:24 p.m.)
Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include: Addressed review comments.
Bugs: ATLAS-2774
https://issues.apache.org/jira/browse/ATLAS-2774
Repository: atlas
Description
-------
**Approach**
- New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
- _SoftDeleteHandler_: Existing implementation.
- _HardDeleteHandler_: Existing implementation.
- _DefaultHandler_ which is initialized via _atlas-application.properties_.
- Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
- Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
- Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
**CURL**
Hard: Entity
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=HARD'
```
Soft: Entity
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=SOFT'
```
Default: As initialized by application based on _atlas-application.properties_
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
```
Hard: Relationship
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=HARD
```
Soft: Relationship
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=SOFT
```
Default: As initialized by application based on _atlas-application.properties_
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade
```
Diffs (updated)
-----
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java 44689516e
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
repository/src/test/java/org/apache/atlas/repository/impexp/ExportImportTestBase.java 4b253ffb7
repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java 936586ba2
repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java 6d6432f74
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
webapp/src/test/java/org/apache/atlas/web/resources/AdminExportTest.java a8f82321b
Diff: https://reviews.apache.org/r/69305/diff/7/
Changes: https://reviews.apache.org/r/69305/diff/6-7/
Testing
-------
**Unit tests**
Additional unit tests.
**Functional tests**
- Via REST APIs. (See above.)
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
**Pre-commit**
https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/800/
Thanks,
Ashutosh Mestry
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/
-----------------------------------------------------------
(Updated Nov. 13, 2018, 7:01 p.m.)
Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include: Addressed review comments.
Bugs: ATLAS-2774
https://issues.apache.org/jira/browse/ATLAS-2774
Repository: atlas
Description
-------
**Approach**
- New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
- _SoftDeleteHandler_: Existing implementation.
- _HardDeleteHandler_: Existing implementation.
- _DefaultHandler_ which is initialized via _atlas-application.properties_.
- Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
- Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
- Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
**CURL**
Hard: Entity
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=HARD'
```
Soft: Entity
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?deleteType=SOFT'
```
Default: As initialized by application based on _atlas-application.properties_
```
curl -X DELETE -u admin:admin123 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
```
Hard: Relationship
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=HARD
```
Soft: Relationship
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade?deleteType=SOFT
```
Default: As initialized by application based on _atlas-application.properties_
```
CURL -X DELETE -u admin:admin123 http://localhost:21000/api/atlas/v2/relationship/guid/7a74072d-19eb-4aee-bdea-2eedb81bbade
```
Diffs (updated)
-----
intg/src/main/java/org/apache/atlas/store/DeleteType.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java 44689516e
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
repository/src/test/java/org/apache/atlas/repository/impexp/ExportImportTestBase.java 4b253ffb7
repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java 936586ba2
repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java 6d6432f74
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
Diff: https://reviews.apache.org/r/69305/diff/6/
Changes: https://reviews.apache.org/r/69305/diff/5-6/
Testing
-------
**Unit tests**
Additional unit tests.
**Functional tests**
- Via REST APIs. (See above.)
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
**Pre-commit**
https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/800/
Thanks,
Ashutosh Mestry
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/
-----------------------------------------------------------
(Updated Nov. 13, 2018, 6:01 a.m.)
Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include: Pre-commit build details.
Bugs: ATLAS-2774
https://issues.apache.org/jira/browse/ATLAS-2774
Repository: atlas
Description
-------
**Approach**
- New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
- _SoftDeleteHandler_: Existing implementation.
- _HardDeleteHandler_: Existing implementation.
- _DefaultHandler_ which is initialized via _atlas-application.properties_.
- Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
- Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
- Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
**CURL**
Hard
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
```
Soft
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
```
Default: As initialized by application based on _atlas-application.properties_
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
```
Diffs
-----
intg/src/main/java/org/apache/atlas/store/DeleteType.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
Diff: https://reviews.apache.org/r/69305/diff/4/
Testing (updated)
-------
**Unit tests**
Additional unit tests.
**Functional tests**
- Via REST APIs. (See above.)
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
**Pre-commit**
https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/799/
Thanks,
Ashutosh Mestry
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/
-----------------------------------------------------------
(Updated Nov. 13, 2018, 6 a.m.)
Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include: Addressed review comments.
Bugs: ATLAS-2774
https://issues.apache.org/jira/browse/ATLAS-2774
Repository: atlas
Description
-------
**Approach**
- New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
- _SoftDeleteHandler_: Existing implementation.
- _HardDeleteHandler_: Existing implementation.
- _DefaultHandler_ which is initialized via _atlas-application.properties_.
- Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
- Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
- Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
**CURL**
Hard
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
```
Soft
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
```
Default: As initialized by application based on _atlas-application.properties_
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
```
Diffs (updated)
-----
intg/src/main/java/org/apache/atlas/store/DeleteType.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
Diff: https://reviews.apache.org/r/69305/diff/4/
Changes: https://reviews.apache.org/r/69305/diff/3-4/
Testing
-------
**Unit tests**
Additional unit tests.
**Functional tests**
- Via REST APIs. (See above.)
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
Thanks,
Ashutosh Mestry
Re: Review Request 69305: Soft/Hard Delete: REST API with
Parameter-based Choice
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69305/
-----------------------------------------------------------
(Updated Nov. 13, 2018, 1:25 a.m.)
Review request for atlas, Kapildeo Nayak, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, and Sarath Subramanian.
Changes
-------
Updates include:
- Addressed review comments.
- Simplified approach.
Bugs: ATLAS-2774
https://issues.apache.org/jira/browse/ATLAS-2774
Repository: atlas
Description
-------
**Approach**
- New: _DeleteHandlerDelegate_. This is a decorator over _DeleteHandlerV1_. In its implementation it encapsulates:
- _SoftDeleteHandler_: Existing implementation.
- _HardDeleteHandler_: Existing implementation.
- _DefaultHandler_ which is initialized via _atlas-application.properties_.
- Modified: _EntityREST_ to accept additional parameter to specify if the delete is hard or soft.
- Modified: _AtlasEntityStoreV2_ to accept additional parameter. Existing APIs delegate their function to the new more generic method.
- Modified: _ConditionalOnAtlasProperty_ to be applied on field instead of class. This initializes the handler from _atlas-application.properties_.
**CURL**
Hard
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=true'
```
Soft
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d?hard=false'
```
Default: As initialized by application based on _atlas-application.properties_
```
curl -X DELETE 'http://localhost:21000/api/atlas/v2/entity/guid/abc8c380-2bfe-47aa-b405-5b79ea9a2a0d'
```
Diffs (updated)
-----
intg/src/main/java/org/apache/atlas/store/DeleteType.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java 750fa1775
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerDelegate.java PRE-CREATION
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java 0bcf0d6cb
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java 733369692
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java 21617dcc3
repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java 3393b82d8
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java 4fd28206c
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityTestBase.java ba0551050
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2Test.java cd1d72787
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java 00b29e6c8
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java 6739364ac
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityRESTDelete.java PRE-CREATION
Diff: https://reviews.apache.org/r/69305/diff/3/
Changes: https://reviews.apache.org/r/69305/diff/2-3/
Testing
-------
**Unit tests**
Additional unit tests.
**Functional tests**
- Via REST APIs. (See above.)
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1
- Tested with atlas.DeleteHandlerV1.impl=org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1
Thanks,
Ashutosh Mestry