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(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() |
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, readStructpublic 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 TableSchemaconn - Connectionoption - CompressOptionIOException@Deprecated public TunnelRecordReader(TableSchema schema, List<Column> columns, com.aliyun.odps.commons.transport.Connection conn, CompressOption option) throws IOException
schema - ODPS表的Schema TableSchemacolumns - 需要读取的列 Columnconn - Connectionoption - CompressOptionIOExceptionpublic TunnelRecordReader(long start,
long count,
List<Column> columns,
CompressOption option,
com.aliyun.odps.rest.RestClient tunnelRestClient,
TableTunnel.DownloadSession session)
throws TunnelException,
IOException
columns - 需要读取的列 Columnoption - CompressOptionstart - 本次要读取记录的起始位置count - 本次要读取记录的数量session - 本次读取所在 sessionIOExceptionTunnelExceptionpublic TunnelRecordReader(long start,
long count,
List<Column> columns,
CompressOption option,
com.aliyun.odps.rest.RestClient tunnelRestClient,
InstanceTunnel.DownloadSession session)
throws TunnelException,
IOException
columns - 需要读取的列 Columnoption - CompressOptionstart - 本次要读取记录的起始位置count - 本次要读取记录的数量session - 本次读取所在 sessionIOExceptionTunnelExceptionpublic void setTransform(boolean shouldTransform)
setTransform in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReaderpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReaderIOExceptionpublic Record read() throws IOException
RecordReaderread in interface RecordReaderread in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReaderRecord对象, 读取完成返回nullIOException - 读取过程发生异常, 发生异常后不可重试public Record read(Record reusedRecord) throws IOException
com.aliyun.odps.commons.proto.ProtobufRecordStreamReaderread in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReaderIOExceptionpublic long getTotalBytes()
getTotalBytes in class com.aliyun.odps.commons.proto.ProtobufRecordStreamReaderCopyright © 2019 Alibaba Cloud Computing. All rights reserved.