Package org.apache.orc.impl
Class InStream
java.lang.Object
java.io.InputStream
org.apache.orc.impl.InStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
InStream.CompressedStream,InStream.UncompressedStream
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classImplements a stream over an encrypted, but uncompressed stream.static classstatic classImplements a stream over an uncompressed stream. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidabstract voidclose()static InStreamCreate an input stream from a list of disk ranges with data.static InStreamcreate(Object name, org.apache.hadoop.hive.common.io.DiskRangeList input, long offset, long length, InStream.StreamOptions options) Create an input stream from a list of disk ranges with data.static com.google.protobuf.CodedInputStreamcreateCodedInputStream(InStream inStream) Creates coded input stream (used for protobuf message parsing) with higher message size limit.static InStream.StreamOptionsoptions()protected voidreset(org.apache.hadoop.hive.common.io.DiskRangeList input) Reset the input to a new set of data.protected voidreset(org.apache.hadoop.hive.common.io.DiskRangeList input, long length) Reset the input to a new set of data with a different length.abstract voidseek(PositionProvider index) protected abstract voidsetCurrent(org.apache.hadoop.hive.common.io.DiskRangeList newRange, boolean isJump) Set the current rangetoString()Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
PROTOBUF_MESSAGE_MAX_LIMIT
public static final int PROTOBUF_MESSAGE_MAX_LIMIT- See Also:
-
name
-
offset
protected final long offset -
length
protected long length -
bytes
protected org.apache.hadoop.hive.common.io.DiskRangeList bytes -
position
protected long position
-
-
Constructor Details
-
InStream
-
-
Method Details
-
toString
-
close
public abstract void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream
-
setCurrent
protected abstract void setCurrent(org.apache.hadoop.hive.common.io.DiskRangeList newRange, boolean isJump) Set the current range- Parameters:
newRange- the block that is currentisJump- if this was a seek instead of a natural read
-
reset
protected void reset(org.apache.hadoop.hive.common.io.DiskRangeList input) Reset the input to a new set of data.- Parameters:
input- the input data
-
reset
protected void reset(org.apache.hadoop.hive.common.io.DiskRangeList input, long length) Reset the input to a new set of data with a different length. in some cases, after resetting an UncompressedStream, its actual length is longer than its initial length. Prior to ORC-516, InStream.UncompressedStream class had the 'length' field and the length was modifiable in the reset() method. It was used in SettableUncompressedStream class in setBuffers() method. SettableUncompressedStream was passing 'diskRangeInfo.getTotalLength()' as the length to the reset() method. SettableUncompressedStream had been removed from ORC code base, but it is required for Apache Hive and Apache Hive manages its own copy of SettableUncompressedStream since upgrading its Apache ORC version to 1.6.7. ORC-516 was the root cause of the regression reported in HIVE-27128 - EOFException when reading DATA stream. This wrapper method allows to resolve HIVE-27128.- Parameters:
input- the input datalength- new length of the stream
-
changeIv
-
seek
- Throws:
IOException
-
options
-
create
public static InStream create(Object name, org.apache.hadoop.hive.common.io.DiskRangeList input, long offset, long length, InStream.StreamOptions options) Create an input stream from a list of disk ranges with data.- Parameters:
name- the name of the streaminput- the list of ranges of bytes for the stream; from disk or cacheoffset- the first byte offset of the streamlength- the length in bytes of the streamoptions- the options to read with- Returns:
- an input stream
-
create
public static InStream create(Object name, org.apache.hadoop.hive.common.io.DiskRangeList input, long offset, long length) Create an input stream from a list of disk ranges with data.- Parameters:
name- the name of the streaminput- the list of ranges of bytes for the stream; from disk or cachelength- the length in bytes of the stream- Returns:
- an input stream
-
createCodedInputStream
Creates coded input stream (used for protobuf message parsing) with higher message size limit.- Parameters:
inStream- the stream to wrap.- Returns:
- coded input stream
-