Package org.elasticsearch.index.translog
Class BufferedChecksumStreamInput
org.elasticsearch.common.io.stream.StreamInput
org.elasticsearch.common.io.stream.FilterStreamInput
org.elasticsearch.index.translog.BufferedChecksumStreamInput
- All Implemented Interfaces:
,
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, source)
BufferedChecksumStreamInput(StreamInput in, 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.
, , , , , , ,
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Constructor Details
-
BufferedChecksumStreamInput
-
BufferedChecksumStreamInput
-
-
Method Details
-
getChecksum
public long getChecksum() -
readByte
public byte readByte() throwsDescription copied from class:StreamInput
Reads and returns a single byte.- Overrides:
readByte
in classFilterStreamInput
- Throws:
-
readBytes
public void readBytes(byte[] b, int offset, int len) throwsDescription 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:
-
readShort
public short readShort() throws- Overrides:
readShort
in classFilterStreamInput
- Throws:
-
readInt
public int readInt() throwsDescription copied from class:StreamInput
Reads four bytes and returns an int.- Overrides:
readInt
in classFilterStreamInput
- Throws:
-
readLong
public long readLong() throwsDescription copied from class:StreamInput
Reads eight bytes and returns a long.- Overrides:
readLong
in classFilterStreamInput
- Throws:
-
readVInt
public int readVInt() throwsDescription 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:
-
readVLong
public long readVLong() throwsDescription 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:
-
reset
public void reset() throws- Overrides:
reset
in classFilterStreamInput
- Throws:
-
read
public int read() throws- Overrides:
read
in classFilterStreamInput
- Throws:
-
markSupported
public boolean markSupported()- Overrides:
in class
-
skip
public long skip(long numBytes) throws- Overrides:
in class
- Throws:
-
mark
public void mark(int readlimit)- Overrides:
in class
-
resetDigest
public void resetDigest() -
getSource
public getSource()
-