hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [19/23] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Sat, 06 May 2017 14:59:26 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/3262a93a/devapidocs/org/apache/hadoop/hbase/util/package-tree.html
----------------------------------------------------------------------
diff --git a/devapidocs/org/apache/hadoop/hbase/util/package-tree.html b/devapidocs/org/apache/hadoop/hbase/util/package-tree.html
index d8a0347..04212de 100644
--- a/devapidocs/org/apache/hadoop/hbase/util/package-tree.html
+++ b/devapidocs/org/apache/hadoop/hbase/util/package-tree.html
@@ -519,13 +519,13 @@
 <ul>
 <li type="circle">java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Enum</span></a>&lt;E&gt; (implements java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;T&gt;, java.io.<a href="http://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>)
 <ul>
-<li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/IdReadWriteLock.ReferenceType.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">IdReadWriteLock.ReferenceType</span></a></li>
-<li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Bytes.LexicographicalComparerHolder.PureJavaComparer.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">Bytes.LexicographicalComparerHolder.PureJavaComparer</span></a> (implements org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Bytes.Comparer.html" title="interface in org.apache.hadoop.hbase.util">Bytes.Comparer</a>&lt;T&gt;)</li>
 <li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/PrettyPrinter.Unit.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">PrettyPrinter.Unit</span></a></li>
-<li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Bytes.LexicographicalComparerHolder.UnsafeComparer.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">Bytes.LexicographicalComparerHolder.UnsafeComparer</span></a> (implements org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Bytes.Comparer.html" title="interface in org.apache.hadoop.hbase.util">Bytes.Comparer</a>&lt;T&gt;)</li>
 <li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/PoolMap.PoolType.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">PoolMap.PoolType</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/ChecksumType.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">ChecksumType</span></a></li>
+<li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/IdReadWriteLock.ReferenceType.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">IdReadWriteLock.ReferenceType</span></a></li>
+<li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Bytes.LexicographicalComparerHolder.UnsafeComparer.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">Bytes.LexicographicalComparerHolder.UnsafeComparer</span></a> (implements org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Bytes.Comparer.html" title="interface in org.apache.hadoop.hbase.util">Bytes.Comparer</a>&lt;T&gt;)</li>
 <li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/HBaseFsck.ErrorReporter.ERROR_CODE.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">HBaseFsck.ErrorReporter.ERROR_CODE</span></a></li>
+<li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Bytes.LexicographicalComparerHolder.PureJavaComparer.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">Bytes.LexicographicalComparerHolder.PureJavaComparer</span></a> (implements org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Bytes.Comparer.html" title="interface in org.apache.hadoop.hbase.util">Bytes.Comparer</a>&lt;T&gt;)</li>
 <li type="circle">org.apache.hadoop.hbase.util.<a href="../../../../../org/apache/hadoop/hbase/util/Order.html" title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">Order</span></a></li>
 </ul>
 </li>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/3262a93a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
index 411342e..c94dbb8 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
@@ -16,11 +16,11 @@
 <span class="sourceLineNo">008</span>@InterfaceAudience.Private<a name="line.8"></a>
 <span class="sourceLineNo">009</span>public class Version {<a name="line.9"></a>
 <span class="sourceLineNo">010</span>  public static final String version = "2.0.0-SNAPSHOT";<a name="line.10"></a>
-<span class="sourceLineNo">011</span>  public static final String revision = "2026540ea347e9359e6ac8cf8b3701cd3872a515";<a name="line.11"></a>
+<span class="sourceLineNo">011</span>  public static final String revision = "0d0ccc38fe59c555176d73e23595a9b569251329";<a name="line.11"></a>
 <span class="sourceLineNo">012</span>  public static final String user = "jenkins";<a name="line.12"></a>
-<span class="sourceLineNo">013</span>  public static final String date = "Fri May  5 14:38:49 UTC 2017";<a name="line.13"></a>
+<span class="sourceLineNo">013</span>  public static final String date = "Sat May  6 14:39:07 UTC 2017";<a name="line.13"></a>
 <span class="sourceLineNo">014</span>  public static final String url = "git://asf920.gq1.ygridcore.net/home/jenkins/jenkins-slave/workspace/hbase_generate_website/hbase";<a name="line.14"></a>
-<span class="sourceLineNo">015</span>  public static final String srcChecksum = "54f389bd1b972e2318608b4907b1209d";<a name="line.15"></a>
+<span class="sourceLineNo">015</span>  public static final String srcChecksum = "e2efc8723d9b8ff8c1eb0dfe68fba295";<a name="line.15"></a>
 <span class="sourceLineNo">016</span>}<a name="line.16"></a>
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/3262a93a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/RSRpcServices.RegionScannerCloseCallBack.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/RSRpcServices.RegionScannerCloseCallBack.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/RSRpcServices.RegionScannerCloseCallBack.html
index ac9ce7d..17d1bcb 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/RSRpcServices.RegionScannerCloseCallBack.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/RSRpcServices.RegionScannerCloseCallBack.html
@@ -3016,230 +3016,233 @@
 <span class="sourceLineNo">3008</span>    try {<a name="line.3008"></a>
 <span class="sourceLineNo">3009</span>      if (request.hasScannerId()) {<a name="line.3009"></a>
 <span class="sourceLineNo">3010</span>        rsh = getRegionScanner(request);<a name="line.3010"></a>
-<span class="sourceLineNo">3011</span>      } else {<a name="line.3011"></a>
-<span class="sourceLineNo">3012</span>        rsh = newRegionScanner(request, builder);<a name="line.3012"></a>
-<span class="sourceLineNo">3013</span>      }<a name="line.3013"></a>
-<span class="sourceLineNo">3014</span>    } catch (IOException e) {<a name="line.3014"></a>
-<span class="sourceLineNo">3015</span>      if (e == SCANNER_ALREADY_CLOSED) {<a name="line.3015"></a>
-<span class="sourceLineNo">3016</span>        // Now we will close scanner automatically if there are no more results for this region but<a name="line.3016"></a>
-<span class="sourceLineNo">3017</span>        // the old client will still send a close request to us. Just ignore it and return.<a name="line.3017"></a>
-<span class="sourceLineNo">3018</span>        return builder.build();<a name="line.3018"></a>
-<span class="sourceLineNo">3019</span>      }<a name="line.3019"></a>
-<span class="sourceLineNo">3020</span>      throw new ServiceException(e);<a name="line.3020"></a>
-<span class="sourceLineNo">3021</span>    }<a name="line.3021"></a>
-<span class="sourceLineNo">3022</span>    Region region = rsh.r;<a name="line.3022"></a>
-<span class="sourceLineNo">3023</span>    String scannerName = rsh.scannerName;<a name="line.3023"></a>
-<span class="sourceLineNo">3024</span>    Leases.Lease lease;<a name="line.3024"></a>
-<span class="sourceLineNo">3025</span>    try {<a name="line.3025"></a>
-<span class="sourceLineNo">3026</span>      // Remove lease while its being processed in server; protects against case<a name="line.3026"></a>
-<span class="sourceLineNo">3027</span>      // where processing of request takes &gt; lease expiration time.<a name="line.3027"></a>
-<span class="sourceLineNo">3028</span>      lease = regionServer.leases.removeLease(scannerName);<a name="line.3028"></a>
-<span class="sourceLineNo">3029</span>    } catch (LeaseException e) {<a name="line.3029"></a>
-<span class="sourceLineNo">3030</span>      throw new ServiceException(e);<a name="line.3030"></a>
-<span class="sourceLineNo">3031</span>    }<a name="line.3031"></a>
-<span class="sourceLineNo">3032</span>    if (request.hasRenew() &amp;&amp; request.getRenew()) {<a name="line.3032"></a>
-<span class="sourceLineNo">3033</span>      // add back and return<a name="line.3033"></a>
-<span class="sourceLineNo">3034</span>      addScannerLeaseBack(lease);<a name="line.3034"></a>
-<span class="sourceLineNo">3035</span>      try {<a name="line.3035"></a>
-<span class="sourceLineNo">3036</span>        checkScanNextCallSeq(request, rsh);<a name="line.3036"></a>
-<span class="sourceLineNo">3037</span>      } catch (OutOfOrderScannerNextException e) {<a name="line.3037"></a>
-<span class="sourceLineNo">3038</span>        throw new ServiceException(e);<a name="line.3038"></a>
-<span class="sourceLineNo">3039</span>      }<a name="line.3039"></a>
-<span class="sourceLineNo">3040</span>      return builder.build();<a name="line.3040"></a>
-<span class="sourceLineNo">3041</span>    }<a name="line.3041"></a>
-<span class="sourceLineNo">3042</span>    OperationQuota quota;<a name="line.3042"></a>
-<span class="sourceLineNo">3043</span>    try {<a name="line.3043"></a>
-<span class="sourceLineNo">3044</span>      quota = getQuotaManager().checkQuota(region, OperationQuota.OperationType.SCAN);<a name="line.3044"></a>
-<span class="sourceLineNo">3045</span>    } catch (IOException e) {<a name="line.3045"></a>
-<span class="sourceLineNo">3046</span>      addScannerLeaseBack(lease);<a name="line.3046"></a>
-<span class="sourceLineNo">3047</span>      throw new ServiceException(e);<a name="line.3047"></a>
-<span class="sourceLineNo">3048</span>    };<a name="line.3048"></a>
-<span class="sourceLineNo">3049</span>    try {<a name="line.3049"></a>
-<span class="sourceLineNo">3050</span>      checkScanNextCallSeq(request, rsh);<a name="line.3050"></a>
-<span class="sourceLineNo">3051</span>    } catch (OutOfOrderScannerNextException e) {<a name="line.3051"></a>
-<span class="sourceLineNo">3052</span>      addScannerLeaseBack(lease);<a name="line.3052"></a>
-<span class="sourceLineNo">3053</span>      throw new ServiceException(e);<a name="line.3053"></a>
-<span class="sourceLineNo">3054</span>    }<a name="line.3054"></a>
-<span class="sourceLineNo">3055</span>    // Now we have increased the next call sequence. If we give client an error, the retry will<a name="line.3055"></a>
-<span class="sourceLineNo">3056</span>    // never success. So we'd better close the scanner and return a DoNotRetryIOException to client<a name="line.3056"></a>
-<span class="sourceLineNo">3057</span>    // and then client will try to open a new scanner.<a name="line.3057"></a>
-<span class="sourceLineNo">3058</span>    boolean closeScanner = request.hasCloseScanner() ? request.getCloseScanner() : false;<a name="line.3058"></a>
-<span class="sourceLineNo">3059</span>    int rows; // this is scan.getCaching<a name="line.3059"></a>
-<span class="sourceLineNo">3060</span>    if (request.hasNumberOfRows()) {<a name="line.3060"></a>
-<span class="sourceLineNo">3061</span>      rows = request.getNumberOfRows();<a name="line.3061"></a>
-<span class="sourceLineNo">3062</span>    } else {<a name="line.3062"></a>
-<span class="sourceLineNo">3063</span>      rows = closeScanner ? 0 : 1;<a name="line.3063"></a>
-<span class="sourceLineNo">3064</span>    }<a name="line.3064"></a>
-<span class="sourceLineNo">3065</span>    RpcCallContext context = RpcServer.getCurrentCall();<a name="line.3065"></a>
-<span class="sourceLineNo">3066</span>    // now let's do the real scan.<a name="line.3066"></a>
-<span class="sourceLineNo">3067</span>    long maxQuotaResultSize = Math.min(maxScannerResultSize, quota.getReadAvailable());<a name="line.3067"></a>
-<span class="sourceLineNo">3068</span>    RegionScanner scanner = rsh.s;<a name="line.3068"></a>
-<span class="sourceLineNo">3069</span>    // this is the limit of rows for this scan, if we the number of rows reach this value, we will<a name="line.3069"></a>
-<span class="sourceLineNo">3070</span>    // close the scanner.<a name="line.3070"></a>
-<span class="sourceLineNo">3071</span>    int limitOfRows;<a name="line.3071"></a>
-<span class="sourceLineNo">3072</span>    if (request.hasLimitOfRows()) {<a name="line.3072"></a>
-<span class="sourceLineNo">3073</span>      limitOfRows = request.getLimitOfRows();<a name="line.3073"></a>
-<span class="sourceLineNo">3074</span>    } else {<a name="line.3074"></a>
-<span class="sourceLineNo">3075</span>      limitOfRows = -1;<a name="line.3075"></a>
-<span class="sourceLineNo">3076</span>    }<a name="line.3076"></a>
-<span class="sourceLineNo">3077</span>    MutableObject lastBlock = new MutableObject();<a name="line.3077"></a>
-<span class="sourceLineNo">3078</span>    boolean scannerClosed = false;<a name="line.3078"></a>
-<span class="sourceLineNo">3079</span>    try {<a name="line.3079"></a>
-<span class="sourceLineNo">3080</span>      List&lt;Result&gt; results = new ArrayList&lt;&gt;();<a name="line.3080"></a>
-<span class="sourceLineNo">3081</span>      if (rows &gt; 0) {<a name="line.3081"></a>
-<span class="sourceLineNo">3082</span>        boolean done = false;<a name="line.3082"></a>
-<span class="sourceLineNo">3083</span>        // Call coprocessor. Get region info from scanner.<a name="line.3083"></a>
-<span class="sourceLineNo">3084</span>        if (region.getCoprocessorHost() != null) {<a name="line.3084"></a>
-<span class="sourceLineNo">3085</span>          Boolean bypass = region.getCoprocessorHost().preScannerNext(scanner, results, rows);<a name="line.3085"></a>
-<span class="sourceLineNo">3086</span>          if (!results.isEmpty()) {<a name="line.3086"></a>
-<span class="sourceLineNo">3087</span>            for (Result r : results) {<a name="line.3087"></a>
-<span class="sourceLineNo">3088</span>              lastBlock.setValue(addSize(context, r, lastBlock.getValue()));<a name="line.3088"></a>
-<span class="sourceLineNo">3089</span>            }<a name="line.3089"></a>
-<span class="sourceLineNo">3090</span>          }<a name="line.3090"></a>
-<span class="sourceLineNo">3091</span>          if (bypass != null &amp;&amp; bypass.booleanValue()) {<a name="line.3091"></a>
-<span class="sourceLineNo">3092</span>            done = true;<a name="line.3092"></a>
+<span class="sourceLineNo">3011</span>        // The downstream projects such as AsyncHBase in OpenTSDB need this value. See HBASE-18000<a name="line.3011"></a>
+<span class="sourceLineNo">3012</span>        // for more details.<a name="line.3012"></a>
+<span class="sourceLineNo">3013</span>        builder.setScannerId(request.getScannerId());<a name="line.3013"></a>
+<span class="sourceLineNo">3014</span>      } else {<a name="line.3014"></a>
+<span class="sourceLineNo">3015</span>        rsh = newRegionScanner(request, builder);<a name="line.3015"></a>
+<span class="sourceLineNo">3016</span>      }<a name="line.3016"></a>
+<span class="sourceLineNo">3017</span>    } catch (IOException e) {<a name="line.3017"></a>
+<span class="sourceLineNo">3018</span>      if (e == SCANNER_ALREADY_CLOSED) {<a name="line.3018"></a>
+<span class="sourceLineNo">3019</span>        // Now we will close scanner automatically if there are no more results for this region but<a name="line.3019"></a>
+<span class="sourceLineNo">3020</span>        // the old client will still send a close request to us. Just ignore it and return.<a name="line.3020"></a>
+<span class="sourceLineNo">3021</span>        return builder.build();<a name="line.3021"></a>
+<span class="sourceLineNo">3022</span>      }<a name="line.3022"></a>
+<span class="sourceLineNo">3023</span>      throw new ServiceException(e);<a name="line.3023"></a>
+<span class="sourceLineNo">3024</span>    }<a name="line.3024"></a>
+<span class="sourceLineNo">3025</span>    Region region = rsh.r;<a name="line.3025"></a>
+<span class="sourceLineNo">3026</span>    String scannerName = rsh.scannerName;<a name="line.3026"></a>
+<span class="sourceLineNo">3027</span>    Leases.Lease lease;<a name="line.3027"></a>
+<span class="sourceLineNo">3028</span>    try {<a name="line.3028"></a>
+<span class="sourceLineNo">3029</span>      // Remove lease while its being processed in server; protects against case<a name="line.3029"></a>
+<span class="sourceLineNo">3030</span>      // where processing of request takes &gt; lease expiration time.<a name="line.3030"></a>
+<span class="sourceLineNo">3031</span>      lease = regionServer.leases.removeLease(scannerName);<a name="line.3031"></a>
+<span class="sourceLineNo">3032</span>    } catch (LeaseException e) {<a name="line.3032"></a>
+<span class="sourceLineNo">3033</span>      throw new ServiceException(e);<a name="line.3033"></a>
+<span class="sourceLineNo">3034</span>    }<a name="line.3034"></a>
+<span class="sourceLineNo">3035</span>    if (request.hasRenew() &amp;&amp; request.getRenew()) {<a name="line.3035"></a>
+<span class="sourceLineNo">3036</span>      // add back and return<a name="line.3036"></a>
+<span class="sourceLineNo">3037</span>      addScannerLeaseBack(lease);<a name="line.3037"></a>
+<span class="sourceLineNo">3038</span>      try {<a name="line.3038"></a>
+<span class="sourceLineNo">3039</span>        checkScanNextCallSeq(request, rsh);<a name="line.3039"></a>
+<span class="sourceLineNo">3040</span>      } catch (OutOfOrderScannerNextException e) {<a name="line.3040"></a>
+<span class="sourceLineNo">3041</span>        throw new ServiceException(e);<a name="line.3041"></a>
+<span class="sourceLineNo">3042</span>      }<a name="line.3042"></a>
+<span class="sourceLineNo">3043</span>      return builder.build();<a name="line.3043"></a>
+<span class="sourceLineNo">3044</span>    }<a name="line.3044"></a>
+<span class="sourceLineNo">3045</span>    OperationQuota quota;<a name="line.3045"></a>
+<span class="sourceLineNo">3046</span>    try {<a name="line.3046"></a>
+<span class="sourceLineNo">3047</span>      quota = getQuotaManager().checkQuota(region, OperationQuota.OperationType.SCAN);<a name="line.3047"></a>
+<span class="sourceLineNo">3048</span>    } catch (IOException e) {<a name="line.3048"></a>
+<span class="sourceLineNo">3049</span>      addScannerLeaseBack(lease);<a name="line.3049"></a>
+<span class="sourceLineNo">3050</span>      throw new ServiceException(e);<a name="line.3050"></a>
+<span class="sourceLineNo">3051</span>    };<a name="line.3051"></a>
+<span class="sourceLineNo">3052</span>    try {<a name="line.3052"></a>
+<span class="sourceLineNo">3053</span>      checkScanNextCallSeq(request, rsh);<a name="line.3053"></a>
+<span class="sourceLineNo">3054</span>    } catch (OutOfOrderScannerNextException e) {<a name="line.3054"></a>
+<span class="sourceLineNo">3055</span>      addScannerLeaseBack(lease);<a name="line.3055"></a>
+<span class="sourceLineNo">3056</span>      throw new ServiceException(e);<a name="line.3056"></a>
+<span class="sourceLineNo">3057</span>    }<a name="line.3057"></a>
+<span class="sourceLineNo">3058</span>    // Now we have increased the next call sequence. If we give client an error, the retry will<a name="line.3058"></a>
+<span class="sourceLineNo">3059</span>    // never success. So we'd better close the scanner and return a DoNotRetryIOException to client<a name="line.3059"></a>
+<span class="sourceLineNo">3060</span>    // and then client will try to open a new scanner.<a name="line.3060"></a>
+<span class="sourceLineNo">3061</span>    boolean closeScanner = request.hasCloseScanner() ? request.getCloseScanner() : false;<a name="line.3061"></a>
+<span class="sourceLineNo">3062</span>    int rows; // this is scan.getCaching<a name="line.3062"></a>
+<span class="sourceLineNo">3063</span>    if (request.hasNumberOfRows()) {<a name="line.3063"></a>
+<span class="sourceLineNo">3064</span>      rows = request.getNumberOfRows();<a name="line.3064"></a>
+<span class="sourceLineNo">3065</span>    } else {<a name="line.3065"></a>
+<span class="sourceLineNo">3066</span>      rows = closeScanner ? 0 : 1;<a name="line.3066"></a>
+<span class="sourceLineNo">3067</span>    }<a name="line.3067"></a>
+<span class="sourceLineNo">3068</span>    RpcCallContext context = RpcServer.getCurrentCall();<a name="line.3068"></a>
+<span class="sourceLineNo">3069</span>    // now let's do the real scan.<a name="line.3069"></a>
+<span class="sourceLineNo">3070</span>    long maxQuotaResultSize = Math.min(maxScannerResultSize, quota.getReadAvailable());<a name="line.3070"></a>
+<span class="sourceLineNo">3071</span>    RegionScanner scanner = rsh.s;<a name="line.3071"></a>
+<span class="sourceLineNo">3072</span>    // this is the limit of rows for this scan, if we the number of rows reach this value, we will<a name="line.3072"></a>
+<span class="sourceLineNo">3073</span>    // close the scanner.<a name="line.3073"></a>
+<span class="sourceLineNo">3074</span>    int limitOfRows;<a name="line.3074"></a>
+<span class="sourceLineNo">3075</span>    if (request.hasLimitOfRows()) {<a name="line.3075"></a>
+<span class="sourceLineNo">3076</span>      limitOfRows = request.getLimitOfRows();<a name="line.3076"></a>
+<span class="sourceLineNo">3077</span>    } else {<a name="line.3077"></a>
+<span class="sourceLineNo">3078</span>      limitOfRows = -1;<a name="line.3078"></a>
+<span class="sourceLineNo">3079</span>    }<a name="line.3079"></a>
+<span class="sourceLineNo">3080</span>    MutableObject lastBlock = new MutableObject();<a name="line.3080"></a>
+<span class="sourceLineNo">3081</span>    boolean scannerClosed = false;<a name="line.3081"></a>
+<span class="sourceLineNo">3082</span>    try {<a name="line.3082"></a>
+<span class="sourceLineNo">3083</span>      List&lt;Result&gt; results = new ArrayList&lt;&gt;();<a name="line.3083"></a>
+<span class="sourceLineNo">3084</span>      if (rows &gt; 0) {<a name="line.3084"></a>
+<span class="sourceLineNo">3085</span>        boolean done = false;<a name="line.3085"></a>
+<span class="sourceLineNo">3086</span>        // Call coprocessor. Get region info from scanner.<a name="line.3086"></a>
+<span class="sourceLineNo">3087</span>        if (region.getCoprocessorHost() != null) {<a name="line.3087"></a>
+<span class="sourceLineNo">3088</span>          Boolean bypass = region.getCoprocessorHost().preScannerNext(scanner, results, rows);<a name="line.3088"></a>
+<span class="sourceLineNo">3089</span>          if (!results.isEmpty()) {<a name="line.3089"></a>
+<span class="sourceLineNo">3090</span>            for (Result r : results) {<a name="line.3090"></a>
+<span class="sourceLineNo">3091</span>              lastBlock.setValue(addSize(context, r, lastBlock.getValue()));<a name="line.3091"></a>
+<span class="sourceLineNo">3092</span>            }<a name="line.3092"></a>
 <span class="sourceLineNo">3093</span>          }<a name="line.3093"></a>
-<span class="sourceLineNo">3094</span>        }<a name="line.3094"></a>
-<span class="sourceLineNo">3095</span>        if (!done) {<a name="line.3095"></a>
-<span class="sourceLineNo">3096</span>          scan((HBaseRpcController) controller, request, rsh, maxQuotaResultSize, rows, limitOfRows,<a name="line.3096"></a>
-<span class="sourceLineNo">3097</span>            results, builder, lastBlock, context);<a name="line.3097"></a>
-<span class="sourceLineNo">3098</span>        }<a name="line.3098"></a>
-<span class="sourceLineNo">3099</span>      }<a name="line.3099"></a>
-<span class="sourceLineNo">3100</span><a name="line.3100"></a>
-<span class="sourceLineNo">3101</span>      quota.addScanResult(results);<a name="line.3101"></a>
-<span class="sourceLineNo">3102</span>      addResults(builder, results, (HBaseRpcController) controller,<a name="line.3102"></a>
-<span class="sourceLineNo">3103</span>        RegionReplicaUtil.isDefaultReplica(region.getRegionInfo()),<a name="line.3103"></a>
-<span class="sourceLineNo">3104</span>        isClientCellBlockSupport(context));<a name="line.3104"></a>
-<span class="sourceLineNo">3105</span>      if (scanner.isFilterDone() &amp;&amp; results.isEmpty()) {<a name="line.3105"></a>
-<span class="sourceLineNo">3106</span>        // If the scanner's filter - if any - is done with the scan<a name="line.3106"></a>
-<span class="sourceLineNo">3107</span>        // only set moreResults to false if the results is empty. This is used to keep compatible<a name="line.3107"></a>
-<span class="sourceLineNo">3108</span>        // with the old scan implementation where we just ignore the returned results if moreResults<a name="line.3108"></a>
-<span class="sourceLineNo">3109</span>        // is false. Can remove the isEmpty check after we get rid of the old implementation.<a name="line.3109"></a>
-<span class="sourceLineNo">3110</span>        builder.setMoreResults(false);<a name="line.3110"></a>
-<span class="sourceLineNo">3111</span>      }<a name="line.3111"></a>
-<span class="sourceLineNo">3112</span>      // we only set moreResults to false in the above code, so set it to true if we haven't set it<a name="line.3112"></a>
-<span class="sourceLineNo">3113</span>      // yet.<a name="line.3113"></a>
-<span class="sourceLineNo">3114</span>      if (!builder.hasMoreResults()) {<a name="line.3114"></a>
-<span class="sourceLineNo">3115</span>        builder.setMoreResults(true);<a name="line.3115"></a>
-<span class="sourceLineNo">3116</span>      }<a name="line.3116"></a>
-<span class="sourceLineNo">3117</span>      if (builder.getMoreResults() &amp;&amp; builder.getMoreResultsInRegion() &amp;&amp; !results.isEmpty()) {<a name="line.3117"></a>
-<span class="sourceLineNo">3118</span>        // Record the last cell of the last result if it is a partial result<a name="line.3118"></a>
-<span class="sourceLineNo">3119</span>        // We need this to calculate the complete rows we have returned to client as the<a name="line.3119"></a>
-<span class="sourceLineNo">3120</span>        // mayHaveMoreCellsInRow is true does not mean that there will be extra cells for the<a name="line.3120"></a>
-<span class="sourceLineNo">3121</span>        // current row. We may filter out all the remaining cells for the current row and just<a name="line.3121"></a>
-<span class="sourceLineNo">3122</span>        // return the cells of the nextRow when calling RegionScanner.nextRaw. So here we need to<a name="line.3122"></a>
-<span class="sourceLineNo">3123</span>        // check for row change.<a name="line.3123"></a>
-<span class="sourceLineNo">3124</span>        Result lastResult = results.get(results.size() - 1);<a name="line.3124"></a>
-<span class="sourceLineNo">3125</span>        if (lastResult.mayHaveMoreCellsInRow()) {<a name="line.3125"></a>
-<span class="sourceLineNo">3126</span>          rsh.rowOfLastPartialResult = lastResult.getRow();<a name="line.3126"></a>
-<span class="sourceLineNo">3127</span>        } else {<a name="line.3127"></a>
-<span class="sourceLineNo">3128</span>          rsh.rowOfLastPartialResult = null;<a name="line.3128"></a>
-<span class="sourceLineNo">3129</span>        }<a name="line.3129"></a>
-<span class="sourceLineNo">3130</span>      }<a name="line.3130"></a>
-<span class="sourceLineNo">3131</span>      if (!builder.getMoreResults() || !builder.getMoreResultsInRegion() || closeScanner) {<a name="line.3131"></a>
-<span class="sourceLineNo">3132</span>        scannerClosed = true;<a name="line.3132"></a>
-<span class="sourceLineNo">3133</span>        closeScanner(region, scanner, scannerName, context);<a name="line.3133"></a>
-<span class="sourceLineNo">3134</span>      }<a name="line.3134"></a>
-<span class="sourceLineNo">3135</span>      return builder.build();<a name="line.3135"></a>
-<span class="sourceLineNo">3136</span>    } catch (Exception e) {<a name="line.3136"></a>
-<span class="sourceLineNo">3137</span>      try {<a name="line.3137"></a>
-<span class="sourceLineNo">3138</span>        // scanner is closed here<a name="line.3138"></a>
-<span class="sourceLineNo">3139</span>        scannerClosed = true;<a name="line.3139"></a>
-<span class="sourceLineNo">3140</span>        // The scanner state might be left in a dirty state, so we will tell the Client to<a name="line.3140"></a>
-<span class="sourceLineNo">3141</span>        // fail this RPC and close the scanner while opening up another one from the start of<a name="line.3141"></a>
-<span class="sourceLineNo">3142</span>        // row that the client has last seen.<a name="line.3142"></a>
-<span class="sourceLineNo">3143</span>        closeScanner(region, scanner, scannerName, context);<a name="line.3143"></a>
-<span class="sourceLineNo">3144</span><a name="line.3144"></a>
-<span class="sourceLineNo">3145</span>        // If it is a DoNotRetryIOException already, throw as it is. Unfortunately, DNRIOE is<a name="line.3145"></a>
-<span class="sourceLineNo">3146</span>        // used in two different semantics.<a name="line.3146"></a>
-<span class="sourceLineNo">3147</span>        // (1) The first is to close the client scanner and bubble up the exception all the way<a name="line.3147"></a>
-<span class="sourceLineNo">3148</span>        // to the application. This is preferred when the exception is really un-recoverable<a name="line.3148"></a>
-<span class="sourceLineNo">3149</span>        // (like CorruptHFileException, etc). Plain DoNotRetryIOException also falls into this<a name="line.3149"></a>
-<span class="sourceLineNo">3150</span>        // bucket usually.<a name="line.3150"></a>
-<span class="sourceLineNo">3151</span>        // (2) Second semantics is to close the current region scanner only, but continue the<a name="line.3151"></a>
-<span class="sourceLineNo">3152</span>        // client scanner by overriding the exception. This is usually UnknownScannerException,<a name="line.3152"></a>
-<span class="sourceLineNo">3153</span>        // OutOfOrderScannerNextException, etc where the region scanner has to be closed, but the<a name="line.3153"></a>
-<span class="sourceLineNo">3154</span>        // application-level ClientScanner has to continue without bubbling up the exception to<a name="line.3154"></a>
-<span class="sourceLineNo">3155</span>        // the client. See ClientScanner code to see how it deals with these special exceptions.<a name="line.3155"></a>
-<span class="sourceLineNo">3156</span>        if (e instanceof DoNotRetryIOException) {<a name="line.3156"></a>
-<span class="sourceLineNo">3157</span>          throw e;<a name="line.3157"></a>
-<span class="sourceLineNo">3158</span>        }<a name="line.3158"></a>
-<span class="sourceLineNo">3159</span><a name="line.3159"></a>
-<span class="sourceLineNo">3160</span>        // If it is a FileNotFoundException, wrap as a<a name="line.3160"></a>
-<span class="sourceLineNo">3161</span>        // DoNotRetryIOException. This can avoid the retry in ClientScanner.<a name="line.3161"></a>
-<span class="sourceLineNo">3162</span>        if (e instanceof FileNotFoundException) {<a name="line.3162"></a>
-<span class="sourceLineNo">3163</span>          throw new DoNotRetryIOException(e);<a name="line.3163"></a>
-<span class="sourceLineNo">3164</span>        }<a name="line.3164"></a>
-<span class="sourceLineNo">3165</span><a name="line.3165"></a>
-<span class="sourceLineNo">3166</span>        // We closed the scanner already. Instead of throwing the IOException, and client<a name="line.3166"></a>
-<span class="sourceLineNo">3167</span>        // retrying with the same scannerId only to get USE on the next RPC, we directly throw<a name="line.3167"></a>
-<span class="sourceLineNo">3168</span>        // a special exception to save an RPC.<a name="line.3168"></a>
-<span class="sourceLineNo">3169</span>        if (VersionInfoUtil.hasMinimumVersion(context.getClientVersionInfo(), 1, 4)) {<a name="line.3169"></a>
-<span class="sourceLineNo">3170</span>          // 1.4.0+ clients know how to handle<a name="line.3170"></a>
-<span class="sourceLineNo">3171</span>          throw new ScannerResetException("Scanner is closed on the server-side", e);<a name="line.3171"></a>
-<span class="sourceLineNo">3172</span>        } else {<a name="line.3172"></a>
-<span class="sourceLineNo">3173</span>          // older clients do not know about SRE. Just throw USE, which they will handle<a name="line.3173"></a>
-<span class="sourceLineNo">3174</span>          throw new UnknownScannerException("Throwing UnknownScannerException to reset the client"<a name="line.3174"></a>
-<span class="sourceLineNo">3175</span>              + " scanner state for clients older than 1.3.", e);<a name="line.3175"></a>
-<span class="sourceLineNo">3176</span>        }<a name="line.3176"></a>
-<span class="sourceLineNo">3177</span>      } catch (IOException ioe) {<a name="line.3177"></a>
-<span class="sourceLineNo">3178</span>        throw new ServiceException(ioe);<a name="line.3178"></a>
-<span class="sourceLineNo">3179</span>      }<a name="line.3179"></a>
-<span class="sourceLineNo">3180</span>    } finally {<a name="line.3180"></a>
-<span class="sourceLineNo">3181</span>      if (!scannerClosed) {<a name="line.3181"></a>
-<span class="sourceLineNo">3182</span>        // Adding resets expiration time on lease.<a name="line.3182"></a>
-<span class="sourceLineNo">3183</span>        // the closeCallBack will be set in closeScanner so here we only care about shippedCallback<a name="line.3183"></a>
-<span class="sourceLineNo">3184</span>        if (context != null) {<a name="line.3184"></a>
-<span class="sourceLineNo">3185</span>          context.setCallBack(rsh.shippedCallback);<a name="line.3185"></a>
-<span class="sourceLineNo">3186</span>        } else {<a name="line.3186"></a>
-<span class="sourceLineNo">3187</span>          // When context != null, adding back the lease will be done in callback set above.<a name="line.3187"></a>
-<span class="sourceLineNo">3188</span>          addScannerLeaseBack(lease);<a name="line.3188"></a>
-<span class="sourceLineNo">3189</span>        }<a name="line.3189"></a>
-<span class="sourceLineNo">3190</span>      }<a name="line.3190"></a>
-<span class="sourceLineNo">3191</span>      quota.close();<a name="line.3191"></a>
-<span class="sourceLineNo">3192</span>    }<a name="line.3192"></a>
-<span class="sourceLineNo">3193</span>  }<a name="line.3193"></a>
-<span class="sourceLineNo">3194</span><a name="line.3194"></a>
-<span class="sourceLineNo">3195</span>  private void closeScanner(Region region, RegionScanner scanner, String scannerName,<a name="line.3195"></a>
-<span class="sourceLineNo">3196</span>      RpcCallContext context) throws IOException {<a name="line.3196"></a>
-<span class="sourceLineNo">3197</span>    if (region.getCoprocessorHost() != null) {<a name="line.3197"></a>
-<span class="sourceLineNo">3198</span>      if (region.getCoprocessorHost().preScannerClose(scanner)) {<a name="line.3198"></a>
-<span class="sourceLineNo">3199</span>        // bypass the actual close.<a name="line.3199"></a>
-<span class="sourceLineNo">3200</span>        return;<a name="line.3200"></a>
-<span class="sourceLineNo">3201</span>      }<a name="line.3201"></a>
-<span class="sourceLineNo">3202</span>    }<a name="line.3202"></a>
-<span class="sourceLineNo">3203</span>    RegionScannerHolder rsh = scanners.remove(scannerName);<a name="line.3203"></a>
-<span class="sourceLineNo">3204</span>    if (rsh != null) {<a name="line.3204"></a>
-<span class="sourceLineNo">3205</span>      if (context != null) {<a name="line.3205"></a>
-<span class="sourceLineNo">3206</span>        context.setCallBack(rsh.closeCallBack);<a name="line.3206"></a>
-<span class="sourceLineNo">3207</span>      } else {<a name="line.3207"></a>
-<span class="sourceLineNo">3208</span>        rsh.s.close();<a name="line.3208"></a>
-<span class="sourceLineNo">3209</span>      }<a name="line.3209"></a>
-<span class="sourceLineNo">3210</span>      if (region.getCoprocessorHost() != null) {<a name="line.3210"></a>
-<span class="sourceLineNo">3211</span>        region.getCoprocessorHost().postScannerClose(scanner);<a name="line.3211"></a>
+<span class="sourceLineNo">3094</span>          if (bypass != null &amp;&amp; bypass.booleanValue()) {<a name="line.3094"></a>
+<span class="sourceLineNo">3095</span>            done = true;<a name="line.3095"></a>
+<span class="sourceLineNo">3096</span>          }<a name="line.3096"></a>
+<span class="sourceLineNo">3097</span>        }<a name="line.3097"></a>
+<span class="sourceLineNo">3098</span>        if (!done) {<a name="line.3098"></a>
+<span class="sourceLineNo">3099</span>          scan((HBaseRpcController) controller, request, rsh, maxQuotaResultSize, rows, limitOfRows,<a name="line.3099"></a>
+<span class="sourceLineNo">3100</span>            results, builder, lastBlock, context);<a name="line.3100"></a>
+<span class="sourceLineNo">3101</span>        }<a name="line.3101"></a>
+<span class="sourceLineNo">3102</span>      }<a name="line.3102"></a>
+<span class="sourceLineNo">3103</span><a name="line.3103"></a>
+<span class="sourceLineNo">3104</span>      quota.addScanResult(results);<a name="line.3104"></a>
+<span class="sourceLineNo">3105</span>      addResults(builder, results, (HBaseRpcController) controller,<a name="line.3105"></a>
+<span class="sourceLineNo">3106</span>        RegionReplicaUtil.isDefaultReplica(region.getRegionInfo()),<a name="line.3106"></a>
+<span class="sourceLineNo">3107</span>        isClientCellBlockSupport(context));<a name="line.3107"></a>
+<span class="sourceLineNo">3108</span>      if (scanner.isFilterDone() &amp;&amp; results.isEmpty()) {<a name="line.3108"></a>
+<span class="sourceLineNo">3109</span>        // If the scanner's filter - if any - is done with the scan<a name="line.3109"></a>
+<span class="sourceLineNo">3110</span>        // only set moreResults to false if the results is empty. This is used to keep compatible<a name="line.3110"></a>
+<span class="sourceLineNo">3111</span>        // with the old scan implementation where we just ignore the returned results if moreResults<a name="line.3111"></a>
+<span class="sourceLineNo">3112</span>        // is false. Can remove the isEmpty check after we get rid of the old implementation.<a name="line.3112"></a>
+<span class="sourceLineNo">3113</span>        builder.setMoreResults(false);<a name="line.3113"></a>
+<span class="sourceLineNo">3114</span>      }<a name="line.3114"></a>
+<span class="sourceLineNo">3115</span>      // we only set moreResults to false in the above code, so set it to true if we haven't set it<a name="line.3115"></a>
+<span class="sourceLineNo">3116</span>      // yet.<a name="line.3116"></a>
+<span class="sourceLineNo">3117</span>      if (!builder.hasMoreResults()) {<a name="line.3117"></a>
+<span class="sourceLineNo">3118</span>        builder.setMoreResults(true);<a name="line.3118"></a>
+<span class="sourceLineNo">3119</span>      }<a name="line.3119"></a>
+<span class="sourceLineNo">3120</span>      if (builder.getMoreResults() &amp;&amp; builder.getMoreResultsInRegion() &amp;&amp; !results.isEmpty()) {<a name="line.3120"></a>
+<span class="sourceLineNo">3121</span>        // Record the last cell of the last result if it is a partial result<a name="line.3121"></a>
+<span class="sourceLineNo">3122</span>        // We need this to calculate the complete rows we have returned to client as the<a name="line.3122"></a>
+<span class="sourceLineNo">3123</span>        // mayHaveMoreCellsInRow is true does not mean that there will be extra cells for the<a name="line.3123"></a>
+<span class="sourceLineNo">3124</span>        // current row. We may filter out all the remaining cells for the current row and just<a name="line.3124"></a>
+<span class="sourceLineNo">3125</span>        // return the cells of the nextRow when calling RegionScanner.nextRaw. So here we need to<a name="line.3125"></a>
+<span class="sourceLineNo">3126</span>        // check for row change.<a name="line.3126"></a>
+<span class="sourceLineNo">3127</span>        Result lastResult = results.get(results.size() - 1);<a name="line.3127"></a>
+<span class="sourceLineNo">3128</span>        if (lastResult.mayHaveMoreCellsInRow()) {<a name="line.3128"></a>
+<span class="sourceLineNo">3129</span>          rsh.rowOfLastPartialResult = lastResult.getRow();<a name="line.3129"></a>
+<span class="sourceLineNo">3130</span>        } else {<a name="line.3130"></a>
+<span class="sourceLineNo">3131</span>          rsh.rowOfLastPartialResult = null;<a name="line.3131"></a>
+<span class="sourceLineNo">3132</span>        }<a name="line.3132"></a>
+<span class="sourceLineNo">3133</span>      }<a name="line.3133"></a>
+<span class="sourceLineNo">3134</span>      if (!builder.getMoreResults() || !builder.getMoreResultsInRegion() || closeScanner) {<a name="line.3134"></a>
+<span class="sourceLineNo">3135</span>        scannerClosed = true;<a name="line.3135"></a>
+<span class="sourceLineNo">3136</span>        closeScanner(region, scanner, scannerName, context);<a name="line.3136"></a>
+<span class="sourceLineNo">3137</span>      }<a name="line.3137"></a>
+<span class="sourceLineNo">3138</span>      return builder.build();<a name="line.3138"></a>
+<span class="sourceLineNo">3139</span>    } catch (Exception e) {<a name="line.3139"></a>
+<span class="sourceLineNo">3140</span>      try {<a name="line.3140"></a>
+<span class="sourceLineNo">3141</span>        // scanner is closed here<a name="line.3141"></a>
+<span class="sourceLineNo">3142</span>        scannerClosed = true;<a name="line.3142"></a>
+<span class="sourceLineNo">3143</span>        // The scanner state might be left in a dirty state, so we will tell the Client to<a name="line.3143"></a>
+<span class="sourceLineNo">3144</span>        // fail this RPC and close the scanner while opening up another one from the start of<a name="line.3144"></a>
+<span class="sourceLineNo">3145</span>        // row that the client has last seen.<a name="line.3145"></a>
+<span class="sourceLineNo">3146</span>        closeScanner(region, scanner, scannerName, context);<a name="line.3146"></a>
+<span class="sourceLineNo">3147</span><a name="line.3147"></a>
+<span class="sourceLineNo">3148</span>        // If it is a DoNotRetryIOException already, throw as it is. Unfortunately, DNRIOE is<a name="line.3148"></a>
+<span class="sourceLineNo">3149</span>        // used in two different semantics.<a name="line.3149"></a>
+<span class="sourceLineNo">3150</span>        // (1) The first is to close the client scanner and bubble up the exception all the way<a name="line.3150"></a>
+<span class="sourceLineNo">3151</span>        // to the application. This is preferred when the exception is really un-recoverable<a name="line.3151"></a>
+<span class="sourceLineNo">3152</span>        // (like CorruptHFileException, etc). Plain DoNotRetryIOException also falls into this<a name="line.3152"></a>
+<span class="sourceLineNo">3153</span>        // bucket usually.<a name="line.3153"></a>
+<span class="sourceLineNo">3154</span>        // (2) Second semantics is to close the current region scanner only, but continue the<a name="line.3154"></a>
+<span class="sourceLineNo">3155</span>        // client scanner by overriding the exception. This is usually UnknownScannerException,<a name="line.3155"></a>
+<span class="sourceLineNo">3156</span>        // OutOfOrderScannerNextException, etc where the region scanner has to be closed, but the<a name="line.3156"></a>
+<span class="sourceLineNo">3157</span>        // application-level ClientScanner has to continue without bubbling up the exception to<a name="line.3157"></a>
+<span class="sourceLineNo">3158</span>        // the client. See ClientScanner code to see how it deals with these special exceptions.<a name="line.3158"></a>
+<span class="sourceLineNo">3159</span>        if (e instanceof DoNotRetryIOException) {<a name="line.3159"></a>
+<span class="sourceLineNo">3160</span>          throw e;<a name="line.3160"></a>
+<span class="sourceLineNo">3161</span>        }<a name="line.3161"></a>
+<span class="sourceLineNo">3162</span><a name="line.3162"></a>
+<span class="sourceLineNo">3163</span>        // If it is a FileNotFoundException, wrap as a<a name="line.3163"></a>
+<span class="sourceLineNo">3164</span>        // DoNotRetryIOException. This can avoid the retry in ClientScanner.<a name="line.3164"></a>
+<span class="sourceLineNo">3165</span>        if (e instanceof FileNotFoundException) {<a name="line.3165"></a>
+<span class="sourceLineNo">3166</span>          throw new DoNotRetryIOException(e);<a name="line.3166"></a>
+<span class="sourceLineNo">3167</span>        }<a name="line.3167"></a>
+<span class="sourceLineNo">3168</span><a name="line.3168"></a>
+<span class="sourceLineNo">3169</span>        // We closed the scanner already. Instead of throwing the IOException, and client<a name="line.3169"></a>
+<span class="sourceLineNo">3170</span>        // retrying with the same scannerId only to get USE on the next RPC, we directly throw<a name="line.3170"></a>
+<span class="sourceLineNo">3171</span>        // a special exception to save an RPC.<a name="line.3171"></a>
+<span class="sourceLineNo">3172</span>        if (VersionInfoUtil.hasMinimumVersion(context.getClientVersionInfo(), 1, 4)) {<a name="line.3172"></a>
+<span class="sourceLineNo">3173</span>          // 1.4.0+ clients know how to handle<a name="line.3173"></a>
+<span class="sourceLineNo">3174</span>          throw new ScannerResetException("Scanner is closed on the server-side", e);<a name="line.3174"></a>
+<span class="sourceLineNo">3175</span>        } else {<a name="line.3175"></a>
+<span class="sourceLineNo">3176</span>          // older clients do not know about SRE. Just throw USE, which they will handle<a name="line.3176"></a>
+<span class="sourceLineNo">3177</span>          throw new UnknownScannerException("Throwing UnknownScannerException to reset the client"<a name="line.3177"></a>
+<span class="sourceLineNo">3178</span>              + " scanner state for clients older than 1.3.", e);<a name="line.3178"></a>
+<span class="sourceLineNo">3179</span>        }<a name="line.3179"></a>
+<span class="sourceLineNo">3180</span>      } catch (IOException ioe) {<a name="line.3180"></a>
+<span class="sourceLineNo">3181</span>        throw new ServiceException(ioe);<a name="line.3181"></a>
+<span class="sourceLineNo">3182</span>      }<a name="line.3182"></a>
+<span class="sourceLineNo">3183</span>    } finally {<a name="line.3183"></a>
+<span class="sourceLineNo">3184</span>      if (!scannerClosed) {<a name="line.3184"></a>
+<span class="sourceLineNo">3185</span>        // Adding resets expiration time on lease.<a name="line.3185"></a>
+<span class="sourceLineNo">3186</span>        // the closeCallBack will be set in closeScanner so here we only care about shippedCallback<a name="line.3186"></a>
+<span class="sourceLineNo">3187</span>        if (context != null) {<a name="line.3187"></a>
+<span class="sourceLineNo">3188</span>          context.setCallBack(rsh.shippedCallback);<a name="line.3188"></a>
+<span class="sourceLineNo">3189</span>        } else {<a name="line.3189"></a>
+<span class="sourceLineNo">3190</span>          // When context != null, adding back the lease will be done in callback set above.<a name="line.3190"></a>
+<span class="sourceLineNo">3191</span>          addScannerLeaseBack(lease);<a name="line.3191"></a>
+<span class="sourceLineNo">3192</span>        }<a name="line.3192"></a>
+<span class="sourceLineNo">3193</span>      }<a name="line.3193"></a>
+<span class="sourceLineNo">3194</span>      quota.close();<a name="line.3194"></a>
+<span class="sourceLineNo">3195</span>    }<a name="line.3195"></a>
+<span class="sourceLineNo">3196</span>  }<a name="line.3196"></a>
+<span class="sourceLineNo">3197</span><a name="line.3197"></a>
+<span class="sourceLineNo">3198</span>  private void closeScanner(Region region, RegionScanner scanner, String scannerName,<a name="line.3198"></a>
+<span class="sourceLineNo">3199</span>      RpcCallContext context) throws IOException {<a name="line.3199"></a>
+<span class="sourceLineNo">3200</span>    if (region.getCoprocessorHost() != null) {<a name="line.3200"></a>
+<span class="sourceLineNo">3201</span>      if (region.getCoprocessorHost().preScannerClose(scanner)) {<a name="line.3201"></a>
+<span class="sourceLineNo">3202</span>        // bypass the actual close.<a name="line.3202"></a>
+<span class="sourceLineNo">3203</span>        return;<a name="line.3203"></a>
+<span class="sourceLineNo">3204</span>      }<a name="line.3204"></a>
+<span class="sourceLineNo">3205</span>    }<a name="line.3205"></a>
+<span class="sourceLineNo">3206</span>    RegionScannerHolder rsh = scanners.remove(scannerName);<a name="line.3206"></a>
+<span class="sourceLineNo">3207</span>    if (rsh != null) {<a name="line.3207"></a>
+<span class="sourceLineNo">3208</span>      if (context != null) {<a name="line.3208"></a>
+<span class="sourceLineNo">3209</span>        context.setCallBack(rsh.closeCallBack);<a name="line.3209"></a>
+<span class="sourceLineNo">3210</span>      } else {<a name="line.3210"></a>
+<span class="sourceLineNo">3211</span>        rsh.s.close();<a name="line.3211"></a>
 <span class="sourceLineNo">3212</span>      }<a name="line.3212"></a>
-<span class="sourceLineNo">3213</span>    }<a name="line.3213"></a>
-<span class="sourceLineNo">3214</span>  }<a name="line.3214"></a>
-<span class="sourceLineNo">3215</span><a name="line.3215"></a>
-<span class="sourceLineNo">3216</span>  @Override<a name="line.3216"></a>
-<span class="sourceLineNo">3217</span>  public CoprocessorServiceResponse execRegionServerService(RpcController controller,<a name="line.3217"></a>
-<span class="sourceLineNo">3218</span>      CoprocessorServiceRequest request) throws ServiceException {<a name="line.3218"></a>
-<span class="sourceLineNo">3219</span>    return regionServer.execRegionServerService(controller, request);<a name="line.3219"></a>
-<span class="sourceLineNo">3220</span>  }<a name="line.3220"></a>
-<span class="sourceLineNo">3221</span><a name="line.3221"></a>
-<span class="sourceLineNo">3222</span>  @Override<a name="line.3222"></a>
-<span class="sourceLineNo">3223</span>  public UpdateConfigurationResponse updateConfiguration(<a name="line.3223"></a>
-<span class="sourceLineNo">3224</span>      RpcController controller, UpdateConfigurationRequest request)<a name="line.3224"></a>
-<span class="sourceLineNo">3225</span>      throws ServiceException {<a name="line.3225"></a>
-<span class="sourceLineNo">3226</span>    try {<a name="line.3226"></a>
-<span class="sourceLineNo">3227</span>      this.regionServer.updateConfiguration();<a name="line.3227"></a>
-<span class="sourceLineNo">3228</span>    } catch (Exception e) {<a name="line.3228"></a>
-<span class="sourceLineNo">3229</span>      throw new ServiceException(e);<a name="line.3229"></a>
-<span class="sourceLineNo">3230</span>    }<a name="line.3230"></a>
-<span class="sourceLineNo">3231</span>    return UpdateConfigurationResponse.getDefaultInstance();<a name="line.3231"></a>
-<span class="sourceLineNo">3232</span>  }<a name="line.3232"></a>
-<span class="sourceLineNo">3233</span><a name="line.3233"></a>
-<span class="sourceLineNo">3234</span>}<a name="line.3234"></a>
+<span class="sourceLineNo">3213</span>      if (region.getCoprocessorHost() != null) {<a name="line.3213"></a>
+<span class="sourceLineNo">3214</span>        region.getCoprocessorHost().postScannerClose(scanner);<a name="line.3214"></a>
+<span class="sourceLineNo">3215</span>      }<a name="line.3215"></a>
+<span class="sourceLineNo">3216</span>    }<a name="line.3216"></a>
+<span class="sourceLineNo">3217</span>  }<a name="line.3217"></a>
+<span class="sourceLineNo">3218</span><a name="line.3218"></a>
+<span class="sourceLineNo">3219</span>  @Override<a name="line.3219"></a>
+<span class="sourceLineNo">3220</span>  public CoprocessorServiceResponse execRegionServerService(RpcController controller,<a name="line.3220"></a>
+<span class="sourceLineNo">3221</span>      CoprocessorServiceRequest request) throws ServiceException {<a name="line.3221"></a>
+<span class="sourceLineNo">3222</span>    return regionServer.execRegionServerService(controller, request);<a name="line.3222"></a>
+<span class="sourceLineNo">3223</span>  }<a name="line.3223"></a>
+<span class="sourceLineNo">3224</span><a name="line.3224"></a>
+<span class="sourceLineNo">3225</span>  @Override<a name="line.3225"></a>
+<span class="sourceLineNo">3226</span>  public UpdateConfigurationResponse updateConfiguration(<a name="line.3226"></a>
+<span class="sourceLineNo">3227</span>      RpcController controller, UpdateConfigurationRequest request)<a name="line.3227"></a>
+<span class="sourceLineNo">3228</span>      throws ServiceException {<a name="line.3228"></a>
+<span class="sourceLineNo">3229</span>    try {<a name="line.3229"></a>
+<span class="sourceLineNo">3230</span>      this.regionServer.updateConfiguration();<a name="line.3230"></a>
+<span class="sourceLineNo">3231</span>    } catch (Exception e) {<a name="line.3231"></a>
+<span class="sourceLineNo">3232</span>      throw new ServiceException(e);<a name="line.3232"></a>
+<span class="sourceLineNo">3233</span>    }<a name="line.3233"></a>
+<span class="sourceLineNo">3234</span>    return UpdateConfigurationResponse.getDefaultInstance();<a name="line.3234"></a>
+<span class="sourceLineNo">3235</span>  }<a name="line.3235"></a>
+<span class="sourceLineNo">3236</span><a name="line.3236"></a>
+<span class="sourceLineNo">3237</span>}<a name="line.3237"></a>
 
 
 


Mime
View raw message