Class BlockDirectory

java.lang.Object
org.apache.lucene.store.Directory
org.apache.lucene.store.FilterDirectory
org.apache.solr.blockcache.BlockDirectory
All Implemented Interfaces:
Closeable, AutoCloseable, ShutdownAwareDirectory

public class BlockDirectory extends org.apache.lucene.store.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
    Description
    static final long
     
    static final long
     
    static final int
     
    static Cache
     

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

    in
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockDirectory(String dirName, org.apache.lucene.store.Directory directory, Cache cache, Set<String> blockCacheFileTypes, boolean blockCacheReadEnabled, boolean blockCacheWriteEnabled)
     
    BlockDirectory(String dirName, org.apache.lucene.store.Directory directory, Cache cache, Set<String> blockCacheFileTypes, boolean blockCacheReadEnabled, boolean blockCacheWriteEnabled, boolean cacheMerges, boolean cacheReadOnce)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    org.apache.lucene.store.IndexOutput
    createOutput(String name, org.apache.lucene.store.IOContext context)
     
    void
     
    static long
    getBlock(long pos)
     
    Expert: mostly for tests
    static long
    getPosition(long pos)
     
    static long
    getRealPosition(long block, long positionInBlock)
     
    boolean
     
    boolean
     
    org.apache.lucene.store.IndexInput
    openInput(String name, org.apache.lucene.store.IOContext context)
     

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

    createTempOutput, ensureOpen, fileLength, getDelegate, getPendingDeletions, listAll, obtainLock, rename, sync, syncMetaData, toString, unwrap

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

    copyFrom, getTempFileName, openChecksumInput

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • 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 Details

    • BlockDirectory

      public BlockDirectory(String dirName, org.apache.lucene.store.Directory directory, Cache cache, Set<String> blockCacheFileTypes, boolean blockCacheReadEnabled, boolean blockCacheWriteEnabled) throws IOException
      Throws:
      IOException
    • BlockDirectory

      public BlockDirectory(String dirName, org.apache.lucene.store.Directory directory, Cache cache, Set<String> blockCacheFileTypes, boolean blockCacheReadEnabled, boolean blockCacheWriteEnabled, boolean cacheMerges, boolean cacheReadOnce) throws IOException
      Throws:
      IOException
  • Method Details

    • 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 org.apache.lucene.store.IndexInput openInput(String name, org.apache.lucene.store.IOContext context) throws IOException
      Overrides:
      openInput in class org.apache.lucene.store.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 AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class org.apache.lucene.store.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 org.apache.lucene.store.IndexOutput createOutput(String name, org.apache.lucene.store.IOContext context) throws IOException
      Overrides:
      createOutput in class org.apache.lucene.store.FilterDirectory
      Throws:
      IOException
    • deleteFile

      public void deleteFile(String name) throws IOException
      Overrides:
      deleteFile in class org.apache.lucene.store.FilterDirectory
      Throws:
      IOException
    • isBlockCacheReadEnabled

      public boolean isBlockCacheReadEnabled()
    • isBlockCacheWriteEnabled

      public boolean isBlockCacheWriteEnabled()