Package org.apache.solr.store.blockcache
Class CustomBufferedIndexInput
- java.lang.Object
-
- org.apache.lucene.store.DataInput
-
- org.apache.lucene.store.IndexInput
-
- org.apache.solr.store.blockcache.CustomBufferedIndexInput
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Cloneable
- Direct Known Subclasses:
HdfsDirectory.HdfsIndexInput
public abstract class CustomBufferedIndexInput extends org.apache.lucene.store.IndexInput- 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 CustomBufferedIndexInput(String resourceDesc)CustomBufferedIndexInput(String resourceDesc, int bufferSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.lucene.store.IndexInputclone()voidclose()protected abstract voidcloseInternal()protected intflushBuffer(org.apache.lucene.store.IndexOutput out, long numBytes)Flushes the in-memory bufer to the given output, copying at mostnumBytes.longgetFilePointer()bytereadByte()voidreadBytes(byte[] b, int offset, int len)voidreadBytes(byte[] b, int offset, int len, boolean useBuffer)intreadInt()protected abstract voidreadInternal(byte[] b, int offset, int length)Expert: implements buffer refill.longreadLong()intreadVInt()longreadVLong()voidseek(long pos)protected abstract voidseekInternal(long pos)Expert: implements seek.org.apache.lucene.store.IndexInputslice(String sliceDescription, long offset, long length)-
Methods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, length, randomAccessSlice, toString
-
-
-
-
Method Detail
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readBytes
public void readBytes(byte[] b, int offset, int len) throws IOException- Specified by:
readBytesin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readBytes
public void readBytes(byte[] b, int offset, int len, boolean useBuffer) throws IOException- Overrides:
readBytesin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readInt
public int readInt() throws IOException- Overrides:
readIntin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readLong
public long readLong() throws IOException- Overrides:
readLongin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readVInt
public int readVInt() throws IOException- Overrides:
readVIntin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readVLong
public long readVLong() throws IOException- Overrides:
readVLongin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
close
public final void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.lucene.store.IndexInput- Throws:
IOException
-
closeInternal
protected abstract void closeInternal() throws IOException- Throws:
IOException
-
readInternal
protected abstract void readInternal(byte[] b, int offset, int length) throws IOExceptionExpert: implements buffer refill. Reads bytes from the current position in the input.- Parameters:
b- the array to read bytes intooffset- the offset in the array to start storing byteslength- the number of bytes to read- Throws:
IOException
-
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointerin classorg.apache.lucene.store.IndexInput
-
seek
public void seek(long pos) throws IOException- Specified by:
seekin classorg.apache.lucene.store.IndexInput- Throws:
IOException
-
seekInternal
protected abstract void seekInternal(long pos) throws IOExceptionExpert: implements seek. Sets current position in this file, where the nextreadInternal(byte[],int,int)will occur.- Throws:
IOException- See Also:
readInternal(byte[],int,int)
-
clone
public org.apache.lucene.store.IndexInput clone()
- Overrides:
clonein classorg.apache.lucene.store.IndexInput
-
slice
public org.apache.lucene.store.IndexInput slice(String sliceDescription, long offset, long length) throws IOException
- Specified by:
slicein classorg.apache.lucene.store.IndexInput- Throws:
IOException
-
flushBuffer
protected int flushBuffer(org.apache.lucene.store.IndexOutput out, long numBytes) throws IOExceptionFlushes the in-memory bufer to the given output, copying at mostnumBytes.NOTE: this method does not refill the buffer, however it does advance the buffer position.
- Returns:
- the number of bytes actually flushed from the in-memory buffer.
- Throws:
IOException
-
-