Skip to content

Commit

Permalink
Merge pull request #3634 from atlanhq/DG-1851-beta-helper
Browse files Browse the repository at this point in the history
DG-1851 Fixed the re-locking for better concurrency and consistency #2
  • Loading branch information
hr2904 authored Oct 12, 2024
2 parents 0169439 + f7015e4 commit 4960a39
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3180,19 +3180,19 @@ public void cleanUpClassificationPropagation(String classificationName, int batc
LOG.info("Impacted GUIDs in this batch: {}", impactedGuids.size());
for (AtlasVertex vertex : entityVertices) {
List<AtlasClassification> deletedClassifications = new ArrayList<>();
try {
GraphTransactionInterceptor.lockObjectAndReleasePostCommit(getGuid(vertex));
} catch (AtlasBaseException e) {
LOG.error("Error in getting GUID for vertex : {}", vertex.getIdForDisplay());
e.printStackTrace();
}
List<AtlasEdge> classificationEdges = GraphHelper.getClassificationEdges(vertex, null, classificationName);
LOG.info("Found {} classification edges for vertex {}", classificationEdges.size(), GraphHelper.getGuid(vertex));
classificationEdgeCount += classificationEdges.size();
int batchSize = CHUNK_SIZE;
for (int i = 0; i < classificationEdges.size(); i += batchSize) {
int end = Math.min(i + batchSize, classificationEdges.size());
List<AtlasEdge> batch = classificationEdges.subList(i, end);
try {
GraphTransactionInterceptor.lockObjectAndReleasePostCommit(getGuid(vertex));
} catch (AtlasBaseException e) {
LOG.error("Error in getting GUID for vertex : {}", vertex.getIdForDisplay());
e.printStackTrace();
}
for (AtlasEdge edge : batch) {
try {
AtlasClassification classification = entityRetriever.toAtlasClassification(edge.getInVertex());
Expand Down

0 comments on commit 4960a39

Please sign in to comment.