更新时间:2021-10-13 GMT+08:00
获取数据游标
参考初始化DIS客户端的操作初始化一个DIS客户端实例,实例名称为dic。
使用DIS SDK获取数据游标信息。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | // 配置通道名称
String streamName = "myStream";
// 配置数据下载分区ID
String partitionId = "0";
// 配置下载数据序列号
String startingSequenceNumber = "0";
// 配置下载数据方式
String cursorType = PartitionCursorTypeEnum.AT_SEQUENCE_NUMBER.name();
GetPartitionCursorRequest request = new GetPartitionCursorRequest();
request.setStreamName(streamName);
request.setPartitionId(partitionId);
request.setStartingSequenceNumber(startingSequenceNumber);
request.setCursorType(cursorType);
GetPartitionCursorResult response = dic.getPartitionCursor(request);
String cursor = response.getPartitionCursor();
|
父主题: 使用SDK(Java)
