Class HdfsDirectory

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class HdfsDirectory
    extends org.apache.lucene.store.BaseDirectory
    • Field Detail

      • 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

      • 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:
        createOutput in class org.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:
        createTempOutput in class org.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:
        openInput in class org.apache.lucene.store.Directory
        Throws:
        IOException
      • deleteFile

        public void deleteFile​(String name)
                        throws IOException
        Specified by:
        deleteFile in class org.apache.lucene.store.Directory
        Throws:
        IOException
      • syncMetaData

        public void syncMetaData()
                          throws IOException
        Specified by:
        syncMetaData in class org.apache.lucene.store.Directory
        Throws:
        IOException
      • fileLength

        public long fileLength​(String name)
                        throws IOException
        Specified by:
        fileLength in class org.apache.lucene.store.Directory
        Throws:
        IOException
      • listAll

        public String[] listAll()
                         throws IOException
        Specified by:
        listAll in class org.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:
        getPendingDeletions in class org.apache.lucene.store.Directory
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Overrides:
        toString in class org.apache.lucene.store.BaseDirectory