hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [31/51] [partial] hbase-site git commit: Published site at .
Date Sat, 26 Aug 2017 15:11:00 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/ebf9a8b8/apidocs/src-html/org/apache/hadoop/hbase/client/RawAsyncTable.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/RawAsyncTable.html b/apidocs/src-html/org/apache/hadoop/hbase/client/RawAsyncTable.html
index da72c6e..ab96dc9 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/client/RawAsyncTable.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/client/RawAsyncTable.html
@@ -52,208 +52,209 @@
 <span class="sourceLineNo">044</span> * method. The {@link RawScanResultConsumer} exposes the implementation details of a scan(heartbeat)<a name="line.44"></a>
 <span class="sourceLineNo">045</span> * so it is not suitable for a normal user. If it is still the only difference after we implement<a name="line.45"></a>
 <span class="sourceLineNo">046</span> * most features of AsyncTable, we can think about merge these two interfaces.<a name="line.46"></a>
-<span class="sourceLineNo">047</span> */<a name="line.47"></a>
-<span class="sourceLineNo">048</span>@InterfaceAudience.Public<a name="line.48"></a>
-<span class="sourceLineNo">049</span>public interface RawAsyncTable extends AsyncTableBase {<a name="line.49"></a>
-<span class="sourceLineNo">050</span><a name="line.50"></a>
-<span class="sourceLineNo">051</span>  /**<a name="line.51"></a>
-<span class="sourceLineNo">052</span>   * The basic scan API uses the observer pattern. All results that match the given scan object will<a name="line.52"></a>
-<span class="sourceLineNo">053</span>   * be passed to the given {@code consumer} by calling {@code RawScanResultConsumer.onNext}.<a name="line.53"></a>
-<span class="sourceLineNo">054</span>   * {@code RawScanResultConsumer.onComplete} means the scan is finished, and<a name="line.54"></a>
-<span class="sourceLineNo">055</span>   * {@code RawScanResultConsumer.onError} means we hit an unrecoverable error and the scan is<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   * terminated. {@code RawScanResultConsumer.onHeartbeat} means the RS is still working but we can<a name="line.56"></a>
-<span class="sourceLineNo">057</span>   * not get a valid result to call {@code RawScanResultConsumer.onNext}. This is usually because<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   * the matched results are too sparse, for example, a filter which almost filters out everything<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   * is specified.<a name="line.59"></a>
-<span class="sourceLineNo">060</span>   * &lt;p&gt;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>   * Notice that, the methods of the given {@code consumer} will be called directly in the rpc<a name="line.61"></a>
-<span class="sourceLineNo">062</span>   * framework's callback thread, so typically you should not do any time consuming work inside<a name="line.62"></a>
-<span class="sourceLineNo">063</span>   * these methods, otherwise you will be likely to block at least one connection to RS(even more if<a name="line.63"></a>
-<span class="sourceLineNo">064</span>   * the rpc framework uses NIO).<a name="line.64"></a>
-<span class="sourceLineNo">065</span>   * @param scan A configured {@link Scan} object.<a name="line.65"></a>
-<span class="sourceLineNo">066</span>   * @param consumer the consumer used to receive results.<a name="line.66"></a>
-<span class="sourceLineNo">067</span>   */<a name="line.67"></a>
-<span class="sourceLineNo">068</span>  void scan(Scan scan, RawScanResultConsumer consumer);<a name="line.68"></a>
-<span class="sourceLineNo">069</span><a name="line.69"></a>
-<span class="sourceLineNo">070</span>  /**<a name="line.70"></a>
-<span class="sourceLineNo">071</span>   * Delegate to a protobuf rpc call.<a name="line.71"></a>
-<span class="sourceLineNo">072</span>   * &lt;p&gt;<a name="line.72"></a>
-<span class="sourceLineNo">073</span>   * Usually, it is just a simple lambda expression, like:<a name="line.73"></a>
-<span class="sourceLineNo">074</span>   *<a name="line.74"></a>
-<span class="sourceLineNo">075</span>   * &lt;pre&gt;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>   * &lt;code&gt;<a name="line.76"></a>
-<span class="sourceLineNo">077</span>   * (stub, controller, rpcCallback) -&gt; {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>   *   XXXRequest request = ...; // prepare the request<a name="line.78"></a>
-<span class="sourceLineNo">079</span>   *   stub.xxx(controller, request, rpcCallback);<a name="line.79"></a>
-<span class="sourceLineNo">080</span>   * }<a name="line.80"></a>
-<span class="sourceLineNo">081</span>   * &lt;/code&gt;<a name="line.81"></a>
-<span class="sourceLineNo">082</span>   * &lt;/pre&gt;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>   *<a name="line.83"></a>
-<span class="sourceLineNo">084</span>   * And if you can prepare the {@code request} before calling the coprocessorService method, the<a name="line.84"></a>
-<span class="sourceLineNo">085</span>   * lambda expression will be:<a name="line.85"></a>
-<span class="sourceLineNo">086</span>   *<a name="line.86"></a>
-<span class="sourceLineNo">087</span>   * &lt;pre&gt;<a name="line.87"></a>
-<span class="sourceLineNo">088</span>   * &lt;code&gt;<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   * (stub, controller, rpcCallback) -&gt; stub.xxx(controller, request, rpcCallback)<a name="line.89"></a>
-<span class="sourceLineNo">090</span>   * &lt;/code&gt;<a name="line.90"></a>
-<span class="sourceLineNo">091</span>   * &lt;/pre&gt;<a name="line.91"></a>
-<span class="sourceLineNo">092</span>   */<a name="line.92"></a>
-<span class="sourceLineNo">093</span>  @InterfaceAudience.Public<a name="line.93"></a>
-<span class="sourceLineNo">094</span>  @FunctionalInterface<a name="line.94"></a>
-<span class="sourceLineNo">095</span>  interface CoprocessorCallable&lt;S, R&gt; {<a name="line.95"></a>
-<span class="sourceLineNo">096</span><a name="line.96"></a>
-<span class="sourceLineNo">097</span>    /**<a name="line.97"></a>
-<span class="sourceLineNo">098</span>     * Represent the actual protobuf rpc call.<a name="line.98"></a>
-<span class="sourceLineNo">099</span>     * @param stub the asynchronous stub<a name="line.99"></a>
-<span class="sourceLineNo">100</span>     * @param controller the rpc controller, has already been prepared for you<a name="line.100"></a>
-<span class="sourceLineNo">101</span>     * @param rpcCallback the rpc callback, has already been prepared for you<a name="line.101"></a>
-<span class="sourceLineNo">102</span>     */<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    void call(S stub, RpcController controller, RpcCallback&lt;R&gt; rpcCallback);<a name="line.103"></a>
-<span class="sourceLineNo">104</span>  }<a name="line.104"></a>
-<span class="sourceLineNo">105</span><a name="line.105"></a>
-<span class="sourceLineNo">106</span>  /**<a name="line.106"></a>
-<span class="sourceLineNo">107</span>   * Execute the given coprocessor call on the region which contains the given {@code row}.<a name="line.107"></a>
-<span class="sourceLineNo">108</span>   * &lt;p&gt;<a name="line.108"></a>
-<span class="sourceLineNo">109</span>   * The {@code stubMaker} is just a delegation to the {@code newStub} call. Usually it is only a<a name="line.109"></a>
-<span class="sourceLineNo">110</span>   * one line lambda expression, like:<a name="line.110"></a>
-<span class="sourceLineNo">111</span>   *<a name="line.111"></a>
-<span class="sourceLineNo">112</span>   * &lt;pre&gt;<a name="line.112"></a>
-<span class="sourceLineNo">113</span>   * &lt;code&gt;<a name="line.113"></a>
-<span class="sourceLineNo">114</span>   * channel -&gt; xxxService.newStub(channel)<a name="line.114"></a>
-<span class="sourceLineNo">115</span>   * &lt;/code&gt;<a name="line.115"></a>
-<span class="sourceLineNo">116</span>   * &lt;/pre&gt;<a name="line.116"></a>
-<span class="sourceLineNo">117</span>   *<a name="line.117"></a>
-<span class="sourceLineNo">118</span>   * @param stubMaker a delegation to the actual {@code newStub} call.<a name="line.118"></a>
-<span class="sourceLineNo">119</span>   * @param callable a delegation to the actual protobuf rpc call. See the comment of<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   *          {@link CoprocessorCallable} for more details.<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   * @param row The row key used to identify the remote region location<a name="line.121"></a>
-<span class="sourceLineNo">122</span>   * @param &lt;S&gt; the type of the asynchronous stub<a name="line.122"></a>
-<span class="sourceLineNo">123</span>   * @param &lt;R&gt; the type of the return value<a name="line.123"></a>
-<span class="sourceLineNo">124</span>   * @return the return value of the protobuf rpc call, wrapped by a {@link CompletableFuture}.<a name="line.124"></a>
-<span class="sourceLineNo">125</span>   * @see CoprocessorCallable<a name="line.125"></a>
-<span class="sourceLineNo">126</span>   */<a name="line.126"></a>
-<span class="sourceLineNo">127</span>  &lt;S, R&gt; CompletableFuture&lt;R&gt; coprocessorService(Function&lt;RpcChannel, S&gt; stubMaker,<a name="line.127"></a>
-<span class="sourceLineNo">128</span>      CoprocessorCallable&lt;S, R&gt; callable, byte[] row);<a name="line.128"></a>
-<span class="sourceLineNo">129</span><a name="line.129"></a>
-<span class="sourceLineNo">130</span>  /**<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * The callback when we want to execute a coprocessor call on a range of regions.<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * &lt;p&gt;<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   * As the locating itself also takes some time, the implementation may want to send rpc calls on<a name="line.133"></a>
-<span class="sourceLineNo">134</span>   * the fly, which means we do not know how many regions we have when we get the return value of<a name="line.134"></a>
-<span class="sourceLineNo">135</span>   * the rpc calls, so we need an {@link #onComplete()} which is used to tell you that we have<a name="line.135"></a>
-<span class="sourceLineNo">136</span>   * passed all the return values to you(through the {@link #onRegionComplete(HRegionInfo, Object)}<a name="line.136"></a>
-<span class="sourceLineNo">137</span>   * or {@link #onRegionError(HRegionInfo, Throwable)} calls), i.e, there will be no<a name="line.137"></a>
-<span class="sourceLineNo">138</span>   * {@link #onRegionComplete(HRegionInfo, Object)} or<a name="line.138"></a>
-<span class="sourceLineNo">139</span>   * {@link #onRegionError(HRegionInfo, Throwable)} calls in the future.<a name="line.139"></a>
-<span class="sourceLineNo">140</span>   * &lt;p&gt;<a name="line.140"></a>
-<span class="sourceLineNo">141</span>   * Here is a pseudo code to describe a typical implementation of a range coprocessor service<a name="line.141"></a>
-<span class="sourceLineNo">142</span>   * method to help you better understand how the {@link CoprocessorCallback} will be called. The<a name="line.142"></a>
-<span class="sourceLineNo">143</span>   * {@code callback} in the pseudo code is our {@link CoprocessorCallback}. And notice that the<a name="line.143"></a>
-<span class="sourceLineNo">144</span>   * {@code whenComplete} is {@code CompletableFuture.whenComplete}.<a name="line.144"></a>
-<span class="sourceLineNo">145</span>   *<a name="line.145"></a>
-<span class="sourceLineNo">146</span>   * &lt;pre&gt;<a name="line.146"></a>
-<span class="sourceLineNo">147</span>   * locateThenCall(byte[] row) {<a name="line.147"></a>
-<span class="sourceLineNo">148</span>   *   locate(row).whenComplete((location, locateError) -&gt; {<a name="line.148"></a>
-<span class="sourceLineNo">149</span>   *     if (locateError != null) {<a name="line.149"></a>
-<span class="sourceLineNo">150</span>   *       callback.onError(locateError);<a name="line.150"></a>
-<span class="sourceLineNo">151</span>   *       return;<a name="line.151"></a>
-<span class="sourceLineNo">152</span>   *     }<a name="line.152"></a>
-<span class="sourceLineNo">153</span>   *     incPendingCall();<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   *     region = location.getRegion();<a name="line.154"></a>
-<span class="sourceLineNo">155</span>   *     if (region.getEndKey() &gt; endKey) {<a name="line.155"></a>
-<span class="sourceLineNo">156</span>   *       locateEnd = true;<a name="line.156"></a>
-<span class="sourceLineNo">157</span>   *     } else {<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   *       locateThenCall(region.getEndKey());<a name="line.158"></a>
-<span class="sourceLineNo">159</span>   *     }<a name="line.159"></a>
-<span class="sourceLineNo">160</span>   *     sendCall().whenComplete((resp, error) -&gt; {<a name="line.160"></a>
-<span class="sourceLineNo">161</span>   *       if (error != null) {<a name="line.161"></a>
-<span class="sourceLineNo">162</span>   *         callback.onRegionError(region, error);<a name="line.162"></a>
-<span class="sourceLineNo">163</span>   *       } else {<a name="line.163"></a>
-<span class="sourceLineNo">164</span>   *         callback.onRegionComplete(region, resp);<a name="line.164"></a>
-<span class="sourceLineNo">165</span>   *       }<a name="line.165"></a>
-<span class="sourceLineNo">166</span>   *       if (locateEnd &amp;&amp; decPendingCallAndGet() == 0) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>   *         callback.onComplete();<a name="line.167"></a>
-<span class="sourceLineNo">168</span>   *       }<a name="line.168"></a>
-<span class="sourceLineNo">169</span>   *     });<a name="line.169"></a>
-<span class="sourceLineNo">170</span>   *   });<a name="line.170"></a>
-<span class="sourceLineNo">171</span>   * }<a name="line.171"></a>
-<span class="sourceLineNo">172</span>   * &lt;/pre&gt;<a name="line.172"></a>
-<span class="sourceLineNo">173</span>   */<a name="line.173"></a>
-<span class="sourceLineNo">174</span>  @InterfaceAudience.Public<a name="line.174"></a>
-<span class="sourceLineNo">175</span>  interface CoprocessorCallback&lt;R&gt; {<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>    /**<a name="line.177"></a>
-<span class="sourceLineNo">178</span>     * @param region the region that the response belongs to<a name="line.178"></a>
-<span class="sourceLineNo">179</span>     * @param resp the response of the coprocessor call<a name="line.179"></a>
-<span class="sourceLineNo">180</span>     */<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    void onRegionComplete(HRegionInfo region, R resp);<a name="line.181"></a>
-<span class="sourceLineNo">182</span><a name="line.182"></a>
-<span class="sourceLineNo">183</span>    /**<a name="line.183"></a>
-<span class="sourceLineNo">184</span>     * @param region the region that the error belongs to<a name="line.184"></a>
-<span class="sourceLineNo">185</span>     * @param error the response error of the coprocessor call<a name="line.185"></a>
-<span class="sourceLineNo">186</span>     */<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    void onRegionError(HRegionInfo region, Throwable error);<a name="line.187"></a>
-<span class="sourceLineNo">188</span><a name="line.188"></a>
-<span class="sourceLineNo">189</span>    /**<a name="line.189"></a>
-<span class="sourceLineNo">190</span>     * Indicate that all responses of the regions have been notified by calling<a name="line.190"></a>
-<span class="sourceLineNo">191</span>     * {@link #onRegionComplete(HRegionInfo, Object)} or<a name="line.191"></a>
-<span class="sourceLineNo">192</span>     * {@link #onRegionError(HRegionInfo, Throwable)}.<a name="line.192"></a>
-<span class="sourceLineNo">193</span>     */<a name="line.193"></a>
-<span class="sourceLineNo">194</span>    void onComplete();<a name="line.194"></a>
-<span class="sourceLineNo">195</span><a name="line.195"></a>
-<span class="sourceLineNo">196</span>    /**<a name="line.196"></a>
-<span class="sourceLineNo">197</span>     * Indicate that we got an error which does not belong to any regions. Usually a locating error.<a name="line.197"></a>
-<span class="sourceLineNo">198</span>     */<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    void onError(Throwable error);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>  }<a name="line.200"></a>
-<span class="sourceLineNo">201</span><a name="line.201"></a>
-<span class="sourceLineNo">202</span>  /**<a name="line.202"></a>
-<span class="sourceLineNo">203</span>   * Execute the given coprocessor call on the regions which are covered by the range from<a name="line.203"></a>
-<span class="sourceLineNo">204</span>   * {@code startKey} inclusive and {@code endKey} exclusive. See the comment of<a name="line.204"></a>
-<span class="sourceLineNo">205</span>   * {@link #coprocessorService(Function, CoprocessorCallable, byte[], boolean, byte[], boolean, CoprocessorCallback)}<a name="line.205"></a>
-<span class="sourceLineNo">206</span>   * for more details.<a name="line.206"></a>
-<span class="sourceLineNo">207</span>   * @see #coprocessorService(Function, CoprocessorCallable, byte[], boolean, byte[], boolean,<a name="line.207"></a>
-<span class="sourceLineNo">208</span>   *      CoprocessorCallback)<a name="line.208"></a>
-<span class="sourceLineNo">209</span>   */<a name="line.209"></a>
-<span class="sourceLineNo">210</span>  default &lt;S, R&gt; void coprocessorService(Function&lt;RpcChannel, S&gt; stubMaker,<a name="line.210"></a>
-<span class="sourceLineNo">211</span>      CoprocessorCallable&lt;S, R&gt; callable, byte[] startKey, byte[] endKey,<a name="line.211"></a>
-<span class="sourceLineNo">212</span>      CoprocessorCallback&lt;R&gt; callback) {<a name="line.212"></a>
-<span class="sourceLineNo">213</span>    coprocessorService(stubMaker, callable, startKey, true, endKey, false, callback);<a name="line.213"></a>
-<span class="sourceLineNo">214</span>  }<a name="line.214"></a>
-<span class="sourceLineNo">215</span><a name="line.215"></a>
-<span class="sourceLineNo">216</span>  /**<a name="line.216"></a>
-<span class="sourceLineNo">217</span>   * Execute the given coprocessor call on the regions which are covered by the range from<a name="line.217"></a>
-<span class="sourceLineNo">218</span>   * {@code startKey} and {@code endKey}. The inclusive of boundaries are specified by<a name="line.218"></a>
-<span class="sourceLineNo">219</span>   * {@code startKeyInclusive} and {@code endKeyInclusive}. The {@code stubMaker} is just a<a name="line.219"></a>
-<span class="sourceLineNo">220</span>   * delegation to the {@code xxxService.newStub} call. Usually it is only a one line lambda<a name="line.220"></a>
-<span class="sourceLineNo">221</span>   * expression, like:<a name="line.221"></a>
-<span class="sourceLineNo">222</span>   *<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   * &lt;pre&gt;<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   * &lt;code&gt;<a name="line.224"></a>
-<span class="sourceLineNo">225</span>   * channel -&gt; xxxService.newStub(channel)<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   * &lt;/code&gt;<a name="line.226"></a>
-<span class="sourceLineNo">227</span>   * &lt;/pre&gt;<a name="line.227"></a>
-<span class="sourceLineNo">228</span>   *<a name="line.228"></a>
-<span class="sourceLineNo">229</span>   * @param stubMaker a delegation to the actual {@code newStub} call.<a name="line.229"></a>
-<span class="sourceLineNo">230</span>   * @param callable a delegation to the actual protobuf rpc call. See the comment of<a name="line.230"></a>
-<span class="sourceLineNo">231</span>   *          {@link CoprocessorCallable} for more details.<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   * @param startKey start region selection with region containing this row. If {@code null}, the<a name="line.232"></a>
-<span class="sourceLineNo">233</span>   *          selection will start with the first table region.<a name="line.233"></a>
-<span class="sourceLineNo">234</span>   * @param startKeyInclusive whether to include the startKey<a name="line.234"></a>
-<span class="sourceLineNo">235</span>   * @param endKey select regions up to and including the region containing this row. If<a name="line.235"></a>
-<span class="sourceLineNo">236</span>   *          {@code null}, selection will continue through the last table region.<a name="line.236"></a>
-<span class="sourceLineNo">237</span>   * @param endKeyInclusive whether to include the endKey<a name="line.237"></a>
-<span class="sourceLineNo">238</span>   * @param callback callback to get the response. See the comment of {@link CoprocessorCallback}<a name="line.238"></a>
-<span class="sourceLineNo">239</span>   *          for more details.<a name="line.239"></a>
-<span class="sourceLineNo">240</span>   * @param &lt;S&gt; the type of the asynchronous stub<a name="line.240"></a>
-<span class="sourceLineNo">241</span>   * @param &lt;R&gt; the type of the return value<a name="line.241"></a>
-<span class="sourceLineNo">242</span>   * @see CoprocessorCallable<a name="line.242"></a>
-<span class="sourceLineNo">243</span>   * @see CoprocessorCallback<a name="line.243"></a>
-<span class="sourceLineNo">244</span>   */<a name="line.244"></a>
-<span class="sourceLineNo">245</span>  &lt;S, R&gt; void coprocessorService(Function&lt;RpcChannel, S&gt; stubMaker,<a name="line.245"></a>
-<span class="sourceLineNo">246</span>      CoprocessorCallable&lt;S, R&gt; callable, byte[] startKey, boolean startKeyInclusive, byte[] endKey,<a name="line.246"></a>
-<span class="sourceLineNo">247</span>      boolean endKeyInclusive, CoprocessorCallback&lt;R&gt; callback);<a name="line.247"></a>
-<span class="sourceLineNo">248</span>}<a name="line.248"></a>
+<span class="sourceLineNo">047</span> * @since 2.0.0<a name="line.47"></a>
+<span class="sourceLineNo">048</span> */<a name="line.48"></a>
+<span class="sourceLineNo">049</span>@InterfaceAudience.Public<a name="line.49"></a>
+<span class="sourceLineNo">050</span>public interface RawAsyncTable extends AsyncTableBase {<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span>  /**<a name="line.52"></a>
+<span class="sourceLineNo">053</span>   * The basic scan API uses the observer pattern. All results that match the given scan object will<a name="line.53"></a>
+<span class="sourceLineNo">054</span>   * be passed to the given {@code consumer} by calling {@code RawScanResultConsumer.onNext}.<a name="line.54"></a>
+<span class="sourceLineNo">055</span>   * {@code RawScanResultConsumer.onComplete} means the scan is finished, and<a name="line.55"></a>
+<span class="sourceLineNo">056</span>   * {@code RawScanResultConsumer.onError} means we hit an unrecoverable error and the scan is<a name="line.56"></a>
+<span class="sourceLineNo">057</span>   * terminated. {@code RawScanResultConsumer.onHeartbeat} means the RS is still working but we can<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   * not get a valid result to call {@code RawScanResultConsumer.onNext}. This is usually because<a name="line.58"></a>
+<span class="sourceLineNo">059</span>   * the matched results are too sparse, for example, a filter which almost filters out everything<a name="line.59"></a>
+<span class="sourceLineNo">060</span>   * is specified.<a name="line.60"></a>
+<span class="sourceLineNo">061</span>   * &lt;p&gt;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>   * Notice that, the methods of the given {@code consumer} will be called directly in the rpc<a name="line.62"></a>
+<span class="sourceLineNo">063</span>   * framework's callback thread, so typically you should not do any time consuming work inside<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   * these methods, otherwise you will be likely to block at least one connection to RS(even more if<a name="line.64"></a>
+<span class="sourceLineNo">065</span>   * the rpc framework uses NIO).<a name="line.65"></a>
+<span class="sourceLineNo">066</span>   * @param scan A configured {@link Scan} object.<a name="line.66"></a>
+<span class="sourceLineNo">067</span>   * @param consumer the consumer used to receive results.<a name="line.67"></a>
+<span class="sourceLineNo">068</span>   */<a name="line.68"></a>
+<span class="sourceLineNo">069</span>  void scan(Scan scan, RawScanResultConsumer consumer);<a name="line.69"></a>
+<span class="sourceLineNo">070</span><a name="line.70"></a>
+<span class="sourceLineNo">071</span>  /**<a name="line.71"></a>
+<span class="sourceLineNo">072</span>   * Delegate to a protobuf rpc call.<a name="line.72"></a>
+<span class="sourceLineNo">073</span>   * &lt;p&gt;<a name="line.73"></a>
+<span class="sourceLineNo">074</span>   * Usually, it is just a simple lambda expression, like:<a name="line.74"></a>
+<span class="sourceLineNo">075</span>   *<a name="line.75"></a>
+<span class="sourceLineNo">076</span>   * &lt;pre&gt;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>   * &lt;code&gt;<a name="line.77"></a>
+<span class="sourceLineNo">078</span>   * (stub, controller, rpcCallback) -&gt; {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>   *   XXXRequest request = ...; // prepare the request<a name="line.79"></a>
+<span class="sourceLineNo">080</span>   *   stub.xxx(controller, request, rpcCallback);<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   * }<a name="line.81"></a>
+<span class="sourceLineNo">082</span>   * &lt;/code&gt;<a name="line.82"></a>
+<span class="sourceLineNo">083</span>   * &lt;/pre&gt;<a name="line.83"></a>
+<span class="sourceLineNo">084</span>   *<a name="line.84"></a>
+<span class="sourceLineNo">085</span>   * And if you can prepare the {@code request} before calling the coprocessorService method, the<a name="line.85"></a>
+<span class="sourceLineNo">086</span>   * lambda expression will be:<a name="line.86"></a>
+<span class="sourceLineNo">087</span>   *<a name="line.87"></a>
+<span class="sourceLineNo">088</span>   * &lt;pre&gt;<a name="line.88"></a>
+<span class="sourceLineNo">089</span>   * &lt;code&gt;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>   * (stub, controller, rpcCallback) -&gt; stub.xxx(controller, request, rpcCallback)<a name="line.90"></a>
+<span class="sourceLineNo">091</span>   * &lt;/code&gt;<a name="line.91"></a>
+<span class="sourceLineNo">092</span>   * &lt;/pre&gt;<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   */<a name="line.93"></a>
+<span class="sourceLineNo">094</span>  @InterfaceAudience.Public<a name="line.94"></a>
+<span class="sourceLineNo">095</span>  @FunctionalInterface<a name="line.95"></a>
+<span class="sourceLineNo">096</span>  interface CoprocessorCallable&lt;S, R&gt; {<a name="line.96"></a>
+<span class="sourceLineNo">097</span><a name="line.97"></a>
+<span class="sourceLineNo">098</span>    /**<a name="line.98"></a>
+<span class="sourceLineNo">099</span>     * Represent the actual protobuf rpc call.<a name="line.99"></a>
+<span class="sourceLineNo">100</span>     * @param stub the asynchronous stub<a name="line.100"></a>
+<span class="sourceLineNo">101</span>     * @param controller the rpc controller, has already been prepared for you<a name="line.101"></a>
+<span class="sourceLineNo">102</span>     * @param rpcCallback the rpc callback, has already been prepared for you<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     */<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    void call(S stub, RpcController controller, RpcCallback&lt;R&gt; rpcCallback);<a name="line.104"></a>
+<span class="sourceLineNo">105</span>  }<a name="line.105"></a>
+<span class="sourceLineNo">106</span><a name="line.106"></a>
+<span class="sourceLineNo">107</span>  /**<a name="line.107"></a>
+<span class="sourceLineNo">108</span>   * Execute the given coprocessor call on the region which contains the given {@code row}.<a name="line.108"></a>
+<span class="sourceLineNo">109</span>   * &lt;p&gt;<a name="line.109"></a>
+<span class="sourceLineNo">110</span>   * The {@code stubMaker} is just a delegation to the {@code newStub} call. Usually it is only a<a name="line.110"></a>
+<span class="sourceLineNo">111</span>   * one line lambda expression, like:<a name="line.111"></a>
+<span class="sourceLineNo">112</span>   *<a name="line.112"></a>
+<span class="sourceLineNo">113</span>   * &lt;pre&gt;<a name="line.113"></a>
+<span class="sourceLineNo">114</span>   * &lt;code&gt;<a name="line.114"></a>
+<span class="sourceLineNo">115</span>   * channel -&gt; xxxService.newStub(channel)<a name="line.115"></a>
+<span class="sourceLineNo">116</span>   * &lt;/code&gt;<a name="line.116"></a>
+<span class="sourceLineNo">117</span>   * &lt;/pre&gt;<a name="line.117"></a>
+<span class="sourceLineNo">118</span>   *<a name="line.118"></a>
+<span class="sourceLineNo">119</span>   * @param stubMaker a delegation to the actual {@code newStub} call.<a name="line.119"></a>
+<span class="sourceLineNo">120</span>   * @param callable a delegation to the actual protobuf rpc call. See the comment of<a name="line.120"></a>
+<span class="sourceLineNo">121</span>   *          {@link CoprocessorCallable} for more details.<a name="line.121"></a>
+<span class="sourceLineNo">122</span>   * @param row The row key used to identify the remote region location<a name="line.122"></a>
+<span class="sourceLineNo">123</span>   * @param &lt;S&gt; the type of the asynchronous stub<a name="line.123"></a>
+<span class="sourceLineNo">124</span>   * @param &lt;R&gt; the type of the return value<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   * @return the return value of the protobuf rpc call, wrapped by a {@link CompletableFuture}.<a name="line.125"></a>
+<span class="sourceLineNo">126</span>   * @see CoprocessorCallable<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   */<a name="line.127"></a>
+<span class="sourceLineNo">128</span>  &lt;S, R&gt; CompletableFuture&lt;R&gt; coprocessorService(Function&lt;RpcChannel, S&gt; stubMaker,<a name="line.128"></a>
+<span class="sourceLineNo">129</span>      CoprocessorCallable&lt;S, R&gt; callable, byte[] row);<a name="line.129"></a>
+<span class="sourceLineNo">130</span><a name="line.130"></a>
+<span class="sourceLineNo">131</span>  /**<a name="line.131"></a>
+<span class="sourceLineNo">132</span>   * The callback when we want to execute a coprocessor call on a range of regions.<a name="line.132"></a>
+<span class="sourceLineNo">133</span>   * &lt;p&gt;<a name="line.133"></a>
+<span class="sourceLineNo">134</span>   * As the locating itself also takes some time, the implementation may want to send rpc calls on<a name="line.134"></a>
+<span class="sourceLineNo">135</span>   * the fly, which means we do not know how many regions we have when we get the return value of<a name="line.135"></a>
+<span class="sourceLineNo">136</span>   * the rpc calls, so we need an {@link #onComplete()} which is used to tell you that we have<a name="line.136"></a>
+<span class="sourceLineNo">137</span>   * passed all the return values to you(through the {@link #onRegionComplete(HRegionInfo, Object)}<a name="line.137"></a>
+<span class="sourceLineNo">138</span>   * or {@link #onRegionError(HRegionInfo, Throwable)} calls), i.e, there will be no<a name="line.138"></a>
+<span class="sourceLineNo">139</span>   * {@link #onRegionComplete(HRegionInfo, Object)} or<a name="line.139"></a>
+<span class="sourceLineNo">140</span>   * {@link #onRegionError(HRegionInfo, Throwable)} calls in the future.<a name="line.140"></a>
+<span class="sourceLineNo">141</span>   * &lt;p&gt;<a name="line.141"></a>
+<span class="sourceLineNo">142</span>   * Here is a pseudo code to describe a typical implementation of a range coprocessor service<a name="line.142"></a>
+<span class="sourceLineNo">143</span>   * method to help you better understand how the {@link CoprocessorCallback} will be called. The<a name="line.143"></a>
+<span class="sourceLineNo">144</span>   * {@code callback} in the pseudo code is our {@link CoprocessorCallback}. And notice that the<a name="line.144"></a>
+<span class="sourceLineNo">145</span>   * {@code whenComplete} is {@code CompletableFuture.whenComplete}.<a name="line.145"></a>
+<span class="sourceLineNo">146</span>   *<a name="line.146"></a>
+<span class="sourceLineNo">147</span>   * &lt;pre&gt;<a name="line.147"></a>
+<span class="sourceLineNo">148</span>   * locateThenCall(byte[] row) {<a name="line.148"></a>
+<span class="sourceLineNo">149</span>   *   locate(row).whenComplete((location, locateError) -&gt; {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>   *     if (locateError != null) {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>   *       callback.onError(locateError);<a name="line.151"></a>
+<span class="sourceLineNo">152</span>   *       return;<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   *     }<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   *     incPendingCall();<a name="line.154"></a>
+<span class="sourceLineNo">155</span>   *     region = location.getRegion();<a name="line.155"></a>
+<span class="sourceLineNo">156</span>   *     if (region.getEndKey() &gt; endKey) {<a name="line.156"></a>
+<span class="sourceLineNo">157</span>   *       locateEnd = true;<a name="line.157"></a>
+<span class="sourceLineNo">158</span>   *     } else {<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   *       locateThenCall(region.getEndKey());<a name="line.159"></a>
+<span class="sourceLineNo">160</span>   *     }<a name="line.160"></a>
+<span class="sourceLineNo">161</span>   *     sendCall().whenComplete((resp, error) -&gt; {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   *       if (error != null) {<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   *         callback.onRegionError(region, error);<a name="line.163"></a>
+<span class="sourceLineNo">164</span>   *       } else {<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   *         callback.onRegionComplete(region, resp);<a name="line.165"></a>
+<span class="sourceLineNo">166</span>   *       }<a name="line.166"></a>
+<span class="sourceLineNo">167</span>   *       if (locateEnd &amp;&amp; decPendingCallAndGet() == 0) {<a name="line.167"></a>
+<span class="sourceLineNo">168</span>   *         callback.onComplete();<a name="line.168"></a>
+<span class="sourceLineNo">169</span>   *       }<a name="line.169"></a>
+<span class="sourceLineNo">170</span>   *     });<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   *   });<a name="line.171"></a>
+<span class="sourceLineNo">172</span>   * }<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   * &lt;/pre&gt;<a name="line.173"></a>
+<span class="sourceLineNo">174</span>   */<a name="line.174"></a>
+<span class="sourceLineNo">175</span>  @InterfaceAudience.Public<a name="line.175"></a>
+<span class="sourceLineNo">176</span>  interface CoprocessorCallback&lt;R&gt; {<a name="line.176"></a>
+<span class="sourceLineNo">177</span><a name="line.177"></a>
+<span class="sourceLineNo">178</span>    /**<a name="line.178"></a>
+<span class="sourceLineNo">179</span>     * @param region the region that the response belongs to<a name="line.179"></a>
+<span class="sourceLineNo">180</span>     * @param resp the response of the coprocessor call<a name="line.180"></a>
+<span class="sourceLineNo">181</span>     */<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    void onRegionComplete(HRegionInfo region, R resp);<a name="line.182"></a>
+<span class="sourceLineNo">183</span><a name="line.183"></a>
+<span class="sourceLineNo">184</span>    /**<a name="line.184"></a>
+<span class="sourceLineNo">185</span>     * @param region the region that the error belongs to<a name="line.185"></a>
+<span class="sourceLineNo">186</span>     * @param error the response error of the coprocessor call<a name="line.186"></a>
+<span class="sourceLineNo">187</span>     */<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    void onRegionError(HRegionInfo region, Throwable error);<a name="line.188"></a>
+<span class="sourceLineNo">189</span><a name="line.189"></a>
+<span class="sourceLineNo">190</span>    /**<a name="line.190"></a>
+<span class="sourceLineNo">191</span>     * Indicate that all responses of the regions have been notified by calling<a name="line.191"></a>
+<span class="sourceLineNo">192</span>     * {@link #onRegionComplete(HRegionInfo, Object)} or<a name="line.192"></a>
+<span class="sourceLineNo">193</span>     * {@link #onRegionError(HRegionInfo, Throwable)}.<a name="line.193"></a>
+<span class="sourceLineNo">194</span>     */<a name="line.194"></a>
+<span class="sourceLineNo">195</span>    void onComplete();<a name="line.195"></a>
+<span class="sourceLineNo">196</span><a name="line.196"></a>
+<span class="sourceLineNo">197</span>    /**<a name="line.197"></a>
+<span class="sourceLineNo">198</span>     * Indicate that we got an error which does not belong to any regions. Usually a locating error.<a name="line.198"></a>
+<span class="sourceLineNo">199</span>     */<a name="line.199"></a>
+<span class="sourceLineNo">200</span>    void onError(Throwable error);<a name="line.200"></a>
+<span class="sourceLineNo">201</span>  }<a name="line.201"></a>
+<span class="sourceLineNo">202</span><a name="line.202"></a>
+<span class="sourceLineNo">203</span>  /**<a name="line.203"></a>
+<span class="sourceLineNo">204</span>   * Execute the given coprocessor call on the regions which are covered by the range from<a name="line.204"></a>
+<span class="sourceLineNo">205</span>   * {@code startKey} inclusive and {@code endKey} exclusive. See the comment of<a name="line.205"></a>
+<span class="sourceLineNo">206</span>   * {@link #coprocessorService(Function, CoprocessorCallable, byte[], boolean, byte[], boolean, CoprocessorCallback)}<a name="line.206"></a>
+<span class="sourceLineNo">207</span>   * for more details.<a name="line.207"></a>
+<span class="sourceLineNo">208</span>   * @see #coprocessorService(Function, CoprocessorCallable, byte[], boolean, byte[], boolean,<a name="line.208"></a>
+<span class="sourceLineNo">209</span>   *      CoprocessorCallback)<a name="line.209"></a>
+<span class="sourceLineNo">210</span>   */<a name="line.210"></a>
+<span class="sourceLineNo">211</span>  default &lt;S, R&gt; void coprocessorService(Function&lt;RpcChannel, S&gt; stubMaker,<a name="line.211"></a>
+<span class="sourceLineNo">212</span>      CoprocessorCallable&lt;S, R&gt; callable, byte[] startKey, byte[] endKey,<a name="line.212"></a>
+<span class="sourceLineNo">213</span>      CoprocessorCallback&lt;R&gt; callback) {<a name="line.213"></a>
+<span class="sourceLineNo">214</span>    coprocessorService(stubMaker, callable, startKey, true, endKey, false, callback);<a name="line.214"></a>
+<span class="sourceLineNo">215</span>  }<a name="line.215"></a>
+<span class="sourceLineNo">216</span><a name="line.216"></a>
+<span class="sourceLineNo">217</span>  /**<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   * Execute the given coprocessor call on the regions which are covered by the range from<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   * {@code startKey} and {@code endKey}. The inclusive of boundaries are specified by<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   * {@code startKeyInclusive} and {@code endKeyInclusive}. The {@code stubMaker} is just a<a name="line.220"></a>
+<span class="sourceLineNo">221</span>   * delegation to the {@code xxxService.newStub} call. Usually it is only a one line lambda<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   * expression, like:<a name="line.222"></a>
+<span class="sourceLineNo">223</span>   *<a name="line.223"></a>
+<span class="sourceLineNo">224</span>   * &lt;pre&gt;<a name="line.224"></a>
+<span class="sourceLineNo">225</span>   * &lt;code&gt;<a name="line.225"></a>
+<span class="sourceLineNo">226</span>   * channel -&gt; xxxService.newStub(channel)<a name="line.226"></a>
+<span class="sourceLineNo">227</span>   * &lt;/code&gt;<a name="line.227"></a>
+<span class="sourceLineNo">228</span>   * &lt;/pre&gt;<a name="line.228"></a>
+<span class="sourceLineNo">229</span>   *<a name="line.229"></a>
+<span class="sourceLineNo">230</span>   * @param stubMaker a delegation to the actual {@code newStub} call.<a name="line.230"></a>
+<span class="sourceLineNo">231</span>   * @param callable a delegation to the actual protobuf rpc call. See the comment of<a name="line.231"></a>
+<span class="sourceLineNo">232</span>   *          {@link CoprocessorCallable} for more details.<a name="line.232"></a>
+<span class="sourceLineNo">233</span>   * @param startKey start region selection with region containing this row. If {@code null}, the<a name="line.233"></a>
+<span class="sourceLineNo">234</span>   *          selection will start with the first table region.<a name="line.234"></a>
+<span class="sourceLineNo">235</span>   * @param startKeyInclusive whether to include the startKey<a name="line.235"></a>
+<span class="sourceLineNo">236</span>   * @param endKey select regions up to and including the region containing this row. If<a name="line.236"></a>
+<span class="sourceLineNo">237</span>   *          {@code null}, selection will continue through the last table region.<a name="line.237"></a>
+<span class="sourceLineNo">238</span>   * @param endKeyInclusive whether to include the endKey<a name="line.238"></a>
+<span class="sourceLineNo">239</span>   * @param callback callback to get the response. See the comment of {@link CoprocessorCallback}<a name="line.239"></a>
+<span class="sourceLineNo">240</span>   *          for more details.<a name="line.240"></a>
+<span class="sourceLineNo">241</span>   * @param &lt;S&gt; the type of the asynchronous stub<a name="line.241"></a>
+<span class="sourceLineNo">242</span>   * @param &lt;R&gt; the type of the return value<a name="line.242"></a>
+<span class="sourceLineNo">243</span>   * @see CoprocessorCallable<a name="line.243"></a>
+<span class="sourceLineNo">244</span>   * @see CoprocessorCallback<a name="line.244"></a>
+<span class="sourceLineNo">245</span>   */<a name="line.245"></a>
+<span class="sourceLineNo">246</span>  &lt;S, R&gt; void coprocessorService(Function&lt;RpcChannel, S&gt; stubMaker,<a name="line.246"></a>
+<span class="sourceLineNo">247</span>      CoprocessorCallable&lt;S, R&gt; callable, byte[] startKey, boolean startKeyInclusive, byte[] endKey,<a name="line.247"></a>
+<span class="sourceLineNo">248</span>      boolean endKeyInclusive, CoprocessorCallback&lt;R&gt; callback);<a name="line.248"></a>
+<span class="sourceLineNo">249</span>}<a name="line.249"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/ebf9a8b8/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanController.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanController.html b/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanController.html
index c804d26..739b628 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanController.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanController.html
@@ -39,109 +39,110 @@
 <span class="sourceLineNo">031</span> * HBase in background while you process the returned data, you need to move the processing work to<a name="line.31"></a>
 <span class="sourceLineNo">032</span> * another thread to make the {@code onNext} call return immediately. And please do NOT do any time<a name="line.32"></a>
 <span class="sourceLineNo">033</span> * consuming tasks in all methods below unless you know what you are doing.<a name="line.33"></a>
-<span class="sourceLineNo">034</span> */<a name="line.34"></a>
-<span class="sourceLineNo">035</span>@InterfaceAudience.Public<a name="line.35"></a>
-<span class="sourceLineNo">036</span>public interface RawScanResultConsumer {<a name="line.36"></a>
-<span class="sourceLineNo">037</span><a name="line.37"></a>
-<span class="sourceLineNo">038</span>  /**<a name="line.38"></a>
-<span class="sourceLineNo">039</span>   * Used to resume a scan.<a name="line.39"></a>
-<span class="sourceLineNo">040</span>   */<a name="line.40"></a>
-<span class="sourceLineNo">041</span>  @InterfaceAudience.Public<a name="line.41"></a>
-<span class="sourceLineNo">042</span>  interface ScanResumer {<a name="line.42"></a>
-<span class="sourceLineNo">043</span><a name="line.43"></a>
-<span class="sourceLineNo">044</span>    /**<a name="line.44"></a>
-<span class="sourceLineNo">045</span>     * Resume the scan. You are free to call it multiple time but only the first call will take<a name="line.45"></a>
-<span class="sourceLineNo">046</span>     * effect.<a name="line.46"></a>
-<span class="sourceLineNo">047</span>     */<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    void resume();<a name="line.48"></a>
-<span class="sourceLineNo">049</span>  }<a name="line.49"></a>
-<span class="sourceLineNo">050</span><a name="line.50"></a>
-<span class="sourceLineNo">051</span>  /**<a name="line.51"></a>
-<span class="sourceLineNo">052</span>   * Used to suspend or stop a scan, or get a scan cursor if available.<a name="line.52"></a>
-<span class="sourceLineNo">053</span>   * &lt;p&gt;<a name="line.53"></a>
-<span class="sourceLineNo">054</span>   * Notice that, you should only call the {@link #suspend()} or {@link #terminate()} inside onNext<a name="line.54"></a>
-<span class="sourceLineNo">055</span>   * or onHeartbeat method. A IllegalStateException will be thrown if you call them at other places.<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   * &lt;p&gt;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>   * You can only call one of the {@link #suspend()} and {@link #terminate()} methods(of course you<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   * are free to not call them both), and the methods are not reentrant. An IllegalStateException<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   * will be thrown if you have already called one of the methods.<a name="line.59"></a>
-<span class="sourceLineNo">060</span>   */<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  @InterfaceAudience.Public<a name="line.61"></a>
-<span class="sourceLineNo">062</span>  interface ScanController {<a name="line.62"></a>
-<span class="sourceLineNo">063</span><a name="line.63"></a>
-<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
-<span class="sourceLineNo">065</span>     * Suspend the scan.<a name="line.65"></a>
-<span class="sourceLineNo">066</span>     * &lt;p&gt;<a name="line.66"></a>
-<span class="sourceLineNo">067</span>     * This means we will stop fetching data in background, i.e., will not call onNext any more<a name="line.67"></a>
-<span class="sourceLineNo">068</span>     * before you resume the scan.<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     * @return A resumer used to resume the scan later.<a name="line.69"></a>
-<span class="sourceLineNo">070</span>     */<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    ScanResumer suspend();<a name="line.71"></a>
-<span class="sourceLineNo">072</span><a name="line.72"></a>
-<span class="sourceLineNo">073</span>    /**<a name="line.73"></a>
-<span class="sourceLineNo">074</span>     * Terminate the scan.<a name="line.74"></a>
-<span class="sourceLineNo">075</span>     * &lt;p&gt;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>     * This is useful when you have got enough results and want to stop the scan in onNext method,<a name="line.76"></a>
-<span class="sourceLineNo">077</span>     * or you want to stop the scan in onHeartbeat method because it has spent too many time.<a name="line.77"></a>
-<span class="sourceLineNo">078</span>     */<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    void terminate();<a name="line.79"></a>
-<span class="sourceLineNo">080</span><a name="line.80"></a>
-<span class="sourceLineNo">081</span>    /**<a name="line.81"></a>
-<span class="sourceLineNo">082</span>     * Get the scan cursor if available.<a name="line.82"></a>
-<span class="sourceLineNo">083</span>     * @return The scan cursor.<a name="line.83"></a>
-<span class="sourceLineNo">084</span>     */<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    Optional&lt;Cursor&gt; cursor();<a name="line.85"></a>
-<span class="sourceLineNo">086</span>  }<a name="line.86"></a>
-<span class="sourceLineNo">087</span><a name="line.87"></a>
-<span class="sourceLineNo">088</span>  /**<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   * Indicate that we have receive some data.<a name="line.89"></a>
-<span class="sourceLineNo">090</span>   * @param results the data fetched from HBase service.<a name="line.90"></a>
-<span class="sourceLineNo">091</span>   * @param controller used to suspend or terminate the scan. Notice that the {@code controller}<a name="line.91"></a>
-<span class="sourceLineNo">092</span>   *          instance is only valid within scope of onNext method. You can only call its method in<a name="line.92"></a>
-<span class="sourceLineNo">093</span>   *          onNext, do NOT store it and call it later outside onNext.<a name="line.93"></a>
-<span class="sourceLineNo">094</span>   */<a name="line.94"></a>
-<span class="sourceLineNo">095</span>  void onNext(Result[] results, ScanController controller);<a name="line.95"></a>
-<span class="sourceLineNo">096</span><a name="line.96"></a>
-<span class="sourceLineNo">097</span>  /**<a name="line.97"></a>
-<span class="sourceLineNo">098</span>   * Indicate that there is a heartbeat message but we have not cumulated enough cells to call<a name="line.98"></a>
-<span class="sourceLineNo">099</span>   * {@link #onNext(Result[], ScanController)}.<a name="line.99"></a>
-<span class="sourceLineNo">100</span>   * &lt;p&gt;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>   * Note that this method will always be called when RS returns something to us but we do not have<a name="line.101"></a>
-<span class="sourceLineNo">102</span>   * enough cells to call {@link #onNext(Result[], ScanController)}. Sometimes it may not be a<a name="line.102"></a>
-<span class="sourceLineNo">103</span>   * 'heartbeat' message for RS, for example, we have a large row with many cells and size limit is<a name="line.103"></a>
-<span class="sourceLineNo">104</span>   * exceeded before sending all the cells for this row. For RS it does send some data to us and the<a name="line.104"></a>
-<span class="sourceLineNo">105</span>   * time limit has not been reached, but we can not return the data to client so here we call this<a name="line.105"></a>
-<span class="sourceLineNo">106</span>   * method to tell client we have already received something.<a name="line.106"></a>
-<span class="sourceLineNo">107</span>   * &lt;p&gt;<a name="line.107"></a>
-<span class="sourceLineNo">108</span>   * This method give you a chance to terminate a slow scan operation.<a name="line.108"></a>
-<span class="sourceLineNo">109</span>   * @param controller used to suspend or terminate the scan. Notice that the {@code controller}<a name="line.109"></a>
-<span class="sourceLineNo">110</span>   *          instance is only valid within the scope of onHeartbeat method. You can only call its<a name="line.110"></a>
-<span class="sourceLineNo">111</span>   *          method in onHeartbeat, do NOT store it and call it later outside onHeartbeat.<a name="line.111"></a>
-<span class="sourceLineNo">112</span>   */<a name="line.112"></a>
-<span class="sourceLineNo">113</span>  default void onHeartbeat(ScanController controller) {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>  }<a name="line.114"></a>
-<span class="sourceLineNo">115</span><a name="line.115"></a>
-<span class="sourceLineNo">116</span>  /**<a name="line.116"></a>
-<span class="sourceLineNo">117</span>   * Indicate that we hit an unrecoverable error and the scan operation is terminated.<a name="line.117"></a>
-<span class="sourceLineNo">118</span>   * &lt;p&gt;<a name="line.118"></a>
-<span class="sourceLineNo">119</span>   * We will not call {@link #onComplete()} after calling {@link #onError(Throwable)}.<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   */<a name="line.120"></a>
-<span class="sourceLineNo">121</span>  void onError(Throwable error);<a name="line.121"></a>
-<span class="sourceLineNo">122</span><a name="line.122"></a>
-<span class="sourceLineNo">123</span>  /**<a name="line.123"></a>
-<span class="sourceLineNo">124</span>   * Indicate that the scan operation is completed normally.<a name="line.124"></a>
-<span class="sourceLineNo">125</span>   */<a name="line.125"></a>
-<span class="sourceLineNo">126</span>  void onComplete();<a name="line.126"></a>
-<span class="sourceLineNo">127</span><a name="line.127"></a>
-<span class="sourceLineNo">128</span>  /**<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   * If {@code scan.isScanMetricsEnabled()} returns true, then this method will be called prior to<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   * all other methods in this interface to give you the {@link ScanMetrics} instance for this scan<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * operation. The {@link ScanMetrics} instance will be updated on-the-fly during the scan, you can<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * store it somewhere to get the metrics at any time if you want.<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   */<a name="line.133"></a>
-<span class="sourceLineNo">134</span>  default void onScanMetricsCreated(ScanMetrics scanMetrics) {<a name="line.134"></a>
-<span class="sourceLineNo">135</span>  }<a name="line.135"></a>
-<span class="sourceLineNo">136</span>}<a name="line.136"></a>
+<span class="sourceLineNo">034</span> * @since 2.0.0<a name="line.34"></a>
+<span class="sourceLineNo">035</span> */<a name="line.35"></a>
+<span class="sourceLineNo">036</span>@InterfaceAudience.Public<a name="line.36"></a>
+<span class="sourceLineNo">037</span>public interface RawScanResultConsumer {<a name="line.37"></a>
+<span class="sourceLineNo">038</span><a name="line.38"></a>
+<span class="sourceLineNo">039</span>  /**<a name="line.39"></a>
+<span class="sourceLineNo">040</span>   * Used to resume a scan.<a name="line.40"></a>
+<span class="sourceLineNo">041</span>   */<a name="line.41"></a>
+<span class="sourceLineNo">042</span>  @InterfaceAudience.Public<a name="line.42"></a>
+<span class="sourceLineNo">043</span>  interface ScanResumer {<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    /**<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * Resume the scan. You are free to call it multiple time but only the first call will take<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     * effect.<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     */<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    void resume();<a name="line.49"></a>
+<span class="sourceLineNo">050</span>  }<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span>  /**<a name="line.52"></a>
+<span class="sourceLineNo">053</span>   * Used to suspend or stop a scan, or get a scan cursor if available.<a name="line.53"></a>
+<span class="sourceLineNo">054</span>   * &lt;p&gt;<a name="line.54"></a>
+<span class="sourceLineNo">055</span>   * Notice that, you should only call the {@link #suspend()} or {@link #terminate()} inside onNext<a name="line.55"></a>
+<span class="sourceLineNo">056</span>   * or onHeartbeat method. A IllegalStateException will be thrown if you call them at other places.<a name="line.56"></a>
+<span class="sourceLineNo">057</span>   * &lt;p&gt;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   * You can only call one of the {@link #suspend()} and {@link #terminate()} methods(of course you<a name="line.58"></a>
+<span class="sourceLineNo">059</span>   * are free to not call them both), and the methods are not reentrant. An IllegalStateException<a name="line.59"></a>
+<span class="sourceLineNo">060</span>   * will be thrown if you have already called one of the methods.<a name="line.60"></a>
+<span class="sourceLineNo">061</span>   */<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  @InterfaceAudience.Public<a name="line.62"></a>
+<span class="sourceLineNo">063</span>  interface ScanController {<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>    /**<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     * Suspend the scan.<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * &lt;p&gt;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     * This means we will stop fetching data in background, i.e., will not call onNext any more<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     * before you resume the scan.<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     * @return A resumer used to resume the scan later.<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     */<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    ScanResumer suspend();<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>    /**<a name="line.74"></a>
+<span class="sourceLineNo">075</span>     * Terminate the scan.<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     * &lt;p&gt;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     * This is useful when you have got enough results and want to stop the scan in onNext method,<a name="line.77"></a>
+<span class="sourceLineNo">078</span>     * or you want to stop the scan in onHeartbeat method because it has spent too many time.<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     */<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    void terminate();<a name="line.80"></a>
+<span class="sourceLineNo">081</span><a name="line.81"></a>
+<span class="sourceLineNo">082</span>    /**<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     * Get the scan cursor if available.<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     * @return The scan cursor.<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     */<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    Optional&lt;Cursor&gt; cursor();<a name="line.86"></a>
+<span class="sourceLineNo">087</span>  }<a name="line.87"></a>
+<span class="sourceLineNo">088</span><a name="line.88"></a>
+<span class="sourceLineNo">089</span>  /**<a name="line.89"></a>
+<span class="sourceLineNo">090</span>   * Indicate that we have receive some data.<a name="line.90"></a>
+<span class="sourceLineNo">091</span>   * @param results the data fetched from HBase service.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>   * @param controller used to suspend or terminate the scan. Notice that the {@code controller}<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   *          instance is only valid within scope of onNext method. You can only call its method in<a name="line.93"></a>
+<span class="sourceLineNo">094</span>   *          onNext, do NOT store it and call it later outside onNext.<a name="line.94"></a>
+<span class="sourceLineNo">095</span>   */<a name="line.95"></a>
+<span class="sourceLineNo">096</span>  void onNext(Result[] results, ScanController controller);<a name="line.96"></a>
+<span class="sourceLineNo">097</span><a name="line.97"></a>
+<span class="sourceLineNo">098</span>  /**<a name="line.98"></a>
+<span class="sourceLineNo">099</span>   * Indicate that there is a heartbeat message but we have not cumulated enough cells to call<a name="line.99"></a>
+<span class="sourceLineNo">100</span>   * {@link #onNext(Result[], ScanController)}.<a name="line.100"></a>
+<span class="sourceLineNo">101</span>   * &lt;p&gt;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>   * Note that this method will always be called when RS returns something to us but we do not have<a name="line.102"></a>
+<span class="sourceLineNo">103</span>   * enough cells to call {@link #onNext(Result[], ScanController)}. Sometimes it may not be a<a name="line.103"></a>
+<span class="sourceLineNo">104</span>   * 'heartbeat' message for RS, for example, we have a large row with many cells and size limit is<a name="line.104"></a>
+<span class="sourceLineNo">105</span>   * exceeded before sending all the cells for this row. For RS it does send some data to us and the<a name="line.105"></a>
+<span class="sourceLineNo">106</span>   * time limit has not been reached, but we can not return the data to client so here we call this<a name="line.106"></a>
+<span class="sourceLineNo">107</span>   * method to tell client we have already received something.<a name="line.107"></a>
+<span class="sourceLineNo">108</span>   * &lt;p&gt;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>   * This method give you a chance to terminate a slow scan operation.<a name="line.109"></a>
+<span class="sourceLineNo">110</span>   * @param controller used to suspend or terminate the scan. Notice that the {@code controller}<a name="line.110"></a>
+<span class="sourceLineNo">111</span>   *          instance is only valid within the scope of onHeartbeat method. You can only call its<a name="line.111"></a>
+<span class="sourceLineNo">112</span>   *          method in onHeartbeat, do NOT store it and call it later outside onHeartbeat.<a name="line.112"></a>
+<span class="sourceLineNo">113</span>   */<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  default void onHeartbeat(ScanController controller) {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>  }<a name="line.115"></a>
+<span class="sourceLineNo">116</span><a name="line.116"></a>
+<span class="sourceLineNo">117</span>  /**<a name="line.117"></a>
+<span class="sourceLineNo">118</span>   * Indicate that we hit an unrecoverable error and the scan operation is terminated.<a name="line.118"></a>
+<span class="sourceLineNo">119</span>   * &lt;p&gt;<a name="line.119"></a>
+<span class="sourceLineNo">120</span>   * We will not call {@link #onComplete()} after calling {@link #onError(Throwable)}.<a name="line.120"></a>
+<span class="sourceLineNo">121</span>   */<a name="line.121"></a>
+<span class="sourceLineNo">122</span>  void onError(Throwable error);<a name="line.122"></a>
+<span class="sourceLineNo">123</span><a name="line.123"></a>
+<span class="sourceLineNo">124</span>  /**<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   * Indicate that the scan operation is completed normally.<a name="line.125"></a>
+<span class="sourceLineNo">126</span>   */<a name="line.126"></a>
+<span class="sourceLineNo">127</span>  void onComplete();<a name="line.127"></a>
+<span class="sourceLineNo">128</span><a name="line.128"></a>
+<span class="sourceLineNo">129</span>  /**<a name="line.129"></a>
+<span class="sourceLineNo">130</span>   * If {@code scan.isScanMetricsEnabled()} returns true, then this method will be called prior to<a name="line.130"></a>
+<span class="sourceLineNo">131</span>   * all other methods in this interface to give you the {@link ScanMetrics} instance for this scan<a name="line.131"></a>
+<span class="sourceLineNo">132</span>   * operation. The {@link ScanMetrics} instance will be updated on-the-fly during the scan, you can<a name="line.132"></a>
+<span class="sourceLineNo">133</span>   * store it somewhere to get the metrics at any time if you want.<a name="line.133"></a>
+<span class="sourceLineNo">134</span>   */<a name="line.134"></a>
+<span class="sourceLineNo">135</span>  default void onScanMetricsCreated(ScanMetrics scanMetrics) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>  }<a name="line.136"></a>
+<span class="sourceLineNo">137</span>}<a name="line.137"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/ebf9a8b8/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanResumer.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanResumer.html b/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanResumer.html
index c804d26..739b628 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanResumer.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/client/RawScanResultConsumer.ScanResumer.html
@@ -39,109 +39,110 @@
 <span class="sourceLineNo">031</span> * HBase in background while you process the returned data, you need to move the processing work to<a name="line.31"></a>
 <span class="sourceLineNo">032</span> * another thread to make the {@code onNext} call return immediately. And please do NOT do any time<a name="line.32"></a>
 <span class="sourceLineNo">033</span> * consuming tasks in all methods below unless you know what you are doing.<a name="line.33"></a>
-<span class="sourceLineNo">034</span> */<a name="line.34"></a>
-<span class="sourceLineNo">035</span>@InterfaceAudience.Public<a name="line.35"></a>
-<span class="sourceLineNo">036</span>public interface RawScanResultConsumer {<a name="line.36"></a>
-<span class="sourceLineNo">037</span><a name="line.37"></a>
-<span class="sourceLineNo">038</span>  /**<a name="line.38"></a>
-<span class="sourceLineNo">039</span>   * Used to resume a scan.<a name="line.39"></a>
-<span class="sourceLineNo">040</span>   */<a name="line.40"></a>
-<span class="sourceLineNo">041</span>  @InterfaceAudience.Public<a name="line.41"></a>
-<span class="sourceLineNo">042</span>  interface ScanResumer {<a name="line.42"></a>
-<span class="sourceLineNo">043</span><a name="line.43"></a>
-<span class="sourceLineNo">044</span>    /**<a name="line.44"></a>
-<span class="sourceLineNo">045</span>     * Resume the scan. You are free to call it multiple time but only the first call will take<a name="line.45"></a>
-<span class="sourceLineNo">046</span>     * effect.<a name="line.46"></a>
-<span class="sourceLineNo">047</span>     */<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    void resume();<a name="line.48"></a>
-<span class="sourceLineNo">049</span>  }<a name="line.49"></a>
-<span class="sourceLineNo">050</span><a name="line.50"></a>
-<span class="sourceLineNo">051</span>  /**<a name="line.51"></a>
-<span class="sourceLineNo">052</span>   * Used to suspend or stop a scan, or get a scan cursor if available.<a name="line.52"></a>
-<span class="sourceLineNo">053</span>   * &lt;p&gt;<a name="line.53"></a>
-<span class="sourceLineNo">054</span>   * Notice that, you should only call the {@link #suspend()} or {@link #terminate()} inside onNext<a name="line.54"></a>
-<span class="sourceLineNo">055</span>   * or onHeartbeat method. A IllegalStateException will be thrown if you call them at other places.<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   * &lt;p&gt;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>   * You can only call one of the {@link #suspend()} and {@link #terminate()} methods(of course you<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   * are free to not call them both), and the methods are not reentrant. An IllegalStateException<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   * will be thrown if you have already called one of the methods.<a name="line.59"></a>
-<span class="sourceLineNo">060</span>   */<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  @InterfaceAudience.Public<a name="line.61"></a>
-<span class="sourceLineNo">062</span>  interface ScanController {<a name="line.62"></a>
-<span class="sourceLineNo">063</span><a name="line.63"></a>
-<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
-<span class="sourceLineNo">065</span>     * Suspend the scan.<a name="line.65"></a>
-<span class="sourceLineNo">066</span>     * &lt;p&gt;<a name="line.66"></a>
-<span class="sourceLineNo">067</span>     * This means we will stop fetching data in background, i.e., will not call onNext any more<a name="line.67"></a>
-<span class="sourceLineNo">068</span>     * before you resume the scan.<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     * @return A resumer used to resume the scan later.<a name="line.69"></a>
-<span class="sourceLineNo">070</span>     */<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    ScanResumer suspend();<a name="line.71"></a>
-<span class="sourceLineNo">072</span><a name="line.72"></a>
-<span class="sourceLineNo">073</span>    /**<a name="line.73"></a>
-<span class="sourceLineNo">074</span>     * Terminate the scan.<a name="line.74"></a>
-<span class="sourceLineNo">075</span>     * &lt;p&gt;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>     * This is useful when you have got enough results and want to stop the scan in onNext method,<a name="line.76"></a>
-<span class="sourceLineNo">077</span>     * or you want to stop the scan in onHeartbeat method because it has spent too many time.<a name="line.77"></a>
-<span class="sourceLineNo">078</span>     */<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    void terminate();<a name="line.79"></a>
-<span class="sourceLineNo">080</span><a name="line.80"></a>
-<span class="sourceLineNo">081</span>    /**<a name="line.81"></a>
-<span class="sourceLineNo">082</span>     * Get the scan cursor if available.<a name="line.82"></a>
-<span class="sourceLineNo">083</span>     * @return The scan cursor.<a name="line.83"></a>
-<span class="sourceLineNo">084</span>     */<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    Optional&lt;Cursor&gt; cursor();<a name="line.85"></a>
-<span class="sourceLineNo">086</span>  }<a name="line.86"></a>
-<span class="sourceLineNo">087</span><a name="line.87"></a>
-<span class="sourceLineNo">088</span>  /**<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   * Indicate that we have receive some data.<a name="line.89"></a>
-<span class="sourceLineNo">090</span>   * @param results the data fetched from HBase service.<a name="line.90"></a>
-<span class="sourceLineNo">091</span>   * @param controller used to suspend or terminate the scan. Notice that the {@code controller}<a name="line.91"></a>
-<span class="sourceLineNo">092</span>   *          instance is only valid within scope of onNext method. You can only call its method in<a name="line.92"></a>
-<span class="sourceLineNo">093</span>   *          onNext, do NOT store it and call it later outside onNext.<a name="line.93"></a>
-<span class="sourceLineNo">094</span>   */<a name="line.94"></a>
-<span class="sourceLineNo">095</span>  void onNext(Result[] results, ScanController controller);<a name="line.95"></a>
-<span class="sourceLineNo">096</span><a name="line.96"></a>
-<span class="sourceLineNo">097</span>  /**<a name="line.97"></a>
-<span class="sourceLineNo">098</span>   * Indicate that there is a heartbeat message but we have not cumulated enough cells to call<a name="line.98"></a>
-<span class="sourceLineNo">099</span>   * {@link #onNext(Result[], ScanController)}.<a name="line.99"></a>
-<span class="sourceLineNo">100</span>   * &lt;p&gt;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>   * Note that this method will always be called when RS returns something to us but we do not have<a name="line.101"></a>
-<span class="sourceLineNo">102</span>   * enough cells to call {@link #onNext(Result[], ScanController)}. Sometimes it may not be a<a name="line.102"></a>
-<span class="sourceLineNo">103</span>   * 'heartbeat' message for RS, for example, we have a large row with many cells and size limit is<a name="line.103"></a>
-<span class="sourceLineNo">104</span>   * exceeded before sending all the cells for this row. For RS it does send some data to us and the<a name="line.104"></a>
-<span class="sourceLineNo">105</span>   * time limit has not been reached, but we can not return the data to client so here we call this<a name="line.105"></a>
-<span class="sourceLineNo">106</span>   * method to tell client we have already received something.<a name="line.106"></a>
-<span class="sourceLineNo">107</span>   * &lt;p&gt;<a name="line.107"></a>
-<span class="sourceLineNo">108</span>   * This method give you a chance to terminate a slow scan operation.<a name="line.108"></a>
-<span class="sourceLineNo">109</span>   * @param controller used to suspend or terminate the scan. Notice that the {@code controller}<a name="line.109"></a>
-<span class="sourceLineNo">110</span>   *          instance is only valid within the scope of onHeartbeat method. You can only call its<a name="line.110"></a>
-<span class="sourceLineNo">111</span>   *          method in onHeartbeat, do NOT store it and call it later outside onHeartbeat.<a name="line.111"></a>
-<span class="sourceLineNo">112</span>   */<a name="line.112"></a>
-<span class="sourceLineNo">113</span>  default void onHeartbeat(ScanController controller) {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>  }<a name="line.114"></a>
-<span class="sourceLineNo">115</span><a name="line.115"></a>
-<span class="sourceLineNo">116</span>  /**<a name="line.116"></a>
-<span class="sourceLineNo">117</span>   * Indicate that we hit an unrecoverable error and the scan operation is terminated.<a name="line.117"></a>
-<span class="sourceLineNo">118</span>   * &lt;p&gt;<a name="line.118"></a>
-<span class="sourceLineNo">119</span>   * We will not call {@link #onComplete()} after calling {@link #onError(Throwable)}.<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   */<a name="line.120"></a>
-<span class="sourceLineNo">121</span>  void onError(Throwable error);<a name="line.121"></a>
-<span class="sourceLineNo">122</span><a name="line.122"></a>
-<span class="sourceLineNo">123</span>  /**<a name="line.123"></a>
-<span class="sourceLineNo">124</span>   * Indicate that the scan operation is completed normally.<a name="line.124"></a>
-<span class="sourceLineNo">125</span>   */<a name="line.125"></a>
-<span class="sourceLineNo">126</span>  void onComplete();<a name="line.126"></a>
-<span class="sourceLineNo">127</span><a name="line.127"></a>
-<span class="sourceLineNo">128</span>  /**<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   * If {@code scan.isScanMetricsEnabled()} returns true, then this method will be called prior to<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   * all other methods in this interface to give you the {@link ScanMetrics} instance for this scan<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * operation. The {@link ScanMetrics} instance will be updated on-the-fly during the scan, you can<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * store it somewhere to get the metrics at any time if you want.<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   */<a name="line.133"></a>
-<span class="sourceLineNo">134</span>  default void onScanMetricsCreated(ScanMetrics scanMetrics) {<a name="line.134"></a>
-<span class="sourceLineNo">135</span>  }<a name="line.135"></a>
-<span class="sourceLineNo">136</span>}<a name="line.136"></a>
+<span class="sourceLineNo">034</span> * @since 2.0.0<a name="line.34"></a>
+<span class="sourceLineNo">035</span> */<a name="line.35"></a>
+<span class="sourceLineNo">036</span>@InterfaceAudience.Public<a name="line.36"></a>
+<span class="sourceLineNo">037</span>public interface RawScanResultConsumer {<a name="line.37"></a>
+<span class="sourceLineNo">038</span><a name="line.38"></a>
+<span class="sourceLineNo">039</span>  /**<a name="line.39"></a>
+<span class="sourceLineNo">040</span>   * Used to resume a scan.<a name="line.40"></a>
+<span class="sourceLineNo">041</span>   */<a name="line.41"></a>
+<span class="sourceLineNo">042</span>  @InterfaceAudience.Public<a name="line.42"></a>
+<span class="sourceLineNo">043</span>  interface ScanResumer {<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    /**<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * Resume the scan. You are free to call it multiple time but only the first call will take<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     * effect.<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     */<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    void resume();<a name="line.49"></a>
+<span class="sourceLineNo">050</span>  }<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span>  /**<a name="line.52"></a>
+<span class="sourceLineNo">053</span>   * Used to suspend or stop a scan, or get a scan cursor if available.<a name="line.53"></a>
+<span class="sourceLineNo">054</span>   * &lt;p&gt;<a name="line.54"></a>
+<span class="sourceLineNo">055</span>   * Notice that, you should only call the {@link #suspend()} or {@link #terminate()} inside onNext<a name="line.55"></a>
+<span class="sourceLineNo">056</span>   * or onHeartbeat method. A IllegalStateException will be thrown if you call them at other places.<a name="line.56"></a>
+<span class="sourceLineNo">057</span>   * &lt;p&gt;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   * You can only call one of the {@link #suspend()} and {@link #terminate()} methods(of course you<a name="line.58"></a>
+<span class="sourceLineNo">059</span>   * are free to not call them both), and the methods are not reentrant. An IllegalStateException<a name="line.59"></a>
+<span class="sourceLineNo">060</span>   * will be thrown if you have already called one of the methods.<a name="line.60"></a>
+<span class="sourceLineNo">061</span>   */<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  @InterfaceAudience.Public<a name="line.62"></a>
+<span class="sourceLineNo">063</span>  interface ScanController {<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>    /**<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     * Suspend the scan.<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * &lt;p&gt;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     * This means we will stop fetching data in background, i.e., will not call onNext any more<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     * before you resume the scan.<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     * @return A resumer used to resume the scan later.<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     */<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    ScanResumer suspend();<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>    /**<a name="line.74"></a>
+<span class="sourceLineNo">075</span>     * Terminate the scan.<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     * &lt;p&gt;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     * This is useful when you have got enough results and want to stop the scan in onNext method,<a name="line.77"></a>
+<span class="sourceLineNo">078</span>     * or you want to stop the scan in onHeartbeat method because it has spent too many time.<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     */<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    void terminate();<a name="line.80"></a>
+<span class="sourceLineNo">081</span><a name="line.81"></a>
+<span class="sourceLineNo">082</span>    /**<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     * Get the scan cursor if available.<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     * @return The scan cursor.<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     */<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    Optional&lt;Cursor&gt; cursor();<a name="line.86"></a>
+<span class="sourceLineNo">087</span>  }<a name="line.87"></a>
+<span class="sourceLineNo">088</span><a name="line.88"></a>
+<span class="sourceLineNo">089</span>  /**<a name="line.89"></a>
+<span class="sourceLineNo">090</span>   * Indicate that we have receive some data.<a name="line.90"></a>
+<span class="sourceLineNo">091</span>   * @param results the data fetched from HBase service.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>   * @param controller used to suspend or terminate the scan. Notice that the {@code controller}<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   *          instance is only valid within scope of onNext method. You can only call its method in<a name="line.93"></a>
+<span class="sourceLineNo">094</span>   *          onNext, do NOT store it and call it later outside onNext.<a name="line.94"></a>
+<span class="sourceLineNo">095</span>   */<a name="line.95"></a>
+<span class="sourceLineNo">096</span>  void onNext(Result[] results, ScanController controller);<a name="line.96"></a>
+<span class="sourceLineNo">097</span><a name="line.97"></a>
+<span class="sourceLineNo">098</span>  /**<a name="line.98"></a>
+<span class="sourceLineNo">099</span>   * Indicate that there is a heartbeat message but we have not cumulated enough cells to call<a name="line.99"></a>
+<span class="sourceLineNo">100</span>   * {@link #onNext(Result[], ScanController)}.<a name="line.100"></a>
+<span class="sourceLineNo">101</span>   * &lt;p&gt;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>   * Note that this method will always be called when RS returns something to us but we do not have<a name="line.102"></a>
+<span class="sourceLineNo">103</span>   * enough cells to call {@link #onNext(Result[], ScanController)}. Sometimes it may not be a<a name="line.103"></a>
+<span class="sourceLineNo">104</span>   * 'heartbeat' message for RS, for example, we have a large row with many cells and size limit is<a name="line.104"></a>
+<span class="sourceLineNo">105</span>   * exceeded before sending all the cells for this row. For RS it does send some data to us and the<a name="line.105"></a>
+<span class="sourceLineNo">106</span>   * time limit has not been reached, but we can not return the data to client so here we call this<a name="line.106"></a>
+<span class="sourceLineNo">107</span>   * method to tell client we have already received something.<a name="line.107"></a>
+<span class="sourceLineNo">108</span>   * &lt;p&gt;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>   * This method give you a chance to terminate a slow scan operation.<a name="line.109"></a>
+<span class="sourceLineNo">110</span>   * @param controller used to suspend or terminate the scan. Notice that the {@code controller}<a name="line.110"></a>
+<span class="sourceLineNo">111</span>   *          instance is only valid within the scope of onHeartbeat method. You can only call its<a name="line.111"></a>
+<span class="sourceLineNo">112</span>   *          method in onHeartbeat, do NOT store it and call it later outside onHeartbeat.<a name="line.112"></a>
+<span class="sourceLineNo">113</span>   */<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  default void onHeartbeat(ScanController controller) {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>  }<a name="line.115"></a>
+<span class="sourceLineNo">116</span><a name="line.116"></a>
+<span class="sourceLineNo">117</span>  /**<a name="line.117"></a>
+<span class="sourceLineNo">118</span>   * Indicate that we hit an unrecoverable error and the scan operation is terminated.<a name="line.118"></a>
+<span class="sourceLineNo">119</span>   * &lt;p&gt;<a name="line.119"></a>
+<span class="sourceLineNo">120</span>   * We will not call {@link #onComplete()} after calling {@link #onError(Throwable)}.<a name="line.120"></a>
+<span class="sourceLineNo">121</span>   */<a name="line.121"></a>
+<span class="sourceLineNo">122</span>  void onError(Throwable error);<a name="line.122"></a>
+<span class="sourceLineNo">123</span><a name="line.123"></a>
+<span class="sourceLineNo">124</span>  /**<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   * Indicate that the scan operation is completed normally.<a name="line.125"></a>
+<span class="sourceLineNo">126</span>   */<a name="line.126"></a>
+<span class="sourceLineNo">127</span>  void onComplete();<a name="line.127"></a>
+<span class="sourceLineNo">128</span><a name="line.128"></a>
+<span class="sourceLineNo">129</span>  /**<a name="line.129"></a>
+<span class="sourceLineNo">130</span>   * If {@code scan.isScanMetricsEnabled()} returns true, then this method will be called prior to<a name="line.130"></a>
+<span class="sourceLineNo">131</span>   * all other methods in this interface to give you the {@link ScanMetrics} instance for this scan<a name="line.131"></a>
+<span class="sourceLineNo">132</span>   * operation. The {@link ScanMetrics} instance will be updated on-the-fly during the scan, you can<a name="line.132"></a>
+<span class="sourceLineNo">133</span>   * store it somewhere to get the metrics at any time if you want.<a name="line.133"></a>
+<span class="sourceLineNo">134</span>   */<a name="line.134"></a>
+<span class="sourceLineNo">135</span>  default void onScanMetricsCreated(ScanMetrics scanMetrics) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>  }<a name="line.136"></a>
+<span class="sourceLineNo">137</span>}<a name="line.137"></a>
 
 
 


Mime
View raw message