bhabegger commented on code in PR #3078:
URL: https://github.com/apache/jackrabbit-oak/pull/3078#discussion_r3812970692
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/inventory/IndexDefinitionPrinter.java:
##########
@@ -81,4 +97,44 @@ public void setFilter(String filter) {
private JsonSerializer createSerializer(JsopBuilder json) {
return new JsonSerializer(json, filter, new Base64BlobSerializer());
}
+
+ /**
+ * Serialize a diff index node, inlining its {@code diff.json} payload as
JSON. All other file child nodes are
+ * rendered as base64 blobs, for backward compatibility.
+ */
+ private void serializeDiffIndex(JsopBuilder json, NodeState idxState) {
+ json.object();
+ JsonSerializer serializer = createSerializer(json);
+ // definition properties (mirror the default filter, which drops
:childOrder)
+ for (PropertyState p : idxState.getProperties()) {
+ if (":childOrder".equals(p.getName())) {
+ continue;
+ }
+ json.key(p.getName());
+ serializer.serialize(p);
+ }
+ // non-hidden child nodes other than diff.json, rendered normally
+ for (ChildNodeEntry child : idxState.getChildNodeEntries()) {
+ String childName = child.getName();
+ if (childName.startsWith(":") || "diff.json".equals(childName)) {
+ continue;
+ }
+ json.key(childName);
+ createSerializer(json).serialize(child.getNodeState());
Review Comment:
Is the serializer so stateful that we need to recreate it ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]