Class ReusedBufferedIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.solr.hdfs.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[]
buffer
static int
BUFFER_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 void
close()
protected abstract void
closeInternal()
protected void
flushBufferToCache()
Write the buffered bytes to cacheprotected long
getBufferStart()
long
getFilePointer()
void
writeByte(byte b)
void
writeBytes(byte[] b, int offset, int length)
protected abstract void
writeInternal(byte[] b, int offset, int length)
Expert: implements buffer flushing to cache.-
Methods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset, getChecksum, getName, toString
-
-
-
-
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 IOException
Write the buffered bytes to cache- Throws:
IOException
-
closeInternal
protected abstract void closeInternal() throws IOException
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classorg.apache.lucene.store.IndexOutput
- Throws:
IOException
-
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointer
in classorg.apache.lucene.store.IndexOutput
-
writeByte
public void writeByte(byte b) throws IOException
- Specified by:
writeByte
in classorg.apache.lucene.store.DataOutput
- Throws:
IOException
-
writeInternal
protected abstract void writeInternal(byte[] b, int offset, int length) throws IOException
Expert: 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:
writeBytes
in classorg.apache.lucene.store.DataOutput
- Throws:
IOException
-
-