Class BlockDirectory

    • 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,
                              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 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 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
      • 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()