From e85d2d45d3da493d89be8d13ec008676b6abefd9 Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Wed, 14 Dec 2011 19:57:42 +0000 Subject: [PATCH] HBASE-5026 Add coprocessor hook to HRegionServer.ScannerListener.leaseExpired() git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1214431 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../hadoop/hbase/regionserver/HRegionServer.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 16a233953e6..1e9143e88d4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -456,6 +456,7 @@ Release 0.92.0 - Unreleased HBASE-4610 Port HBASE-3380 (Master failover can split logs of live servers) to 92/trunk HBASE-4946 HTable.coprocessorExec (and possibly coprocessorProxy) does not work with dynamically loaded coprocessors (Andrei Dragomir) + HBASE-5026 Add coprocessor hook to HRegionServer.ScannerListener.leaseExpired() TESTS HBASE-4450 test for number of blocks read: to serve as baseline for expected diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 63a3ace1d6e..4d375263d70 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -2421,9 +2421,18 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler, RegionScanner s = scanners.remove(this.scannerName); if (s != null) { try { + HRegion region = getRegion(s.getRegionInfo().getRegionName()); + if (region != null && region.getCoprocessorHost() != null) { + region.getCoprocessorHost().preScannerClose(s); + } + s.close(); + if (region != null && region.getCoprocessorHost() != null) { + region.getCoprocessorHost().postScannerClose(s); + } } catch (IOException e) { - LOG.error("Closing scanner", e); + LOG.error("Closing scanner for " + + s.getRegionInfo().getRegionNameAsString(), e); } } }