Skip to content

Commit

Permalink
#4682 PlanB State Store
Browse files Browse the repository at this point in the history
  • Loading branch information
stroomdev66 committed Jan 22, 2025
1 parent fedd401 commit 400095c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ public ShardWriter(final PlanBDocCache planBDocCache,

public Optional<PlanBDoc> getDoc(final String mapName, final Consumer<String> errorConsumer) {
if (NullSafe.isBlankString(mapName)) {
errorConsumer.accept("Null map key");
errorConsumer.accept("Null map name");
return Optional.empty();
}

return stateDocMap.computeIfAbsent(mapName, k -> {
PlanBDoc doc = null;

if (!PlanBNameValidator.isValidName(k)) {
errorConsumer.accept("Bad map key: " + k);
errorConsumer.accept("Bad map name: " + k);
} else {
try {
doc = planBDocCache.get(k);
if (doc == null) {
errorConsumer.accept("Unable to find state doc for map key: " + k);
errorConsumer.accept("Unable to find state doc for map name: " + k);
}
} catch (final RuntimeException e) {
errorConsumer.accept(e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,29 +422,9 @@ public void endElement(final String uri, final String localName, final String qN
fastInfosetEndElement(localName, newUri, newQName);
} else {
if (MAP_ELEMENT.equalsIgnoreCase(localName)) {
// capture the key of the map that the subsequent values will belong to. A ref
// capture the name of the map that the subsequent values will belong to. A ref
// stream can contain data for multiple maps
mapName = contentBuffer.toString().toLowerCase(Locale.ROOT);
// if (!NullSafe.isBlankString(mapName)) {
// stateDoc = stateDocMap.computeIfAbsent(mapName, k -> {
// PlanBDoc doc = null;
//
// if (!PlanBNameValidator.isValidName(k)) {
// error("Bad map key: " + k);
// } else {
// try {
// doc = stateDocCache.get(k);
// if (doc == null) {
// error("Unable to find state doc for map key: " + k);
// }
// } catch (final RuntimeException e) {
// error(e);
// }
// }
//
// return Optional.ofNullable(doc);
// }).orElse(null);
// }

} else if (KEY_ELEMENT.equalsIgnoreCase(localName)) {
// the key for the KV pair
Expand Down

0 comments on commit 400095c

Please sign in to comment.