HBASE-1779 ThriftServer logged error if getVer() result is empty
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@811220 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fde591c2d2
commit
aa2e21ceb6
|
@ -11,6 +11,7 @@ Release 0.21.0 - Unreleased
|
|||
HBASE-1698 Review documentation for o.a.h.h.mapreduce
|
||||
HBASE-1798 [Regression] Unable to delete a row in the future
|
||||
HBASE-1790 filters are not working correctly (HBASE-1710 HBASE-1807 too)
|
||||
HBASE-1779 ThriftServer logged error if getVer() result is empty
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-1760 Cleanup TODOs in HTable
|
||||
|
|
|
@ -278,9 +278,11 @@ public class ThriftServer {
|
|||
get.setMaxVersions(numVersions);
|
||||
Result result = table.get(get);
|
||||
List<Cell> cells = new ArrayList<Cell>();
|
||||
for(KeyValue kv : result.sorted()) {
|
||||
cells.add(new Cell(kv.getValue(), kv.getTimestamp()));
|
||||
}
|
||||
if ( ! result.isEmpty() ) {
|
||||
for(KeyValue kv : result.sorted()) {
|
||||
cells.add(new Cell(kv.getValue(), kv.getTimestamp()));
|
||||
}
|
||||
}
|
||||
return ThriftUtilities.cellFromHBase(cells.toArray(new Cell[0]));
|
||||
} catch (IOException e) {
|
||||
throw new IOError(e.getMessage());
|
||||
|
@ -304,12 +306,14 @@ public class ThriftServer {
|
|||
get.setTimeRange(Long.MIN_VALUE, timestamp);
|
||||
get.setMaxVersions(numVersions);
|
||||
Result result = table.get(get);
|
||||
List<Cell> cells = new ArrayList<Cell>();
|
||||
KeyValue [] kvs = result.sorted();
|
||||
if (kvs != null) {
|
||||
for(KeyValue kv : kvs) {
|
||||
cells.add(new Cell(kv.getValue(), kv.getTimestamp()));
|
||||
}
|
||||
List<Cell> cells = new ArrayList<Cell>();
|
||||
if ( ! result.isEmpty() ) {
|
||||
KeyValue [] kvs = result.sorted();
|
||||
if (kvs != null) {
|
||||
for(KeyValue kv : kvs) {
|
||||
cells.add(new Cell(kv.getValue(), kv.getTimestamp()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ThriftUtilities.cellFromHBase(cells.toArray(new Cell[0]));
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue