@Test public void emptyDir() throws Exception{ LuceneIndexReaderFactory factory = new DefaultIndexReaderFactory(mip, null); List<LuceneIndexReader> readers = factory.createReaders(defn, EMPTY_NODE,"/foo"); assertTrue(readers.isEmpty()); }
@Override public List<LuceneIndexReader> createReaders(LuceneIndexDefinition definition, NodeState defnState, String indexPath) throws IOException { if (!mountInfoProvider.hasNonDefaultMounts()) { LuceneIndexReader reader = createReader(definition, defnState, indexPath, FulltextIndexConstants.INDEX_DATA_CHILD_NAME, SUGGEST_DATA_CHILD_NAME); return reader != null ? ImmutableList.of(reader) : Collections.<LuceneIndexReader>emptyList(); } else { return createMountedReaders(definition, defnState, indexPath); } }
DefaultIndexReaderFactory implements LuceneIndexReaderFactory { @Override public List<LuceneIndexReader> createReaders(LuceneIndexDefinition definition, NodeState defnState, String indexPath) throws IOException { if (!mountInfoProvider.hasNonDefaultMounts()) { LuceneIndexReader reader = createReader(definition, defnState, indexPath, FulltextIndexConstants.INDEX_DATA_CHILD_NAME, SUGGEST_DATA_CHILD_NAME); return reader != null ? ImmutableList.of(reader) : Collections.<LuceneIndexReader>emptyList(); } else { return createMountedReaders(definition, defnState, indexPath); } } }
DefaultIndexReaderFactory implements LuceneIndexReaderFactory { @Override public List<LuceneIndexReader> createReaders(LuceneIndexDefinition definition, NodeState defnState, String indexPath) throws IOException { if (!mountInfoProvider.hasNonDefaultMounts()) { LuceneIndexReader reader = createReader(definition, defnState, indexPath, FulltextIndexConstants.INDEX_DATA_CHILD_NAME, SUGGEST_DATA_CHILD_NAME); return reader != null ? ImmutableList.of(reader) : Collections.<LuceneIndexReader>emptyList(); } else { return createMountedReaders(definition, defnState, indexPath); } } DefaultIndexReaderFactory(MountInfoProvider mountInfoProvider, @Nullable IndexCopier cloner); }
DefaultIndexReaderFactory implements LuceneIndexReaderFactory { @Override public List<LuceneIndexReader> createReaders(LuceneIndexDefinition definition, NodeState defnState, String indexPath) throws IOException { if (!mountInfoProvider.hasNonDefaultMounts()) { LuceneIndexReader reader = createReader(definition, defnState, indexPath, FulltextIndexConstants.INDEX_DATA_CHILD_NAME, SUGGEST_DATA_CHILD_NAME); return reader != null ? ImmutableList.of(reader) : Collections.<LuceneIndexReader>emptyList(); } else { return createMountedReaders(definition, defnState, indexPath); } } DefaultIndexReaderFactory(MountInfoProvider mountInfoProvider, @Nullable IndexCopier cloner); @Override List<LuceneIndexReader> createReaders(LuceneIndexDefinition definition, NodeState defnState,
                                                 String indexPath); @Override MountInfoProvider getMountInfoProvider(); }
DefaultIndexReaderFactory implements LuceneIndexReaderFactory { @Override public List<LuceneIndexReader> createReaders(LuceneIndexDefinition definition, NodeState defnState, String indexPath) throws IOException { if (!mountInfoProvider.hasNonDefaultMounts()) { LuceneIndexReader reader = createReader(definition, defnState, indexPath, FulltextIndexConstants.INDEX_DATA_CHILD_NAME, SUGGEST_DATA_CHILD_NAME); return reader != null ? ImmutableList.of(reader) : Collections.<LuceneIndexReader>emptyList(); } else { return createMountedReaders(definition, defnState, indexPath); } } DefaultIndexReaderFactory(MountInfoProvider mountInfoProvider, @Nullable IndexCopier cloner); @Override List<LuceneIndexReader> createReaders(LuceneIndexDefinition definition, NodeState defnState,
                                                 String indexPath); @Override MountInfoProvider getMountInfoProvider();  }