use of org.neo4j.helpers.collection.Visitor in project neo4j by neo4j.
the class BatchingMultipleIndexPopulatorTest method newStoreView.
@SuppressWarnings("unchecked")
private static IndexStoreView newStoreView(NodeUpdates... updates) {
IndexStoreView storeView = mock(IndexStoreView.class);
when(storeView.visitNodes(any(), any(), any(), any(), anyBoolean())).thenAnswer(invocation -> {
Object visitorArg = invocation.getArguments()[2];
Visitor<NodeUpdates, IndexPopulationFailedKernelException> visitor = (Visitor<NodeUpdates, IndexPopulationFailedKernelException>) visitorArg;
return new IndexEntryUpdateScan(updates, visitor);
});
return storeView;
}
use of org.neo4j.helpers.collection.Visitor in project neo4j by neo4j.
the class TestCrashWithRebuildSlow method getHighIds.
private static Map<IdType, Long> getHighIds(GraphDatabaseAPI db) {
final Map<IdType, Long> highIds = new HashMap<>();
NeoStores neoStores = db.getDependencyResolver().resolveDependency(RecordStorageEngine.class).testAccessNeoStores();
Visitor<CommonAbstractStore, RuntimeException> visitor = new Visitor<CommonAbstractStore, RuntimeException>() {
@Override
public boolean visit(CommonAbstractStore store) throws RuntimeException {
highIds.put(store.getIdType(), store.getHighId());
return true;
}
};
neoStores.visitStore(visitor);
return highIds;
}
Aggregations