Package org.apache.solr.blockcache
Class CustomBufferedIndexInput
java.lang.Object
org.apache.lucene.store.DataInput
org.apache.lucene.store.IndexInput
org.apache.solr.blockcache.CustomBufferedIndexInput
- All Implemented Interfaces:
Closeable,AutoCloseable,Cloneable
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 -
Constructor Summary
ConstructorsConstructorDescriptionCustomBufferedIndexInput(String resourceDesc) CustomBufferedIndexInput(String resourceDesc, int bufferSize) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.store.IndexInputclone()final voidclose()protected abstract voidprotected intflushBuffer(org.apache.lucene.store.IndexOutput out, long numBytes) Flushes the in-memory bufer to the given output, copying at mostnumBytes.longbytereadByte()voidreadBytes(byte[] b, int offset, int len) voidreadBytes(byte[] b, int offset, int len, boolean useBuffer) final intreadInt()protected abstract voidreadInternal(byte[] b, int offset, int length) Expert: implements buffer refill.final longreadLong()final shortfinal intreadVInt()final longvoidseek(long pos) protected abstract voidseekInternal(long pos) Expert: implements seek.org.apache.lucene.store.IndexInputMethods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, isLoaded, length, prefetch, randomAccessSlice, skipBytes, slice, toString, updateIOContextMethods inherited from class org.apache.lucene.store.DataInput
readFloats, readGroupVInt, readInts, readLongs, readMapOfStrings, readSetOfStrings, readString, readZInt, readZLong
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZE -
buffer
protected byte[] buffer
-
-
Constructor Details
-
CustomBufferedIndexInput
-
CustomBufferedIndexInput
-
-
Method Details
-
readByte
- Specified by:
readBytein classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readBytes
- Specified by:
readBytesin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readBytes
- Overrides:
readBytesin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readShort
- Overrides:
readShortin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readInt
- Overrides:
readIntin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readLong
- Overrides:
readLongin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readVInt
- Overrides:
readVIntin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
readVLong
- Overrides:
readVLongin classorg.apache.lucene.store.DataInput- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.lucene.store.IndexInput- Throws:
IOException
-
closeInternal
- Throws:
IOException
-
readInternal
Expert: 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
- Specified by:
seekin classorg.apache.lucene.store.IndexInput- Throws:
IOException
-
seekInternal
Expert: implements seek. Sets current position in this file, where the nextreadInternal(byte[],int,int)will occur.- Throws:
IOException- See Also:
-
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 IOException Flushes 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
-