adding the blocksize to the metadata section

This commit is contained in:
2020-10-10 17:03:55 +02:00
parent f9ed27f03b
commit 277dba4c04
2 changed files with 69 additions and 32 deletions

View File

@@ -88,7 +88,7 @@ public class PersistentMapTest {
final String actualValue = map.getValue(entry.getKey());
if (!Objects.equals(actualValue, entry.getValue())) {
map.print();
map.print(true);
}
Assertions.assertEquals(entry.getValue(), actualValue,
@@ -149,7 +149,7 @@ public class PersistentMapTest {
final Long actualValue = map.getValue(entry.getKey());
if (!Objects.equals(actualValue, entry.getValue())) {
map.print();
map.print(true);
}
Assertions.assertEquals(entry.getValue(), actualValue,
@@ -166,8 +166,8 @@ public class PersistentMapTest {
map.visitNodeEntriesPreOrder(
(node, parentNode, nodeEntry, depth) -> counter.addAndGet(nodeEntry.isInnerNode() ? 1 : 0));
Assertions.assertEquals(4, counter.get(),
"number of nodes should be small. Any number larger than 4 indicates, "
Assertions.assertEquals(3, counter.get(),
"number of nodes should be small. Any number larger than 3 indicates, "
+ "that new inner nodes are created even though the existing inner "
+ "nodes could hold the values");
@@ -202,7 +202,7 @@ public class PersistentMapTest {
insertedValues.put(key, value);
// map.print();
// map.print(false);
final boolean failEarly = false;
if (failEarly) {
@@ -210,7 +210,7 @@ public class PersistentMapTest {
final Empty actualValue = map.getValue(entry.getKey());
if (!Objects.equals(actualValue, entry.getValue())) {
map.print();
map.print(false);
}
Assertions.assertEquals(entry.getValue(), actualValue,
@@ -222,13 +222,13 @@ public class PersistentMapTest {
try (final PersistentMap<Long, Empty> map = new PersistentMap<>(file, dataDirectory, PersistentMap.LONG_CODER,
PersistentMap.EMPTY_ENCODER)) {
map.print();
// map.print(false);
final AtomicInteger counter = new AtomicInteger();
map.visitNodeEntriesPreOrder(
(node, parentNode, nodeEntry, depth) -> counter.addAndGet(nodeEntry.isInnerNode() ? 1 : 0));
Assertions.assertEquals(4, counter.get(),
"number of nodes should be small. Any number larger than 4 indicates, "
Assertions.assertEquals(3, counter.get(),
"number of nodes should be small. Any number larger than 3 indicates, "
+ "that new inner nodes are created even though the existing inner "
+ "nodes could hold the values");
@@ -410,7 +410,7 @@ public class PersistentMapTest {
final Long actualValue = map.getValue(entry.getKey());
if (!Objects.equals(actualValue, entry.getValue())) {
map.print();
map.print(true);
}
Assertions.assertEquals(entry.getValue(), actualValue,