HBASE-16139 Use CellUtil instead of KeyValueUtil in Import (NIDHI GAMBHIR)

This commit is contained in:
tedyu 2016-06-29 02:45:00 -07:00
parent 432868b038
commit 6fb0dd07a8
2 changed files with 7 additions and 3 deletions

View File

@ -1506,6 +1506,10 @@ public final class CellUtil {
return new FirstOnRowCell(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()); return new FirstOnRowCell(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
} }
public static Cell createFirstOnRow(final byte [] row, int roffset, short rlength) {
return new FirstOnRowCell(row, roffset, rlength);
}
/** /**
* Create a Cell that is smaller than all other possible Cells for the given Cell's row. * Create a Cell that is smaller than all other possible Cells for the given Cell's row.
* *

View File

@ -209,7 +209,7 @@ public class Import extends Configured implements Tool {
+ Bytes.toString(row.get(), row.getOffset(), row.getLength())); + Bytes.toString(row.get(), row.getOffset(), row.getLength()));
} }
if (filter == null if (filter == null
|| !filter.filterRowKey(KeyValueUtil.createFirstOnRow(row.get(), row.getOffset(), || !filter.filterRowKey(CellUtil.createFirstOnRow(row.get(), row.getOffset(),
(short) row.getLength()))) { (short) row.getLength()))) {
for (Cell kv : value.rawCells()) { for (Cell kv : value.rawCells()) {
kv = filterKv(filter, kv); kv = filterKv(filter, kv);
@ -275,7 +275,7 @@ public class Import extends Configured implements Tool {
+ Bytes.toString(row.get(), row.getOffset(), row.getLength())); + Bytes.toString(row.get(), row.getOffset(), row.getLength()));
} }
if (filter == null if (filter == null
|| !filter.filterRowKey(KeyValueUtil.createFirstOnRow(row.get(), row.getOffset(), || !filter.filterRowKey(CellUtil.createFirstOnRow(row.get(), row.getOffset(),
(short) row.getLength()))) { (short) row.getLength()))) {
for (Cell kv : value.rawCells()) { for (Cell kv : value.rawCells()) {
kv = filterKv(filter, kv); kv = filterKv(filter, kv);
@ -332,7 +332,7 @@ public class Import extends Configured implements Tool {
+ Bytes.toString(key.get(), key.getOffset(), key.getLength())); + Bytes.toString(key.get(), key.getOffset(), key.getLength()));
} }
if (filter == null if (filter == null
|| !filter.filterRowKey(KeyValueUtil.createFirstOnRow(key.get(), key.getOffset(), || !filter.filterRowKey(CellUtil.createFirstOnRow(key.get(), key.getOffset(),
(short) key.getLength()))) { (short) key.getLength()))) {
processKV(key, result, context, put, delete); processKV(key, result, context, put, delete);
} }