Class BufferedChecksumStreamOutput
java.lang.Object
java.io.OutputStream
org.opensearch.core.common.io.stream.StreamOutput
org.opensearch.core.common.io.stream.BufferedChecksumStreamOutput
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Similar to Lucene's BufferedChecksumIndexOutput, however this wraps a
StreamOutput so anything written will update the checksum- Opensearch.api:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this stream to further operations.voidflush()Forces any buffered output to be written.longvoidreset()voidvoidwriteByte(byte b) Writes a single byte.voidwriteBytes(byte[] b, int offset, int length) Writes an array of bytes.voidwriteCollection(Collection<? extends Writeable> collection) Writes a collection to this stream.void<K,V> void writeMap(Map<K, V> map, Writeable.Writer<K> keyWriter, Writeable.Writer<V> valueWriter) <K,V> void writeMapValues(Map<K, V> map, Writeable.Writer<V> valueWriter) voidwriteOptionalStringCollection(Collection<String> collection) Writes an optional collection of a strings.voidwriteStringArray(String[] array) voidwriteStringCollection(Collection<String> collection) Writes a collection of a strings.voidwriteVLongArray(long[] values) Methods inherited from class org.opensearch.core.common.io.stream.StreamOutput
checkWriteable, failOnTooManyNestedExceptions, getFeatures, getVersion, getWriter, hasFeature, position, seek, setFeatures, setVersion, write, write, writeArray, writeArray, writeBigInteger, writeBoolean, writeBuild, writeByteArray, writeBytes, writeBytes, writeBytesRef, writeBytesReference, writeCollection, writeDouble, writeDoubleArray, writeEnum, writeEnumSet, writeException, writeFloat, writeFloatArray, writeGenericValue, writeInstant, writeInt, writeIntArray, writeList, writeLong, writeLongArray, writeMapOfLists, writeMapWithConsistentOrder, writeNamedWriteable, writeNamedWriteableList, writeOptionalArray, writeOptionalArray, writeOptionalBoolean, writeOptionalBytesReference, writeOptionalDouble, writeOptionalEnumSet, writeOptionalFloat, writeOptionalInstant, writeOptionalInt, writeOptionalLong, writeOptionalNamedWriteable, writeOptionalSecureString, writeOptionalString, writeOptionalStringArray, writeOptionalText, writeOptionalTimeValue, writeOptionalVInt, writeOptionalVLong, writeOptionalWriteable, writeOptionalWriteable, writeOptionalZoneId, writeSecureString, writeSemverRange, writeShort, writeString, writeStringArrayNullable, writeText, writeTimeValue, writeVersion, writeVInt, writeVIntArray, writeVLong, writeVLongNoCheck, writeZLong, writeZoneIdMethods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
BufferedChecksumStreamOutput
-
-
Method Details
-
getChecksum
public long getChecksum() -
writeByte
Description copied from class:StreamOutputWrites a single byte.- Specified by:
writeBytein classStreamOutput- Throws:
IOException
-
writeBytes
Description copied from class:StreamOutputWrites an array of bytes.- Specified by:
writeBytesin classStreamOutput- Parameters:
b- the bytes to writeoffset- the offset in the byte arraylength- the number of bytes to write- Throws:
IOException
-
flush
Description copied from class:StreamOutputForces any buffered output to be written.- Specified by:
flushin interfaceFlushable- Specified by:
flushin classStreamOutput- Throws:
IOException
-
close
Description copied from class:StreamOutputCloses this stream to further operations.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classStreamOutput- Throws:
IOException
-
reset
- Specified by:
resetin classStreamOutput- Throws:
IOException
-
resetDigest
public void resetDigest() -
writeMap
- Overrides:
writeMapin classStreamOutput- Throws:
IOException
-
writeMap
public <K,V> void writeMap(Map<K, V> map, Writeable.Writer<K> keyWriter, Writeable.Writer<V> valueWriter) throws IOExceptionDescription copied from class:StreamOutputWrite aMapofK-type keys toV-type.Map<String, String> map = ...; out.writeMap(map, StreamOutput::writeString, StreamOutput::writeString);- Overrides:
writeMapin classStreamOutput- Parameters:
keyWriter- The key writervalueWriter- The value writer- Throws:
IOException
-
writeMapValues
- Throws:
IOException
-
writeStringArray
- Overrides:
writeStringArrayin classStreamOutput- Throws:
IOException
-
writeVLongArray
- Overrides:
writeVLongArrayin classStreamOutput- Throws:
IOException
-
writeCollection
Description copied from class:StreamOutputWrites a collection to this stream. The corresponding collection can be read from a stream input usingStreamInput.readList(Writeable.Reader).- Overrides:
writeCollectionin classStreamOutput- Parameters:
collection- the collection to write to this stream- Throws:
IOException- if an I/O exception occurs writing the collection
-
writeStringCollection
Description copied from class:StreamOutputWrites a collection of a strings. The corresponding collection can be read from a stream input usingStreamInput.readList(Writeable.Reader).- Overrides:
writeStringCollectionin classStreamOutput- Parameters:
collection- the collection of strings- Throws:
IOException- if an I/O exception occurs writing the collection
-
writeOptionalStringCollection
Description copied from class:StreamOutputWrites an optional collection of a strings. The corresponding collection can be read from a stream input usingStreamInput.readList(Writeable.Reader).- Overrides:
writeOptionalStringCollectionin classStreamOutput- Parameters:
collection- the collection of strings- Throws:
IOException- if an I/O exception occurs writing the collection
-