@Test public void listAll() throws Exception { Directory buffered = createDir(builder, true); writeFile(buffered, "file"); Directory base = createDir(builder, false); assertEquals(0, base.listAll().length); base.close(); buffered.close(); base = createDir(builder, false); assertEquals(Sets.newHashSet("file"), Sets.newHashSet(base.listAll())); base.close(); buffered = createDir(builder, true); buffered.deleteFile("file"); assertEquals(0, buffered.listAll().length); base = createDir(builder, false); assertEquals(Sets.newHashSet("file"), Sets.newHashSet(base.listAll())); base.close(); buffered.close(); base = createDir(builder, false); assertEquals(0, base.listAll().length); base.close(); }
@Override public String[] listAll() throws IOException { LOG.debug("[{}]listAll()", definition.getIndexPath()); Set<String> all = Sets.newTreeSet(); all.addAll(asList(base.listAll())); all.addAll(asList(buffered.listAll())); all.removeAll(bufferedForDelete); return all.toArray(new String[all.size()]); }
BufferedOakDirectory extends Directory { @Override public String[] listAll() throws IOException { LOG.debug("[{}]listAll()", definition.getIndexPath()); Set<String> all = Sets.newTreeSet(); all.addAll(asList(base.listAll())); all.addAll(asList(buffered.listAll())); all.removeAll(bufferedForDelete); return all.toArray(new String[all.size()]); } }
BufferedOakDirectory extends Directory { @Override public String[] listAll() throws IOException { LOG.debug("[{}]listAll()", definition.getIndexPath()); Set<String> all = Sets.newTreeSet(); all.addAll(asList(base.listAll())); all.addAll(asList(buffered.listAll())); all.removeAll(bufferedForDelete); return all.toArray(new String[all.size()]); } BufferedOakDirectory(@NotNull NodeBuilder builder,
                                @NotNull String dataNodeName,
                                @NotNull LuceneIndexDefinition definition,
                                @Nullable BlobStore blobStore);  BufferedOakDirectory(@NotNull NodeBuilder builder,
                                @NotNull String dataNodeName,
                                @NotNull LuceneIndexDefinition definition,
                                @Nullable BlobStore blobStore,
                                @NotNull ActiveDeletedBlobCollectorFactory.BlobDeletionCallback blobDeletionCallback); }
BufferedOakDirectory extends Directory { @Override public String[] listAll() throws IOException { LOG.debug("[{}]listAll()", definition.getIndexPath()); Set<String> all = Sets.newTreeSet(); all.addAll(asList(base.listAll())); all.addAll(asList(buffered.listAll())); all.removeAll(bufferedForDelete); return all.toArray(new String[all.size()]); } BufferedOakDirectory(@NotNull NodeBuilder builder,
                                @NotNull String dataNodeName,
                                @NotNull LuceneIndexDefinition definition,
                                @Nullable BlobStore blobStore);  BufferedOakDirectory(@NotNull NodeBuilder builder,
                                @NotNull String dataNodeName,
                                @NotNull LuceneIndexDefinition definition,
                                @Nullable BlobStore blobStore,
                                @NotNull ActiveDeletedBlobCollectorFactory.BlobDeletionCallback blobDeletionCallback); static void setEnableWritingSingleBlobIndexFile(boolean val); static boolean isEnableWritingSingleBlobIndexFile(); @Override String[] listAll(); @Override boolean fileExists(String name); @Override void deleteFile(String name); @Override long fileLength(String name); @Override IndexOutput createOutput(String name, IOContext context); @Override void sync(Collection<String> names); @Override IndexInput openInput(String name, IOContext context); @Override Lock makeLock(String name); @Override void clearLock(String name); @Override void close(); @Override void setLockFactory(LockFactory lockFactory); @Override LockFactory getLockFactory(); }
BufferedOakDirectory extends Directory { @Override public String[] listAll() throws IOException { LOG.debug("[{}]listAll()", definition.getIndexPath()); Set<String> all = Sets.newTreeSet(); all.addAll(asList(base.listAll())); all.addAll(asList(buffered.listAll())); all.removeAll(bufferedForDelete); return all.toArray(new String[all.size()]); } BufferedOakDirectory(@NotNull NodeBuilder builder,
                                @NotNull String dataNodeName,
                                @NotNull LuceneIndexDefinition definition,
                                @Nullable BlobStore blobStore);  BufferedOakDirectory(@NotNull NodeBuilder builder,
                                @NotNull String dataNodeName,
                                @NotNull LuceneIndexDefinition definition,
                                @Nullable BlobStore blobStore,
                                @NotNull ActiveDeletedBlobCollectorFactory.BlobDeletionCallback blobDeletionCallback); static void setEnableWritingSingleBlobIndexFile(boolean val); static boolean isEnableWritingSingleBlobIndexFile(); @Override String[] listAll(); @Override boolean fileExists(String name); @Override void deleteFile(String name); @Override long fileLength(String name); @Override IndexOutput createOutput(String name, IOContext context); @Override void sync(Collection<String> names); @Override IndexInput openInput(String name, IOContext context); @Override Lock makeLock(String name); @Override void clearLock(String name); @Override void close(); @Override void setLockFactory(LockFactory lockFactory); @Override LockFactory getLockFactory(); static final String ENABLE_WRITING_SINGLE_BLOB_INDEX_FILE_PARAM; }