Package 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 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 long
BLOCK_MOD
static long
BLOCK_SHIFT
static int
BLOCK_SIZE
static Cache
NO_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 void
close()
void
closeOnShutdown()
org.apache.lucene.store.IndexOutput
createOutput(String name, org.apache.lucene.store.IOContext context)
void
deleteFile(String name)
static long
getBlock(long pos)
Cache
getCache()
Expert: mostly for testsstatic long
getPosition(long pos)
static long
getRealPosition(long block, long positionInBlock)
boolean
isBlockCacheReadEnabled()
boolean
isBlockCacheWriteEnabled()
org.apache.lucene.store.IndexInput
openInput(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:
openInput
in classorg.apache.lucene.store.FilterDirectory
- Throws:
IOException
-
closeOnShutdown
public void closeOnShutdown() throws IOException
- Specified by:
closeOnShutdown
in interfaceShutdownAwareDirectory
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in 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:
createOutput
in classorg.apache.lucene.store.FilterDirectory
- Throws:
IOException
-
deleteFile
public void deleteFile(String name) throws IOException
- Overrides:
deleteFile
in classorg.apache.lucene.store.FilterDirectory
- Throws:
IOException
-
isBlockCacheReadEnabled
public boolean isBlockCacheReadEnabled()
-
isBlockCacheWriteEnabled
public boolean isBlockCacheWriteEnabled()
-
-