protected synchronized void importIndexDefinitions() throws RepositoryException { RepositoryConfiguration.Indexes indexes = config.getIndexes(); if (indexes.isEmpty()) return; List<IndexDefinition> defns = indexes.getIndexNames().stream() .map(indexes::getIndex) .filter(Objects::nonNull) .collect(Collectors.toList()); if (!defns.isEmpty()) { IndexDefinition[] array = defns.toArray(new IndexDefinition[defns.size()]); registerIndexes(array, true); } }
protected synchronized void importIndexDefinitions() throws RepositoryException { RepositoryConfiguration.Indexes indexes = config.getIndexes(); if (indexes.isEmpty()) return; List<IndexDefinition> defns = indexes.getIndexNames().stream() .map(indexes::getIndex) .filter(Objects::nonNull) .collect(Collectors.toList()); if (!defns.isEmpty()) { IndexDefinition[] array = defns.toArray(new IndexDefinition[defns.size()]); registerIndexes(array, true); } }
@FixFor( "MODE-2160" ) @Test public void shouldAlwaysReturnNonNullIndexesComponentForNoIndexes() { RepositoryConfiguration config = new RepositoryConfiguration("repoName"); assertThat(config.getIndexes(), is(notNullValue())); }
@FixFor( {"MODE-2160", "MODE-2279"} ) @Test public void shouldAllowValidRepositoryConfigurationWithIndexProvidersAndNotionalIndexes() { RepositoryConfiguration config = assertValid("config/repo-config-local-provider-and-notional-indexes.json"); Indexes indexes = config.getIndexes(); EnumSet<IndexKind> found = EnumSet.noneOf(IndexKind.class); for (String indexName : indexes.getIndexNames()) { IndexDefinition defn = indexes.getIndex(indexName); IndexKind kind = defn.getKind(); found.add(kind); assertThat(kind, is(notNullValue())); } assertThat(found, is(EnumSet.allOf(IndexKind.class))); }
@FixFor( {"MODE-2160", "MODE-2279"} ) @Test public void shouldAllowValidRepositoryConfigurationWithIndexProvidersAndIndexes() { RepositoryConfiguration config = assertValid("config/repo-config-local-provider-and-indexes.json"); Indexes indexes = config.getIndexes(); for (String indexName : indexes.getIndexNames()) { IndexDefinition defn = indexes.getIndex(indexName); assertThat(defn.getKind(), is(notNullValue())); } }
getTextExtraction().validateTextExtractors(problems); validateIndexProviders(problems); getIndexes().validateIndexDefinitions(problems); this.problems = problems;
getTextExtraction().validateTextExtractors(problems); validateIndexProviders(problems); getIndexes().validateIndexDefinitions(problems); this.problems = problems;