Skip to content

Commit

Permalink
Merge branch 'beta' into dev/janusupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshi0301 committed Dec 11, 2024
2 parents 18184d7 + 9db293a commit 9e77b09
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public UniqueQNAttributeMigrationService(EntityGraphRetriever entityRetriever, S
public void migrateQN() throws Exception {
try {
int count = 0;
int totalUpdatedCount = 0;
for (String entityGuid : entityGuids) {
AtlasVertex entityVertex = entityRetriever.getEntityVertex(entityGuid);

Expand All @@ -42,19 +43,25 @@ public void migrateQN() throws Exception {
boolean isCommitRequired = migrateuniqueQnAttr(entityVertex);
if (isCommitRequired){
count++;
totalUpdatedCount++;
}
else {
LOG.info("No changes to commit for entity: {} as no migration needed", entityGuid);
}

if (count == 20) {
LOG.info("Committing batch of 20 entities...");
commitChanges();
count = 0;
}
}

if (count > 0) {
LOG.info("Total Vertex updated: {}", count);
LOG.info("Committing remaining {} entities...", count);
commitChanges();
}
else {
LOG.info("No changes to commit for entities as no migration needed");
}

LOG.info("Total Vertex updated: {}", totalUpdatedCount);

} catch (Exception e) {
LOG.error("Error while migration unique qualifiedName attribute for entities: {}", entityGuids, e);
Expand Down

0 comments on commit 9e77b09

Please sign in to comment.