public class TunnelRecordReader extends com.aliyun.odps.commons.proto.ProtobufRecordStreamReader
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECT_RETRYTIMES
底层网络重试次数, 4
|
static int |
DEFAULT_CONNECT_TIMEOUT
底层网络建立超时时间,30秒
|
Constructor and Description |
---|
TunnelRecordReader(long start,
long count,
List<Column> columns,
CompressOption option,
com.aliyun.odps.rest.RestClient tunnelRestClient,
InstanceTunnel.DownloadSession session)
构造此类对象
|
TunnelRecordReader(long start,
long count,
List<Column> columns,
CompressOption option,
com.aliyun.odps.rest.RestClient tunnelRestClient,
TableTunnel.DownloadSession session)
构造此类对象
|
TunnelRecordReader(long start,
long count,
long sizeLimit,
List<Column> columns,
CompressOption option,
com.aliyun.odps.rest.RestClient tunnelRestClient,
InstanceTunnel.DownloadSession session)
构造此类对象
|
TunnelRecordReader(TableSchema schema,
com.aliyun.odps.commons.transport.Connection conn,
CompressOption option)
Deprecated.
|
TunnelRecordReader(TableSchema schema,
List<Column> columns,
com.aliyun.odps.commons.transport.Connection conn,
CompressOption option)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
TableSchema |
getTableSchema() |
long |
getTotalBytes() |
Record |
read()
读取一条记录
|
Record |
read(Record reusedRecord)
使用 reuse 的Record 读取数据
当 reuseRecord 为 null 时,返回一个新的 Record 对象
当 reuseRecord 非 null 时, 返回 reuseRecord 本身
当数据读取完成, 返回 null
|
void |
setTransform(boolean shouldTransform) |
createEmptyRecord, readArray, readArray, readMap, readMap, readSchema, readStruct
public static final int DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_RETRYTIMES
@Deprecated public TunnelRecordReader(TableSchema schema, com.aliyun.odps.commons.transport.Connection conn, CompressOption option) throws IOException
schema
- ODPS表的Schema TableSchema
conn
- Connection
option
- CompressOption
IOException
@Deprecated public TunnelRecordReader(TableSchema schema, List<Column> columns, com.aliyun.odps.commons.transport.Connection conn, CompressOption option) throws IOException
schema
- ODPS表的Schema TableSchema
columns
- 需要读取的列 Column
conn
- Connection
option
- CompressOption
IOException
public TunnelRecordReader(long start, long count, List<Column> columns, CompressOption option, com.aliyun.odps.rest.RestClient tunnelRestClient, TableTunnel.DownloadSession session) throws TunnelException, IOException
columns
- 需要读取的列 Column
option
- CompressOption
start
- 本次要读取记录的起始位置count
- 本次要读取记录的数量session
- 本次读取所在 sessionIOException
TunnelException
public TunnelRecordReader(long start, long count, List<Column> columns, CompressOption option, com.aliyun.odps.rest.RestClient tunnelRestClient, InstanceTunnel.DownloadSession session) throws TunnelException, IOException
columns
- 需要读取的列 Column
option
- CompressOption
start
- 本次要读取记录的起始位置count
- 本次要读取记录的数量session
- 本次读取所在 sessionIOException
TunnelException
public TunnelRecordReader(long start, long count, long sizeLimit, List<Column> columns, CompressOption option, com.aliyun.odps.rest.RestClient tunnelRestClient, InstanceTunnel.DownloadSession session) throws TunnelException, IOException
columns
- 需要读取的列 Column
option
- CompressOption
start
- 本次要读取记录的起始位置count
- 本次要读取记录的数量sizeLimit
- 本次要读取记录的大小(Bytes)session
- 本次读取所在 sessionIOException
TunnelException
public void setTransform(boolean shouldTransform)
setTransform
in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReader
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReader
IOException
public Record read() throws IOException
RecordReader
read
in interface RecordReader
read
in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReader
Record
对象, 读取完成返回nullIOException
- 读取过程发生异常, 发生异常后不可重试public Record read(Record reusedRecord) throws IOException
com.aliyun.odps.commons.proto.ProtobufRecordStreamReader
read
in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReader
IOException
public long getTotalBytes()
getTotalBytes
in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReader
public TableSchema getTableSchema()
getTableSchema
in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReader
Copyright © 2023 Alibaba Cloud Computing. All rights reserved.