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:
Michael Stack 2009-09-04 04:57:26 +00:00
parent fde591c2d2
commit aa2e21ceb6
2 changed files with 14 additions and 9 deletions

View File

@ -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

View File

@ -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) {