Search in sources :

Example 1 with GetFirstRowPrimaryKeyCallable

use of com.alibaba.datax.plugin.reader.otsreader.callable.GetFirstRowPrimaryKeyCallable 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)

Aggregations

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