@Test public void testRemove() throws IOException { SuggesterTestData t = initSuggester(); t.s.remove(Collections.singleton("test")); assertFalse(t.suggesterDir.resolve("test").toFile().exists()); FileUtils.deleteDirectory(t.suggesterDir.toFile()); FileUtils.deleteDirectory(t.indexDir.toFile()); }
public void remove(final Iterable<String> names) { if (names == null) { return; } synchronized (lock) { logger.log(Level.INFO, "Removing following suggesters: {0}", names); for (String suggesterName : names) { SuggesterProjectData collection = projectData.get(suggesterName); if (collection == null) { logger.log(Level.WARNING, "Unknown suggester {0}", suggesterName); continue; } collection.remove(); projectData.remove(suggesterName); } } }
Suggester implements Closeable { public void remove(final Iterable<String> names) { if (names == null) { return; } synchronized (lock) { logger.log(Level.INFO, "Removing following suggesters: {0}", names); for (String suggesterName : names) { SuggesterProjectData collection = projectData.get(suggesterName); if (collection == null) { logger.log(Level.WARNING, "Unknown suggester {0}", suggesterName); continue; } collection.remove(); projectData.remove(suggesterName); } } } }
Suggester implements Closeable { public void remove(final Iterable<String> names) { if (names == null) { return; } synchronized (lock) { logger.log(Level.INFO, "Removing following suggesters: {0}", names); for (String suggesterName : names) { SuggesterProjectData collection = projectData.get(suggesterName); if (collection == null) { logger.log(Level.WARNING, "Unknown suggester {0}", suggesterName); continue; } collection.remove(); projectData.remove(suggesterName); } } } Suggester(
            final File suggesterDir,
            final int resultSize,
            final Duration awaitTerminationTime,
            final boolean allowMostPopular,
            final boolean projectsEnabled,
            final Set<String> allowedFields,
            final int timeThreshold,
            final int rebuildParallelismLevel,
            MeterRegistry registry); }
Suggester implements Closeable { public void remove(final Iterable<String> names) { if (names == null) { return; } synchronized (lock) { logger.log(Level.INFO, "Removing following suggesters: {0}", names); for (String suggesterName : names) { SuggesterProjectData collection = projectData.get(suggesterName); if (collection == null) { logger.log(Level.WARNING, "Unknown suggester {0}", suggesterName); continue; } collection.remove(); projectData.remove(suggesterName); } } } Suggester(
            final File suggesterDir,
            final int resultSize,
            final Duration awaitTerminationTime,
            final boolean allowMostPopular,
            final boolean projectsEnabled,
            final Set<String> allowedFields,
            final int timeThreshold,
            final int rebuildParallelismLevel,
            MeterRegistry registry); void init(final Collection<NamedIndexDir> luceneIndexes); void waitForInit(long timeout, TimeUnit unit); void rebuild(final Collection<NamedIndexDir> indexDirs); void waitForRebuild(long timeout, TimeUnit unit); void remove(final Iterable<String> names); Suggestions search(
            final List<NamedIndexReader> indexReaders,
            final SuggesterQuery suggesterQuery,
            final Query query
    ); void onSearch(final Iterable<String> projects, final Query query); void setResultSize(final int resultSize); void setAwaitTerminationTime(final Duration awaitTerminationTime); boolean increaseSearchCount(final String project, final Term term, final int value, final boolean waitForLock); List<Entry<BytesRef, Integer>> getSearchCounts(
            final String project,
            final String field,
            final int page,
            final int pageSize
    ); @Override void close(); }
Suggester implements Closeable { public void remove(final Iterable<String> names) { if (names == null) { return; } synchronized (lock) { logger.log(Level.INFO, "Removing following suggesters: {0}", names); for (String suggesterName : names) { SuggesterProjectData collection = projectData.get(suggesterName); if (collection == null) { logger.log(Level.WARNING, "Unknown suggester {0}", suggesterName); continue; } collection.remove(); projectData.remove(suggesterName); } } } Suggester(
            final File suggesterDir,
            final int resultSize,
            final Duration awaitTerminationTime,
            final boolean allowMostPopular,
            final boolean projectsEnabled,
            final Set<String> allowedFields,
            final int timeThreshold,
            final int rebuildParallelismLevel,
            MeterRegistry registry); void init(final Collection<NamedIndexDir> luceneIndexes); void waitForInit(long timeout, TimeUnit unit); void rebuild(final Collection<NamedIndexDir> indexDirs); void waitForRebuild(long timeout, TimeUnit unit); void remove(final Iterable<String> names); Suggestions search(
            final List<NamedIndexReader> indexReaders,
            final SuggesterQuery suggesterQuery,
            final Query query
    ); void onSearch(final Iterable<String> projects, final Query query); void setResultSize(final int resultSize); void setAwaitTerminationTime(final Duration awaitTerminationTime); boolean increaseSearchCount(final String project, final Term term, final int value, final boolean waitForLock); List<Entry<BytesRef, Integer>> getSearchCounts(
            final String project,
            final String field,
            final int page,
            final int pageSize
    ); @Override void close();  }