Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Mar 13, 2024
1 parent 90dcb1e commit 7a82cd5
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public FileBackedJsonIndexStorage<Integer, ConcurrentHashMap<String, VariableVar
Map<String, VariableVariantMasks> masks1 = variantMaskStorage1.get(key);
Map<String, VariableVariantMasks> masks2 = variantMaskStorage2.get(key);
if (masks2 == null) {
log.info("Key " + key + " not found in dataset 2");
masks2 = Map.of();
}

Expand All @@ -247,20 +246,27 @@ public FileBackedJsonIndexStorage<Integer, ConcurrentHashMap<String, VariableVar
mergedMasks.put(entry.getKey(), new VariableVariantMasks(variantStore1.getPatientIds().length).append(entry.getValue()));
}
}
merged.put(key, mergedMasks);
if (merged.keys().contains(key)) {
log.warn("Merged already contains key: " + key);
} else {
merged.put(key, mergedMasks);
}
});

variantMaskStorage2.keys().forEach(key -> {
if (variantMaskStorage1.get(key) == null) {
log.info("Key " + key + " not found in dataset 1");
ConcurrentHashMap<String, VariableVariantMasks> mergedMasks = new ConcurrentHashMap<>();
Map<String, VariableVariantMasks> masks2 = variantMaskStorage2.get(key);
for (Map.Entry<String, VariableVariantMasks> entry : masks2.entrySet()) {
if (!mergedMasks.containsKey(entry.getKey())) {
mergedMasks.put(entry.getKey(), new VariableVariantMasks(variantStore1.getPatientIds().length).append(entry.getValue()));
}
}
merged.put(key, mergedMasks);
if (merged.keys().contains(key)) {
log.warn("Second loop: merged already contains key: " + key);
} else {
merged.put(key, mergedMasks);
}
}
});
return merged;
Expand Down

0 comments on commit 7a82cd5

Please sign in to comment.