IndexRetriever extends AbstractRetriever { void retrieveIndexes(final NamedObjectList<MutableTable> allTables) throws SQLException { requireNonNull(allTables, "No tables provided"); switch (getRetrieverConnection().get(indexesRetrievalStrategy)) { case data_dictionary_all: LOGGER.log(Level.INFO, "Retrieving indexes, using fast data dictionary retrieval"); retrieveIndexesFromDataDictionary(allTables); break; case metadata: LOGGER.log(Level.INFO, "Retrieving indexes"); retrieveIndexesFromMetadata(allTables); break; default: break; } } IndexRetriever(
      final RetrieverConnection retrieverConnection,
      final MutableCatalog catalog,
      final SchemaCrawlerOptions options);   }
@Test @DisplayName("Retrieve indexes from data dictionary") public void indexesFromDataDictionary(final Connection connection) throws Exception { final InformationSchemaViews informationSchemaViews = InformationSchemaViewsBuilder.builder() .withSql( InformationSchemaKey.INDEXES, "SELECT * FROM INFORMATION_SCHEMA.SYSTEM_INDEXINFO") .toOptions(); final SchemaRetrievalOptionsBuilder schemaRetrievalOptionsBuilder = SchemaRetrievalOptionsBuilder.builder(); schemaRetrievalOptionsBuilder .with(indexesRetrievalStrategy, data_dictionary_all) .withInformationSchemaViews(informationSchemaViews); final SchemaRetrievalOptions schemaRetrievalOptions = schemaRetrievalOptionsBuilder.toOptions(); final RetrieverConnection retrieverConnection = new RetrieverConnection(connection, schemaRetrievalOptions); final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions(); final IndexRetriever indexRetriever = new IndexRetriever(retrieverConnection, catalog, options); indexRetriever.retrieveIndexes(catalog.getAllTables()); verifyRetrieveIndexes(catalog); }