use of com.aliyun.openservices.ots.model.Row in project DataX by alibaba.
the class OtsReaderSlaveProxy method rowsToSender.
private void rowsToSender(List<Row> rows, RecordSender sender, List<OTSColumn> columns) {
for (Row row : rows) {
Record line = sender.createRecord();
line = Common.parseRowToLine(row, columns, line);
LOG.debug("Reader send record : {}", line.toString());
sender.sendToWriter(line);
}
}
use of com.aliyun.openservices.ots.model.Row in project DataX by alibaba.
the class GetFirstRowPrimaryKeyCallable method call.
@Override
public RowPrimaryKey call() throws Exception {
RowPrimaryKey ret = new RowPrimaryKey();
GetRangeRequest request = new GetRangeRequest();
request.setRangeRowQueryCriteria(criteria);
GetRangeResult result = ots.getRange(request);
List<Row> rows = result.getRows();
if (rows.isEmpty()) {
// no data
return null;
}
Row row = rows.get(0);
Map<String, PrimaryKeyType> pk = meta.getPrimaryKey();
for (String key : pk.keySet()) {
ColumnValue v = row.getColumns().get(key);
if (v.getType() == ColumnType.INTEGER) {
ret.addPrimaryKeyColumn(key, PrimaryKeyValue.fromLong(v.asLong()));
} else {
ret.addPrimaryKeyColumn(key, PrimaryKeyValue.fromString(v.asString()));
}
}
return ret;
}
Aggregations