diff --git a/block-storage/src/main/java/org/lucares/pdb/map/PersistentMapDiskNode.java b/block-storage/src/main/java/org/lucares/pdb/map/PersistentMapDiskNode.java index 7693b55..133e37a 100644 --- a/block-storage/src/main/java/org/lucares/pdb/map/PersistentMapDiskNode.java +++ b/block-storage/src/main/java/org/lucares/pdb/map/PersistentMapDiskNode.java @@ -21,11 +21,11 @@ import org.lucares.utils.byteencoder.VariableByteEncoder; *
* Node layout:
*
- * ◀─────── Prefix ──────▶ ◀───────────────── Suffix ──────────────────▶
+ * ──────── Prefix ──────▶ ◀───────────────── Suffix ───────────────────
* ┏━━━┳━━━━━┳━━━━━┳━━━━━┳━━━┳╸╺╸╺╸╺╸╺┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
* ┃ 6 ┃ 5,6 ┃ 3,6 ┃ 3,2 ┃ ∅ ┃ ┃"ba"->"147"┃"foobar"->"467"┃"foobaz"->"value"┃
* ┗━━━┻━━━━━┻━━━━━┻━━━━━┻━━━┻╸╺╸╺╸╺╸╺┻━━━━━━━━━━━┻━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┛
- * │ │ │ │ │ │ │ └▶ null byte that serves as a separator for the prefix.
+ * │ │ │ │ │ │ │ └▶ null byte that serves as a terminator for the prefix.
* │ │ │ │ │ │ └▶ size of the third last key ("ba" in this example)
* │ │ │ │ │ └▶ size of the third last value ("147" in this example)
* │ │ │ │ └▶ size of the second last key ("foobar" in this example)
@@ -202,13 +202,13 @@ public class PersistentMapDiskNode {
+ String.join("\n", entries.values().stream().map(NodeEntry::toString).collect(Collectors.toList()));
}
- public String toString(Function keyDecoder, Function valueDecoder) {
- StringBuilder result = new StringBuilder();
+ public String toString(final Function keyDecoder, final Function valueDecoder) {
+ final StringBuilder result = new StringBuilder();
result.append("@");
result.append(nodeOffset);
result.append(": ");
- for (NodeEntry e : entries.values()) {
- String s = e.toString(keyDecoder, valueDecoder);
+ for (final NodeEntry e : entries.values()) {
+ final String s = e.toString(keyDecoder, valueDecoder);
result.append("\n");
result.append(s);
}