HBASE-21007 Memory leak in HBase REST server

Close the scanner leak in rest server when using the limit number of rows.

Example: when using uris like

        /sometable/*?limit=5&startrow=eGlND&endrow=eGlNE

where the scan range has more rows than the limit, the
rest server will start leaking memmory.

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Bosko Devetak 2018-08-07 13:54:00 +00:00 committed by Andrew Purtell
parent 9d594ac86a
commit ff89ec17c4
1 changed files with 3 additions and 0 deletions

View File

@ -98,6 +98,9 @@ public class TableScanResource extends ResourceBase {
kv.getTimestamp(), CellUtil.cloneValue(kv)));
}
count--;
if (count == 0) {
results.close();
}
return rModel;
}
};