This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 67a7367 ATLAS-3562: Hive metadata has the same classification
multiple times
67a7367 is described below
commit 67a7367a786b93e596ab64b6036b6be21a11b459
Author: Mandar Ambawane <[email protected]>
AuthorDate: Wed Dec 18 12:44:29 2019 +0530
ATLAS-3562: Hive metadata has the same classification multiple times
Signed-off-by: Sarath Subramanian <[email protected]>
---
.../atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
index ea5e6ab..3fbcecb 100644
---
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
+++
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
@@ -594,6 +594,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
throw new AtlasBaseException(AtlasErrorCode.INVALID_PARAMETERS,
"classifications(s) not specified");
}
+ GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid);
+
AtlasVertex entityVertex = AtlasGraphUtilsV2.findByGuid(guid);
if (entityVertex == null) {
@@ -611,7 +613,6 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
context.cacheEntity(guid, entityVertex,
typeRegistry.getEntityTypeByName(entityHeader.getTypeName()));
- GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid);
for (AtlasClassification classification : classifications) {
validateAndNormalize(classification);
@@ -638,6 +639,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
throw new AtlasBaseException(AtlasErrorCode.INVALID_PARAMETERS,
"classifications(s) not specified");
}
+ GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid);
+
AtlasVertex entityVertex = AtlasGraphUtilsV2.findByGuid(guid);
if (entityVertex == null) {
@@ -654,7 +657,6 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
context.cacheEntity(guid, entityVertex,
typeRegistry.getEntityTypeByName(entityHeader.getTypeName()));
- GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid);
for (AtlasClassification classification : classifications) {
validateAndNormalize(classification);
@@ -679,6 +681,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
EntityMutationContext context = new EntityMutationContext();
+ GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guids);
+
for (String guid : guids) {
AtlasVertex entityVertex = AtlasGraphUtilsV2.findByGuid(guid);
@@ -694,7 +698,6 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
context.cacheEntity(guid, entityVertex,
typeRegistry.getEntityTypeByName(entityHeader.getTypeName()));
}
- GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guids);
validateAndNormalize(classification);
@@ -723,6 +726,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
throw new AtlasBaseException(AtlasErrorCode.INVALID_PARAMETERS,
"classifications not specified");
}
+ GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid);
+
AtlasEntityHeader entityHeader =
entityRetriever.toAtlasEntityHeaderWithClassifications(guid);
// verify authorization only for removal of directly associated
classification and not propagated one.
@@ -736,7 +741,6 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
LOG.debug("Deleting classification={} from entity={}",
classificationName, guid);
}
- GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid);
entityGraphMapper.deleteClassification(guid, classificationName,
associatedEntityGuid);
}