Package org.apache.solr.store.blockcache
Class ReusedBufferedIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.solr.store.blockcache.ReusedBufferedIndexOutput
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
CachedIndexOutput
public abstract class ReusedBufferedIndexOutput extends org.apache.lucene.store.IndexOutput- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]bufferstatic intBUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description ReusedBufferedIndexOutput(String resourceDescription, String name)ReusedBufferedIndexOutput(String resourceDescription, String name, int bufferSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract voidcloseInternal()protected voidflushBufferToCache()Write the buffered bytes to cacheprotected longgetBufferStart()longgetFilePointer()voidwriteByte(byte b)voidwriteBytes(byte[] b, int offset, int length)protected abstract voidwriteInternal(byte[] b, int offset, int length)Expert: implements buffer flushing to cache.
-
-
-
Field Detail
-
BUFFER_SIZE
public static final int BUFFER_SIZE
- See Also:
- Constant Field Values
-
buffer
protected byte[] buffer
-
-
Method Detail
-
getBufferStart
protected long getBufferStart()
-
flushBufferToCache
protected void flushBufferToCache() throws IOExceptionWrite the buffered bytes to cache- Throws:
IOException
-
closeInternal
protected abstract void closeInternal() throws IOException- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.lucene.store.IndexOutput- Throws:
IOException
-
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointerin classorg.apache.lucene.store.IndexOutput
-
writeByte
public void writeByte(byte b) throws IOException- Specified by:
writeBytein classorg.apache.lucene.store.DataOutput- Throws:
IOException
-
writeInternal
protected abstract void writeInternal(byte[] b, int offset, int length) throws IOExceptionExpert: implements buffer flushing to cache. Writes bytes to the current position in the output.- 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
-
writeBytes
public void writeBytes(byte[] b, int offset, int length) throws IOException- Specified by:
writeBytesin classorg.apache.lucene.store.DataOutput- Throws:
IOException
-
-