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
ConstructorsConstructorDescriptionBufferedChecksumStreamInput(StreamInput in, String source)BufferedChecksumStreamInput(StreamInput in, String source, BufferedChecksumStreamInput reuse) -
Method Summary
Modifier and TypeMethodDescriptionlongvoidmark(int readlimit)booleanintread()bytereadByte()Reads and returns a single byte.voidreadBytes(byte[] b, int offset, int len)Reads a specified number of bytes into an array at the specified offset.intreadInt()Reads four bytes and returns an int.longreadLong()Reads eight bytes and returns a long.shortintreadVInt()Reads an int stored in variable-length format.longReads a long stored in variable-length format.voidreset()voidlongskip(long numBytes)Methods inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
available, close, ensureCanReadBytes, getVersion, namedWriteableRegistry, readReleasableBytesReference, setVersionMethods 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, wrapMethods 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:StreamInputReads and returns a single byte.- Overrides:
readBytein classFilterStreamInput- Throws:
IOException
-
readBytes
Description copied from class:StreamInputReads a specified number of bytes into an array at the specified offset.- Overrides:
readBytesin 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:
readShortin classFilterStreamInput- Throws:
IOException
-
readInt
Description copied from class:StreamInputReads four bytes and returns an int.- Overrides:
readIntin classFilterStreamInput- Throws:
IOException
-
readLong
Description copied from class:StreamInputReads eight bytes and returns a long.- Overrides:
readLongin classFilterStreamInput- Throws:
IOException
-
readVInt
Description copied from class:StreamInputReads 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:
readVIntin classFilterStreamInput- Throws:
IOException
-
readVLong
Description copied from class:StreamInputReads 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:
readVLongin classFilterStreamInput- Throws:
IOException
-
reset
- Overrides:
resetin classFilterStreamInput- Throws:
IOException
-
read
- Overrides:
readin classFilterStreamInput- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit)- Overrides:
markin classInputStream
-
resetDigest
public void resetDigest() -
getSource
-