HBASE-8938 Thrift2 does not close scanner instance (Hamed Madani)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1502798 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4371bae636
commit
88e4876eb8
|
@ -336,11 +336,17 @@ public class ThriftHBaseServiceHandler implements THBaseService.Iface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, TException {
|
public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, TException {
|
||||||
if (removeScanner(scannerId) == null) {
|
LOG.debug("scannerClose: id=" + scannerId);
|
||||||
|
ResultScanner scanner = getScanner(scannerId);
|
||||||
|
if (scanner == null) {
|
||||||
|
String message = "scanner ID is invalid";
|
||||||
|
LOG.warn(message);
|
||||||
TIllegalArgument ex = new TIllegalArgument();
|
TIllegalArgument ex = new TIllegalArgument();
|
||||||
ex.setMessage("Invalid scanner Id");
|
ex.setMessage("Invalid scanner Id");
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
scanner.close();
|
||||||
|
removeScanner(scannerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue