use of org.neo4j.kernel.api.index.ValueIndexReader in project neo4j by neo4j.
the class DeferredConflictCheckingIndexUpdaterTest method shouldThrowOnIndexEntryConflict.
@Test
void shouldThrowOnIndexEntryConflict() throws Exception {
// given
IndexUpdater actual = mock(IndexUpdater.class);
ValueIndexReader reader = mock(ValueIndexReader.class);
doAnswer(new NodeIdsIndexReaderQueryAnswer(descriptor, 101, 202)).when(reader).query(any(), any(), any(), any());
DeferredConflictCheckingIndexUpdater updater = new DeferredConflictCheckingIndexUpdater(actual, () -> reader, descriptor, NULL);
// when
updater.process(add(0, descriptor, tuple(10, 11)));
var e = assertThrows(IndexEntryConflictException.class, updater::close);
assertThat(e.getMessage()).contains("101");
assertThat(e.getMessage()).contains("202");
}
use of org.neo4j.kernel.api.index.ValueIndexReader in project neo4j by neo4j.
the class LuceneIndexProvider method getMinimalIndexAccessor.
@Override
public MinimalIndexAccessor getMinimalIndexAccessor(IndexDescriptor descriptor) {
PartitionedIndexStorage indexStorage = indexStorageFactory.indexStorageOf(descriptor.getId());
DroppableIndex<ValueIndexReader> index = new DroppableIndex<>(new DroppableLuceneIndex<>(indexStorage, new ReadOnlyIndexPartitionFactory(), descriptor));
return new LuceneMinimalIndexAccessor<>(descriptor, index, true);
}
Aggregations