org.apache.solr.store.blockcache

## Class BlockDirectory

- java.lang.Object
- - org.apache.lucene.store.Directory
  - - org.apache.lucene.store.FilterDirectory
    - - org.apache.solr.store.blockcache.BlockDirectory

- All Implemented Interfaces:
    Closeable, AutoCloseable, ShutdownAwareDirectory

      public class BlockDirectory
      extends FilterDirectory
      implements ShutdownAwareDirectory

  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `BLOCK_MOD`
    `static long` | `BLOCK_SHIFT`
    `static int` | `BLOCK_SIZE`
    `static Cache` | `NO_CACHE`

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

      `in`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BlockDirectory(String dirName, Directory directory, Cache cache, Set<String> blockCacheFileTypes, boolean blockCacheReadEnabled, boolean blockCacheWriteEnabled)`
    `BlockDirectory(String dirName, Directory directory, Cache cache, Set<String> blockCacheFileTypes, boolean blockCacheReadEnabled, boolean blockCacheWriteEnabled, boolean cacheMerges, boolean cacheReadOnce)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `closeOnShutdown()`
    `IndexOutput` | `createOutput(String name, IOContext context)`
    `void` | `deleteFile(String name)`
    `static long` | `getBlock(long pos)`
    `Cache` | `getCache()` Expert: mostly for tests
    `static long` | `getPosition(long pos)`
    `static long` | `getRealPosition(long block, long positionInBlock)`
    `boolean` | `isBlockCacheReadEnabled()`
    `boolean` | `isBlockCacheWriteEnabled()`
    `IndexInput` | `openInput(String name, IOContext context)`

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

      `createTempOutput, fileLength, getDelegate, listAll, obtainLock, rename, sync, syncMetaData, toString, unwrap`

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

      `copyFrom, ensureOpen, openChecksumInput, renameFile`

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

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

- - ### Field Detail

    - #### BLOCK_SHIFT

          public static final long BLOCK_SHIFT

    - #### BLOCK_SIZE

          public static final int BLOCK_SIZE

    - #### BLOCK_MOD

          public static final long BLOCK_MOD

    - #### NO_CACHE

          public static Cache NO_CACHE

  - ### Constructor Detail

    - #### BlockDirectory

          public BlockDirectory(String dirName,
                                Directory directory,
                                Cache cache,
                                Set<String> blockCacheFileTypes,
                                boolean blockCacheReadEnabled,
                                boolean blockCacheWriteEnabled)
                         throws IOException

      Throws:
        `IOException`

    - #### BlockDirectory

          public BlockDirectory(String dirName,
                                Directory directory,
                                Cache cache,
                                Set<String> blockCacheFileTypes,
                                boolean blockCacheReadEnabled,
                                boolean blockCacheWriteEnabled,
                                boolean cacheMerges,
                                boolean cacheReadOnce)
                         throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### getBlock

          public static long getBlock(long pos)

    - #### getPosition

          public static long getPosition(long pos)

    - #### getRealPosition

          public static long getRealPosition(long block,
                                             long positionInBlock)

    - #### openInput

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

      Overrides:
        `openInput` in class `FilterDirectory`
      Throws:
        `IOException`

    - #### closeOnShutdown

          public void closeOnShutdown()
                               throws IOException

      Specified by:
        `closeOnShutdown` in interface `ShutdownAwareDirectory`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `FilterDirectory`
      Throws:
        `IOException`

    - #### getCache

          public Cache getCache()

      Expert: mostly for tests
      WARNING: This API is experimental and might change in incompatible ways in the next release.

    - #### createOutput

          public IndexOutput createOutput(String name,
                                          IOContext context)
                                   throws IOException

      Overrides:
        `createOutput` in class `FilterDirectory`
      Throws:
        `IOException`

    - #### deleteFile

          public void deleteFile(String name)
                          throws IOException

      Overrides:
        `deleteFile` in class `FilterDirectory`
      Throws:
        `IOException`

    - #### isBlockCacheReadEnabled

          public boolean isBlockCacheReadEnabled()

    - #### isBlockCacheWriteEnabled

          public boolean isBlockCacheWriteEnabled()

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