org.apache.solr.store.hdfs

## Class HdfsDirectory

- java.lang.Object
- - org.apache.lucene.store.Directory
  - - org.apache.lucene.store.BaseDirectory
    - - org.apache.solr.store.hdfs.HdfsDirectory

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class HdfsDirectory
      extends BaseDirectory

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `HdfsDirectory.HdfsIndexInput`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.apache.hadoop.conf.Configuration` | `configuration`
    `static int` | `DEFAULT_BUFFER_SIZE`
    `protected org.apache.hadoop.fs.Path` | `hdfsDirPath`

    - ### Fields inherited from class org.apache.lucene.store.BaseDirectory

      `isOpen, lockFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HdfsDirectory(org.apache.hadoop.fs.Path hdfsDirPath, org.apache.hadoop.conf.Configuration configuration)`
    `HdfsDirectory(org.apache.hadoop.fs.Path hdfsDirPath, LockFactory lockFactory, org.apache.hadoop.conf.Configuration configuration, int bufferSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `IndexOutput` | `createOutput(String name, IOContext context)`
    `IndexOutput` | `createTempOutput(String prefix, String suffix, IOContext context)`
    `void` | `deleteFile(String name)`
    `boolean` | `equals(Object obj)`
    `long` | `fileLength(String name)`
    `long` | `fileModified(String name)`
    `org.apache.hadoop.conf.Configuration` | `getConfiguration()`
    `org.apache.hadoop.fs.FileSystem` | `getFileSystem()`
    `org.apache.hadoop.fs.Path` | `getHdfsDirPath()`
    `int` | `hashCode()`
    `boolean` | `isClosed()` Check whether this directory is open or closed.
    `String[]` | `listAll()`
    `IndexInput` | `openInput(String name, IOContext context)`
    `void` | `rename(String source, String dest)`
    `void` | `sync(Collection<String> names)`
    `void` | `syncMetaData()`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.lucene.store.BaseDirectory

      `ensureOpen, obtainLock`

    - ### Methods inherited from class org.apache.lucene.store.Directory

      `copyFrom, openChecksumInput, renameFile`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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,
                               LockFactory lockFactory,
                               org.apache.hadoop.conf.Configuration configuration,
                               int bufferSize)
                        throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `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 IndexOutput createOutput(String name,
                                          IOContext context)
                                   throws IOException

      Specified by:
        `createOutput` in class `Directory`
      Throws:
        `IOException`

    - #### createTempOutput

          public IndexOutput createTempOutput(String prefix,
                                              String suffix,
                                              IOContext context)
                                       throws IOException

      Specified by:
        `createTempOutput` in class `Directory`
      Throws:
        `IOException`

    - #### openInput

          public IndexInput openInput(String name,
                                      IOContext context)
                               throws IOException

      Specified by:
        `openInput` in class `Directory`
      Throws:
        `IOException`

    - #### deleteFile

          public void deleteFile(String name)
                          throws IOException

      Specified by:
        `deleteFile` in class `Directory`
      Throws:
        `IOException`

    - #### rename

          public void rename(String source,
                             String dest)
                      throws IOException

      Specified by:
        `rename` in class `Directory`
      Throws:
        `IOException`

    - #### syncMetaData

          public void syncMetaData()
                            throws IOException

      Specified by:
        `syncMetaData` in class `Directory`
      Throws:
        `IOException`

    - #### fileLength

          public long fileLength(String name)
                          throws IOException

      Specified by:
        `fileLength` in class `Directory`
      Throws:
        `IOException`

    - #### fileModified

          public long fileModified(String name)
                            throws IOException

      Throws:
        `IOException`

    - #### listAll

          public String[] listAll()
                           throws IOException

      Specified by:
        `listAll` in class `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()

    - #### sync

          public void sync(Collection<String> names)
                    throws IOException

      Specified by:
        `sync` in class `Directory`
      Throws:
        `IOException`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `BaseDirectory`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.