use of org.apache.commons.lang3.mutable.MutableBoolean in project neo4j by neo4j.
the class GBPTreeConsistencyCheckerTestBase method assertReportAnyStructuralInconsistency.
private static <KEY, VALUE> void assertReportAnyStructuralInconsistency(GBPTree<KEY, VALUE> index) throws IOException {
MutableBoolean called = new MutableBoolean();
index.consistencyCheck(new GBPTreeConsistencyCheckVisitor.Adaptor<>() {
@Override
public void rightmostNodeHasRightSibling(long rightSiblingPointer, long rightmostNode, Path file) {
called.setTrue();
}
@Override
public void siblingsDontPointToEachOther(long leftNode, long leftNodeGeneration, long leftRightSiblingPointerGeneration, long leftRightSiblingPointer, long rightLeftSiblingPointer, long rightLeftSiblingPointerGeneration, long rightNode, long rightNodeGeneration, Path file) {
called.setTrue();
}
@Override
public void keysLocatedInWrongNode(KeyRange<KEY> range, KEY key, int pos, int keyCount, long pageId, Path file) {
called.setTrue();
}
@Override
public void pageIdSeenMultipleTimes(long pageId, Path file) {
called.setTrue();
}
@Override
public void childNodeFoundAmongParentNodes(KeyRange<KEY> superRange, int level, long pageId, Path file) {
called.setTrue();
}
}, NULL);
assertCalled(called);
}
use of org.apache.commons.lang3.mutable.MutableBoolean in project neo4j by neo4j.
the class GBPTreeConsistencyCheckerTestBase method assertReportDirtyOnStartup.
private static <KEY, VALUE> void assertReportDirtyOnStartup(GBPTree<KEY, VALUE> index) throws IOException {
MutableBoolean called = new MutableBoolean();
index.consistencyCheck(new GBPTreeConsistencyCheckVisitor.Adaptor<>() {
@Override
public void dirtyOnStartup(Path file) {
called.setTrue();
}
}, NULL);
assertCalled(called);
}
use of org.apache.commons.lang3.mutable.MutableBoolean in project neo4j by neo4j.
the class GBPTreeConsistencyCheckerTestBase method assertReportUnknownTreeNodeType.
private static <KEY, VALUE> void assertReportUnknownTreeNodeType(GBPTree<KEY, VALUE> index, long targetNode) throws IOException {
MutableBoolean called = new MutableBoolean();
index.consistencyCheck(new GBPTreeConsistencyCheckVisitor.Adaptor<>() {
@Override
public void unknownTreeNodeType(long pageId, byte treeNodeType, Path file) {
called.setTrue();
assertEquals(targetNode, pageId);
}
}, NULL);
assertCalled(called);
}
use of org.apache.commons.lang3.mutable.MutableBoolean in project neo4j by neo4j.
the class GBPTreeConsistencyCheckerTestBase method assertReportSpaceAreasNotSummingToTotalSpace.
private static <KEY, VALUE> void assertReportSpaceAreasNotSummingToTotalSpace(GBPTree<KEY, VALUE> index, long targetNode) throws IOException {
MutableBoolean called = new MutableBoolean();
index.consistencyCheck(new GBPTreeConsistencyCheckVisitor.Adaptor<>() {
@Override
public void nodeMetaInconsistency(long pageId, String message, Path file) {
called.setTrue();
assertEquals(targetNode, pageId);
assertThat(message).contains("Space areas did not sum to total space");
}
}, NULL);
assertCalled(called);
}
use of org.apache.commons.lang3.mutable.MutableBoolean in project neo4j by neo4j.
the class GBPTreeConsistencyCheckerTestBase method assertReportKeysLocatedInWrongNode.
private static <KEY, VALUE> void assertReportKeysLocatedInWrongNode(GBPTree<KEY, VALUE> index, long targetNode) throws IOException {
Set<Long> allNodesWithKeysLocatedInWrongNode = new HashSet<>();
MutableBoolean called = new MutableBoolean();
index.consistencyCheck(new GBPTreeConsistencyCheckVisitor.Adaptor<>() {
@Override
public void keysLocatedInWrongNode(KeyRange<KEY> range, KEY key, int pos, int keyCount, long pageId, Path file) {
called.setTrue();
allNodesWithKeysLocatedInWrongNode.add(pageId);
}
}, NULL);
assertCalled(called);
assertTrue(allNodesWithKeysLocatedInWrongNode.contains(targetNode));
}
Aggregations