Package org.apache.solr.store.blockcache
Class CachedIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.solr.store.blockcache.ReusedBufferedIndexOutput
-
- org.apache.solr.store.blockcache.CachedIndexOutput
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class CachedIndexOutput extends ReusedBufferedIndexOutput
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.store.blockcache.ReusedBufferedIndexOutput
buffer, BUFFER_SIZE
-
-
Constructor Summary
Constructors Constructor Description CachedIndexOutput(BlockDirectory directory, org.apache.lucene.store.IndexOutput dest, int blockSize, String name, Cache cache, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeInternal()
long
getChecksum()
void
writeInternal(byte[] b, int offset, int length)
Expert: implements buffer flushing to cache.-
Methods inherited from class org.apache.solr.store.blockcache.ReusedBufferedIndexOutput
close, flushBufferToCache, getBufferStart, getFilePointer, writeByte, writeBytes
-
-
-
-
Constructor Detail
-
CachedIndexOutput
public CachedIndexOutput(BlockDirectory directory, org.apache.lucene.store.IndexOutput dest, int blockSize, String name, Cache cache, int bufferSize)
-
-
Method Detail
-
closeInternal
public void closeInternal() throws IOException
- Specified by:
closeInternal
in classReusedBufferedIndexOutput
- Throws:
IOException
-
writeInternal
public void writeInternal(byte[] b, int offset, int length) throws IOException
Description copied from class:ReusedBufferedIndexOutput
Expert: implements buffer flushing to cache. Writes bytes to the current position in the output.- Specified by:
writeInternal
in 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
public long getChecksum() throws IOException
- Specified by:
getChecksum
in classorg.apache.lucene.store.IndexOutput
- Throws:
IOException
-
-