Package org.apache.solr.hdfs.store
Class HdfsDirectory
- java.lang.Object
-
- org.apache.lucene.store.Directory
-
- org.apache.lucene.store.BaseDirectory
-
- org.apache.solr.hdfs.store.HdfsDirectory
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class HdfsDirectory extends org.apache.lucene.store.BaseDirectory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHdfsDirectory.HdfsIndexInput
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.hadoop.conf.Configurationconfigurationstatic intDEFAULT_BUFFER_SIZEprotected org.apache.hadoop.fs.PathhdfsDirPath
-
Constructor Summary
Constructors Constructor Description HdfsDirectory(org.apache.hadoop.fs.Path hdfsDirPath, org.apache.hadoop.conf.Configuration configuration)HdfsDirectory(org.apache.hadoop.fs.Path hdfsDirPath, org.apache.lucene.store.LockFactory lockFactory, org.apache.hadoop.conf.Configuration configuration, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.apache.lucene.store.IndexOutputcreateOutput(String name, org.apache.lucene.store.IOContext context)org.apache.lucene.store.IndexOutputcreateTempOutput(String prefix, String suffix, org.apache.lucene.store.IOContext context)voiddeleteFile(String name)booleanequals(Object obj)longfileLength(String name)longfileModified(String name)org.apache.hadoop.conf.ConfigurationgetConfiguration()org.apache.hadoop.fs.FileSystemgetFileSystem()org.apache.hadoop.fs.PathgetHdfsDirPath()Set<String>getPendingDeletions()inthashCode()booleanisClosed()Check whether this directory is open or closed.String[]listAll()org.apache.lucene.store.IndexInputopenInput(String name, org.apache.lucene.store.IOContext context)voidrename(String source, String dest)voidsync(Collection<String> names)voidsyncMetaData()StringtoString()
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
- See Also:
- Constant Field Values
-
hdfsDirPath
protected final org.apache.hadoop.fs.Path hdfsDirPath
-
configuration
protected final org.apache.hadoop.conf.Configuration configuration
-
-
Constructor Detail
-
HdfsDirectory
public HdfsDirectory(org.apache.hadoop.fs.Path hdfsDirPath, org.apache.hadoop.conf.Configuration configuration) throws IOException- Throws:
IOException
-
HdfsDirectory
public HdfsDirectory(org.apache.hadoop.fs.Path hdfsDirPath, org.apache.lucene.store.LockFactory lockFactory, org.apache.hadoop.conf.Configuration configuration, int bufferSize) throws IOException- Throws:
IOException
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.lucene.store.Directory- Throws:
IOException
-
isClosed
public boolean isClosed()
Check whether this directory is open or closed. This check may return stale results in the form of false negatives.- Returns:
- true if the directory is definitely closed, false if the directory is open or is pending closure
-
createOutput
public org.apache.lucene.store.IndexOutput createOutput(String name, org.apache.lucene.store.IOContext context) throws IOException
- Specified by:
createOutputin classorg.apache.lucene.store.Directory- Throws:
IOException
-
createTempOutput
public org.apache.lucene.store.IndexOutput createTempOutput(String prefix, String suffix, org.apache.lucene.store.IOContext context) throws IOException
- Specified by:
createTempOutputin classorg.apache.lucene.store.Directory- Throws:
IOException
-
openInput
public org.apache.lucene.store.IndexInput openInput(String name, org.apache.lucene.store.IOContext context) throws IOException
- Specified by:
openInputin classorg.apache.lucene.store.Directory- Throws:
IOException
-
deleteFile
public void deleteFile(String name) throws IOException
- Specified by:
deleteFilein classorg.apache.lucene.store.Directory- Throws:
IOException
-
rename
public void rename(String source, String dest) throws IOException
- Specified by:
renamein classorg.apache.lucene.store.Directory- Throws:
IOException
-
syncMetaData
public void syncMetaData() throws IOException- Specified by:
syncMetaDatain classorg.apache.lucene.store.Directory- Throws:
IOException
-
fileLength
public long fileLength(String name) throws IOException
- Specified by:
fileLengthin classorg.apache.lucene.store.Directory- Throws:
IOException
-
fileModified
public long fileModified(String name) throws IOException
- Throws:
IOException
-
listAll
public String[] listAll() throws IOException
- Specified by:
listAllin classorg.apache.lucene.store.Directory- Throws:
IOException
-
getHdfsDirPath
public org.apache.hadoop.fs.Path getHdfsDirPath()
-
getFileSystem
public org.apache.hadoop.fs.FileSystem getFileSystem()
-
getConfiguration
public org.apache.hadoop.conf.Configuration getConfiguration()
-
getPendingDeletions
public Set<String> getPendingDeletions()
- Specified by:
getPendingDeletionsin classorg.apache.lucene.store.Directory
-
sync
public void sync(Collection<String> names) throws IOException
- Specified by:
syncin classorg.apache.lucene.store.Directory- Throws:
IOException
-
toString
public String toString()
- Overrides:
toStringin classorg.apache.lucene.store.BaseDirectory
-
-