Re: Review Request 72358: ATLAS-3730: In case Hard delete and Purge of an Entity we should make the entity status as purged instead of deleted

2020-04-13 Thread Sarath Subramanian

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72358/#review220302
---


Ship it!




Ship It!

- Sarath Subramanian


On April 13, 2020, 5:35 p.m., Sidharth Mishra wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72358/
> ---
> 
> (Updated April 13, 2020, 5:35 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, and Sarath 
> Subramanian.
> 
> 
> Bugs: ATLAS-3730
> https://issues.apache.org/jira/browse/ATLAS-3730
> 
> 
> Repository: atlas
> 
> 
> Description
> ---
> 
> ATLAS-3730: Changed code to make entity status to PURGED at classification in 
> case of Hard delete or Purge of an entity
> 
> 
> Diffs
> -
> 
>   intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java 
> c534fd06f 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
>  7b438600d 
> 
> 
> Diff: https://reviews.apache.org/r/72358/diff/1/
> 
> 
> Testing
> ---
> 
> 1. Before Test when we do get we can see the classification contains entity 
> status as DELETED. 
> curl -u admin:admin123 --location --request GET 
> 'http://sid-ycloud-atlas1-1.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/v2/entity/guid/b7d5d07c-fbaf-4a10-9c2e-c360d4ac0828?minExtInfo=true&_=1586810974769'
> 
> 
> "classifications": [
> {
> "typeName": "TEST_TAG_2",
> "entityGuid": "b7d5d07c-fbaf-4a10-9c2e-c360d4ac0828",
> "entityStatus": "ACTIVE",
> "propagate": true,
> "validityPeriods": [],
> "removePropagationsOnEntityDelete": false
> },
> {
> "typeName": "TEST_TAG_1",
> "entityGuid": "7d5dfc2d-bcb9-429a-b241-a34705777b6b",
> "entityStatus": "DELETED",
> "propagate": true,
> "validityPeriods": [],
> "removePropagationsOnEntityDelete": false
> },
> {
> "typeName": "TEST_TAG_1",
> "entityGuid": "a2d1cad9-d2a1-4fe4-8570-2e58e16877ca",
> "entityStatus": "ACTIVE",
> "propagate": true,
> "validityPeriods": [],
> "removePropagationsOnEntityDelete": false
> }
> ]
> 2. Purge the entity:
> curl -u admin:admin123 --location --request DELETE 
> 'http://sid-ycloud-atlas1-1.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/admin/purge/'
>  \
> --header 'Content-Type: application/json' \
> --data-raw ' ["7d5dfc2d-bcb9-429a-b241-a34705777b6b"]'
> 
> 3. After purge of entity - 7d5dfc2d-bcb9-429a-b241-a34705777b6b we can see 
> the entity state changed to PURGED.
> 
> curl -u admin:admin123 --location --request GET 
> 'http://sid-ycloud-atlas1-1.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/v2/entity/guid/b7d5d07c-fbaf-4a10-9c2e-c360d4ac0828?minExtInfo=true&_=1586810974769'
> 
> "classifications": [
> {
> "typeName": "TEST_TAG_2",
> "entityGuid": "b7d5d07c-fbaf-4a10-9c2e-c360d4ac0828",
> "entityStatus": "ACTIVE",
> "propagate": true,
> "validityPeriods": [],
> "removePropagationsOnEntityDelete": false
> },
> {
> "typeName": "TEST_TAG_1",
> "entityGuid": "7d5dfc2d-bcb9-429a-b241-a34705777b6b",
> "entityStatus": "PURGED",
> "propagate": true,
> "validityPeriods": [],
> "removePropagationsOnEntityDelete": false
> },
> {
> "typeName": "TEST_TAG_1",
> "entityGuid": "a2d1cad9-d2a1-4fe4-8570-2e58e16877ca",
> "entityStatus": "ACTIVE",
> "propagate": true,
> "validityPeriods": [],
> "removePropagationsOnEntityDelete": false
> }
> ]
> 
> 
> Thanks,
> 
> Sidharth Mishra
> 
>



Review Request 72358: ATLAS-3730: In case Hard delete and Purge of an Entity we should make the entity status as purged instead of deleted

2020-04-13 Thread Sidharth Mishra

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72358/
---

Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, and Sarath 
Subramanian.


Bugs: ATLAS-3730
https://issues.apache.org/jira/browse/ATLAS-3730


Repository: atlas


Description
---

ATLAS-3730: Changed code to make entity status to PURGED at classification in 
case of Hard delete or Purge of an entity


Diffs
-

  intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java c534fd06f 
  
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
 7b438600d 


Diff: https://reviews.apache.org/r/72358/diff/1/


Testing
---

1. Before Test when we do get we can see the classification contains entity 
status as DELETED. 
curl -u admin:admin123 --location --request GET 
'http://sid-ycloud-atlas1-1.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/v2/entity/guid/b7d5d07c-fbaf-4a10-9c2e-c360d4ac0828?minExtInfo=true&_=1586810974769'


"classifications": [
{
"typeName": "TEST_TAG_2",
"entityGuid": "b7d5d07c-fbaf-4a10-9c2e-c360d4ac0828",
"entityStatus": "ACTIVE",
"propagate": true,
"validityPeriods": [],
"removePropagationsOnEntityDelete": false
},
{
"typeName": "TEST_TAG_1",
"entityGuid": "7d5dfc2d-bcb9-429a-b241-a34705777b6b",
"entityStatus": "DELETED",
"propagate": true,
"validityPeriods": [],
"removePropagationsOnEntityDelete": false
},
{
"typeName": "TEST_TAG_1",
"entityGuid": "a2d1cad9-d2a1-4fe4-8570-2e58e16877ca",
"entityStatus": "ACTIVE",
"propagate": true,
"validityPeriods": [],
"removePropagationsOnEntityDelete": false
}
]
2. Purge the entity:
curl -u admin:admin123 --location --request DELETE 
'http://sid-ycloud-atlas1-1.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/admin/purge/'
 \
--header 'Content-Type: application/json' \
--data-raw ' ["7d5dfc2d-bcb9-429a-b241-a34705777b6b"]'

3. After purge of entity - 7d5dfc2d-bcb9-429a-b241-a34705777b6b we can see the 
entity state changed to PURGED.

curl -u admin:admin123 --location --request GET 
'http://sid-ycloud-atlas1-1.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/v2/entity/guid/b7d5d07c-fbaf-4a10-9c2e-c360d4ac0828?minExtInfo=true&_=1586810974769'

"classifications": [
{
"typeName": "TEST_TAG_2",
"entityGuid": "b7d5d07c-fbaf-4a10-9c2e-c360d4ac0828",
"entityStatus": "ACTIVE",
"propagate": true,
"validityPeriods": [],
"removePropagationsOnEntityDelete": false
},
{
"typeName": "TEST_TAG_1",
"entityGuid": "7d5dfc2d-bcb9-429a-b241-a34705777b6b",
"entityStatus": "PURGED",
"propagate": true,
"validityPeriods": [],
"removePropagationsOnEntityDelete": false
},
{
"typeName": "TEST_TAG_1",
"entityGuid": "a2d1cad9-d2a1-4fe4-8570-2e58e16877ca",
"entityStatus": "ACTIVE",
"propagate": true,
"validityPeriods": [],
"removePropagationsOnEntityDelete": false
}
]


Thanks,

Sidharth Mishra