@Override public Iterable<IndexDefinition> getIndexes() { KernelTransaction transaction = transactionSupplier.get(); SchemaRead schemaRead = transaction.schemaRead(); try ( Statement ignore = transaction.acquireStatement() ) { List<IndexDefinition> definitions = new ArrayList<>(); Iterator<IndexReference> indexes = schemaRead.indexesGetAll(); addDefinitions( definitions, transaction.tokenRead(), IndexReference.sortByType( indexes ) ); return definitions; } }
@Override public Iterable<IndexDefinition> getIndexes( final Label label ) { KernelTransaction transaction = transactionSupplier.get(); try ( Statement ignore = transaction.acquireStatement() ) { TokenRead tokenRead = transaction.tokenRead(); SchemaRead schemaRead = transaction.schemaRead(); List<IndexDefinition> definitions = new ArrayList<>(); int labelId = tokenRead.nodeLabel( label.name() ); if ( labelId == TokenRead.NO_TOKEN ) { return emptyList(); } Iterator<IndexReference> indexes = schemaRead.indexesGetForLabel( labelId ); addDefinitions( definitions, tokenRead, IndexReference.sortByType( indexes ) ); return definitions; } }
private void showIndices( DbStructureVisitor visitor, KernelTransaction ktx, TokenNameLookup nameLookup ) throws IndexNotFoundKernelException { SchemaRead schemaRead = ktx.schemaRead(); for ( IndexReference reference : loop( sortByType( schemaRead.indexesGetAll() ) ) ) { String userDescription = reference.schema().userDescription( nameLookup ); double uniqueValuesPercentage = schemaRead.indexUniqueValuesSelectivity( reference ); long size = schemaRead.indexSize( reference ); visitor.visitIndex( (IndexDescriptor) reference, userDescription, uniqueValuesPercentage, size ); } }
@Override public Iterable<IndexDefinition> getIndexes() { KernelTransaction transaction = transactionSupplier.get(); SchemaRead schemaRead = transaction.schemaRead(); try ( Statement ignore = transaction.acquireStatement() ) { List<IndexDefinition> definitions = new ArrayList<>(); Iterator<IndexReference> indexes = schemaRead.indexesGetAll(); addDefinitions( definitions, transaction.tokenRead(), IndexReference.sortByType( indexes ) ); return definitions; } }
@Override public Iterable<IndexDefinition> getIndexes( final Label label ) { KernelTransaction transaction = transactionSupplier.get(); try ( Statement ignore = transaction.acquireStatement() ) { TokenRead tokenRead = transaction.tokenRead(); SchemaRead schemaRead = transaction.schemaRead(); List<IndexDefinition> definitions = new ArrayList<>(); int labelId = tokenRead.nodeLabel( label.name() ); if ( labelId == TokenRead.NO_TOKEN ) { return emptyList(); } Iterator<IndexReference> indexes = schemaRead.indexesGetForLabel( labelId ); addDefinitions( definitions, tokenRead, IndexReference.sortByType( indexes ) ); return definitions; } }
private void showIndices( DbStructureVisitor visitor, KernelTransaction ktx, TokenNameLookup nameLookup ) throws IndexNotFoundKernelException { SchemaRead schemaRead = ktx.schemaRead(); for ( IndexReference reference : loop( sortByType( schemaRead.indexesGetAll() ) ) ) { String userDescription = reference.schema().userDescription( nameLookup ); double uniqueValuesPercentage = schemaRead.indexUniqueValuesSelectivity( reference ); long size = schemaRead.indexSize( reference ); visitor.visitIndex( (IndexDescriptor) reference, userDescription, uniqueValuesPercentage, size ); } }