@Test public void testMultipleWritersOpenOnSameDirectory() throws IOException { IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_43, new KeywordAnalyzer()); FastHdfsKeyValueDirectory directory = new FastHdfsKeyValueDirectory(false, _timer, _configuration, new Path(_path, "test_multiple")); IndexWriter writer1 = new IndexWriter(directory, config.clone()); addDoc(writer1, getDoc(1)); IndexWriter writer2 = new IndexWriter(directory, config.clone()); addDoc(writer2, getDoc(2)); writer1.close(); writer2.close(); DirectoryReader reader = DirectoryReader.open(directory); int maxDoc = reader.maxDoc(); assertEquals(1, maxDoc); Document document = reader.document(0); assertEquals("2", document.get("id")); reader.close(); }
@Override public void close() throws IOException { _store.close(); }
FastHdfsKeyValueDirectory extends Directory implements LastModified { @Override public void close() throws IOException { _store.close(); } }
FastHdfsKeyValueDirectory extends Directory implements LastModified { @Override public void close() throws IOException { _store.close(); } FastHdfsKeyValueDirectory(boolean readOnly, Timer hdfsKeyValueTimer, Configuration configuration, Path path);  FastHdfsKeyValueDirectory(boolean readOnly, Timer hdfsKeyValueTimer, Configuration configuration, Path path,
      long maxAmountAllowedPerFile, long maxOpenForWriting); }
FastHdfsKeyValueDirectory extends Directory implements LastModified { @Override public void close() throws IOException { _store.close(); } FastHdfsKeyValueDirectory(boolean readOnly, Timer hdfsKeyValueTimer, Configuration configuration, Path path);  FastHdfsKeyValueDirectory(boolean readOnly, Timer hdfsKeyValueTimer, Configuration configuration, Path path,
      long maxAmountAllowedPerFile, long maxOpenForWriting); void gc(); void writeBlock(String name, long blockId, byte[] b, int offset, int length); void readBlock(String name, long blockId, BytesRef ref); synchronized void writeLength(String name, long length); @Override IndexInput openInput(String name, IOContext context); @Override IndexOutput createOutput(final String name, IOContext context); @Override String[] listAll(); @Override boolean fileExists(String name); @Override void deleteFile(String name); @Override long fileLength(String name); @Override void sync(Collection<String> names); @Override void close(); @Override long getFileModified(String name); }
FastHdfsKeyValueDirectory extends Directory implements LastModified { @Override public void close() throws IOException { _store.close(); } FastHdfsKeyValueDirectory(boolean readOnly, Timer hdfsKeyValueTimer, Configuration configuration, Path path);  FastHdfsKeyValueDirectory(boolean readOnly, Timer hdfsKeyValueTimer, Configuration configuration, Path path,
      long maxAmountAllowedPerFile, long maxOpenForWriting); void gc(); void writeBlock(String name, long blockId, byte[] b, int offset, int length); void readBlock(String name, long blockId, BytesRef ref); synchronized void writeLength(String name, long length); @Override IndexInput openInput(String name, IOContext context); @Override IndexOutput createOutput(final String name, IOContext context); @Override String[] listAll(); @Override boolean fileExists(String name); @Override void deleteFile(String name); @Override long fileLength(String name); @Override void sync(Collection<String> names); @Override void close(); @Override long getFileModified(String name);  }