use of org.neo4j.kernel.api.impl.schema.verification.SimpleUniquenessVerifier in project neo4j by neo4j.
the class LuceneSchemaIndex method createSimpleUniquenessVerifier.
private UniquenessVerifier createSimpleUniquenessVerifier(List<AbstractIndexPartition> partitions) throws IOException {
AbstractIndexPartition singlePartition = getFirstPartition(partitions);
PartitionSearcher partitionSearcher = singlePartition.acquireSearcher();
return new SimpleUniquenessVerifier(partitionSearcher);
}
use of org.neo4j.kernel.api.impl.schema.verification.SimpleUniquenessVerifier in project neo4j by neo4j.
the class SimpleUniquenessVerifierTest method partitionSearcherIsClosed.
@Test
public void partitionSearcherIsClosed() throws IOException {
PartitionSearcher partitionSearcher = mock(PartitionSearcher.class);
SimpleUniquenessVerifier verifier = new SimpleUniquenessVerifier(partitionSearcher);
verifier.close();
verify(partitionSearcher).close();
}
use of org.neo4j.kernel.api.impl.schema.verification.SimpleUniquenessVerifier in project neo4j by neo4j.
the class SimpleUniquenessVerifierTest method runUniquenessVerification.
private void runUniquenessVerification(PropertyAccessor propertyAccessor, IndexSearcher indexSearcher) throws IOException, IndexEntryConflictException {
try {
PartitionSearcher partitionSearcher = mock(PartitionSearcher.class);
when(partitionSearcher.getIndexSearcher()).thenReturn(indexSearcher);
try (UniquenessVerifier verifier = new SimpleUniquenessVerifier(partitionSearcher)) {
verifier.verify(propertyAccessor, PROPERTY_KEY_IDS);
}
} finally {
searcherManager.release(indexSearcher);
}
}
Aggregations