Search in sources :

Example 1 with TokenIndexAccessor

use of org.neo4j.kernel.impl.index.schema.TokenIndexAccessor in project neo4j by neo4j.

the class BatchInsertTokenIndexesTest method tokenIndexAccessor.

private TokenIndexAccessor tokenIndexAccessor(EntityType entityType) {
    var context = DatabaseIndexContext.builder(pageCache, fs, databaseLayout.getDatabaseName()).build();
    var id = forSchema(forAnyEntityTokens(entityType), TokenIndexProvider.DESCRIPTOR).withName("index").materialise(0);
    Path path = entityType == EntityType.NODE ? databaseLayout.labelScanStore() : databaseLayout.relationshipTypeScanStore();
    return new TokenIndexAccessor(context, databaseLayout, new IndexFiles.SingleFile(fs, path), configuration(), id, RecoveryCleanupWorkCollector.immediate());
}
Also used : Path(java.nio.file.Path) IndexFiles(org.neo4j.kernel.impl.index.schema.IndexFiles) TokenIndexAccessor(org.neo4j.kernel.impl.index.schema.TokenIndexAccessor)

Aggregations

Path (java.nio.file.Path)1 IndexFiles (org.neo4j.kernel.impl.index.schema.IndexFiles)1 TokenIndexAccessor (org.neo4j.kernel.impl.index.schema.TokenIndexAccessor)1