Skip to content

Commit

Permalink
use concurrent hashmap
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshi0301 committed Jan 30, 2024
1 parent b4fe22f commit d6bd3cf
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import static org.apache.atlas.model.patches.AtlasPatch.PatchStatus.FAILED;
import static org.apache.atlas.model.patches.AtlasPatch.PatchStatus.UNKNOWN;
Expand All @@ -66,9 +67,9 @@ public AtlasPatchRegistry(AtlasGraph graph) {

LOG.info("AtlasPatchRegistry: found {} patches", patchNameStatusMap.size());

for (Map.Entry<String, PatchStatus> entry : patchNameStatusMap.entrySet()) {
LOG.info("AtlasPatchRegistry: patchId={}, status={}", entry.getKey(), entry.getValue());
}
// for (Map.Entry<String, PatchStatus> entry : patchNameStatusMap.entrySet()) {
// LOG.info("AtlasPatchRegistry: patchId={}, status={}", entry.getKey(), entry.getValue());
// }
}

public boolean isApplicable(String incomingId, String patchFile, int index) {
Expand Down Expand Up @@ -146,13 +147,12 @@ private void createOrUpdatePatchVertex(AtlasGraph graph, String patchId, String
setEncodedProperty(patchVertex, MODIFIED_BY_KEY, AtlasTypeDefGraphStoreV2.getCurrentUser());
} finally {
graph.commit();

patchNameStatusMap.put(patchId, patchStatus);
}
}

private static Map<String, PatchStatus> getPatchNameStatusForAllRegistered(AtlasGraph graph) {
Map<String, PatchStatus> ret = new HashMap<>();
Map<String, PatchStatus> ret = new ConcurrentHashMap<>();
AtlasPatches patches = getAllPatches(graph);

for (AtlasPatch patch : patches.getPatches()) {
Expand Down

0 comments on commit d6bd3cf

Please sign in to comment.