hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [06/51] [partial] hbase-site git commit: Published site at .
Date Sun, 12 Nov 2017 15:16:58 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/ipc/Call.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/Call.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/Call.html
index e2b7111..d2cb27d 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/Call.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/Call.html
@@ -38,8 +38,8 @@
 <span class="sourceLineNo">030</span>import org.apache.yetus.audience.InterfaceAudience;<a name="line.30"></a>
 <span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.client.MetricsConnection;<a name="line.31"></a>
 <span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.htrace.Span;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.apache.htrace.Trace;<a name="line.34"></a>
+<span class="sourceLineNo">033</span>import org.apache.htrace.core.Span;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.htrace.core.Tracer;<a name="line.34"></a>
 <span class="sourceLineNo">035</span><a name="line.35"></a>
 <span class="sourceLineNo">036</span>/** A call waiting for a value. */<a name="line.36"></a>
 <span class="sourceLineNo">037</span>@InterfaceAudience.Private<a name="line.37"></a>
@@ -81,7 +81,7 @@
 <span class="sourceLineNo">073</span>    this.timeout = timeout;<a name="line.73"></a>
 <span class="sourceLineNo">074</span>    this.priority = priority;<a name="line.74"></a>
 <span class="sourceLineNo">075</span>    this.callback = callback;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    this.span = Trace.currentSpan();<a name="line.76"></a>
+<span class="sourceLineNo">076</span>    this.span = Tracer.getCurrentSpan();<a name="line.76"></a>
 <span class="sourceLineNo">077</span>  }<a name="line.77"></a>
 <span class="sourceLineNo">078</span><a name="line.78"></a>
 <span class="sourceLineNo">079</span>  @Override<a name="line.79"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/ipc/CallRunner.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/CallRunner.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/CallRunner.html
index 036fe26..0c56c9e 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/CallRunner.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/CallRunner.html
@@ -32,211 +32,204 @@
 <span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.CallDroppedException;<a name="line.24"></a>
 <span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.25"></a>
 <span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.yetus.audience.InterfaceAudience;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.yetus.audience.InterfaceStability;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.exceptions.TimeoutIOException;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.monitoring.MonitoredRPCHandler;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.security.User;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.shaded.com.google.protobuf.Message;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.util.Pair;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.apache.hadoop.util.StringUtils;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.apache.htrace.Trace;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.htrace.TraceScope;<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> * The request processing logic, which is usually executed in thread pools provided by an<a name="line.39"></a>
-<span class="sourceLineNo">040</span> * {@link RpcScheduler}.  Call {@link #run()} to actually execute the contained<a name="line.40"></a>
-<span class="sourceLineNo">041</span> * RpcServer.Call<a name="line.41"></a>
-<span class="sourceLineNo">042</span> */<a name="line.42"></a>
-<span class="sourceLineNo">043</span>@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})<a name="line.43"></a>
-<span class="sourceLineNo">044</span>@InterfaceStability.Evolving<a name="line.44"></a>
-<span class="sourceLineNo">045</span>public class CallRunner {<a name="line.45"></a>
-<span class="sourceLineNo">046</span><a name="line.46"></a>
-<span class="sourceLineNo">047</span>  private static final CallDroppedException CALL_DROPPED_EXCEPTION<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    = new CallDroppedException();<a name="line.48"></a>
-<span class="sourceLineNo">049</span><a name="line.49"></a>
-<span class="sourceLineNo">050</span>  private RpcCall call;<a name="line.50"></a>
-<span class="sourceLineNo">051</span>  private RpcServerInterface rpcServer;<a name="line.51"></a>
-<span class="sourceLineNo">052</span>  private MonitoredRPCHandler status;<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  private volatile boolean sucessful;<a name="line.53"></a>
-<span class="sourceLineNo">054</span><a name="line.54"></a>
-<span class="sourceLineNo">055</span>  /**<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   * On construction, adds the size of this call to the running count of outstanding call sizes.<a name="line.56"></a>
-<span class="sourceLineNo">057</span>   * Presumption is that we are put on a queue while we wait on an executor to run us.  During this<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   * time we occupy heap.<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   */<a name="line.59"></a>
-<span class="sourceLineNo">060</span>  // The constructor is shutdown so only RpcServer in this class can make one of these.<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  CallRunner(final RpcServerInterface rpcServer, final RpcCall call) {<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    this.call = call;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    this.rpcServer = rpcServer;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>    // Add size of the call to queue size.<a name="line.64"></a>
-<span class="sourceLineNo">065</span>    if (call != null &amp;&amp; rpcServer != null) {<a name="line.65"></a>
-<span class="sourceLineNo">066</span>      this.rpcServer.addCallSize(call.getSize());<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    }<a name="line.67"></a>
-<span class="sourceLineNo">068</span>  }<a name="line.68"></a>
-<span class="sourceLineNo">069</span><a name="line.69"></a>
-<span class="sourceLineNo">070</span>  public RpcCall getRpcCall() {<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    return call;<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>  /**<a name="line.74"></a>
-<span class="sourceLineNo">075</span>   * Keep for backward compatibility.<a name="line.75"></a>
-<span class="sourceLineNo">076</span>   * @deprecated As of release 2.0, this will be removed in HBase 3.0<a name="line.76"></a>
-<span class="sourceLineNo">077</span>   */<a name="line.77"></a>
-<span class="sourceLineNo">078</span>  @Deprecated<a name="line.78"></a>
-<span class="sourceLineNo">079</span>  public ServerCall&lt;?&gt; getCall() {<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    return (ServerCall&lt;?&gt;) call;<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>  public void setStatus(MonitoredRPCHandler status) {<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    this.status = status;<a name="line.84"></a>
-<span class="sourceLineNo">085</span>  }<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>   * Cleanup after ourselves... let go of references.<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   */<a name="line.89"></a>
-<span class="sourceLineNo">090</span>  private void cleanup() {<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    this.call = null;<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    this.rpcServer = null;<a name="line.92"></a>
-<span class="sourceLineNo">093</span>  }<a name="line.93"></a>
-<span class="sourceLineNo">094</span><a name="line.94"></a>
-<span class="sourceLineNo">095</span>  public void run() {<a name="line.95"></a>
-<span class="sourceLineNo">096</span>    try {<a name="line.96"></a>
-<span class="sourceLineNo">097</span>      if (call.disconnectSince() &gt;= 0) {<a name="line.97"></a>
-<span class="sourceLineNo">098</span>        if (RpcServer.LOG.isDebugEnabled()) {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>          RpcServer.LOG.debug(Thread.currentThread().getName() + ": skipped " + call);<a name="line.99"></a>
-<span class="sourceLineNo">100</span>        }<a name="line.100"></a>
-<span class="sourceLineNo">101</span>        return;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      }<a name="line.102"></a>
-<span class="sourceLineNo">103</span>      call.setStartTime(System.currentTimeMillis());<a name="line.103"></a>
-<span class="sourceLineNo">104</span>      if (call.getStartTime() &gt; call.getDeadline()) {<a name="line.104"></a>
-<span class="sourceLineNo">105</span>        RpcServer.LOG.warn("Dropping timed out call: " + call);<a name="line.105"></a>
-<span class="sourceLineNo">106</span>        return;<a name="line.106"></a>
-<span class="sourceLineNo">107</span>      }<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      this.status.setStatus("Setting up call");<a name="line.108"></a>
-<span class="sourceLineNo">109</span>      this.status.setConnection(call.getRemoteAddress().getHostAddress(), call.getRemotePort());<a name="line.109"></a>
-<span class="sourceLineNo">110</span>      if (RpcServer.LOG.isTraceEnabled()) {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>        Optional&lt;User&gt; remoteUser = call.getRequestUser();<a name="line.111"></a>
-<span class="sourceLineNo">112</span>        RpcServer.LOG.trace(call.toShortString() + " executing as " +<a name="line.112"></a>
-<span class="sourceLineNo">113</span>            (remoteUser.isPresent() ? "NULL principal" : remoteUser.get().getName()));<a name="line.113"></a>
-<span class="sourceLineNo">114</span>      }<a name="line.114"></a>
-<span class="sourceLineNo">115</span>      Throwable errorThrowable = null;<a name="line.115"></a>
-<span class="sourceLineNo">116</span>      String error = null;<a name="line.116"></a>
-<span class="sourceLineNo">117</span>      Pair&lt;Message, CellScanner&gt; resultPair = null;<a name="line.117"></a>
-<span class="sourceLineNo">118</span>      RpcServer.CurCall.set(call);<a name="line.118"></a>
-<span class="sourceLineNo">119</span>      TraceScope traceScope = null;<a name="line.119"></a>
-<span class="sourceLineNo">120</span>      try {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>        if (!this.rpcServer.isStarted()) {<a name="line.121"></a>
-<span class="sourceLineNo">122</span>          InetSocketAddress address = rpcServer.getListenerAddress();<a name="line.122"></a>
-<span class="sourceLineNo">123</span>          throw new ServerNotRunningYetException("Server " +<a name="line.123"></a>
-<span class="sourceLineNo">124</span>              (address != null ? address : "(channel closed)") + " is not running yet");<a name="line.124"></a>
-<span class="sourceLineNo">125</span>        }<a name="line.125"></a>
-<span class="sourceLineNo">126</span>        if (call.getTraceInfo() != null) {<a name="line.126"></a>
-<span class="sourceLineNo">127</span>          String serviceName =<a name="line.127"></a>
-<span class="sourceLineNo">128</span>              call.getService() != null ? call.getService().getDescriptorForType().getName() : "";<a name="line.128"></a>
-<span class="sourceLineNo">129</span>          String methodName = (call.getMethod() != null) ? call.getMethod().getName() : "";<a name="line.129"></a>
-<span class="sourceLineNo">130</span>          String traceString = serviceName + "." + methodName;<a name="line.130"></a>
-<span class="sourceLineNo">131</span>          traceScope = Trace.startSpan(traceString, call.getTraceInfo());<a name="line.131"></a>
-<span class="sourceLineNo">132</span>        }<a name="line.132"></a>
-<span class="sourceLineNo">133</span>        // make the call<a name="line.133"></a>
-<span class="sourceLineNo">134</span>        resultPair = this.rpcServer.call(call, this.status);<a name="line.134"></a>
-<span class="sourceLineNo">135</span>      } catch (TimeoutIOException e){<a name="line.135"></a>
-<span class="sourceLineNo">136</span>        RpcServer.LOG.warn("Can not complete this request in time, drop it: " + call);<a name="line.136"></a>
-<span class="sourceLineNo">137</span>        return;<a name="line.137"></a>
-<span class="sourceLineNo">138</span>      } catch (Throwable e) {<a name="line.138"></a>
-<span class="sourceLineNo">139</span>        if (e instanceof ServerNotRunningYetException) {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>          // If ServerNotRunningYetException, don't spew stack trace.<a name="line.140"></a>
-<span class="sourceLineNo">141</span>          if (RpcServer.LOG.isTraceEnabled()) {<a name="line.141"></a>
-<span class="sourceLineNo">142</span>            RpcServer.LOG.trace(call.toShortString(), e);<a name="line.142"></a>
-<span class="sourceLineNo">143</span>          }<a name="line.143"></a>
-<span class="sourceLineNo">144</span>        } else {<a name="line.144"></a>
-<span class="sourceLineNo">145</span>          RpcServer.LOG.debug(call.toShortString(), e);<a name="line.145"></a>
-<span class="sourceLineNo">146</span>        }<a name="line.146"></a>
-<span class="sourceLineNo">147</span>        errorThrowable = e;<a name="line.147"></a>
-<span class="sourceLineNo">148</span>        error = StringUtils.stringifyException(e);<a name="line.148"></a>
-<span class="sourceLineNo">149</span>        if (e instanceof Error) {<a name="line.149"></a>
-<span class="sourceLineNo">150</span>          throw (Error)e;<a name="line.150"></a>
-<span class="sourceLineNo">151</span>        }<a name="line.151"></a>
-<span class="sourceLineNo">152</span>      } finally {<a name="line.152"></a>
-<span class="sourceLineNo">153</span>        if (traceScope != null) {<a name="line.153"></a>
-<span class="sourceLineNo">154</span>          traceScope.close();<a name="line.154"></a>
-<span class="sourceLineNo">155</span>        }<a name="line.155"></a>
-<span class="sourceLineNo">156</span>        RpcServer.CurCall.set(null);<a name="line.156"></a>
-<span class="sourceLineNo">157</span>        if (resultPair != null) {<a name="line.157"></a>
-<span class="sourceLineNo">158</span>          this.rpcServer.addCallSize(call.getSize() * -1);<a name="line.158"></a>
-<span class="sourceLineNo">159</span>          sucessful = true;<a name="line.159"></a>
-<span class="sourceLineNo">160</span>        }<a name="line.160"></a>
-<span class="sourceLineNo">161</span>      }<a name="line.161"></a>
-<span class="sourceLineNo">162</span>      // return back the RPC request read BB we can do here. It is done by now.<a name="line.162"></a>
-<span class="sourceLineNo">163</span>      call.cleanup();<a name="line.163"></a>
-<span class="sourceLineNo">164</span>      // Set the response<a name="line.164"></a>
-<span class="sourceLineNo">165</span>      Message param = resultPair != null ? resultPair.getFirst() : null;<a name="line.165"></a>
-<span class="sourceLineNo">166</span>      CellScanner cells = resultPair != null ? resultPair.getSecond() : null;<a name="line.166"></a>
-<span class="sourceLineNo">167</span>      call.setResponse(param, cells, errorThrowable, error);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      call.sendResponseIfReady();<a name="line.168"></a>
-<span class="sourceLineNo">169</span>      this.status.markComplete("Sent response");<a name="line.169"></a>
-<span class="sourceLineNo">170</span>      this.status.pause("Waiting for a call");<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    } catch (OutOfMemoryError e) {<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      if (this.rpcServer.getErrorHandler() != null) {<a name="line.172"></a>
-<span class="sourceLineNo">173</span>        if (this.rpcServer.getErrorHandler().checkOOME(e)) {<a name="line.173"></a>
-<span class="sourceLineNo">174</span>          RpcServer.LOG.info(Thread.currentThread().getName() + ": exiting on OutOfMemoryError");<a name="line.174"></a>
-<span class="sourceLineNo">175</span>          return;<a name="line.175"></a>
-<span class="sourceLineNo">176</span>        }<a name="line.176"></a>
-<span class="sourceLineNo">177</span>      } else {<a name="line.177"></a>
-<span class="sourceLineNo">178</span>        // rethrow if no handler<a name="line.178"></a>
-<span class="sourceLineNo">179</span>        throw e;<a name="line.179"></a>
-<span class="sourceLineNo">180</span>      }<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    } catch (ClosedChannelException cce) {<a name="line.181"></a>
-<span class="sourceLineNo">182</span>      InetSocketAddress address = rpcServer.getListenerAddress();<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      RpcServer.LOG.warn(Thread.currentThread().getName() + ": caught a ClosedChannelException, " +<a name="line.183"></a>
-<span class="sourceLineNo">184</span>          "this means that the server " + (address != null ? address : "(channel closed)") +<a name="line.184"></a>
-<span class="sourceLineNo">185</span>          " was processing a request but the client went away. The error message was: " +<a name="line.185"></a>
-<span class="sourceLineNo">186</span>          cce.getMessage());<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    } catch (Exception e) {<a name="line.187"></a>
-<span class="sourceLineNo">188</span>      RpcServer.LOG.warn(Thread.currentThread().getName()<a name="line.188"></a>
-<span class="sourceLineNo">189</span>          + ": caught: " + StringUtils.stringifyException(e));<a name="line.189"></a>
-<span class="sourceLineNo">190</span>    } finally {<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      if (!sucessful) {<a name="line.191"></a>
-<span class="sourceLineNo">192</span>        this.rpcServer.addCallSize(call.getSize() * -1);<a name="line.192"></a>
-<span class="sourceLineNo">193</span>      }<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      cleanup();<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><a name="line.197"></a>
-<span class="sourceLineNo">198</span>  /**<a name="line.198"></a>
-<span class="sourceLineNo">199</span>   * When we want to drop this call because of server is overloaded.<a name="line.199"></a>
-<span class="sourceLineNo">200</span>   */<a name="line.200"></a>
-<span class="sourceLineNo">201</span>  public void drop() {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>    try {<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      if (call.disconnectSince() &gt;= 0) {<a name="line.203"></a>
-<span class="sourceLineNo">204</span>        if (RpcServer.LOG.isDebugEnabled()) {<a name="line.204"></a>
-<span class="sourceLineNo">205</span>          RpcServer.LOG.debug(Thread.currentThread().getName() + ": skipped " + call);<a name="line.205"></a>
-<span class="sourceLineNo">206</span>        }<a name="line.206"></a>
-<span class="sourceLineNo">207</span>        return;<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      }<a name="line.208"></a>
-<span class="sourceLineNo">209</span><a name="line.209"></a>
-<span class="sourceLineNo">210</span>      // Set the response<a name="line.210"></a>
-<span class="sourceLineNo">211</span>      InetSocketAddress address = rpcServer.getListenerAddress();<a name="line.211"></a>
-<span class="sourceLineNo">212</span>      call.setResponse(null, null, CALL_DROPPED_EXCEPTION, "Call dropped, server "<a name="line.212"></a>
-<span class="sourceLineNo">213</span>        + (address != null ? address : "(channel closed)") + " is overloaded, please retry.");<a name="line.213"></a>
-<span class="sourceLineNo">214</span>      call.sendResponseIfReady();<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    } catch (ClosedChannelException cce) {<a name="line.215"></a>
-<span class="sourceLineNo">216</span>      InetSocketAddress address = rpcServer.getListenerAddress();<a name="line.216"></a>
-<span class="sourceLineNo">217</span>      RpcServer.LOG.warn(Thread.currentThread().getName() + ": caught a ClosedChannelException, " +<a name="line.217"></a>
-<span class="sourceLineNo">218</span>        "this means that the server " + (address != null ? address : "(channel closed)") +<a name="line.218"></a>
-<span class="sourceLineNo">219</span>        " was processing a request but the client went away. The error message was: " +<a name="line.219"></a>
-<span class="sourceLineNo">220</span>        cce.getMessage());<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    } catch (Exception e) {<a name="line.221"></a>
-<span class="sourceLineNo">222</span>      RpcServer.LOG.warn(Thread.currentThread().getName()<a name="line.222"></a>
-<span class="sourceLineNo">223</span>        + ": caught: " + StringUtils.stringifyException(e));<a name="line.223"></a>
-<span class="sourceLineNo">224</span>    } finally {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>      if (!sucessful) {<a name="line.225"></a>
-<span class="sourceLineNo">226</span>        this.rpcServer.addCallSize(call.getSize() * -1);<a name="line.226"></a>
-<span class="sourceLineNo">227</span>      }<a name="line.227"></a>
-<span class="sourceLineNo">228</span>      cleanup();<a name="line.228"></a>
-<span class="sourceLineNo">229</span>    }<a name="line.229"></a>
-<span class="sourceLineNo">230</span>  }<a name="line.230"></a>
-<span class="sourceLineNo">231</span>}<a name="line.231"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.trace.TraceUtil;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.yetus.audience.InterfaceAudience;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.yetus.audience.InterfaceStability;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.exceptions.TimeoutIOException;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.monitoring.MonitoredRPCHandler;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.security.User;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.shaded.com.google.protobuf.Message;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.util.Pair;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.apache.hadoop.util.StringUtils;<a name="line.35"></a>
+<span class="sourceLineNo">036</span><a name="line.36"></a>
+<span class="sourceLineNo">037</span>/**<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * The request processing logic, which is usually executed in thread pools provided by an<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * {@link RpcScheduler}.  Call {@link #run()} to actually execute the contained<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * RpcServer.Call<a name="line.40"></a>
+<span class="sourceLineNo">041</span> */<a name="line.41"></a>
+<span class="sourceLineNo">042</span>@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})<a name="line.42"></a>
+<span class="sourceLineNo">043</span>@InterfaceStability.Evolving<a name="line.43"></a>
+<span class="sourceLineNo">044</span>public class CallRunner {<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>  private static final CallDroppedException CALL_DROPPED_EXCEPTION<a name="line.46"></a>
+<span class="sourceLineNo">047</span>    = new CallDroppedException();<a name="line.47"></a>
+<span class="sourceLineNo">048</span><a name="line.48"></a>
+<span class="sourceLineNo">049</span>  private RpcCall call;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>  private RpcServerInterface rpcServer;<a name="line.50"></a>
+<span class="sourceLineNo">051</span>  private MonitoredRPCHandler status;<a name="line.51"></a>
+<span class="sourceLineNo">052</span>  private volatile boolean sucessful;<a name="line.52"></a>
+<span class="sourceLineNo">053</span><a name="line.53"></a>
+<span class="sourceLineNo">054</span>  /**<a name="line.54"></a>
+<span class="sourceLineNo">055</span>   * On construction, adds the size of this call to the running count of outstanding call sizes.<a name="line.55"></a>
+<span class="sourceLineNo">056</span>   * Presumption is that we are put on a queue while we wait on an executor to run us.  During this<a name="line.56"></a>
+<span class="sourceLineNo">057</span>   * time we occupy heap.<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   */<a name="line.58"></a>
+<span class="sourceLineNo">059</span>  // The constructor is shutdown so only RpcServer in this class can make one of these.<a name="line.59"></a>
+<span class="sourceLineNo">060</span>  CallRunner(final RpcServerInterface rpcServer, final RpcCall call) {<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    this.call = call;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    this.rpcServer = rpcServer;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    // Add size of the call to queue size.<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    if (call != null &amp;&amp; rpcServer != null) {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>      this.rpcServer.addCallSize(call.getSize());<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    }<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  }<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>  public RpcCall getRpcCall() {<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    return call;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>  }<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>   * Keep for backward compatibility.<a name="line.74"></a>
+<span class="sourceLineNo">075</span>   * @deprecated As of release 2.0, this will be removed in HBase 3.0<a name="line.75"></a>
+<span class="sourceLineNo">076</span>   */<a name="line.76"></a>
+<span class="sourceLineNo">077</span>  @Deprecated<a name="line.77"></a>
+<span class="sourceLineNo">078</span>  public ServerCall&lt;?&gt; getCall() {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    return (ServerCall&lt;?&gt;) call;<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>  public void setStatus(MonitoredRPCHandler status) {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    this.status = status;<a name="line.83"></a>
+<span class="sourceLineNo">084</span>  }<a name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>  /**<a name="line.86"></a>
+<span class="sourceLineNo">087</span>   * Cleanup after ourselves... let go of references.<a name="line.87"></a>
+<span class="sourceLineNo">088</span>   */<a name="line.88"></a>
+<span class="sourceLineNo">089</span>  private void cleanup() {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    this.call = null;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    this.rpcServer = null;<a name="line.91"></a>
+<span class="sourceLineNo">092</span>  }<a name="line.92"></a>
+<span class="sourceLineNo">093</span><a name="line.93"></a>
+<span class="sourceLineNo">094</span>  public void run() {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>    try {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>      if (call.disconnectSince() &gt;= 0) {<a name="line.96"></a>
+<span class="sourceLineNo">097</span>        if (RpcServer.LOG.isDebugEnabled()) {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>          RpcServer.LOG.debug(Thread.currentThread().getName() + ": skipped " + call);<a name="line.98"></a>
+<span class="sourceLineNo">099</span>        }<a name="line.99"></a>
+<span class="sourceLineNo">100</span>        return;<a name="line.100"></a>
+<span class="sourceLineNo">101</span>      }<a name="line.101"></a>
+<span class="sourceLineNo">102</span>      call.setStartTime(System.currentTimeMillis());<a name="line.102"></a>
+<span class="sourceLineNo">103</span>      if (call.getStartTime() &gt; call.getDeadline()) {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>        RpcServer.LOG.warn("Dropping timed out call: " + call);<a name="line.104"></a>
+<span class="sourceLineNo">105</span>        return;<a name="line.105"></a>
+<span class="sourceLineNo">106</span>      }<a name="line.106"></a>
+<span class="sourceLineNo">107</span>      this.status.setStatus("Setting up call");<a name="line.107"></a>
+<span class="sourceLineNo">108</span>      this.status.setConnection(call.getRemoteAddress().getHostAddress(), call.getRemotePort());<a name="line.108"></a>
+<span class="sourceLineNo">109</span>      if (RpcServer.LOG.isTraceEnabled()) {<a name="line.109"></a>
+<span class="sourceLineNo">110</span>        Optional&lt;User&gt; remoteUser = call.getRequestUser();<a name="line.110"></a>
+<span class="sourceLineNo">111</span>        RpcServer.LOG.trace(call.toShortString() + " executing as " +<a name="line.111"></a>
+<span class="sourceLineNo">112</span>            (remoteUser.isPresent() ? "NULL principal" : remoteUser.get().getName()));<a name="line.112"></a>
+<span class="sourceLineNo">113</span>      }<a name="line.113"></a>
+<span class="sourceLineNo">114</span>      Throwable errorThrowable = null;<a name="line.114"></a>
+<span class="sourceLineNo">115</span>      String error = null;<a name="line.115"></a>
+<span class="sourceLineNo">116</span>      Pair&lt;Message, CellScanner&gt; resultPair = null;<a name="line.116"></a>
+<span class="sourceLineNo">117</span>      RpcServer.CurCall.set(call);<a name="line.117"></a>
+<span class="sourceLineNo">118</span>      try {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>        if (!this.rpcServer.isStarted()) {<a name="line.119"></a>
+<span class="sourceLineNo">120</span>          InetSocketAddress address = rpcServer.getListenerAddress();<a name="line.120"></a>
+<span class="sourceLineNo">121</span>          throw new ServerNotRunningYetException("Server " +<a name="line.121"></a>
+<span class="sourceLineNo">122</span>              (address != null ? address : "(channel closed)") + " is not running yet");<a name="line.122"></a>
+<span class="sourceLineNo">123</span>        }<a name="line.123"></a>
+<span class="sourceLineNo">124</span>        String serviceName =<a name="line.124"></a>
+<span class="sourceLineNo">125</span>            call.getService() != null ? call.getService().getDescriptorForType().getName() : "";<a name="line.125"></a>
+<span class="sourceLineNo">126</span>        String methodName = (call.getMethod() != null) ? call.getMethod().getName() : "";<a name="line.126"></a>
+<span class="sourceLineNo">127</span>        String traceString = serviceName + "." + methodName;<a name="line.127"></a>
+<span class="sourceLineNo">128</span>        TraceUtil.createTrace(traceString);<a name="line.128"></a>
+<span class="sourceLineNo">129</span>        // make the call<a name="line.129"></a>
+<span class="sourceLineNo">130</span>        resultPair = this.rpcServer.call(call, this.status);<a name="line.130"></a>
+<span class="sourceLineNo">131</span>      } catch (TimeoutIOException e){<a name="line.131"></a>
+<span class="sourceLineNo">132</span>        RpcServer.LOG.warn("Can not complete this request in time, drop it: " + call);<a name="line.132"></a>
+<span class="sourceLineNo">133</span>        return;<a name="line.133"></a>
+<span class="sourceLineNo">134</span>      } catch (Throwable e) {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>        if (e instanceof ServerNotRunningYetException) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>          // If ServerNotRunningYetException, don't spew stack trace.<a name="line.136"></a>
+<span class="sourceLineNo">137</span>          if (RpcServer.LOG.isTraceEnabled()) {<a name="line.137"></a>
+<span class="sourceLineNo">138</span>            RpcServer.LOG.trace(call.toShortString(), e);<a name="line.138"></a>
+<span class="sourceLineNo">139</span>          }<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        } else {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>          RpcServer.LOG.debug(call.toShortString(), e);<a name="line.141"></a>
+<span class="sourceLineNo">142</span>        }<a name="line.142"></a>
+<span class="sourceLineNo">143</span>        errorThrowable = e;<a name="line.143"></a>
+<span class="sourceLineNo">144</span>        error = StringUtils.stringifyException(e);<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        if (e instanceof Error) {<a name="line.145"></a>
+<span class="sourceLineNo">146</span>          throw (Error)e;<a name="line.146"></a>
+<span class="sourceLineNo">147</span>        }<a name="line.147"></a>
+<span class="sourceLineNo">148</span>      } finally {<a name="line.148"></a>
+<span class="sourceLineNo">149</span>        RpcServer.CurCall.set(null);<a name="line.149"></a>
+<span class="sourceLineNo">150</span>        if (resultPair != null) {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>          this.rpcServer.addCallSize(call.getSize() * -1);<a name="line.151"></a>
+<span class="sourceLineNo">152</span>          sucessful = true;<a name="line.152"></a>
+<span class="sourceLineNo">153</span>        }<a name="line.153"></a>
+<span class="sourceLineNo">154</span>      }<a name="line.154"></a>
+<span class="sourceLineNo">155</span>      // return back the RPC request read BB we can do here. It is done by now.<a name="line.155"></a>
+<span class="sourceLineNo">156</span>      call.cleanup();<a name="line.156"></a>
+<span class="sourceLineNo">157</span>      // Set the response<a name="line.157"></a>
+<span class="sourceLineNo">158</span>      Message param = resultPair != null ? resultPair.getFirst() : null;<a name="line.158"></a>
+<span class="sourceLineNo">159</span>      CellScanner cells = resultPair != null ? resultPair.getSecond() : null;<a name="line.159"></a>
+<span class="sourceLineNo">160</span>      call.setResponse(param, cells, errorThrowable, error);<a name="line.160"></a>
+<span class="sourceLineNo">161</span>      call.sendResponseIfReady();<a name="line.161"></a>
+<span class="sourceLineNo">162</span>      this.status.markComplete("Sent response");<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      this.status.pause("Waiting for a call");<a name="line.163"></a>
+<span class="sourceLineNo">164</span>    } catch (OutOfMemoryError e) {<a name="line.164"></a>
+<span class="sourceLineNo">165</span>      if (this.rpcServer.getErrorHandler() != null) {<a name="line.165"></a>
+<span class="sourceLineNo">166</span>        if (this.rpcServer.getErrorHandler().checkOOME(e)) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>          RpcServer.LOG.info(Thread.currentThread().getName() + ": exiting on OutOfMemoryError");<a name="line.167"></a>
+<span class="sourceLineNo">168</span>          return;<a name="line.168"></a>
+<span class="sourceLineNo">169</span>        }<a name="line.169"></a>
+<span class="sourceLineNo">170</span>      } else {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>        // rethrow if no handler<a name="line.171"></a>
+<span class="sourceLineNo">172</span>        throw e;<a name="line.172"></a>
+<span class="sourceLineNo">173</span>      }<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    } catch (ClosedChannelException cce) {<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      InetSocketAddress address = rpcServer.getListenerAddress();<a name="line.175"></a>
+<span class="sourceLineNo">176</span>      RpcServer.LOG.warn(Thread.currentThread().getName() + ": caught a ClosedChannelException, " +<a name="line.176"></a>
+<span class="sourceLineNo">177</span>          "this means that the server " + (address != null ? address : "(channel closed)") +<a name="line.177"></a>
+<span class="sourceLineNo">178</span>          " was processing a request but the client went away. The error message was: " +<a name="line.178"></a>
+<span class="sourceLineNo">179</span>          cce.getMessage());<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    } catch (Exception e) {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>      RpcServer.LOG.warn(Thread.currentThread().getName()<a name="line.181"></a>
+<span class="sourceLineNo">182</span>          + ": caught: " + StringUtils.stringifyException(e));<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    } finally {<a name="line.183"></a>
+<span class="sourceLineNo">184</span>      if (!sucessful) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>        this.rpcServer.addCallSize(call.getSize() * -1);<a name="line.185"></a>
+<span class="sourceLineNo">186</span>      }<a name="line.186"></a>
+<span class="sourceLineNo">187</span>      cleanup();<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><a name="line.190"></a>
+<span class="sourceLineNo">191</span>  /**<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   * When we want to drop this call because of server is overloaded.<a name="line.192"></a>
+<span class="sourceLineNo">193</span>   */<a name="line.193"></a>
+<span class="sourceLineNo">194</span>  public void drop() {<a name="line.194"></a>
+<span class="sourceLineNo">195</span>    try {<a name="line.195"></a>
+<span class="sourceLineNo">196</span>      if (call.disconnectSince() &gt;= 0) {<a name="line.196"></a>
+<span class="sourceLineNo">197</span>        if (RpcServer.LOG.isDebugEnabled()) {<a name="line.197"></a>
+<span class="sourceLineNo">198</span>          RpcServer.LOG.debug(Thread.currentThread().getName() + ": skipped " + call);<a name="line.198"></a>
+<span class="sourceLineNo">199</span>        }<a name="line.199"></a>
+<span class="sourceLineNo">200</span>        return;<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>      // Set the response<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      InetSocketAddress address = rpcServer.getListenerAddress();<a name="line.204"></a>
+<span class="sourceLineNo">205</span>      call.setResponse(null, null, CALL_DROPPED_EXCEPTION, "Call dropped, server "<a name="line.205"></a>
+<span class="sourceLineNo">206</span>        + (address != null ? address : "(channel closed)") + " is overloaded, please retry.");<a name="line.206"></a>
+<span class="sourceLineNo">207</span>      call.sendResponseIfReady();<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    } catch (ClosedChannelException cce) {<a name="line.208"></a>
+<span class="sourceLineNo">209</span>      InetSocketAddress address = rpcServer.getListenerAddress();<a name="line.209"></a>
+<span class="sourceLineNo">210</span>      RpcServer.LOG.warn(Thread.currentThread().getName() + ": caught a ClosedChannelException, " +<a name="line.210"></a>
+<span class="sourceLineNo">211</span>        "this means that the server " + (address != null ? address : "(channel closed)") +<a name="line.211"></a>
+<span class="sourceLineNo">212</span>        " was processing a request but the client went away. The error message was: " +<a name="line.212"></a>
+<span class="sourceLineNo">213</span>        cce.getMessage());<a name="line.213"></a>
+<span class="sourceLineNo">214</span>    } catch (Exception e) {<a name="line.214"></a>
+<span class="sourceLineNo">215</span>      RpcServer.LOG.warn(Thread.currentThread().getName()<a name="line.215"></a>
+<span class="sourceLineNo">216</span>        + ": caught: " + StringUtils.stringifyException(e));<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    } finally {<a name="line.217"></a>
+<span class="sourceLineNo">218</span>      if (!sucessful) {<a name="line.218"></a>
+<span class="sourceLineNo">219</span>        this.rpcServer.addCallSize(call.getSize() * -1);<a name="line.219"></a>
+<span class="sourceLineNo">220</span>      }<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      cleanup();<a name="line.221"></a>
+<span class="sourceLineNo">222</span>    }<a name="line.222"></a>
+<span class="sourceLineNo">223</span>  }<a name="line.223"></a>
+<span class="sourceLineNo">224</span>}<a name="line.224"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/ipc/IPCUtil.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/IPCUtil.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/IPCUtil.html
index 659ab90..3871431 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/IPCUtil.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/IPCUtil.html
@@ -43,77 +43,77 @@
 <span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.CellBlockMeta;<a name="line.35"></a>
 <span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.ExceptionResponse;<a name="line.36"></a>
 <span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.TracingProtos.RPCTInfo;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>import org.apache.hadoop.ipc.RemoteException;<a name="line.41"></a>
-<span class="sourceLineNo">042</span><a name="line.42"></a>
-<span class="sourceLineNo">043</span>/**<a name="line.43"></a>
-<span class="sourceLineNo">044</span> * Utility to help ipc'ing.<a name="line.44"></a>
-<span class="sourceLineNo">045</span> */<a name="line.45"></a>
-<span class="sourceLineNo">046</span>@InterfaceAudience.Private<a name="line.46"></a>
-<span class="sourceLineNo">047</span>class IPCUtil {<a name="line.47"></a>
-<span class="sourceLineNo">048</span><a name="line.48"></a>
-<span class="sourceLineNo">049</span>  /**<a name="line.49"></a>
-<span class="sourceLineNo">050</span>   * Write out header, param, and cell block if there is one.<a name="line.50"></a>
-<span class="sourceLineNo">051</span>   * @param dos Stream to write into<a name="line.51"></a>
-<span class="sourceLineNo">052</span>   * @param header to write<a name="line.52"></a>
-<span class="sourceLineNo">053</span>   * @param param to write<a name="line.53"></a>
-<span class="sourceLineNo">054</span>   * @param cellBlock to write<a name="line.54"></a>
-<span class="sourceLineNo">055</span>   * @return Total number of bytes written.<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   * @throws IOException if write action fails<a name="line.56"></a>
-<span class="sourceLineNo">057</span>   */<a name="line.57"></a>
-<span class="sourceLineNo">058</span>  public static int write(final OutputStream dos, final Message header, final Message param,<a name="line.58"></a>
-<span class="sourceLineNo">059</span>      final ByteBuffer cellBlock) throws IOException {<a name="line.59"></a>
-<span class="sourceLineNo">060</span>    // Must calculate total size and write that first so other side can read it all in in one<a name="line.60"></a>
-<span class="sourceLineNo">061</span>    // swoop. This is dictated by how the server is currently written. Server needs to change<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    // if we are to be able to write without the length prefixing.<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    int totalSize = IPCUtil.getTotalSizeWhenWrittenDelimited(header, param);<a name="line.63"></a>
-<span class="sourceLineNo">064</span>    if (cellBlock != null) {<a name="line.64"></a>
-<span class="sourceLineNo">065</span>      totalSize += cellBlock.remaining();<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    }<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    return write(dos, header, param, cellBlock, totalSize);<a name="line.67"></a>
-<span class="sourceLineNo">068</span>  }<a name="line.68"></a>
-<span class="sourceLineNo">069</span><a name="line.69"></a>
-<span class="sourceLineNo">070</span>  private static int write(final OutputStream dos, final Message header, final Message param,<a name="line.70"></a>
-<span class="sourceLineNo">071</span>      final ByteBuffer cellBlock, final int totalSize) throws IOException {<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    // I confirmed toBytes does same as DataOutputStream#writeInt.<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    dos.write(Bytes.toBytes(totalSize));<a name="line.73"></a>
-<span class="sourceLineNo">074</span>    // This allocates a buffer that is the size of the message internally.<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    header.writeDelimitedTo(dos);<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    if (param != null) {<a name="line.76"></a>
-<span class="sourceLineNo">077</span>      param.writeDelimitedTo(dos);<a name="line.77"></a>
-<span class="sourceLineNo">078</span>    }<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    if (cellBlock != null) {<a name="line.79"></a>
-<span class="sourceLineNo">080</span>      dos.write(cellBlock.array(), 0, cellBlock.remaining());<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    }<a name="line.81"></a>
-<span class="sourceLineNo">082</span>    dos.flush();<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    return totalSize;<a name="line.83"></a>
-<span class="sourceLineNo">084</span>  }<a name="line.84"></a>
-<span class="sourceLineNo">085</span><a name="line.85"></a>
-<span class="sourceLineNo">086</span>  /**<a name="line.86"></a>
-<span class="sourceLineNo">087</span>   * @return Size on the wire when the two messages are written with writeDelimitedTo<a name="line.87"></a>
-<span class="sourceLineNo">088</span>   */<a name="line.88"></a>
-<span class="sourceLineNo">089</span>  public static int getTotalSizeWhenWrittenDelimited(Message... messages) {<a name="line.89"></a>
-<span class="sourceLineNo">090</span>    int totalSize = 0;<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    for (Message m : messages) {<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      if (m == null) {<a name="line.92"></a>
-<span class="sourceLineNo">093</span>        continue;<a name="line.93"></a>
-<span class="sourceLineNo">094</span>      }<a name="line.94"></a>
-<span class="sourceLineNo">095</span>      totalSize += m.getSerializedSize();<a name="line.95"></a>
-<span class="sourceLineNo">096</span>      totalSize += CodedOutputStream.computeRawVarint32Size(m.getSerializedSize());<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    }<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    Preconditions.checkArgument(totalSize &lt; Integer.MAX_VALUE);<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    return totalSize;<a name="line.99"></a>
-<span class="sourceLineNo">100</span>  }<a name="line.100"></a>
-<span class="sourceLineNo">101</span><a name="line.101"></a>
-<span class="sourceLineNo">102</span>  static RequestHeader buildRequestHeader(Call call, CellBlockMeta cellBlockMeta) {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    RequestHeader.Builder builder = RequestHeader.newBuilder();<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    builder.setCallId(call.id);<a name="line.104"></a>
-<span class="sourceLineNo">105</span>    if (call.span != null) {<a name="line.105"></a>
+<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import org.apache.hadoop.ipc.RemoteException;<a name="line.40"></a>
+<span class="sourceLineNo">041</span><a name="line.41"></a>
+<span class="sourceLineNo">042</span>/**<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * Utility to help ipc'ing.<a name="line.43"></a>
+<span class="sourceLineNo">044</span> */<a name="line.44"></a>
+<span class="sourceLineNo">045</span>@InterfaceAudience.Private<a name="line.45"></a>
+<span class="sourceLineNo">046</span>class IPCUtil {<a name="line.46"></a>
+<span class="sourceLineNo">047</span><a name="line.47"></a>
+<span class="sourceLineNo">048</span>  /**<a name="line.48"></a>
+<span class="sourceLineNo">049</span>   * Write out header, param, and cell block if there is one.<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   * @param dos Stream to write into<a name="line.50"></a>
+<span class="sourceLineNo">051</span>   * @param header to write<a name="line.51"></a>
+<span class="sourceLineNo">052</span>   * @param param to write<a name="line.52"></a>
+<span class="sourceLineNo">053</span>   * @param cellBlock to write<a name="line.53"></a>
+<span class="sourceLineNo">054</span>   * @return Total number of bytes written.<a name="line.54"></a>
+<span class="sourceLineNo">055</span>   * @throws IOException if write action fails<a name="line.55"></a>
+<span class="sourceLineNo">056</span>   */<a name="line.56"></a>
+<span class="sourceLineNo">057</span>  public static int write(final OutputStream dos, final Message header, final Message param,<a name="line.57"></a>
+<span class="sourceLineNo">058</span>      final ByteBuffer cellBlock) throws IOException {<a name="line.58"></a>
+<span class="sourceLineNo">059</span>    // Must calculate total size and write that first so other side can read it all in in one<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    // swoop. This is dictated by how the server is currently written. Server needs to change<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    // if we are to be able to write without the length prefixing.<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    int totalSize = IPCUtil.getTotalSizeWhenWrittenDelimited(header, param);<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    if (cellBlock != null) {<a name="line.63"></a>
+<span class="sourceLineNo">064</span>      totalSize += cellBlock.remaining();<a name="line.64"></a>
+<span class="sourceLineNo">065</span>    }<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    return write(dos, header, param, cellBlock, totalSize);<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  }<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>  private static int write(final OutputStream dos, final Message header, final Message param,<a name="line.69"></a>
+<span class="sourceLineNo">070</span>      final ByteBuffer cellBlock, final int totalSize) throws IOException {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    // I confirmed toBytes does same as DataOutputStream#writeInt.<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    dos.write(Bytes.toBytes(totalSize));<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    // This allocates a buffer that is the size of the message internally.<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    header.writeDelimitedTo(dos);<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    if (param != null) {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>      param.writeDelimitedTo(dos);<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    }<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    if (cellBlock != null) {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>      dos.write(cellBlock.array(), 0, cellBlock.remaining());<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    }<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    dos.flush();<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    return totalSize;<a name="line.82"></a>
+<span class="sourceLineNo">083</span>  }<a name="line.83"></a>
+<span class="sourceLineNo">084</span><a name="line.84"></a>
+<span class="sourceLineNo">085</span>  /**<a name="line.85"></a>
+<span class="sourceLineNo">086</span>   * @return Size on the wire when the two messages are written with writeDelimitedTo<a name="line.86"></a>
+<span class="sourceLineNo">087</span>   */<a name="line.87"></a>
+<span class="sourceLineNo">088</span>  public static int getTotalSizeWhenWrittenDelimited(Message... messages) {<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    int totalSize = 0;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    for (Message m : messages) {<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      if (m == null) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>        continue;<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      }<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      totalSize += m.getSerializedSize();<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      totalSize += CodedOutputStream.computeRawVarint32Size(m.getSerializedSize());<a name="line.95"></a>
+<span class="sourceLineNo">096</span>    }<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    Preconditions.checkArgument(totalSize &lt; Integer.MAX_VALUE);<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    return totalSize;<a name="line.98"></a>
+<span class="sourceLineNo">099</span>  }<a name="line.99"></a>
+<span class="sourceLineNo">100</span><a name="line.100"></a>
+<span class="sourceLineNo">101</span>  static RequestHeader buildRequestHeader(Call call, CellBlockMeta cellBlockMeta) {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    RequestHeader.Builder builder = RequestHeader.newBuilder();<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    builder.setCallId(call.id);<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    //TODO handle htrace API change, see HBASE-18895<a name="line.104"></a>
+<span class="sourceLineNo">105</span>    /*if (call.span != null) {<a name="line.105"></a>
 <span class="sourceLineNo">106</span>      builder.setTraceInfo(RPCTInfo.newBuilder().setParentId(call.span.getSpanId())<a name="line.106"></a>
-<span class="sourceLineNo">107</span>          .setTraceId(call.span.getTraceId()));<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    }<a name="line.108"></a>
+<span class="sourceLineNo">107</span>          .setTraceId(call.span.getTracerId()));<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    }*/<a name="line.108"></a>
 <span class="sourceLineNo">109</span>    builder.setMethodName(call.md.getName());<a name="line.109"></a>
 <span class="sourceLineNo">110</span>    builder.setRequestParam(call.param != null);<a name="line.110"></a>
 <span class="sourceLineNo">111</span>    if (cellBlockMeta != null) {<a name="line.111"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcServer.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcServer.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcServer.html
index f3dab4f..c4f26fd 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcServer.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcServer.html
@@ -189,7 +189,7 @@
 <span class="sourceLineNo">181</span>      Message param, CellScanner cellScanner, long receiveTime, MonitoredRPCHandler status,<a name="line.181"></a>
 <span class="sourceLineNo">182</span>      long startTime, int timeout) throws IOException {<a name="line.182"></a>
 <span class="sourceLineNo">183</span>    NettyServerCall fakeCall = new NettyServerCall(-1, service, md, null, param, cellScanner, null,<a name="line.183"></a>
-<span class="sourceLineNo">184</span>        -1, null, null, receiveTime, timeout, reservoir, cellBlockBuilder, null);<a name="line.184"></a>
+<span class="sourceLineNo">184</span>        -1, null, receiveTime, timeout, reservoir, cellBlockBuilder, null);<a name="line.184"></a>
 <span class="sourceLineNo">185</span>    return call(fakeCall, status);<a name="line.185"></a>
 <span class="sourceLineNo">186</span>  }<a name="line.186"></a>
 <span class="sourceLineNo">187</span>}<a name="line.187"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerCall.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerCall.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerCall.html
index 0d246ed..22832ae 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerCall.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerCall.html
@@ -36,35 +36,34 @@
 <span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.MethodDescriptor;<a name="line.28"></a>
 <span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.shaded.com.google.protobuf.Message;<a name="line.29"></a>
 <span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.htrace.TraceInfo;<a name="line.31"></a>
-<span class="sourceLineNo">032</span><a name="line.32"></a>
-<span class="sourceLineNo">033</span>/**<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * Datastructure that holds all necessary to a method invocation and then afterward, carries the<a name="line.34"></a>
-<span class="sourceLineNo">035</span> * result.<a name="line.35"></a>
-<span class="sourceLineNo">036</span> * @since 2.0.0<a name="line.36"></a>
-<span class="sourceLineNo">037</span> */<a name="line.37"></a>
-<span class="sourceLineNo">038</span>@InterfaceAudience.Private<a name="line.38"></a>
-<span class="sourceLineNo">039</span>class NettyServerCall extends ServerCall&lt;NettyServerRpcConnection&gt; {<a name="line.39"></a>
-<span class="sourceLineNo">040</span><a name="line.40"></a>
-<span class="sourceLineNo">041</span>  NettyServerCall(int id, BlockingService service, MethodDescriptor md, RequestHeader header,<a name="line.41"></a>
-<span class="sourceLineNo">042</span>      Message param, CellScanner cellScanner, NettyServerRpcConnection connection, long size,<a name="line.42"></a>
-<span class="sourceLineNo">043</span>      TraceInfo tinfo, InetAddress remoteAddress, long receiveTime, int timeout,<a name="line.43"></a>
-<span class="sourceLineNo">044</span>      ByteBufferPool reservoir, CellBlockBuilder cellBlockBuilder, CallCleanup reqCleanup) {<a name="line.44"></a>
-<span class="sourceLineNo">045</span>    super(id, service, md, header, param, cellScanner, connection, size, tinfo, remoteAddress,<a name="line.45"></a>
-<span class="sourceLineNo">046</span>        receiveTime, timeout, reservoir, cellBlockBuilder, reqCleanup);<a name="line.46"></a>
-<span class="sourceLineNo">047</span>  }<a name="line.47"></a>
-<span class="sourceLineNo">048</span><a name="line.48"></a>
-<span class="sourceLineNo">049</span>  /**<a name="line.49"></a>
-<span class="sourceLineNo">050</span>   * If we have a response, and delay is not set, then respond immediately. Otherwise, do not<a name="line.50"></a>
-<span class="sourceLineNo">051</span>   * respond to client. This is called by the RPC code in the context of the Handler thread.<a name="line.51"></a>
-<span class="sourceLineNo">052</span>   */<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  @Override<a name="line.53"></a>
-<span class="sourceLineNo">054</span>  public synchronized void sendResponseIfReady() throws IOException {<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    // set param null to reduce memory pressure<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    this.param = null;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>    connection.channel.writeAndFlush(this);<a name="line.57"></a>
-<span class="sourceLineNo">058</span>  }<a name="line.58"></a>
-<span class="sourceLineNo">059</span>}<a name="line.59"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>/**<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * Datastructure that holds all necessary to a method invocation and then afterward, carries the<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * result.<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * @since 2.0.0<a name="line.35"></a>
+<span class="sourceLineNo">036</span> */<a name="line.36"></a>
+<span class="sourceLineNo">037</span>@InterfaceAudience.Private<a name="line.37"></a>
+<span class="sourceLineNo">038</span>class NettyServerCall extends ServerCall&lt;NettyServerRpcConnection&gt; {<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span>  NettyServerCall(int id, BlockingService service, MethodDescriptor md, RequestHeader header,<a name="line.40"></a>
+<span class="sourceLineNo">041</span>      Message param, CellScanner cellScanner, NettyServerRpcConnection connection, long size,<a name="line.41"></a>
+<span class="sourceLineNo">042</span>      InetAddress remoteAddress, long receiveTime, int timeout,<a name="line.42"></a>
+<span class="sourceLineNo">043</span>      ByteBufferPool reservoir, CellBlockBuilder cellBlockBuilder, CallCleanup reqCleanup) {<a name="line.43"></a>
+<span class="sourceLineNo">044</span>    super(id, service, md, header, param, cellScanner, connection, size, remoteAddress,<a name="line.44"></a>
+<span class="sourceLineNo">045</span>        receiveTime, timeout, reservoir, cellBlockBuilder, reqCleanup);<a name="line.45"></a>
+<span class="sourceLineNo">046</span>  }<a name="line.46"></a>
+<span class="sourceLineNo">047</span><a name="line.47"></a>
+<span class="sourceLineNo">048</span>  /**<a name="line.48"></a>
+<span class="sourceLineNo">049</span>   * If we have a response, and delay is not set, then respond immediately. Otherwise, do not<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   * respond to client. This is called by the RPC code in the context of the Handler thread.<a name="line.50"></a>
+<span class="sourceLineNo">051</span>   */<a name="line.51"></a>
+<span class="sourceLineNo">052</span>  @Override<a name="line.52"></a>
+<span class="sourceLineNo">053</span>  public synchronized void sendResponseIfReady() throws IOException {<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    // set param null to reduce memory pressure<a name="line.54"></a>
+<span class="sourceLineNo">055</span>    this.param = null;<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    connection.channel.writeAndFlush(this);<a name="line.56"></a>
+<span class="sourceLineNo">057</span>  }<a name="line.57"></a>
+<span class="sourceLineNo">058</span>}<a name="line.58"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerRpcConnection.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerRpcConnection.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerRpcConnection.html
index 84aaaee..a5a0019 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerRpcConnection.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyServerRpcConnection.html
@@ -42,103 +42,102 @@
 <span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.MethodDescriptor;<a name="line.34"></a>
 <span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.shaded.com.google.protobuf.Message;<a name="line.35"></a>
 <span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import org.apache.htrace.TraceInfo;<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> * RpcConnection implementation for netty rpc server.<a name="line.40"></a>
-<span class="sourceLineNo">041</span> * @since 2.0.0<a name="line.41"></a>
-<span class="sourceLineNo">042</span> */<a name="line.42"></a>
-<span class="sourceLineNo">043</span>@InterfaceAudience.Private<a name="line.43"></a>
-<span class="sourceLineNo">044</span>class NettyServerRpcConnection extends ServerRpcConnection {<a name="line.44"></a>
-<span class="sourceLineNo">045</span><a name="line.45"></a>
-<span class="sourceLineNo">046</span>  final Channel channel;<a name="line.46"></a>
-<span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>  NettyServerRpcConnection(NettyRpcServer rpcServer, Channel channel) {<a name="line.48"></a>
-<span class="sourceLineNo">049</span>    super(rpcServer);<a name="line.49"></a>
-<span class="sourceLineNo">050</span>    this.channel = channel;<a name="line.50"></a>
-<span class="sourceLineNo">051</span>    InetSocketAddress inetSocketAddress = ((InetSocketAddress) channel.remoteAddress());<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    this.addr = inetSocketAddress.getAddress();<a name="line.52"></a>
-<span class="sourceLineNo">053</span>    if (addr == null) {<a name="line.53"></a>
-<span class="sourceLineNo">054</span>      this.hostAddress = "*Unknown*";<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    } else {<a name="line.55"></a>
-<span class="sourceLineNo">056</span>      this.hostAddress = inetSocketAddress.getAddress().getHostAddress();<a name="line.56"></a>
-<span class="sourceLineNo">057</span>    }<a name="line.57"></a>
-<span class="sourceLineNo">058</span>    this.remotePort = inetSocketAddress.getPort();<a name="line.58"></a>
-<span class="sourceLineNo">059</span>  }<a name="line.59"></a>
-<span class="sourceLineNo">060</span><a name="line.60"></a>
-<span class="sourceLineNo">061</span>  void process(final ByteBuf buf) throws IOException, InterruptedException {<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    if (connectionHeaderRead) {<a name="line.62"></a>
-<span class="sourceLineNo">063</span>      this.callCleanup = new RpcServer.CallCleanup() {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        @Override<a name="line.64"></a>
-<span class="sourceLineNo">065</span>        public void run() {<a name="line.65"></a>
-<span class="sourceLineNo">066</span>          buf.release();<a name="line.66"></a>
-<span class="sourceLineNo">067</span>        }<a name="line.67"></a>
-<span class="sourceLineNo">068</span>      };<a name="line.68"></a>
-<span class="sourceLineNo">069</span>      process(new SingleByteBuff(buf.nioBuffer()));<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    } else {<a name="line.70"></a>
-<span class="sourceLineNo">071</span>      ByteBuffer connectionHeader = ByteBuffer.allocate(buf.readableBytes());<a name="line.71"></a>
-<span class="sourceLineNo">072</span>      buf.readBytes(connectionHeader);<a name="line.72"></a>
-<span class="sourceLineNo">073</span>      buf.release();<a name="line.73"></a>
-<span class="sourceLineNo">074</span>      process(connectionHeader);<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    }<a name="line.75"></a>
-<span class="sourceLineNo">076</span>  }<a name="line.76"></a>
-<span class="sourceLineNo">077</span><a name="line.77"></a>
-<span class="sourceLineNo">078</span>  void process(ByteBuffer buf) throws IOException, InterruptedException {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    process(new SingleByteBuff(buf));<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>  void process(ByteBuff buf) throws IOException, InterruptedException {<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    try {<a name="line.83"></a>
-<span class="sourceLineNo">084</span>      if (skipInitialSaslHandshake) {<a name="line.84"></a>
-<span class="sourceLineNo">085</span>        skipInitialSaslHandshake = false;<a name="line.85"></a>
-<span class="sourceLineNo">086</span>        if (callCleanup != null) {<a name="line.86"></a>
-<span class="sourceLineNo">087</span>          callCleanup.run();<a name="line.87"></a>
-<span class="sourceLineNo">088</span>        }<a name="line.88"></a>
-<span class="sourceLineNo">089</span>        return;<a name="line.89"></a>
-<span class="sourceLineNo">090</span>      }<a name="line.90"></a>
-<span class="sourceLineNo">091</span><a name="line.91"></a>
-<span class="sourceLineNo">092</span>      if (useSasl) {<a name="line.92"></a>
-<span class="sourceLineNo">093</span>        saslReadAndProcess(buf);<a name="line.93"></a>
-<span class="sourceLineNo">094</span>      } else {<a name="line.94"></a>
-<span class="sourceLineNo">095</span>        processOneRpc(buf);<a name="line.95"></a>
-<span class="sourceLineNo">096</span>      }<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    } catch (Exception e) {<a name="line.97"></a>
-<span class="sourceLineNo">098</span>      if (callCleanup != null) {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>        callCleanup.run();<a name="line.99"></a>
-<span class="sourceLineNo">100</span>      }<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      throw e;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    } finally {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>      this.callCleanup = null;<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>  @Override<a name="line.107"></a>
-<span class="sourceLineNo">108</span>  public synchronized void close() {<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    disposeSasl();<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    channel.close();<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    callCleanup = null;<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  }<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>  @Override<a name="line.114"></a>
-<span class="sourceLineNo">115</span>  public boolean isConnectionOpen() {<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    return channel.isOpen();<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  }<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  @Override<a name="line.119"></a>
-<span class="sourceLineNo">120</span>  public NettyServerCall createCall(int id, final BlockingService service,<a name="line.120"></a>
-<span class="sourceLineNo">121</span>      final MethodDescriptor md, RequestHeader header, Message param, CellScanner cellScanner,<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      long size, TraceInfo tinfo, final InetAddress remoteAddress, int timeout,<a name="line.122"></a>
-<span class="sourceLineNo">123</span>      CallCleanup reqCleanup) {<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    return new NettyServerCall(id, service, md, header, param, cellScanner, this, size, tinfo,<a name="line.124"></a>
-<span class="sourceLineNo">125</span>        remoteAddress, System.currentTimeMillis(), timeout, this.rpcServer.reservoir,<a name="line.125"></a>
-<span class="sourceLineNo">126</span>        this.rpcServer.cellBlockBuilder, reqCleanup);<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>  @Override<a name="line.129"></a>
-<span class="sourceLineNo">130</span>  protected void doRespond(RpcResponse resp) {<a name="line.130"></a>
-<span class="sourceLineNo">131</span>    channel.writeAndFlush(resp);<a name="line.131"></a>
-<span class="sourceLineNo">132</span>  }<a name="line.132"></a>
-<span class="sourceLineNo">133</span>}<a name="line.133"></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> * RpcConnection implementation for netty rpc server.<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * @since 2.0.0<a name="line.40"></a>
+<span class="sourceLineNo">041</span> */<a name="line.41"></a>
+<span class="sourceLineNo">042</span>@InterfaceAudience.Private<a name="line.42"></a>
+<span class="sourceLineNo">043</span>class NettyServerRpcConnection extends ServerRpcConnection {<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>  final Channel channel;<a name="line.45"></a>
+<span class="sourceLineNo">046</span><a name="line.46"></a>
+<span class="sourceLineNo">047</span>  NettyServerRpcConnection(NettyRpcServer rpcServer, Channel channel) {<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    super(rpcServer);<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    this.channel = channel;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    InetSocketAddress inetSocketAddress = ((InetSocketAddress) channel.remoteAddress());<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    this.addr = inetSocketAddress.getAddress();<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    if (addr == null) {<a name="line.52"></a>
+<span class="sourceLineNo">053</span>      this.hostAddress = "*Unknown*";<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    } else {<a name="line.54"></a>
+<span class="sourceLineNo">055</span>      this.hostAddress = inetSocketAddress.getAddress().getHostAddress();<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    }<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    this.remotePort = inetSocketAddress.getPort();<a name="line.57"></a>
+<span class="sourceLineNo">058</span>  }<a name="line.58"></a>
+<span class="sourceLineNo">059</span><a name="line.59"></a>
+<span class="sourceLineNo">060</span>  void process(final ByteBuf buf) throws IOException, InterruptedException {<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    if (connectionHeaderRead) {<a name="line.61"></a>
+<span class="sourceLineNo">062</span>      this.callCleanup = new RpcServer.CallCleanup() {<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        @Override<a name="line.63"></a>
+<span class="sourceLineNo">064</span>        public void run() {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>          buf.release();<a name="line.65"></a>
+<span class="sourceLineNo">066</span>        }<a name="line.66"></a>
+<span class="sourceLineNo">067</span>      };<a name="line.67"></a>
+<span class="sourceLineNo">068</span>      process(new SingleByteBuff(buf.nioBuffer()));<a name="line.68"></a>
+<span class="sourceLineNo">069</span>    } else {<a name="line.69"></a>
+<span class="sourceLineNo">070</span>      ByteBuffer connectionHeader = ByteBuffer.allocate(buf.readableBytes());<a name="line.70"></a>
+<span class="sourceLineNo">071</span>      buf.readBytes(connectionHeader);<a name="line.71"></a>
+<span class="sourceLineNo">072</span>      buf.release();<a name="line.72"></a>
+<span class="sourceLineNo">073</span>      process(connectionHeader);<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    }<a name="line.74"></a>
+<span class="sourceLineNo">075</span>  }<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>  void process(ByteBuffer buf) throws IOException, InterruptedException {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    process(new SingleByteBuff(buf));<a name="line.78"></a>
+<span class="sourceLineNo">079</span>  }<a name="line.79"></a>
+<span class="sourceLineNo">080</span><a name="line.80"></a>
+<span class="sourceLineNo">081</span>  void process(ByteBuff buf) throws IOException, InterruptedException {<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    try {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>      if (skipInitialSaslHandshake) {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>        skipInitialSaslHandshake = false;<a name="line.84"></a>
+<span class="sourceLineNo">085</span>        if (callCleanup != null) {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>          callCleanup.run();<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        }<a name="line.87"></a>
+<span class="sourceLineNo">088</span>        return;<a name="line.88"></a>
+<span class="sourceLineNo">089</span>      }<a name="line.89"></a>
+<span class="sourceLineNo">090</span><a name="line.90"></a>
+<span class="sourceLineNo">091</span>      if (useSasl) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>        saslReadAndProcess(buf);<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      } else {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>        processOneRpc(buf);<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      }<a name="line.95"></a>
+<span class="sourceLineNo">096</span>    } catch (Exception e) {<a name="line.96"></a>
+<span class="sourceLineNo">097</span>      if (callCleanup != null) {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        callCleanup.run();<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      }<a name="line.99"></a>
+<span class="sourceLineNo">100</span>      throw e;<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    } finally {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>      this.callCleanup = null;<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    }<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>  @Override<a name="line.106"></a>
+<span class="sourceLineNo">107</span>  public synchronized void close() {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    disposeSasl();<a name="line.108"></a>
+<span class="sourceLineNo">109</span>    channel.close();<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    callCleanup = null;<a name="line.110"></a>
+<span class="sourceLineNo">111</span>  }<a name="line.111"></a>
+<span class="sourceLineNo">112</span><a name="line.112"></a>
+<span class="sourceLineNo">113</span>  @Override<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  public boolean isConnectionOpen() {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    return channel.isOpen();<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>  @Override<a name="line.118"></a>
+<span class="sourceLineNo">119</span>  public NettyServerCall createCall(int id, final BlockingService service,<a name="line.119"></a>
+<span class="sourceLineNo">120</span>      final MethodDescriptor md, RequestHeader header, Message param, CellScanner cellScanner,<a name="line.120"></a>
+<span class="sourceLineNo">121</span>      long size, final InetAddress remoteAddress, int timeout,<a name="line.121"></a>
+<span class="sourceLineNo">122</span>      CallCleanup reqCleanup) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    return new NettyServerCall(id, service, md, header, param, cellScanner, this, size,<a name="line.123"></a>
+<span class="sourceLineNo">124</span>        remoteAddress, System.currentTimeMillis(), timeout, this.rpcServer.reservoir,<a name="line.124"></a>
+<span class="sourceLineNo">125</span>        this.rpcServer.cellBlockBuilder, reqCleanup);<a name="line.125"></a>
+<span class="sourceLineNo">126</span>  }<a name="line.126"></a>
+<span class="sourceLineNo">127</span><a name="line.127"></a>
+<span class="sourceLineNo">128</span>  @Override<a name="line.128"></a>
+<span class="sourceLineNo">129</span>  protected void doRespond(RpcResponse resp) {<a name="line.129"></a>
+<span class="sourceLineNo">130</span>    channel.writeAndFlush(resp);<a name="line.130"></a>
+<span class="sourceLineNo">131</span>  }<a name="line.131"></a>
+<span class="sourceLineNo">132</span>}<a name="line.132"></a>
 
 
 


Mime
View raw message