Package org.apache.solr.blockcache
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
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final intstatic CacheFields inherited from class org.apache.lucene.store.FilterDirectory
in -
Constructor Summary
ConstructorsConstructorDescriptionBlockDirectory(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 TypeMethodDescriptionvoidclose()voidorg.apache.lucene.store.IndexOutputcreateOutput(String name, org.apache.lucene.store.IOContext context) voiddeleteFile(String name) static longgetBlock(long pos) getCache()Expert: mostly for testsstatic longgetPosition(long pos) static longgetRealPosition(long block, long positionInBlock) booleanbooleanorg.apache.lucene.store.IndexInputMethods inherited from class org.apache.lucene.store.FilterDirectory
createTempOutput, ensureOpen, fileLength, getDelegate, getPendingDeletions, listAll, obtainLock, rename, sync, syncMetaData, toString, unwrapMethods inherited from class org.apache.lucene.store.Directory
copyFrom, getTempFileName, openChecksumInput
-
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
-
-
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:
openInputin classorg.apache.lucene.store.FilterDirectory- Throws:
IOException
-
closeOnShutdown
- Specified by:
closeOnShutdownin interfaceShutdownAwareDirectory- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.apache.lucene.store.FilterDirectory- Throws:
IOException
-
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
- Overrides:
deleteFilein classorg.apache.lucene.store.FilterDirectory- Throws:
IOException
-
isBlockCacheReadEnabled
public boolean isBlockCacheReadEnabled() -
isBlockCacheWriteEnabled
public boolean isBlockCacheWriteEnabled()
-