Package org.elasticsearch.index.translog
Class BufferedChecksumStreamInput
java.lang.Object
java.io.InputStream
org.elasticsearch.common.io.stream.StreamInput
org.elasticsearch.common.io.stream.FilterStreamInput
org.elasticsearch.index.translog.BufferedChecksumStreamInput
- All Implemented Interfaces:
Closeable
,AutoCloseable
Similar to Lucene's BufferedChecksumIndexInput, however this wraps a
StreamInput
so anything read will update the checksum-
Field Summary
Fields inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
delegate
-
Constructor Summary
ConstructorDescriptionBufferedChecksumStreamInput(StreamInput in, String source)
BufferedChecksumStreamInput(StreamInput in, String source, BufferedChecksumStreamInput reuse)
-
Method Summary
Modifier and TypeMethodDescriptionlong
void
mark(int readlimit)
boolean
int
read()
byte
readByte()
Reads and returns a single byte.void
readBytes(byte[] b, int offset, int len)
Reads a specified number of bytes into an array at the specified offset.int
readInt()
Reads four bytes and returns an int.long
readLong()
Reads eight bytes and returns a long.short
int
readVInt()
Reads an int stored in variable-length format.long
Reads a long stored in variable-length format.void
reset()
void
long
skip(long numBytes)
Methods inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
available, close, ensureCanReadBytes, getVersion, namedWriteableRegistry, readReleasableBytesReference, setVersion
Methods inherited from class org.elasticsearch.common.io.stream.StreamInput
readArray, readArraySize, readBigInteger, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readEnum, readEnumSet, readException, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readImmutableMap, readInstant, readIntArray, readList, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteable, readNamedWriteable, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalEnum, readOptionalFloat, readOptionalInstant, readOptionalInt, readOptionalLong, readOptionalNamedWriteable, readOptionalSecureString, readOptionalString, readOptionalStringArray, readOptionalStringList, readOptionalText, readOptionalTimeValue, readOptionalTimeZone, readOptionalVInt, readOptionalVLong, readOptionalWriteable, readOptionalZoneId, readOrderedMap, readSecureString, readSet, readString, readStringArray, readStringList, readText, readTimeValue, readTimeZone, readVIntArray, readVIntSlow, readVLongArray, readVLongSlow, readZLong, readZoneId, throwOnBrokenVInt, throwOnBrokenVLong, wrap, wrap
Methods inherited from class java.io.InputStream
nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
BufferedChecksumStreamInput
public BufferedChecksumStreamInput(StreamInput in, String source, BufferedChecksumStreamInput reuse) -
BufferedChecksumStreamInput
-
-
Method Details
-
getChecksum
public long getChecksum() -
readByte
Description copied from class:StreamInput
Reads and returns a single byte.- Overrides:
readByte
in classFilterStreamInput
- Throws:
IOException
-
readBytes
Description copied from class:StreamInput
Reads a specified number of bytes into an array at the specified offset.- Overrides:
readBytes
in classFilterStreamInput
- Parameters:
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to read- Throws:
IOException
-
readShort
- Overrides:
readShort
in classFilterStreamInput
- Throws:
IOException
-
readInt
Description copied from class:StreamInput
Reads four bytes and returns an int.- Overrides:
readInt
in classFilterStreamInput
- Throws:
IOException
-
readLong
Description copied from class:StreamInput
Reads eight bytes and returns a long.- Overrides:
readLong
in classFilterStreamInput
- Throws:
IOException
-
readVInt
Description copied from class:StreamInput
Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers will always use all 5 bytes and are therefore better serialized usingStreamInput.readInt()
- Overrides:
readVInt
in classFilterStreamInput
- Throws:
IOException
-
readVLong
Description copied from class:StreamInput
Reads a long stored in variable-length format. Reads between one and ten bytes. Smaller values take fewer bytes. Negative numbers are encoded in ten bytes so preferStreamInput.readLong()
orStreamInput.readZLong()
for negative numbers.- Overrides:
readVLong
in classFilterStreamInput
- Throws:
IOException
-
reset
- Overrides:
reset
in classFilterStreamInput
- Throws:
IOException
-
read
- Overrides:
read
in classFilterStreamInput
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit)- Overrides:
mark
in classInputStream
-
resetDigest
public void resetDigest() -
getSource
-