hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [25/51] [partial] hbase-site git commit: Published site at 07b623670647686084f8f5fd2038e2bafcfdac54.
Date Wed, 30 Dec 2015 22:15:46 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e5c3dcd1/devapidocs/src-html/org/apache/hadoop/hbase/ipc/AsyncRpcClient.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/AsyncRpcClient.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/AsyncRpcClient.html
index c9ae0e6..dfa8ee0 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/AsyncRpcClient.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/AsyncRpcClient.html
@@ -259,255 +259,256 @@
 <span class="sourceLineNo">251</span>      if (e.getCause() instanceof IOException) {<a name="line.251"></a>
 <span class="sourceLineNo">252</span>        throw (IOException) e.getCause();<a name="line.252"></a>
 <span class="sourceLineNo">253</span>      } else {<a name="line.253"></a>
-<span class="sourceLineNo">254</span>        throw new IOException(e.getCause());<a name="line.254"></a>
+<span class="sourceLineNo">254</span>        throw wrapException(addr, (Exception) e.getCause());<a name="line.254"></a>
 <span class="sourceLineNo">255</span>      }<a name="line.255"></a>
 <span class="sourceLineNo">256</span>    } catch (TimeoutException e) {<a name="line.256"></a>
-<span class="sourceLineNo">257</span>      throw new CallTimeoutException(promise.toString());<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    }<a name="line.258"></a>
-<span class="sourceLineNo">259</span>  }<a name="line.259"></a>
-<span class="sourceLineNo">260</span><a name="line.260"></a>
-<span class="sourceLineNo">261</span>  /**<a name="line.261"></a>
-<span class="sourceLineNo">262</span>   * Call method async<a name="line.262"></a>
-<span class="sourceLineNo">263</span>   */<a name="line.263"></a>
-<span class="sourceLineNo">264</span>  private void callMethod(final Descriptors.MethodDescriptor md,<a name="line.264"></a>
-<span class="sourceLineNo">265</span>      final PayloadCarryingRpcController pcrc, final Message param, Message returnType, User ticket,<a name="line.265"></a>
-<span class="sourceLineNo">266</span>      InetSocketAddress addr, final RpcCallback&lt;Message&gt; done) {<a name="line.266"></a>
-<span class="sourceLineNo">267</span>    final AsyncRpcChannel connection;<a name="line.267"></a>
-<span class="sourceLineNo">268</span>    try {<a name="line.268"></a>
-<span class="sourceLineNo">269</span>      connection = createRpcChannel(md.getService().getName(), addr, ticket);<a name="line.269"></a>
-<span class="sourceLineNo">270</span>      final MetricsConnection.CallStats cs = MetricsConnection.newCallStats();<a name="line.270"></a>
-<span class="sourceLineNo">271</span>      GenericFutureListener&lt;Future&lt;Message&gt;&gt; listener =<a name="line.271"></a>
-<span class="sourceLineNo">272</span>          new GenericFutureListener&lt;Future&lt;Message&gt;&gt;() {<a name="line.272"></a>
-<span class="sourceLineNo">273</span>            @Override<a name="line.273"></a>
-<span class="sourceLineNo">274</span>            public void operationComplete(Future&lt;Message&gt; future) throws Exception {<a name="line.274"></a>
-<span class="sourceLineNo">275</span>              cs.setCallTimeMs(EnvironmentEdgeManager.currentTime() - cs.getStartTime());<a name="line.275"></a>
-<span class="sourceLineNo">276</span>              if (metrics != null) {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>                metrics.updateRpc(md, param, cs);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>              }<a name="line.278"></a>
-<span class="sourceLineNo">279</span>              if (LOG.isTraceEnabled()) {<a name="line.279"></a>
-<span class="sourceLineNo">280</span>                LOG.trace("Call: " + md.getName() + ", callTime: " + cs.getCallTimeMs() + "ms");<a name="line.280"></a>
-<span class="sourceLineNo">281</span>              }<a name="line.281"></a>
-<span class="sourceLineNo">282</span>              if (!future.isSuccess()) {<a name="line.282"></a>
-<span class="sourceLineNo">283</span>                Throwable cause = future.cause();<a name="line.283"></a>
-<span class="sourceLineNo">284</span>                if (cause instanceof IOException) {<a name="line.284"></a>
-<span class="sourceLineNo">285</span>                  pcrc.setFailed((IOException) cause);<a name="line.285"></a>
-<span class="sourceLineNo">286</span>                } else {<a name="line.286"></a>
-<span class="sourceLineNo">287</span>                  pcrc.setFailed(new IOException(cause));<a name="line.287"></a>
-<span class="sourceLineNo">288</span>                }<a name="line.288"></a>
-<span class="sourceLineNo">289</span>              } else {<a name="line.289"></a>
-<span class="sourceLineNo">290</span>                try {<a name="line.290"></a>
-<span class="sourceLineNo">291</span>                  done.run(future.get());<a name="line.291"></a>
-<span class="sourceLineNo">292</span>                } catch (ExecutionException e) {<a name="line.292"></a>
-<span class="sourceLineNo">293</span>                  Throwable cause = e.getCause();<a name="line.293"></a>
-<span class="sourceLineNo">294</span>                  if (cause instanceof IOException) {<a name="line.294"></a>
-<span class="sourceLineNo">295</span>                    pcrc.setFailed((IOException) cause);<a name="line.295"></a>
-<span class="sourceLineNo">296</span>                  } else {<a name="line.296"></a>
-<span class="sourceLineNo">297</span>                    pcrc.setFailed(new IOException(cause));<a name="line.297"></a>
-<span class="sourceLineNo">298</span>                  }<a name="line.298"></a>
-<span class="sourceLineNo">299</span>                } catch (InterruptedException e) {<a name="line.299"></a>
-<span class="sourceLineNo">300</span>                  pcrc.setFailed(new IOException(e));<a name="line.300"></a>
-<span class="sourceLineNo">301</span>                }<a name="line.301"></a>
-<span class="sourceLineNo">302</span>              }<a name="line.302"></a>
-<span class="sourceLineNo">303</span>            }<a name="line.303"></a>
-<span class="sourceLineNo">304</span>          };<a name="line.304"></a>
-<span class="sourceLineNo">305</span>      cs.setStartTime(EnvironmentEdgeManager.currentTime());<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      connection.callMethod(md, pcrc, param, returnType, cs).addListener(listener);<a name="line.306"></a>
-<span class="sourceLineNo">307</span>    } catch (StoppedRpcClientException|FailedServerException e) {<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      pcrc.setFailed(e);<a name="line.308"></a>
-<span class="sourceLineNo">309</span>    }<a name="line.309"></a>
-<span class="sourceLineNo">310</span>  }<a name="line.310"></a>
-<span class="sourceLineNo">311</span><a name="line.311"></a>
-<span class="sourceLineNo">312</span>  private boolean closed = false;<a name="line.312"></a>
-<span class="sourceLineNo">313</span><a name="line.313"></a>
-<span class="sourceLineNo">314</span>  /**<a name="line.314"></a>
-<span class="sourceLineNo">315</span>   * Close netty<a name="line.315"></a>
-<span class="sourceLineNo">316</span>   */<a name="line.316"></a>
-<span class="sourceLineNo">317</span>  public void close() {<a name="line.317"></a>
-<span class="sourceLineNo">318</span>    if (LOG.isDebugEnabled()) {<a name="line.318"></a>
-<span class="sourceLineNo">319</span>      LOG.debug("Stopping async HBase RPC client");<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    }<a name="line.320"></a>
-<span class="sourceLineNo">321</span><a name="line.321"></a>
-<span class="sourceLineNo">322</span>    synchronized (connections) {<a name="line.322"></a>
-<span class="sourceLineNo">323</span>      if (closed) {<a name="line.323"></a>
-<span class="sourceLineNo">324</span>        return;<a name="line.324"></a>
-<span class="sourceLineNo">325</span>      }<a name="line.325"></a>
-<span class="sourceLineNo">326</span>      closed = true;<a name="line.326"></a>
-<span class="sourceLineNo">327</span>      for (AsyncRpcChannel conn : connections.values()) {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>        conn.close(null);<a name="line.328"></a>
-<span class="sourceLineNo">329</span>      }<a name="line.329"></a>
-<span class="sourceLineNo">330</span>    }<a name="line.330"></a>
-<span class="sourceLineNo">331</span>    // do not close global EventLoopGroup.<a name="line.331"></a>
-<span class="sourceLineNo">332</span>    if (!useGlobalEventLoopGroup) {<a name="line.332"></a>
-<span class="sourceLineNo">333</span>      bootstrap.group().shutdownGracefully();<a name="line.333"></a>
-<span class="sourceLineNo">334</span>    }<a name="line.334"></a>
-<span class="sourceLineNo">335</span>  }<a name="line.335"></a>
-<span class="sourceLineNo">336</span><a name="line.336"></a>
-<span class="sourceLineNo">337</span>  /**<a name="line.337"></a>
-<span class="sourceLineNo">338</span>   * Create a cell scanner<a name="line.338"></a>
-<span class="sourceLineNo">339</span>   *<a name="line.339"></a>
-<span class="sourceLineNo">340</span>   * @param cellBlock to create scanner for<a name="line.340"></a>
-<span class="sourceLineNo">341</span>   * @return CellScanner<a name="line.341"></a>
-<span class="sourceLineNo">342</span>   * @throws java.io.IOException on error on creation cell scanner<a name="line.342"></a>
-<span class="sourceLineNo">343</span>   */<a name="line.343"></a>
-<span class="sourceLineNo">344</span>  public CellScanner createCellScanner(byte[] cellBlock) throws IOException {<a name="line.344"></a>
-<span class="sourceLineNo">345</span>    return ipcUtil.createCellScanner(this.codec, this.compressor, cellBlock);<a name="line.345"></a>
-<span class="sourceLineNo">346</span>  }<a name="line.346"></a>
-<span class="sourceLineNo">347</span><a name="line.347"></a>
-<span class="sourceLineNo">348</span>  /**<a name="line.348"></a>
-<span class="sourceLineNo">349</span>   * Build cell block<a name="line.349"></a>
-<span class="sourceLineNo">350</span>   *<a name="line.350"></a>
-<span class="sourceLineNo">351</span>   * @param cells to create block with<a name="line.351"></a>
-<span class="sourceLineNo">352</span>   * @return ByteBuffer with cells<a name="line.352"></a>
-<span class="sourceLineNo">353</span>   * @throws java.io.IOException if block creation fails<a name="line.353"></a>
-<span class="sourceLineNo">354</span>   */<a name="line.354"></a>
-<span class="sourceLineNo">355</span>  public ByteBuffer buildCellBlock(CellScanner cells) throws IOException {<a name="line.355"></a>
-<span class="sourceLineNo">356</span>    return ipcUtil.buildCellBlock(this.codec, this.compressor, cells);<a name="line.356"></a>
-<span class="sourceLineNo">357</span>  }<a name="line.357"></a>
-<span class="sourceLineNo">358</span><a name="line.358"></a>
-<span class="sourceLineNo">359</span>  /**<a name="line.359"></a>
-<span class="sourceLineNo">360</span>   * Creates an RPC client<a name="line.360"></a>
-<span class="sourceLineNo">361</span>   *<a name="line.361"></a>
-<span class="sourceLineNo">362</span>   * @param serviceName    name of servicce<a name="line.362"></a>
-<span class="sourceLineNo">363</span>   * @param location       to connect to<a name="line.363"></a>
-<span class="sourceLineNo">364</span>   * @param ticket         for current user<a name="line.364"></a>
-<span class="sourceLineNo">365</span>   * @return new RpcChannel<a name="line.365"></a>
-<span class="sourceLineNo">366</span>   * @throws StoppedRpcClientException when Rpc client is stopped<a name="line.366"></a>
-<span class="sourceLineNo">367</span>   * @throws FailedServerException if server failed<a name="line.367"></a>
-<span class="sourceLineNo">368</span>   */<a name="line.368"></a>
-<span class="sourceLineNo">369</span>  private AsyncRpcChannel createRpcChannel(String serviceName, InetSocketAddress location,<a name="line.369"></a>
-<span class="sourceLineNo">370</span>      User ticket) throws StoppedRpcClientException, FailedServerException {<a name="line.370"></a>
-<span class="sourceLineNo">371</span>    // Check if server is failed<a name="line.371"></a>
-<span class="sourceLineNo">372</span>    if (this.failedServers.isFailedServer(location)) {<a name="line.372"></a>
-<span class="sourceLineNo">373</span>      if (LOG.isDebugEnabled()) {<a name="line.373"></a>
-<span class="sourceLineNo">374</span>        LOG.debug("Not trying to connect to " + location +<a name="line.374"></a>
-<span class="sourceLineNo">375</span>            " this server is in the failed servers list");<a name="line.375"></a>
-<span class="sourceLineNo">376</span>      }<a name="line.376"></a>
-<span class="sourceLineNo">377</span>      throw new FailedServerException(<a name="line.377"></a>
-<span class="sourceLineNo">378</span>          "This server is in the failed servers list: " + location);<a name="line.378"></a>
-<span class="sourceLineNo">379</span>    }<a name="line.379"></a>
-<span class="sourceLineNo">380</span><a name="line.380"></a>
-<span class="sourceLineNo">381</span>    int hashCode = ConnectionId.hashCode(ticket,serviceName,location);<a name="line.381"></a>
-<span class="sourceLineNo">382</span><a name="line.382"></a>
-<span class="sourceLineNo">383</span>    AsyncRpcChannel rpcChannel;<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    synchronized (connections) {<a name="line.384"></a>
-<span class="sourceLineNo">385</span>      if (closed) {<a name="line.385"></a>
-<span class="sourceLineNo">386</span>        throw new StoppedRpcClientException();<a name="line.386"></a>
-<span class="sourceLineNo">387</span>      }<a name="line.387"></a>
-<span class="sourceLineNo">388</span>      rpcChannel = connections.get(hashCode);<a name="line.388"></a>
-<span class="sourceLineNo">389</span>      if (rpcChannel != null &amp;&amp; !rpcChannel.isAlive()) {<a name="line.389"></a>
-<span class="sourceLineNo">390</span>        LOG.debug("Removing dead channel from server="+rpcChannel.address.toString());<a name="line.390"></a>
-<span class="sourceLineNo">391</span>        connections.remove(hashCode);<a name="line.391"></a>
-<span class="sourceLineNo">392</span>      }<a name="line.392"></a>
-<span class="sourceLineNo">393</span>      if (rpcChannel == null) {<a name="line.393"></a>
-<span class="sourceLineNo">394</span>        rpcChannel = new AsyncRpcChannel(this.bootstrap, this, ticket, serviceName, location);<a name="line.394"></a>
-<span class="sourceLineNo">395</span>        connections.put(hashCode, rpcChannel);<a name="line.395"></a>
-<span class="sourceLineNo">396</span>      }<a name="line.396"></a>
-<span class="sourceLineNo">397</span>    }<a name="line.397"></a>
-<span class="sourceLineNo">398</span><a name="line.398"></a>
-<span class="sourceLineNo">399</span>    return rpcChannel;<a name="line.399"></a>
-<span class="sourceLineNo">400</span>  }<a name="line.400"></a>
-<span class="sourceLineNo">401</span><a name="line.401"></a>
-<span class="sourceLineNo">402</span>  /**<a name="line.402"></a>
-<span class="sourceLineNo">403</span>   * Interrupt the connections to the given ip:port server. This should be called if the server<a name="line.403"></a>
-<span class="sourceLineNo">404</span>   * is known as actually dead. This will not prevent current operation to be retried, and,<a name="line.404"></a>
-<span class="sourceLineNo">405</span>   * depending on their own behavior, they may retry on the same server. This can be a feature,<a name="line.405"></a>
-<span class="sourceLineNo">406</span>   * for example at startup. In any case, they're likely to get connection refused (if the<a name="line.406"></a>
-<span class="sourceLineNo">407</span>   * process died) or no route to host: i.e. there next retries should be faster and with a<a name="line.407"></a>
-<span class="sourceLineNo">408</span>   * safe exception.<a name="line.408"></a>
-<span class="sourceLineNo">409</span>   *<a name="line.409"></a>
-<span class="sourceLineNo">410</span>   * @param sn server to cancel connections for<a name="line.410"></a>
-<span class="sourceLineNo">411</span>   */<a name="line.411"></a>
-<span class="sourceLineNo">412</span>  @Override<a name="line.412"></a>
-<span class="sourceLineNo">413</span>  public void cancelConnections(ServerName sn) {<a name="line.413"></a>
-<span class="sourceLineNo">414</span>    synchronized (connections) {<a name="line.414"></a>
-<span class="sourceLineNo">415</span>      for (AsyncRpcChannel rpcChannel : connections.values()) {<a name="line.415"></a>
-<span class="sourceLineNo">416</span>        if (rpcChannel.isAlive() &amp;&amp;<a name="line.416"></a>
-<span class="sourceLineNo">417</span>            rpcChannel.address.getPort() == sn.getPort() &amp;&amp;<a name="line.417"></a>
-<span class="sourceLineNo">418</span>            rpcChannel.address.getHostName().contentEquals(sn.getHostname())) {<a name="line.418"></a>
-<span class="sourceLineNo">419</span>          LOG.info("The server on " + sn.toString() +<a name="line.419"></a>
-<span class="sourceLineNo">420</span>              " is dead - stopping the connection " + rpcChannel.toString());<a name="line.420"></a>
-<span class="sourceLineNo">421</span>          rpcChannel.close(null);<a name="line.421"></a>
-<span class="sourceLineNo">422</span>        }<a name="line.422"></a>
-<span class="sourceLineNo">423</span>      }<a name="line.423"></a>
-<span class="sourceLineNo">424</span>    }<a name="line.424"></a>
-<span class="sourceLineNo">425</span>  }<a name="line.425"></a>
-<span class="sourceLineNo">426</span><a name="line.426"></a>
-<span class="sourceLineNo">427</span>  /**<a name="line.427"></a>
-<span class="sourceLineNo">428</span>   * Remove connection from pool<a name="line.428"></a>
-<span class="sourceLineNo">429</span>   */<a name="line.429"></a>
-<span class="sourceLineNo">430</span>  public void removeConnection(AsyncRpcChannel connection) {<a name="line.430"></a>
-<span class="sourceLineNo">431</span>    int connectionHashCode = connection.hashCode();<a name="line.431"></a>
-<span class="sourceLineNo">432</span>    synchronized (connections) {<a name="line.432"></a>
-<span class="sourceLineNo">433</span>      // we use address as cache key, so we should check here to prevent removing the<a name="line.433"></a>
-<span class="sourceLineNo">434</span>      // wrong connection<a name="line.434"></a>
-<span class="sourceLineNo">435</span>      AsyncRpcChannel connectionInPool = this.connections.get(connectionHashCode);<a name="line.435"></a>
-<span class="sourceLineNo">436</span>      if (connectionInPool != null &amp;&amp; connectionInPool.equals(connection)) {<a name="line.436"></a>
-<span class="sourceLineNo">437</span>        this.connections.remove(connectionHashCode);<a name="line.437"></a>
-<span class="sourceLineNo">438</span>      } else if (LOG.isDebugEnabled()) {<a name="line.438"></a>
-<span class="sourceLineNo">439</span>        LOG.debug(String.format("%s already removed, expected instance %08x, actual %08x",<a name="line.439"></a>
-<span class="sourceLineNo">440</span>          connection.toString(), System.identityHashCode(connection),<a name="line.440"></a>
-<span class="sourceLineNo">441</span>          System.identityHashCode(connectionInPool)));<a name="line.441"></a>
-<span class="sourceLineNo">442</span>      }<a name="line.442"></a>
-<span class="sourceLineNo">443</span>    }<a name="line.443"></a>
-<span class="sourceLineNo">444</span>  }<a name="line.444"></a>
-<span class="sourceLineNo">445</span><a name="line.445"></a>
-<span class="sourceLineNo">446</span>  /**<a name="line.446"></a>
-<span class="sourceLineNo">447</span>   * Creates a "channel" that can be used by a protobuf service.  Useful setting up<a name="line.447"></a>
-<span class="sourceLineNo">448</span>   * protobuf stubs.<a name="line.448"></a>
-<span class="sourceLineNo">449</span>   *<a name="line.449"></a>
-<span class="sourceLineNo">450</span>   * @param sn server name describing location of server<a name="line.450"></a>
-<span class="sourceLineNo">451</span>   * @param user which is to use the connection<a name="line.451"></a>
-<span class="sourceLineNo">452</span>   * @param rpcTimeout default rpc operation timeout<a name="line.452"></a>
-<span class="sourceLineNo">453</span>   *<a name="line.453"></a>
-<span class="sourceLineNo">454</span>   * @return A rpc channel that goes via this rpc client instance.<a name="line.454"></a>
-<span class="sourceLineNo">455</span>   */<a name="line.455"></a>
-<span class="sourceLineNo">456</span>  public RpcChannel createRpcChannel(final ServerName sn, final User user, int rpcTimeout) {<a name="line.456"></a>
-<span class="sourceLineNo">457</span>    return new RpcChannelImplementation(this, sn, user, rpcTimeout);<a name="line.457"></a>
-<span class="sourceLineNo">458</span>  }<a name="line.458"></a>
-<span class="sourceLineNo">459</span><a name="line.459"></a>
-<span class="sourceLineNo">460</span>  /**<a name="line.460"></a>
-<span class="sourceLineNo">461</span>   * Blocking rpc channel that goes via hbase rpc.<a name="line.461"></a>
-<span class="sourceLineNo">462</span>   */<a name="line.462"></a>
-<span class="sourceLineNo">463</span>  @VisibleForTesting<a name="line.463"></a>
-<span class="sourceLineNo">464</span>  public static class RpcChannelImplementation implements RpcChannel {<a name="line.464"></a>
-<span class="sourceLineNo">465</span>    private final InetSocketAddress isa;<a name="line.465"></a>
-<span class="sourceLineNo">466</span>    private final AsyncRpcClient rpcClient;<a name="line.466"></a>
-<span class="sourceLineNo">467</span>    private final User ticket;<a name="line.467"></a>
-<span class="sourceLineNo">468</span>    private final int channelOperationTimeout;<a name="line.468"></a>
-<span class="sourceLineNo">469</span><a name="line.469"></a>
-<span class="sourceLineNo">470</span>    /**<a name="line.470"></a>
-<span class="sourceLineNo">471</span>     * @param channelOperationTimeout - the default timeout when no timeout is given<a name="line.471"></a>
-<span class="sourceLineNo">472</span>     */<a name="line.472"></a>
-<span class="sourceLineNo">473</span>    protected RpcChannelImplementation(final AsyncRpcClient rpcClient,<a name="line.473"></a>
-<span class="sourceLineNo">474</span>        final ServerName sn, final User ticket, int channelOperationTimeout) {<a name="line.474"></a>
-<span class="sourceLineNo">475</span>      this.isa = new InetSocketAddress(sn.getHostname(), sn.getPort());<a name="line.475"></a>
-<span class="sourceLineNo">476</span>      this.rpcClient = rpcClient;<a name="line.476"></a>
-<span class="sourceLineNo">477</span>      this.ticket = ticket;<a name="line.477"></a>
-<span class="sourceLineNo">478</span>      this.channelOperationTimeout = channelOperationTimeout;<a name="line.478"></a>
-<span class="sourceLineNo">479</span>    }<a name="line.479"></a>
-<span class="sourceLineNo">480</span><a name="line.480"></a>
-<span class="sourceLineNo">481</span>    @Override<a name="line.481"></a>
-<span class="sourceLineNo">482</span>    public void callMethod(Descriptors.MethodDescriptor md, RpcController controller,<a name="line.482"></a>
-<span class="sourceLineNo">483</span>        Message param, Message returnType, RpcCallback&lt;Message&gt; done) {<a name="line.483"></a>
-<span class="sourceLineNo">484</span>      PayloadCarryingRpcController pcrc;<a name="line.484"></a>
-<span class="sourceLineNo">485</span>      if (controller != null) {<a name="line.485"></a>
-<span class="sourceLineNo">486</span>        pcrc = (PayloadCarryingRpcController) controller;<a name="line.486"></a>
-<span class="sourceLineNo">487</span>        if (!pcrc.hasCallTimeout()) {<a name="line.487"></a>
-<span class="sourceLineNo">488</span>          pcrc.setCallTimeout(channelOperationTimeout);<a name="line.488"></a>
-<span class="sourceLineNo">489</span>        }<a name="line.489"></a>
-<span class="sourceLineNo">490</span>      } else {<a name="line.490"></a>
-<span class="sourceLineNo">491</span>        pcrc = new PayloadCarryingRpcController();<a name="line.491"></a>
-<span class="sourceLineNo">492</span>        pcrc.setCallTimeout(channelOperationTimeout);<a name="line.492"></a>
-<span class="sourceLineNo">493</span>      }<a name="line.493"></a>
-<span class="sourceLineNo">494</span><a name="line.494"></a>
-<span class="sourceLineNo">495</span>      this.rpcClient.callMethod(md, pcrc, param, returnType, this.ticket, this.isa, done);<a name="line.495"></a>
-<span class="sourceLineNo">496</span>    }<a name="line.496"></a>
-<span class="sourceLineNo">497</span>  }<a name="line.497"></a>
-<span class="sourceLineNo">498</span><a name="line.498"></a>
-<span class="sourceLineNo">499</span>  Timeout newTimeout(TimerTask task, long delay, TimeUnit unit) {<a name="line.499"></a>
-<span class="sourceLineNo">500</span>    return WHEEL_TIMER.newTimeout(task, delay, unit);<a name="line.500"></a>
-<span class="sourceLineNo">501</span>  }<a name="line.501"></a>
-<span class="sourceLineNo">502</span>}<a name="line.502"></a>
+<span class="sourceLineNo">257</span>      CallTimeoutException cte = new CallTimeoutException(promise.toString());<a name="line.257"></a>
+<span class="sourceLineNo">258</span>      throw wrapException(addr, cte);<a name="line.258"></a>
+<span class="sourceLineNo">259</span>    }<a name="line.259"></a>
+<span class="sourceLineNo">260</span>  }<a name="line.260"></a>
+<span class="sourceLineNo">261</span><a name="line.261"></a>
+<span class="sourceLineNo">262</span>  /**<a name="line.262"></a>
+<span class="sourceLineNo">263</span>   * Call method async<a name="line.263"></a>
+<span class="sourceLineNo">264</span>   */<a name="line.264"></a>
+<span class="sourceLineNo">265</span>  private void callMethod(final Descriptors.MethodDescriptor md,<a name="line.265"></a>
+<span class="sourceLineNo">266</span>      final PayloadCarryingRpcController pcrc, final Message param, Message returnType, User ticket,<a name="line.266"></a>
+<span class="sourceLineNo">267</span>      InetSocketAddress addr, final RpcCallback&lt;Message&gt; done) {<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    final AsyncRpcChannel connection;<a name="line.268"></a>
+<span class="sourceLineNo">269</span>    try {<a name="line.269"></a>
+<span class="sourceLineNo">270</span>      connection = createRpcChannel(md.getService().getName(), addr, ticket);<a name="line.270"></a>
+<span class="sourceLineNo">271</span>      final MetricsConnection.CallStats cs = MetricsConnection.newCallStats();<a name="line.271"></a>
+<span class="sourceLineNo">272</span>      GenericFutureListener&lt;Future&lt;Message&gt;&gt; listener =<a name="line.272"></a>
+<span class="sourceLineNo">273</span>          new GenericFutureListener&lt;Future&lt;Message&gt;&gt;() {<a name="line.273"></a>
+<span class="sourceLineNo">274</span>            @Override<a name="line.274"></a>
+<span class="sourceLineNo">275</span>            public void operationComplete(Future&lt;Message&gt; future) throws Exception {<a name="line.275"></a>
+<span class="sourceLineNo">276</span>              cs.setCallTimeMs(EnvironmentEdgeManager.currentTime() - cs.getStartTime());<a name="line.276"></a>
+<span class="sourceLineNo">277</span>              if (metrics != null) {<a name="line.277"></a>
+<span class="sourceLineNo">278</span>                metrics.updateRpc(md, param, cs);<a name="line.278"></a>
+<span class="sourceLineNo">279</span>              }<a name="line.279"></a>
+<span class="sourceLineNo">280</span>              if (LOG.isTraceEnabled()) {<a name="line.280"></a>
+<span class="sourceLineNo">281</span>                LOG.trace("Call: " + md.getName() + ", callTime: " + cs.getCallTimeMs() + "ms");<a name="line.281"></a>
+<span class="sourceLineNo">282</span>              }<a name="line.282"></a>
+<span class="sourceLineNo">283</span>              if (!future.isSuccess()) {<a name="line.283"></a>
+<span class="sourceLineNo">284</span>                Throwable cause = future.cause();<a name="line.284"></a>
+<span class="sourceLineNo">285</span>                if (cause instanceof IOException) {<a name="line.285"></a>
+<span class="sourceLineNo">286</span>                  pcrc.setFailed((IOException) cause);<a name="line.286"></a>
+<span class="sourceLineNo">287</span>                } else {<a name="line.287"></a>
+<span class="sourceLineNo">288</span>                  pcrc.setFailed(new IOException(cause));<a name="line.288"></a>
+<span class="sourceLineNo">289</span>                }<a name="line.289"></a>
+<span class="sourceLineNo">290</span>              } else {<a name="line.290"></a>
+<span class="sourceLineNo">291</span>                try {<a name="line.291"></a>
+<span class="sourceLineNo">292</span>                  done.run(future.get());<a name="line.292"></a>
+<span class="sourceLineNo">293</span>                } catch (ExecutionException e) {<a name="line.293"></a>
+<span class="sourceLineNo">294</span>                  Throwable cause = e.getCause();<a name="line.294"></a>
+<span class="sourceLineNo">295</span>                  if (cause instanceof IOException) {<a name="line.295"></a>
+<span class="sourceLineNo">296</span>                    pcrc.setFailed((IOException) cause);<a name="line.296"></a>
+<span class="sourceLineNo">297</span>                  } else {<a name="line.297"></a>
+<span class="sourceLineNo">298</span>                    pcrc.setFailed(new IOException(cause));<a name="line.298"></a>
+<span class="sourceLineNo">299</span>                  }<a name="line.299"></a>
+<span class="sourceLineNo">300</span>                } catch (InterruptedException e) {<a name="line.300"></a>
+<span class="sourceLineNo">301</span>                  pcrc.setFailed(new IOException(e));<a name="line.301"></a>
+<span class="sourceLineNo">302</span>                }<a name="line.302"></a>
+<span class="sourceLineNo">303</span>              }<a name="line.303"></a>
+<span class="sourceLineNo">304</span>            }<a name="line.304"></a>
+<span class="sourceLineNo">305</span>          };<a name="line.305"></a>
+<span class="sourceLineNo">306</span>      cs.setStartTime(EnvironmentEdgeManager.currentTime());<a name="line.306"></a>
+<span class="sourceLineNo">307</span>      connection.callMethod(md, pcrc, param, returnType, cs).addListener(listener);<a name="line.307"></a>
+<span class="sourceLineNo">308</span>    } catch (StoppedRpcClientException|FailedServerException e) {<a name="line.308"></a>
+<span class="sourceLineNo">309</span>      pcrc.setFailed(e);<a name="line.309"></a>
+<span class="sourceLineNo">310</span>    }<a name="line.310"></a>
+<span class="sourceLineNo">311</span>  }<a name="line.311"></a>
+<span class="sourceLineNo">312</span><a name="line.312"></a>
+<span class="sourceLineNo">313</span>  private boolean closed = false;<a name="line.313"></a>
+<span class="sourceLineNo">314</span><a name="line.314"></a>
+<span class="sourceLineNo">315</span>  /**<a name="line.315"></a>
+<span class="sourceLineNo">316</span>   * Close netty<a name="line.316"></a>
+<span class="sourceLineNo">317</span>   */<a name="line.317"></a>
+<span class="sourceLineNo">318</span>  public void close() {<a name="line.318"></a>
+<span class="sourceLineNo">319</span>    if (LOG.isDebugEnabled()) {<a name="line.319"></a>
+<span class="sourceLineNo">320</span>      LOG.debug("Stopping async HBase RPC client");<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    }<a name="line.321"></a>
+<span class="sourceLineNo">322</span><a name="line.322"></a>
+<span class="sourceLineNo">323</span>    synchronized (connections) {<a name="line.323"></a>
+<span class="sourceLineNo">324</span>      if (closed) {<a name="line.324"></a>
+<span class="sourceLineNo">325</span>        return;<a name="line.325"></a>
+<span class="sourceLineNo">326</span>      }<a name="line.326"></a>
+<span class="sourceLineNo">327</span>      closed = true;<a name="line.327"></a>
+<span class="sourceLineNo">328</span>      for (AsyncRpcChannel conn : connections.values()) {<a name="line.328"></a>
+<span class="sourceLineNo">329</span>        conn.close(null);<a name="line.329"></a>
+<span class="sourceLineNo">330</span>      }<a name="line.330"></a>
+<span class="sourceLineNo">331</span>    }<a name="line.331"></a>
+<span class="sourceLineNo">332</span>    // do not close global EventLoopGroup.<a name="line.332"></a>
+<span class="sourceLineNo">333</span>    if (!useGlobalEventLoopGroup) {<a name="line.333"></a>
+<span class="sourceLineNo">334</span>      bootstrap.group().shutdownGracefully();<a name="line.334"></a>
+<span class="sourceLineNo">335</span>    }<a name="line.335"></a>
+<span class="sourceLineNo">336</span>  }<a name="line.336"></a>
+<span class="sourceLineNo">337</span><a name="line.337"></a>
+<span class="sourceLineNo">338</span>  /**<a name="line.338"></a>
+<span class="sourceLineNo">339</span>   * Create a cell scanner<a name="line.339"></a>
+<span class="sourceLineNo">340</span>   *<a name="line.340"></a>
+<span class="sourceLineNo">341</span>   * @param cellBlock to create scanner for<a name="line.341"></a>
+<span class="sourceLineNo">342</span>   * @return CellScanner<a name="line.342"></a>
+<span class="sourceLineNo">343</span>   * @throws java.io.IOException on error on creation cell scanner<a name="line.343"></a>
+<span class="sourceLineNo">344</span>   */<a name="line.344"></a>
+<span class="sourceLineNo">345</span>  public CellScanner createCellScanner(byte[] cellBlock) throws IOException {<a name="line.345"></a>
+<span class="sourceLineNo">346</span>    return ipcUtil.createCellScanner(this.codec, this.compressor, cellBlock);<a name="line.346"></a>
+<span class="sourceLineNo">347</span>  }<a name="line.347"></a>
+<span class="sourceLineNo">348</span><a name="line.348"></a>
+<span class="sourceLineNo">349</span>  /**<a name="line.349"></a>
+<span class="sourceLineNo">350</span>   * Build cell block<a name="line.350"></a>
+<span class="sourceLineNo">351</span>   *<a name="line.351"></a>
+<span class="sourceLineNo">352</span>   * @param cells to create block with<a name="line.352"></a>
+<span class="sourceLineNo">353</span>   * @return ByteBuffer with cells<a name="line.353"></a>
+<span class="sourceLineNo">354</span>   * @throws java.io.IOException if block creation fails<a name="line.354"></a>
+<span class="sourceLineNo">355</span>   */<a name="line.355"></a>
+<span class="sourceLineNo">356</span>  public ByteBuffer buildCellBlock(CellScanner cells) throws IOException {<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    return ipcUtil.buildCellBlock(this.codec, this.compressor, cells);<a name="line.357"></a>
+<span class="sourceLineNo">358</span>  }<a name="line.358"></a>
+<span class="sourceLineNo">359</span><a name="line.359"></a>
+<span class="sourceLineNo">360</span>  /**<a name="line.360"></a>
+<span class="sourceLineNo">361</span>   * Creates an RPC client<a name="line.361"></a>
+<span class="sourceLineNo">362</span>   *<a name="line.362"></a>
+<span class="sourceLineNo">363</span>   * @param serviceName    name of servicce<a name="line.363"></a>
+<span class="sourceLineNo">364</span>   * @param location       to connect to<a name="line.364"></a>
+<span class="sourceLineNo">365</span>   * @param ticket         for current user<a name="line.365"></a>
+<span class="sourceLineNo">366</span>   * @return new RpcChannel<a name="line.366"></a>
+<span class="sourceLineNo">367</span>   * @throws StoppedRpcClientException when Rpc client is stopped<a name="line.367"></a>
+<span class="sourceLineNo">368</span>   * @throws FailedServerException if server failed<a name="line.368"></a>
+<span class="sourceLineNo">369</span>   */<a name="line.369"></a>
+<span class="sourceLineNo">370</span>  private AsyncRpcChannel createRpcChannel(String serviceName, InetSocketAddress location,<a name="line.370"></a>
+<span class="sourceLineNo">371</span>      User ticket) throws StoppedRpcClientException, FailedServerException {<a name="line.371"></a>
+<span class="sourceLineNo">372</span>    // Check if server is failed<a name="line.372"></a>
+<span class="sourceLineNo">373</span>    if (this.failedServers.isFailedServer(location)) {<a name="line.373"></a>
+<span class="sourceLineNo">374</span>      if (LOG.isDebugEnabled()) {<a name="line.374"></a>
+<span class="sourceLineNo">375</span>        LOG.debug("Not trying to connect to " + location +<a name="line.375"></a>
+<span class="sourceLineNo">376</span>            " this server is in the failed servers list");<a name="line.376"></a>
+<span class="sourceLineNo">377</span>      }<a name="line.377"></a>
+<span class="sourceLineNo">378</span>      throw new FailedServerException(<a name="line.378"></a>
+<span class="sourceLineNo">379</span>          "This server is in the failed servers list: " + location);<a name="line.379"></a>
+<span class="sourceLineNo">380</span>    }<a name="line.380"></a>
+<span class="sourceLineNo">381</span><a name="line.381"></a>
+<span class="sourceLineNo">382</span>    int hashCode = ConnectionId.hashCode(ticket,serviceName,location);<a name="line.382"></a>
+<span class="sourceLineNo">383</span><a name="line.383"></a>
+<span class="sourceLineNo">384</span>    AsyncRpcChannel rpcChannel;<a name="line.384"></a>
+<span class="sourceLineNo">385</span>    synchronized (connections) {<a name="line.385"></a>
+<span class="sourceLineNo">386</span>      if (closed) {<a name="line.386"></a>
+<span class="sourceLineNo">387</span>        throw new StoppedRpcClientException();<a name="line.387"></a>
+<span class="sourceLineNo">388</span>      }<a name="line.388"></a>
+<span class="sourceLineNo">389</span>      rpcChannel = connections.get(hashCode);<a name="line.389"></a>
+<span class="sourceLineNo">390</span>      if (rpcChannel != null &amp;&amp; !rpcChannel.isAlive()) {<a name="line.390"></a>
+<span class="sourceLineNo">391</span>        LOG.debug("Removing dead channel from server="+rpcChannel.address.toString());<a name="line.391"></a>
+<span class="sourceLineNo">392</span>        connections.remove(hashCode);<a name="line.392"></a>
+<span class="sourceLineNo">393</span>      }<a name="line.393"></a>
+<span class="sourceLineNo">394</span>      if (rpcChannel == null) {<a name="line.394"></a>
+<span class="sourceLineNo">395</span>        rpcChannel = new AsyncRpcChannel(this.bootstrap, this, ticket, serviceName, location);<a name="line.395"></a>
+<span class="sourceLineNo">396</span>        connections.put(hashCode, rpcChannel);<a name="line.396"></a>
+<span class="sourceLineNo">397</span>      }<a name="line.397"></a>
+<span class="sourceLineNo">398</span>    }<a name="line.398"></a>
+<span class="sourceLineNo">399</span><a name="line.399"></a>
+<span class="sourceLineNo">400</span>    return rpcChannel;<a name="line.400"></a>
+<span class="sourceLineNo">401</span>  }<a name="line.401"></a>
+<span class="sourceLineNo">402</span><a name="line.402"></a>
+<span class="sourceLineNo">403</span>  /**<a name="line.403"></a>
+<span class="sourceLineNo">404</span>   * Interrupt the connections to the given ip:port server. This should be called if the server<a name="line.404"></a>
+<span class="sourceLineNo">405</span>   * is known as actually dead. This will not prevent current operation to be retried, and,<a name="line.405"></a>
+<span class="sourceLineNo">406</span>   * depending on their own behavior, they may retry on the same server. This can be a feature,<a name="line.406"></a>
+<span class="sourceLineNo">407</span>   * for example at startup. In any case, they're likely to get connection refused (if the<a name="line.407"></a>
+<span class="sourceLineNo">408</span>   * process died) or no route to host: i.e. there next retries should be faster and with a<a name="line.408"></a>
+<span class="sourceLineNo">409</span>   * safe exception.<a name="line.409"></a>
+<span class="sourceLineNo">410</span>   *<a name="line.410"></a>
+<span class="sourceLineNo">411</span>   * @param sn server to cancel connections for<a name="line.411"></a>
+<span class="sourceLineNo">412</span>   */<a name="line.412"></a>
+<span class="sourceLineNo">413</span>  @Override<a name="line.413"></a>
+<span class="sourceLineNo">414</span>  public void cancelConnections(ServerName sn) {<a name="line.414"></a>
+<span class="sourceLineNo">415</span>    synchronized (connections) {<a name="line.415"></a>
+<span class="sourceLineNo">416</span>      for (AsyncRpcChannel rpcChannel : connections.values()) {<a name="line.416"></a>
+<span class="sourceLineNo">417</span>        if (rpcChannel.isAlive() &amp;&amp;<a name="line.417"></a>
+<span class="sourceLineNo">418</span>            rpcChannel.address.getPort() == sn.getPort() &amp;&amp;<a name="line.418"></a>
+<span class="sourceLineNo">419</span>            rpcChannel.address.getHostName().contentEquals(sn.getHostname())) {<a name="line.419"></a>
+<span class="sourceLineNo">420</span>          LOG.info("The server on " + sn.toString() +<a name="line.420"></a>
+<span class="sourceLineNo">421</span>              " is dead - stopping the connection " + rpcChannel.toString());<a name="line.421"></a>
+<span class="sourceLineNo">422</span>          rpcChannel.close(null);<a name="line.422"></a>
+<span class="sourceLineNo">423</span>        }<a name="line.423"></a>
+<span class="sourceLineNo">424</span>      }<a name="line.424"></a>
+<span class="sourceLineNo">425</span>    }<a name="line.425"></a>
+<span class="sourceLineNo">426</span>  }<a name="line.426"></a>
+<span class="sourceLineNo">427</span><a name="line.427"></a>
+<span class="sourceLineNo">428</span>  /**<a name="line.428"></a>
+<span class="sourceLineNo">429</span>   * Remove connection from pool<a name="line.429"></a>
+<span class="sourceLineNo">430</span>   */<a name="line.430"></a>
+<span class="sourceLineNo">431</span>  public void removeConnection(AsyncRpcChannel connection) {<a name="line.431"></a>
+<span class="sourceLineNo">432</span>    int connectionHashCode = connection.hashCode();<a name="line.432"></a>
+<span class="sourceLineNo">433</span>    synchronized (connections) {<a name="line.433"></a>
+<span class="sourceLineNo">434</span>      // we use address as cache key, so we should check here to prevent removing the<a name="line.434"></a>
+<span class="sourceLineNo">435</span>      // wrong connection<a name="line.435"></a>
+<span class="sourceLineNo">436</span>      AsyncRpcChannel connectionInPool = this.connections.get(connectionHashCode);<a name="line.436"></a>
+<span class="sourceLineNo">437</span>      if (connectionInPool != null &amp;&amp; connectionInPool.equals(connection)) {<a name="line.437"></a>
+<span class="sourceLineNo">438</span>        this.connections.remove(connectionHashCode);<a name="line.438"></a>
+<span class="sourceLineNo">439</span>      } else if (LOG.isDebugEnabled()) {<a name="line.439"></a>
+<span class="sourceLineNo">440</span>        LOG.debug(String.format("%s already removed, expected instance %08x, actual %08x",<a name="line.440"></a>
+<span class="sourceLineNo">441</span>          connection.toString(), System.identityHashCode(connection),<a name="line.441"></a>
+<span class="sourceLineNo">442</span>          System.identityHashCode(connectionInPool)));<a name="line.442"></a>
+<span class="sourceLineNo">443</span>      }<a name="line.443"></a>
+<span class="sourceLineNo">444</span>    }<a name="line.444"></a>
+<span class="sourceLineNo">445</span>  }<a name="line.445"></a>
+<span class="sourceLineNo">446</span><a name="line.446"></a>
+<span class="sourceLineNo">447</span>  /**<a name="line.447"></a>
+<span class="sourceLineNo">448</span>   * Creates a "channel" that can be used by a protobuf service.  Useful setting up<a name="line.448"></a>
+<span class="sourceLineNo">449</span>   * protobuf stubs.<a name="line.449"></a>
+<span class="sourceLineNo">450</span>   *<a name="line.450"></a>
+<span class="sourceLineNo">451</span>   * @param sn server name describing location of server<a name="line.451"></a>
+<span class="sourceLineNo">452</span>   * @param user which is to use the connection<a name="line.452"></a>
+<span class="sourceLineNo">453</span>   * @param rpcTimeout default rpc operation timeout<a name="line.453"></a>
+<span class="sourceLineNo">454</span>   *<a name="line.454"></a>
+<span class="sourceLineNo">455</span>   * @return A rpc channel that goes via this rpc client instance.<a name="line.455"></a>
+<span class="sourceLineNo">456</span>   */<a name="line.456"></a>
+<span class="sourceLineNo">457</span>  public RpcChannel createRpcChannel(final ServerName sn, final User user, int rpcTimeout) {<a name="line.457"></a>
+<span class="sourceLineNo">458</span>    return new RpcChannelImplementation(this, sn, user, rpcTimeout);<a name="line.458"></a>
+<span class="sourceLineNo">459</span>  }<a name="line.459"></a>
+<span class="sourceLineNo">460</span><a name="line.460"></a>
+<span class="sourceLineNo">461</span>  /**<a name="line.461"></a>
+<span class="sourceLineNo">462</span>   * Blocking rpc channel that goes via hbase rpc.<a name="line.462"></a>
+<span class="sourceLineNo">463</span>   */<a name="line.463"></a>
+<span class="sourceLineNo">464</span>  @VisibleForTesting<a name="line.464"></a>
+<span class="sourceLineNo">465</span>  public static class RpcChannelImplementation implements RpcChannel {<a name="line.465"></a>
+<span class="sourceLineNo">466</span>    private final InetSocketAddress isa;<a name="line.466"></a>
+<span class="sourceLineNo">467</span>    private final AsyncRpcClient rpcClient;<a name="line.467"></a>
+<span class="sourceLineNo">468</span>    private final User ticket;<a name="line.468"></a>
+<span class="sourceLineNo">469</span>    private final int channelOperationTimeout;<a name="line.469"></a>
+<span class="sourceLineNo">470</span><a name="line.470"></a>
+<span class="sourceLineNo">471</span>    /**<a name="line.471"></a>
+<span class="sourceLineNo">472</span>     * @param channelOperationTimeout - the default timeout when no timeout is given<a name="line.472"></a>
+<span class="sourceLineNo">473</span>     */<a name="line.473"></a>
+<span class="sourceLineNo">474</span>    protected RpcChannelImplementation(final AsyncRpcClient rpcClient,<a name="line.474"></a>
+<span class="sourceLineNo">475</span>        final ServerName sn, final User ticket, int channelOperationTimeout) {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>      this.isa = new InetSocketAddress(sn.getHostname(), sn.getPort());<a name="line.476"></a>
+<span class="sourceLineNo">477</span>      this.rpcClient = rpcClient;<a name="line.477"></a>
+<span class="sourceLineNo">478</span>      this.ticket = ticket;<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      this.channelOperationTimeout = channelOperationTimeout;<a name="line.479"></a>
+<span class="sourceLineNo">480</span>    }<a name="line.480"></a>
+<span class="sourceLineNo">481</span><a name="line.481"></a>
+<span class="sourceLineNo">482</span>    @Override<a name="line.482"></a>
+<span class="sourceLineNo">483</span>    public void callMethod(Descriptors.MethodDescriptor md, RpcController controller,<a name="line.483"></a>
+<span class="sourceLineNo">484</span>        Message param, Message returnType, RpcCallback&lt;Message&gt; done) {<a name="line.484"></a>
+<span class="sourceLineNo">485</span>      PayloadCarryingRpcController pcrc;<a name="line.485"></a>
+<span class="sourceLineNo">486</span>      if (controller != null) {<a name="line.486"></a>
+<span class="sourceLineNo">487</span>        pcrc = (PayloadCarryingRpcController) controller;<a name="line.487"></a>
+<span class="sourceLineNo">488</span>        if (!pcrc.hasCallTimeout()) {<a name="line.488"></a>
+<span class="sourceLineNo">489</span>          pcrc.setCallTimeout(channelOperationTimeout);<a name="line.489"></a>
+<span class="sourceLineNo">490</span>        }<a name="line.490"></a>
+<span class="sourceLineNo">491</span>      } else {<a name="line.491"></a>
+<span class="sourceLineNo">492</span>        pcrc = new PayloadCarryingRpcController();<a name="line.492"></a>
+<span class="sourceLineNo">493</span>        pcrc.setCallTimeout(channelOperationTimeout);<a name="line.493"></a>
+<span class="sourceLineNo">494</span>      }<a name="line.494"></a>
+<span class="sourceLineNo">495</span><a name="line.495"></a>
+<span class="sourceLineNo">496</span>      this.rpcClient.callMethod(md, pcrc, param, returnType, this.ticket, this.isa, done);<a name="line.496"></a>
+<span class="sourceLineNo">497</span>    }<a name="line.497"></a>
+<span class="sourceLineNo">498</span>  }<a name="line.498"></a>
+<span class="sourceLineNo">499</span><a name="line.499"></a>
+<span class="sourceLineNo">500</span>  Timeout newTimeout(TimerTask task, long delay, TimeUnit unit) {<a name="line.500"></a>
+<span class="sourceLineNo">501</span>    return WHEEL_TIMER.newTimeout(task, delay, unit);<a name="line.501"></a>
+<span class="sourceLineNo">502</span>  }<a name="line.502"></a>
+<span class="sourceLineNo">503</span>}<a name="line.503"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e5c3dcd1/devapidocs/src-html/org/apache/hadoop/hbase/ipc/RpcClientImpl.CallFuture.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/RpcClientImpl.CallFuture.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/RpcClientImpl.CallFuture.html
index 03ccec3..298a8bd 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/RpcClientImpl.CallFuture.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/RpcClientImpl.CallFuture.html
@@ -27,88 +27,88 @@
 <span class="sourceLineNo">019</span><a name="line.19"></a>
 <span class="sourceLineNo">020</span>package org.apache.hadoop.hbase.ipc;<a name="line.20"></a>
 <span class="sourceLineNo">021</span><a name="line.21"></a>
-<span class="sourceLineNo">022</span>import com.google.common.annotations.VisibleForTesting;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import com.google.protobuf.Descriptors.MethodDescriptor;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import com.google.protobuf.Message;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import com.google.protobuf.Message.Builder;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import com.google.protobuf.RpcCallback;<a name="line.26"></a>
-<span class="sourceLineNo">027</span><a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.commons.logging.Log;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.commons.logging.LogFactory;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.hadoop.conf.Configuration;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.DoNotRetryIOException;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.HConstants;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.ServerName;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.client.MetricsConnection;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.codec.Codec;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.exceptions.ConnectionClosingException;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.protobuf.ProtobufUtil;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.CellBlockMeta;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ConnectionHeader;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ExceptionResponse;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader;<a name="line.44"></a>
-<span class="sourceLineNo">045</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ResponseHeader;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.UserInformation;<a name="line.46"></a>
-<span class="sourceLineNo">047</span>import org.apache.hadoop.hbase.protobuf.generated.TracingProtos.RPCTInfo;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>import org.apache.hadoop.hbase.security.AuthMethod;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>import org.apache.hadoop.hbase.security.HBaseSaslRpcClient;<a name="line.49"></a>
-<span class="sourceLineNo">050</span>import org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection;<a name="line.50"></a>
-<span class="sourceLineNo">051</span>import org.apache.hadoop.hbase.security.SecurityInfo;<a name="line.51"></a>
-<span class="sourceLineNo">052</span>import org.apache.hadoop.hbase.security.User;<a name="line.52"></a>
-<span class="sourceLineNo">053</span>import org.apache.hadoop.hbase.security.UserProvider;<a name="line.53"></a>
-<span class="sourceLineNo">054</span>import org.apache.hadoop.hbase.security.token.AuthenticationTokenSelector;<a name="line.54"></a>
-<span class="sourceLineNo">055</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.55"></a>
-<span class="sourceLineNo">056</span>import org.apache.hadoop.hbase.util.ExceptionUtil;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>import org.apache.hadoop.hbase.util.Pair;<a name="line.57"></a>
-<span class="sourceLineNo">058</span>import org.apache.hadoop.hbase.util.PoolMap;<a name="line.58"></a>
-<span class="sourceLineNo">059</span>import org.apache.hadoop.io.IOUtils;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>import org.apache.hadoop.io.Text;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>import org.apache.hadoop.io.compress.CompressionCodec;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>import org.apache.hadoop.ipc.RemoteException;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>import org.apache.hadoop.net.NetUtils;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>import org.apache.hadoop.security.SecurityUtil;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>import org.apache.hadoop.security.UserGroupInformation;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>import org.apache.hadoop.security.token.Token;<a name="line.66"></a>
-<span class="sourceLineNo">067</span>import org.apache.hadoop.security.token.TokenIdentifier;<a name="line.67"></a>
-<span class="sourceLineNo">068</span>import org.apache.hadoop.security.token.TokenSelector;<a name="line.68"></a>
-<span class="sourceLineNo">069</span>import org.apache.htrace.Span;<a name="line.69"></a>
-<span class="sourceLineNo">070</span>import org.apache.htrace.Trace;<a name="line.70"></a>
-<span class="sourceLineNo">071</span>import org.apache.htrace.TraceScope;<a name="line.71"></a>
-<span class="sourceLineNo">072</span><a name="line.72"></a>
-<span class="sourceLineNo">073</span>import javax.net.SocketFactory;<a name="line.73"></a>
-<span class="sourceLineNo">074</span>import javax.security.sasl.SaslException;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>import java.io.BufferedInputStream;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>import java.io.BufferedOutputStream;<a name="line.76"></a>
-<span class="sourceLineNo">077</span>import java.io.Closeable;<a name="line.77"></a>
-<span class="sourceLineNo">078</span>import java.io.DataInputStream;<a name="line.78"></a>
-<span class="sourceLineNo">079</span>import java.io.DataOutputStream;<a name="line.79"></a>
-<span class="sourceLineNo">080</span>import java.io.IOException;<a name="line.80"></a>
-<span class="sourceLineNo">081</span>import java.io.InputStream;<a name="line.81"></a>
-<span class="sourceLineNo">082</span>import java.io.InterruptedIOException;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>import java.io.OutputStream;<a name="line.83"></a>
-<span class="sourceLineNo">084</span>import java.net.ConnectException;<a name="line.84"></a>
-<span class="sourceLineNo">085</span>import java.net.InetSocketAddress;<a name="line.85"></a>
-<span class="sourceLineNo">086</span>import java.net.Socket;<a name="line.86"></a>
-<span class="sourceLineNo">087</span>import java.net.SocketAddress;<a name="line.87"></a>
-<span class="sourceLineNo">088</span>import java.net.SocketTimeoutException;<a name="line.88"></a>
-<span class="sourceLineNo">089</span>import java.net.UnknownHostException;<a name="line.89"></a>
-<span class="sourceLineNo">090</span>import java.nio.ByteBuffer;<a name="line.90"></a>
-<span class="sourceLineNo">091</span>import java.security.PrivilegedExceptionAction;<a name="line.91"></a>
-<span class="sourceLineNo">092</span>import java.util.HashMap;<a name="line.92"></a>
-<span class="sourceLineNo">093</span>import java.util.HashSet;<a name="line.93"></a>
-<span class="sourceLineNo">094</span>import java.util.Iterator;<a name="line.94"></a>
-<span class="sourceLineNo">095</span>import java.util.Map;<a name="line.95"></a>
-<span class="sourceLineNo">096</span>import java.util.Map.Entry;<a name="line.96"></a>
-<span class="sourceLineNo">097</span>import java.util.Random;<a name="line.97"></a>
-<span class="sourceLineNo">098</span>import java.util.Set;<a name="line.98"></a>
-<span class="sourceLineNo">099</span>import java.util.concurrent.ArrayBlockingQueue;<a name="line.99"></a>
-<span class="sourceLineNo">100</span>import java.util.concurrent.BlockingQueue;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>import java.util.concurrent.ConcurrentSkipListMap;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>import java.util.concurrent.atomic.AtomicBoolean;<a name="line.102"></a>
-<span class="sourceLineNo">103</span>import java.util.concurrent.atomic.AtomicInteger;<a name="line.103"></a>
+<span class="sourceLineNo">022</span>import java.io.BufferedInputStream;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.io.BufferedOutputStream;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import java.io.Closeable;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import java.io.DataInputStream;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import java.io.DataOutputStream;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import java.io.IOException;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import java.io.InputStream;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import java.io.InterruptedIOException;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import java.io.OutputStream;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import java.net.InetSocketAddress;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import java.net.Socket;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import java.net.SocketAddress;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import java.net.SocketTimeoutException;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import java.net.UnknownHostException;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import java.nio.ByteBuffer;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import java.security.PrivilegedExceptionAction;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import java.util.HashMap;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import java.util.HashSet;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import java.util.Iterator;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>import java.util.Map;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>import java.util.Map.Entry;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>import java.util.Random;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>import java.util.Set;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>import java.util.concurrent.ArrayBlockingQueue;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>import java.util.concurrent.BlockingQueue;<a name="line.46"></a>
+<span class="sourceLineNo">047</span>import java.util.concurrent.ConcurrentSkipListMap;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>import java.util.concurrent.atomic.AtomicBoolean;<a name="line.48"></a>
+<span class="sourceLineNo">049</span>import java.util.concurrent.atomic.AtomicInteger;<a name="line.49"></a>
+<span class="sourceLineNo">050</span><a name="line.50"></a>
+<span class="sourceLineNo">051</span>import javax.net.SocketFactory;<a name="line.51"></a>
+<span class="sourceLineNo">052</span>import javax.security.sasl.SaslException;<a name="line.52"></a>
+<span class="sourceLineNo">053</span><a name="line.53"></a>
+<span class="sourceLineNo">054</span>import org.apache.commons.logging.Log;<a name="line.54"></a>
+<span class="sourceLineNo">055</span>import org.apache.commons.logging.LogFactory;<a name="line.55"></a>
+<span class="sourceLineNo">056</span>import org.apache.hadoop.conf.Configuration;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>import org.apache.hadoop.hbase.DoNotRetryIOException;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>import org.apache.hadoop.hbase.HConstants;<a name="line.59"></a>
+<span class="sourceLineNo">060</span>import org.apache.hadoop.hbase.ServerName;<a name="line.60"></a>
+<span class="sourceLineNo">061</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>import org.apache.hadoop.hbase.client.MetricsConnection;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>import org.apache.hadoop.hbase.codec.Codec;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>import org.apache.hadoop.hbase.exceptions.ConnectionClosingException;<a name="line.64"></a>
+<span class="sourceLineNo">065</span>import org.apache.hadoop.hbase.protobuf.ProtobufUtil;<a name="line.65"></a>
+<span class="sourceLineNo">066</span>import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos;<a name="line.66"></a>
+<span class="sourceLineNo">067</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.CellBlockMeta;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ConnectionHeader;<a name="line.68"></a>
+<span class="sourceLineNo">069</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ExceptionResponse;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ResponseHeader;<a name="line.71"></a>
+<span class="sourceLineNo">072</span>import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.UserInformation;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>import org.apache.hadoop.hbase.protobuf.generated.TracingProtos.RPCTInfo;<a name="line.73"></a>
+<span class="sourceLineNo">074</span>import org.apache.hadoop.hbase.security.AuthMethod;<a name="line.74"></a>
+<span class="sourceLineNo">075</span>import org.apache.hadoop.hbase.security.HBaseSaslRpcClient;<a name="line.75"></a>
+<span class="sourceLineNo">076</span>import org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>import org.apache.hadoop.hbase.security.SecurityInfo;<a name="line.77"></a>
+<span class="sourceLineNo">078</span>import org.apache.hadoop.hbase.security.User;<a name="line.78"></a>
+<span class="sourceLineNo">079</span>import org.apache.hadoop.hbase.security.UserProvider;<a name="line.79"></a>
+<span class="sourceLineNo">080</span>import org.apache.hadoop.hbase.security.token.AuthenticationTokenSelector;<a name="line.80"></a>
+<span class="sourceLineNo">081</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.81"></a>
+<span class="sourceLineNo">082</span>import org.apache.hadoop.hbase.util.ExceptionUtil;<a name="line.82"></a>
+<span class="sourceLineNo">083</span>import org.apache.hadoop.hbase.util.Pair;<a name="line.83"></a>
+<span class="sourceLineNo">084</span>import org.apache.hadoop.hbase.util.PoolMap;<a name="line.84"></a>
+<span class="sourceLineNo">085</span>import org.apache.hadoop.io.IOUtils;<a name="line.85"></a>
+<span class="sourceLineNo">086</span>import org.apache.hadoop.io.Text;<a name="line.86"></a>
+<span class="sourceLineNo">087</span>import org.apache.hadoop.io.compress.CompressionCodec;<a name="line.87"></a>
+<span class="sourceLineNo">088</span>import org.apache.hadoop.ipc.RemoteException;<a name="line.88"></a>
+<span class="sourceLineNo">089</span>import org.apache.hadoop.net.NetUtils;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>import org.apache.hadoop.security.SecurityUtil;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>import org.apache.hadoop.security.UserGroupInformation;<a name="line.91"></a>
+<span class="sourceLineNo">092</span>import org.apache.hadoop.security.token.Token;<a name="line.92"></a>
+<span class="sourceLineNo">093</span>import org.apache.hadoop.security.token.TokenIdentifier;<a name="line.93"></a>
+<span class="sourceLineNo">094</span>import org.apache.hadoop.security.token.TokenSelector;<a name="line.94"></a>
+<span class="sourceLineNo">095</span>import org.apache.htrace.Span;<a name="line.95"></a>
+<span class="sourceLineNo">096</span>import org.apache.htrace.Trace;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>import org.apache.htrace.TraceScope;<a name="line.97"></a>
+<span class="sourceLineNo">098</span><a name="line.98"></a>
+<span class="sourceLineNo">099</span>import com.google.common.annotations.VisibleForTesting;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>import com.google.protobuf.Descriptors.MethodDescriptor;<a name="line.100"></a>
+<span class="sourceLineNo">101</span>import com.google.protobuf.Message;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>import com.google.protobuf.Message.Builder;<a name="line.102"></a>
+<span class="sourceLineNo">103</span>import com.google.protobuf.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> * Does RPC against a cluster.  Manages connections per regionserver in the cluster.<a name="line.106"></a>
@@ -1275,80 +1275,50 @@
 <span class="sourceLineNo">1267</span><a name="line.1267"></a>
 <span class="sourceLineNo">1268</span><a name="line.1268"></a>
 <span class="sourceLineNo">1269</span>  /**<a name="line.1269"></a>
-<span class="sourceLineNo">1270</span>   * Take an IOException and the address we were trying to connect to<a name="line.1270"></a>
-<span class="sourceLineNo">1271</span>   * and return an IOException with the input exception as the cause.<a name="line.1271"></a>
-<span class="sourceLineNo">1272</span>   * The new exception provides the stack trace of the place where<a name="line.1272"></a>
-<span class="sourceLineNo">1273</span>   * the exception is thrown and some extra diagnostics information.<a name="line.1273"></a>
-<span class="sourceLineNo">1274</span>   * If the exception is ConnectException or SocketTimeoutException,<a name="line.1274"></a>
-<span class="sourceLineNo">1275</span>   * return a new one of the same type; Otherwise return an IOException.<a name="line.1275"></a>
-<span class="sourceLineNo">1276</span>   *<a name="line.1276"></a>
-<span class="sourceLineNo">1277</span>   * @param addr target address<a name="line.1277"></a>
-<span class="sourceLineNo">1278</span>   * @param exception the relevant exception<a name="line.1278"></a>
-<span class="sourceLineNo">1279</span>   * @return an exception to throw<a name="line.1279"></a>
-<span class="sourceLineNo">1280</span>   */<a name="line.1280"></a>
-<span class="sourceLineNo">1281</span>  protected IOException wrapException(InetSocketAddress addr,<a name="line.1281"></a>
-<span class="sourceLineNo">1282</span>                                         IOException exception) {<a name="line.1282"></a>
-<span class="sourceLineNo">1283</span>    if (exception instanceof ConnectException) {<a name="line.1283"></a>
-<span class="sourceLineNo">1284</span>      //connection refused; include the host:port in the error<a name="line.1284"></a>
-<span class="sourceLineNo">1285</span>      return (ConnectException)new ConnectException(<a name="line.1285"></a>
-<span class="sourceLineNo">1286</span>         "Call to " + addr + " failed on connection exception: " + exception).initCause(exception);<a name="line.1286"></a>
-<span class="sourceLineNo">1287</span>    } else if (exception instanceof SocketTimeoutException) {<a name="line.1287"></a>
-<span class="sourceLineNo">1288</span>      return (SocketTimeoutException)new SocketTimeoutException("Call to " + addr +<a name="line.1288"></a>
-<span class="sourceLineNo">1289</span>        " failed because " + exception).initCause(exception);<a name="line.1289"></a>
-<span class="sourceLineNo">1290</span>    } else if (exception instanceof ConnectionClosingException){<a name="line.1290"></a>
-<span class="sourceLineNo">1291</span>      return (ConnectionClosingException) new ConnectionClosingException(<a name="line.1291"></a>
-<span class="sourceLineNo">1292</span>          "Call to " + addr + " failed on local exception: " + exception).initCause(exception);<a name="line.1292"></a>
-<span class="sourceLineNo">1293</span>    } else {<a name="line.1293"></a>
-<span class="sourceLineNo">1294</span>      return (IOException)new IOException("Call to " + addr + " failed on local exception: " +<a name="line.1294"></a>
-<span class="sourceLineNo">1295</span>        exception).initCause(exception);<a name="line.1295"></a>
-<span class="sourceLineNo">1296</span>    }<a name="line.1296"></a>
-<span class="sourceLineNo">1297</span>  }<a name="line.1297"></a>
-<span class="sourceLineNo">1298</span><a name="line.1298"></a>
-<span class="sourceLineNo">1299</span>  /**<a name="line.1299"></a>
-<span class="sourceLineNo">1300</span>   * Interrupt the connections to the given ip:port server. This should be called if the server<a name="line.1300"></a>
-<span class="sourceLineNo">1301</span>   *  is known as actually dead. This will not prevent current operation to be retried, and,<a name="line.1301"></a>
-<span class="sourceLineNo">1302</span>   *  depending on their own behavior, they may retry on the same server. This can be a feature,<a name="line.1302"></a>
-<span class="sourceLineNo">1303</span>   *  for example at startup. In any case, they're likely to get connection refused (if the<a name="line.1303"></a>
-<span class="sourceLineNo">1304</span>   *  process died) or no route to host: i.e. their next retries should be faster and with a<a name="line.1304"></a>
-<span class="sourceLineNo">1305</span>   *  safe exception.<a name="line.1305"></a>
-<span class="sourceLineNo">1306</span>   */<a name="line.1306"></a>
-<span class="sourceLineNo">1307</span>  @Override<a name="line.1307"></a>
-<span class="sourceLineNo">1308</span>  public void cancelConnections(ServerName sn) {<a name="line.1308"></a>
-<span class="sourceLineNo">1309</span>    synchronized (connections) {<a name="line.1309"></a>
-<span class="sourceLineNo">1310</span>      for (Connection connection : connections.values()) {<a name="line.1310"></a>
-<span class="sourceLineNo">1311</span>        if (connection.isAlive() &amp;&amp;<a name="line.1311"></a>
-<span class="sourceLineNo">1312</span>            connection.getRemoteAddress().getPort() == sn.getPort() &amp;&amp;<a name="line.1312"></a>
-<span class="sourceLineNo">1313</span>            connection.getRemoteAddress().getHostName().equals(sn.getHostname())) {<a name="line.1313"></a>
-<span class="sourceLineNo">1314</span>          LOG.info("The server on " + sn.toString() +<a name="line.1314"></a>
-<span class="sourceLineNo">1315</span>              " is dead - stopping the connection " + connection.remoteId);<a name="line.1315"></a>
-<span class="sourceLineNo">1316</span>          connection.interrupt(); // We're interrupting a Reader. It means we want it to finish.<a name="line.1316"></a>
-<span class="sourceLineNo">1317</span>                                  // This will close the connection as well.<a name="line.1317"></a>
-<span class="sourceLineNo">1318</span>        }<a name="line.1318"></a>
-<span class="sourceLineNo">1319</span>      }<a name="line.1319"></a>
-<span class="sourceLineNo">1320</span>    }<a name="line.1320"></a>
-<span class="sourceLineNo">1321</span>  }<a name="line.1321"></a>
-<span class="sourceLineNo">1322</span><a name="line.1322"></a>
-<span class="sourceLineNo">1323</span>  /**<a name="line.1323"></a>
-<span class="sourceLineNo">1324</span>   *  Get a connection from the pool, or create a new one and add it to the<a name="line.1324"></a>
-<span class="sourceLineNo">1325</span>   * pool. Connections to a given host/port are reused.<a name="line.1325"></a>
-<span class="sourceLineNo">1326</span>   */<a name="line.1326"></a>
-<span class="sourceLineNo">1327</span>  protected Connection getConnection(User ticket, Call call, InetSocketAddress addr)<a name="line.1327"></a>
-<span class="sourceLineNo">1328</span>  throws IOException {<a name="line.1328"></a>
-<span class="sourceLineNo">1329</span>    if (!running.get()) throw new StoppedRpcClientException();<a name="line.1329"></a>
-<span class="sourceLineNo">1330</span>    Connection connection;<a name="line.1330"></a>
-<span class="sourceLineNo">1331</span>    ConnectionId remoteId =<a name="line.1331"></a>
-<span class="sourceLineNo">1332</span>      new ConnectionId(ticket, call.md.getService().getName(), addr);<a name="line.1332"></a>
-<span class="sourceLineNo">1333</span>    synchronized (connections) {<a name="line.1333"></a>
-<span class="sourceLineNo">1334</span>      connection = connections.get(remoteId);<a name="line.1334"></a>
-<span class="sourceLineNo">1335</span>      if (connection == null) {<a name="line.1335"></a>
-<span class="sourceLineNo">1336</span>        connection = createConnection(remoteId, this.codec, this.compressor);<a name="line.1336"></a>
-<span class="sourceLineNo">1337</span>        connections.put(remoteId, connection);<a name="line.1337"></a>
-<span class="sourceLineNo">1338</span>      }<a name="line.1338"></a>
-<span class="sourceLineNo">1339</span>    }<a name="line.1339"></a>
-<span class="sourceLineNo">1340</span><a name="line.1340"></a>
-<span class="sourceLineNo">1341</span>    return connection;<a name="line.1341"></a>
-<span class="sourceLineNo">1342</span>  }<a name="line.1342"></a>
-<span class="sourceLineNo">1343</span>}<a name="line.1343"></a>
+<span class="sourceLineNo">1270</span>   * Interrupt the connections to the given ip:port server. This should be called if the server<a name="line.1270"></a>
+<span class="sourceLineNo">1271</span>   *  is known as actually dead. This will not prevent current operation to be retried, and,<a name="line.1271"></a>
+<span class="sourceLineNo">1272</span>   *  depending on their own behavior, they may retry on the same server. This can be a feature,<a name="line.1272"></a>
+<span class="sourceLineNo">1273</span>   *  for example at startup. In any case, they're likely to get connection refused (if the<a name="line.1273"></a>
+<span class="sourceLineNo">1274</span>   *  process died) or no route to host: i.e. their next retries should be faster and with a<a name="line.1274"></a>
+<span class="sourceLineNo">1275</span>   *  safe exception.<a name="line.1275"></a>
+<span class="sourceLineNo">1276</span>   */<a name="line.1276"></a>
+<span class="sourceLineNo">1277</span>  @Override<a name="line.1277"></a>
+<span class="sourceLineNo">1278</span>  public void cancelConnections(ServerName sn) {<a name="line.1278"></a>
+<span class="sourceLineNo">1279</span>    synchronized (connections) {<a name="line.1279"></a>
+<span class="sourceLineNo">1280</span>      for (Connection connection : connections.values()) {<a name="line.1280"></a>
+<span class="sourceLineNo">1281</span>        if (connection.isAlive() &amp;&amp;<a name="line.1281"></a>
+<span class="sourceLineNo">1282</span>            connection.getRemoteAddress().getPort() == sn.getPort() &amp;&amp;<a name="line.1282"></a>
+<span class="sourceLineNo">1283</span>            connection.getRemoteAddress().getHostName().equals(sn.getHostname())) {<a name="line.1283"></a>
+<span class="sourceLineNo">1284</span>          LOG.info("The server on " + sn.toString() +<a name="line.1284"></a>
+<span class="sourceLineNo">1285</span>              " is dead - stopping the connection " + connection.remoteId);<a name="line.1285"></a>
+<span class="sourceLineNo">1286</span>          connection.interrupt(); // We're interrupting a Reader. It means we want it to finish.<a name="line.1286"></a>
+<span class="sourceLineNo">1287</span>                                  // This will close the connection as well.<a name="line.1287"></a>
+<span class="sourceLineNo">1288</span>        }<a name="line.1288"></a>
+<span class="sourceLineNo">1289</span>      }<a name="line.1289"></a>
+<span class="sourceLineNo">1290</span>    }<a name="line.1290"></a>
+<span class="sourceLineNo">1291</span>  }<a name="line.1291"></a>
+<span class="sourceLineNo">1292</span><a name="line.1292"></a>
+<span class="sourceLineNo">1293</span>  /**<a name="line.1293"></a>
+<span class="sourceLineNo">1294</span>   *  Get a connection from the pool, or create a new one and add it to the<a name="line.1294"></a>
+<span class="sourceLineNo">1295</span>   * pool. Connections to a given host/port are reused.<a name="line.1295"></a>
+<span class="sourceLineNo">1296</span>   */<a name="line.1296"></a>
+<span class="sourceLineNo">1297</span>  protected Connection getConnection(User ticket, Call call, InetSocketAddress addr)<a name="line.1297"></a>
+<span class="sourceLineNo">1298</span>  throws IOException {<a name="line.1298"></a>
+<span class="sourceLineNo">1299</span>    if (!running.get()) throw new StoppedRpcClientException();<a name="line.1299"></a>
+<span class="sourceLineNo">1300</span>    Connection connection;<a name="line.1300"></a>
+<span class="sourceLineNo">1301</span>    ConnectionId remoteId =<a name="line.1301"></a>
+<span class="sourceLineNo">1302</span>      new ConnectionId(ticket, call.md.getService().getName(), addr);<a name="line.1302"></a>
+<span class="sourceLineNo">1303</span>    synchronized (connections) {<a name="line.1303"></a>
+<span class="sourceLineNo">1304</span>      connection = connections.get(remoteId);<a name="line.1304"></a>
+<span class="sourceLineNo">1305</span>      if (connection == null) {<a name="line.1305"></a>
+<span class="sourceLineNo">1306</span>        connection = createConnection(remoteId, this.codec, this.compressor);<a name="line.1306"></a>
+<span class="sourceLineNo">1307</span>        connections.put(remoteId, connection);<a name="line.1307"></a>
+<span class="sourceLineNo">1308</span>      }<a name="line.1308"></a>
+<span class="sourceLineNo">1309</span>    }<a name="line.1309"></a>
+<span class="sourceLineNo">1310</span><a name="line.1310"></a>
+<span class="sourceLineNo">1311</span>    return connection;<a name="line.1311"></a>
+<span class="sourceLineNo">1312</span>  }<a name="line.1312"></a>
+<span class="sourceLineNo">1313</span>}<a name="line.1313"></a>
 
 
 


Mime
View raw message