use of org.neo4j.kernel.impl.store.SchemaStorage in project neo4j by neo4j.
the class IndexStatisticsTest method shouldRemoveIndexStatisticsAfterIndexIsDeleted.
@Test
public void shouldRemoveIndexStatisticsAfterIndexIsDeleted() throws KernelException {
// given
createSomePersons();
NewIndexDescriptor index = awaitOnline(createIndex("Person", "name"));
SchemaStorage storage = new SchemaStorage(neoStores().getSchemaStore());
long indexId = storage.indexGetForSchema(index).getId();
// when
dropIndex(index);
// then
try {
indexSelectivity(index);
fail("Expected IndexNotFoundKernelException to be thrown");
} catch (IndexNotFoundKernelException e) {
DoubleLongRegister actual = getTracker().indexSample(indexId, Registers.newDoubleLongRegister());
assertDoubleLongEquals(0L, 0L, actual);
}
// and then index size and index updates are zero on disk
DoubleLongRegister actual = getTracker().indexUpdatesAndSize(indexId, Registers.newDoubleLongRegister());
assertDoubleLongEquals(0L, 0L, actual);
}
Aggregations