use of com.aliyun.openservices.ots.model.RangeRowQueryCriteria in project DataX by alibaba.
the class OtsReaderMasterProxy method getPKOfFirstRow.
private RowPrimaryKey getPKOfFirstRow(OTSRange range, Direction direction) throws Exception {
RangeRowQueryCriteria cur = new RangeRowQueryCriteria(this.conf.getTableName());
cur.setInclusiveStartPrimaryKey(range.getBegin());
cur.setExclusiveEndPrimaryKey(range.getEnd());
cur.setLimit(1);
cur.setColumnsToGet(Common.getPrimaryKeyNameList(meta));
cur.setDirection(direction);
return RetryHelper.executeWithRetry(new GetFirstRowPrimaryKeyCallable(ots, meta, cur), conf.getRetry(), conf.getSleepInMilliSecond());
}
use of com.aliyun.openservices.ots.model.RangeRowQueryCriteria in project DataX by alibaba.
the class OtsReaderSlaveProxy method generateRequestItem.
private RequestItem generateRequestItem(OTSClientAsync ots, OTSConf conf, RowPrimaryKey begin, RowPrimaryKey end, Direction direction, List<String> columns) throws Exception {
RangeRowQueryCriteria criteria = generateRangeRowQueryCriteria(conf.getTableName(), begin, end, direction, columns);
GetRangeRequest request = new GetRangeRequest();
request.setRangeRowQueryCriteria(criteria);
OTSFuture<GetRangeResult> future = ots.getRange(request);
return new RequestItem(criteria, future);
}
use of com.aliyun.openservices.ots.model.RangeRowQueryCriteria in project DataX by alibaba.
the class OtsReaderSlaveProxy method generateRangeRowQueryCriteria.
private RangeRowQueryCriteria generateRangeRowQueryCriteria(String tableName, RowPrimaryKey begin, RowPrimaryKey end, Direction direction, List<String> columns) {
RangeRowQueryCriteria criteria = new RangeRowQueryCriteria(tableName);
criteria.setInclusiveStartPrimaryKey(begin);
criteria.setDirection(direction);
criteria.setColumnsToGet(columns);
criteria.setLimit(-1);
criteria.setExclusiveEndPrimaryKey(end);
return criteria;
}
Aggregations