Package org.apache.solr.blockcache
Class CachedIndexOutput
java.lang.Object
org.apache.lucene.store.DataOutput
org.apache.lucene.store.IndexOutput
org.apache.solr.blockcache.ReusedBufferedIndexOutput
org.apache.solr.blockcache.CachedIndexOutput
- All Implemented Interfaces:
Closeable,AutoCloseable
Cache the blocks as they are written. The cache file name is the name of the file until the file
is closed, at which point the cache is updated to include the last modified date (which is
unknown until that point).
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
Fields inherited from class org.apache.solr.blockcache.ReusedBufferedIndexOutput
buffer, BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionCachedIndexOutput(BlockDirectory directory, org.apache.lucene.store.IndexOutput dest, int blockSize, String name, Cache cache, int bufferSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidlongvoidwriteInternal(byte[] b, int offset, int length) Expert: implements buffer flushing to cache.Methods inherited from class org.apache.solr.blockcache.ReusedBufferedIndexOutput
close, flushBufferToCache, getBufferStart, getFilePointer, writeByte, writeBytesMethods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset, getName, toStringMethods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeGroupVInts, writeGroupVInts, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
Constructor Details
-
CachedIndexOutput
public CachedIndexOutput(BlockDirectory directory, org.apache.lucene.store.IndexOutput dest, int blockSize, String name, Cache cache, int bufferSize)
-
-
Method Details
-
closeInternal
- Specified by:
closeInternalin classReusedBufferedIndexOutput- Throws:
IOException
-
writeInternal
Description copied from class:ReusedBufferedIndexOutputExpert: implements buffer flushing to cache. Writes bytes to the current position in the output.- Specified by:
writeInternalin classReusedBufferedIndexOutput- Parameters:
b- the array of bytes to writeoffset- the offset in the array of bytes to writelength- the number of bytes to write- Throws:
IOException
-
getChecksum
- Specified by:
getChecksumin classorg.apache.lucene.store.IndexOutput- Throws:
IOException
-