Search in sources :

Example 1 with RangeRowQueryCriteria

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());
}
Also used : GetFirstRowPrimaryKeyCallable(com.alibaba.datax.plugin.reader.otsreader.callable.GetFirstRowPrimaryKeyCallable) RangeRowQueryCriteria(com.aliyun.openservices.ots.model.RangeRowQueryCriteria)

Example 2 with RangeRowQueryCriteria

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);
}
Also used : GetRangeResult(com.aliyun.openservices.ots.model.GetRangeResult) GetRangeRequest(com.aliyun.openservices.ots.model.GetRangeRequest) RangeRowQueryCriteria(com.aliyun.openservices.ots.model.RangeRowQueryCriteria)

Example 3 with RangeRowQueryCriteria

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;
}
Also used : RangeRowQueryCriteria(com.aliyun.openservices.ots.model.RangeRowQueryCriteria)

Aggregations

RangeRowQueryCriteria (com.aliyun.openservices.ots.model.RangeRowQueryCriteria)3 GetFirstRowPrimaryKeyCallable (com.alibaba.datax.plugin.reader.otsreader.callable.GetFirstRowPrimaryKeyCallable)1 GetRangeRequest (com.aliyun.openservices.ots.model.GetRangeRequest)1 GetRangeResult (com.aliyun.openservices.ots.model.GetRangeResult)1