Package alluxio.underfs
Class ObjectPositionReader
- java.lang.Object
-
- alluxio.underfs.ObjectPositionReader
-
- All Implemented Interfaces:
PositionReader
,java.io.Closeable
,java.lang.AutoCloseable
public abstract class ObjectPositionReader extends java.lang.Object implements PositionReader
A stream for reading data using position reader.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
mBucketName
Name of the bucket the object resides in.protected long
mFileLength
Length of the file.protected java.lang.String
mPath
Path of the file when it is uploaded to object storage.
-
Constructor Summary
Constructors Constructor Description ObjectPositionReader(java.lang.String bucketName, java.lang.String path, long fileLength)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.io.InputStream
openObjectInputStream(long position, int bytesToRead)
int
readInternal(long position, ReadTargetBuffer buffer, int length)
-
-
-
Method Detail
-
readInternal
public int readInternal(long position, ReadTargetBuffer buffer, int length) throws java.io.IOException
- Specified by:
readInternal
in interfacePositionReader
- Parameters:
position
- position of the file to start reading databuffer
- target byte bufferlength
- bytes to read- Returns:
- bytes read, or -1 none of data is read
- Throws:
java.io.IOException
-
openObjectInputStream
protected abstract java.io.InputStream openObjectInputStream(long position, int bytesToRead) throws java.io.IOException
- Parameters:
position
- position of the file to start reading databytesToRead
- bytes to read- Returns:
- input stream of Object Storage's API
- Throws:
java.io.IOException
-
-