Class BlockDirectory
- java.lang.Object
-
- org.apache.lucene.store.Directory
-
- org.apache.lucene.store.FilterDirectory
-
- org.apache.solr.hdfs.store.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 longBLOCK_MODstatic longBLOCK_SHIFTstatic intBLOCK_SIZEstatic CacheNO_CACHE
-
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcloseOnShutdown()org.apache.lucene.store.IndexOutputcreateOutput(String name, org.apache.lucene.store.IOContext context)voiddeleteFile(String name)static longgetBlock(long pos)CachegetCache()Expert: mostly for testsstatic longgetPosition(long pos)static longgetRealPosition(long block, long positionInBlock)booleanisBlockCacheReadEnabled()booleanisBlockCacheWriteEnabled()org.apache.lucene.store.IndexInputopenInput(String name, org.apache.lucene.store.IOContext context)-
Methods inherited from class org.apache.lucene.store.FilterDirectory
createTempOutput, fileLength, getDelegate, getPendingDeletions, listAll, obtainLock, rename, sync, syncMetaData, toString, unwrap
-
-
-
-
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:
openInputin classorg.apache.lucene.store.FilterDirectory- Throws:
IOException
-
closeOnShutdown
public void closeOnShutdown() throws IOException- Specified by:
closeOnShutdownin interfaceShutdownAwareDirectory- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.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:
createOutputin classorg.apache.lucene.store.FilterDirectory- Throws:
IOException
-
deleteFile
public void deleteFile(String name) throws IOException
- Overrides:
deleteFilein classorg.apache.lucene.store.FilterDirectory- Throws:
IOException
-
isBlockCacheReadEnabled
public boolean isBlockCacheReadEnabled()
-
isBlockCacheWriteEnabled
public boolean isBlockCacheWriteEnabled()
-
-