hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [07/12] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Sun, 21 May 2017 14:59:25 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1a880974/devapidocs/src-html/org/apache/hadoop/hbase/ipc/SimpleServerRpcConnection.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/SimpleServerRpcConnection.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/SimpleServerRpcConnection.html
index ff541c9..dedc08e 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/SimpleServerRpcConnection.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/SimpleServerRpcConnection.html
@@ -71,369 +71,365 @@
 <span class="sourceLineNo">063</span>  final SocketChannel channel;<a name="line.63"></a>
 <span class="sourceLineNo">064</span>  private ByteBuff data;<a name="line.64"></a>
 <span class="sourceLineNo">065</span>  private ByteBuffer dataLengthBuffer;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>  protected final ConcurrentLinkedDeque&lt;SimpleServerCall&gt; responseQueue =<a name="line.66"></a>
-<span class="sourceLineNo">067</span>      new ConcurrentLinkedDeque&lt;&gt;();<a name="line.67"></a>
-<span class="sourceLineNo">068</span>  final Lock responseWriteLock = new ReentrantLock();<a name="line.68"></a>
-<span class="sourceLineNo">069</span>  private final LongAdder rpcCount = new LongAdder(); // number of outstanding rpcs<a name="line.69"></a>
-<span class="sourceLineNo">070</span>  private long lastContact;<a name="line.70"></a>
-<span class="sourceLineNo">071</span>  private final Socket socket;<a name="line.71"></a>
-<span class="sourceLineNo">072</span>  private final SimpleRpcServerResponder responder;<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>  public SimpleServerRpcConnection(SimpleRpcServer rpcServer, SocketChannel channel,<a name="line.74"></a>
-<span class="sourceLineNo">075</span>      long lastContact) {<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    super(rpcServer);<a name="line.76"></a>
-<span class="sourceLineNo">077</span>    this.channel = channel;<a name="line.77"></a>
-<span class="sourceLineNo">078</span>    this.lastContact = lastContact;<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    this.data = null;<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    this.dataLengthBuffer = ByteBuffer.allocate(4);<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    this.socket = channel.socket();<a name="line.81"></a>
-<span class="sourceLineNo">082</span>    this.addr = socket.getInetAddress();<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    if (addr == null) {<a name="line.83"></a>
-<span class="sourceLineNo">084</span>      this.hostAddress = "*Unknown*";<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    } else {<a name="line.85"></a>
-<span class="sourceLineNo">086</span>      this.hostAddress = addr.getHostAddress();<a name="line.86"></a>
-<span class="sourceLineNo">087</span>    }<a name="line.87"></a>
-<span class="sourceLineNo">088</span>    this.remotePort = socket.getPort();<a name="line.88"></a>
-<span class="sourceLineNo">089</span>    if (rpcServer.socketSendBufferSize != 0) {<a name="line.89"></a>
-<span class="sourceLineNo">090</span>      try {<a name="line.90"></a>
-<span class="sourceLineNo">091</span>        socket.setSendBufferSize(rpcServer.socketSendBufferSize);<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      } catch (IOException e) {<a name="line.92"></a>
-<span class="sourceLineNo">093</span>        SimpleRpcServer.LOG.warn(<a name="line.93"></a>
-<span class="sourceLineNo">094</span>          "Connection: unable to set socket send buffer size to " + rpcServer.socketSendBufferSize);<a name="line.94"></a>
-<span class="sourceLineNo">095</span>      }<a name="line.95"></a>
-<span class="sourceLineNo">096</span>    }<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    this.saslCall = new SimpleServerCall(SASL_CALLID, null, null, null, null, null, this, 0, null,<a name="line.97"></a>
-<span class="sourceLineNo">098</span>        null, System.currentTimeMillis(), 0, rpcServer.reservoir, rpcServer.cellBlockBuilder, null,<a name="line.98"></a>
-<span class="sourceLineNo">099</span>        rpcServer.responder);<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    this.setConnectionHeaderResponseCall = new SimpleServerCall(CONNECTION_HEADER_RESPONSE_CALLID,<a name="line.100"></a>
-<span class="sourceLineNo">101</span>        null, null, null, null, null, this, 0, null, null, System.currentTimeMillis(), 0,<a name="line.101"></a>
-<span class="sourceLineNo">102</span>        rpcServer.reservoir, rpcServer.cellBlockBuilder, null, rpcServer.responder);<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    this.authFailedCall = new SimpleServerCall(AUTHORIZATION_FAILED_CALLID, null, null, null, null,<a name="line.103"></a>
-<span class="sourceLineNo">104</span>        null, this, 0, null, null, System.currentTimeMillis(), 0, rpcServer.reservoir,<a name="line.104"></a>
-<span class="sourceLineNo">105</span>        rpcServer.cellBlockBuilder, null, rpcServer.responder);<a name="line.105"></a>
-<span class="sourceLineNo">106</span>    this.responder = rpcServer.responder;<a name="line.106"></a>
-<span class="sourceLineNo">107</span>  }<a name="line.107"></a>
-<span class="sourceLineNo">108</span><a name="line.108"></a>
-<span class="sourceLineNo">109</span>  public void setLastContact(long lastContact) {<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    this.lastContact = lastContact;<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>  public long getLastContact() {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    return lastContact;<a name="line.114"></a>
-<span class="sourceLineNo">115</span>  }<a name="line.115"></a>
-<span class="sourceLineNo">116</span><a name="line.116"></a>
-<span class="sourceLineNo">117</span>  /* Return true if the connection has no outstanding rpc */<a name="line.117"></a>
-<span class="sourceLineNo">118</span>  boolean isIdle() {<a name="line.118"></a>
-<span class="sourceLineNo">119</span>    return rpcCount.sum() == 0;<a name="line.119"></a>
-<span class="sourceLineNo">120</span>  }<a name="line.120"></a>
-<span class="sourceLineNo">121</span><a name="line.121"></a>
-<span class="sourceLineNo">122</span>  /* Decrement the outstanding RPC count */<a name="line.122"></a>
-<span class="sourceLineNo">123</span>  protected void decRpcCount() {<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    rpcCount.decrement();<a name="line.124"></a>
-<span class="sourceLineNo">125</span>  }<a name="line.125"></a>
-<span class="sourceLineNo">126</span><a name="line.126"></a>
-<span class="sourceLineNo">127</span>  /* Increment the outstanding RPC count */<a name="line.127"></a>
-<span class="sourceLineNo">128</span>  protected void incRpcCount() {<a name="line.128"></a>
-<span class="sourceLineNo">129</span>    rpcCount.increment();<a name="line.129"></a>
-<span class="sourceLineNo">130</span>  }<a name="line.130"></a>
-<span class="sourceLineNo">131</span><a name="line.131"></a>
-<span class="sourceLineNo">132</span>  private int readPreamble() throws IOException {<a name="line.132"></a>
-<span class="sourceLineNo">133</span>    int count;<a name="line.133"></a>
-<span class="sourceLineNo">134</span>    // Check for 'HBas' magic.<a name="line.134"></a>
-<span class="sourceLineNo">135</span>    this.dataLengthBuffer.flip();<a name="line.135"></a>
-<span class="sourceLineNo">136</span>    if (!Arrays.equals(HConstants.RPC_HEADER, dataLengthBuffer.array())) {<a name="line.136"></a>
-<span class="sourceLineNo">137</span>      return doBadPreambleHandling(<a name="line.137"></a>
-<span class="sourceLineNo">138</span>        "Expected HEADER=" + Bytes.toStringBinary(HConstants.RPC_HEADER) + " but received HEADER=" +<a name="line.138"></a>
-<span class="sourceLineNo">139</span>            Bytes.toStringBinary(dataLengthBuffer.array()) + " from " + toString());<a name="line.139"></a>
+<span class="sourceLineNo">066</span>  private ByteBuffer preambleBuffer;<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  protected final ConcurrentLinkedDeque&lt;SimpleServerCall&gt; responseQueue =<a name="line.67"></a>
+<span class="sourceLineNo">068</span>      new ConcurrentLinkedDeque&lt;&gt;();<a name="line.68"></a>
+<span class="sourceLineNo">069</span>  final Lock responseWriteLock = new ReentrantLock();<a name="line.69"></a>
+<span class="sourceLineNo">070</span>  private final LongAdder rpcCount = new LongAdder(); // number of outstanding rpcs<a name="line.70"></a>
+<span class="sourceLineNo">071</span>  private long lastContact;<a name="line.71"></a>
+<span class="sourceLineNo">072</span>  private final Socket socket;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>  private final SimpleRpcServerResponder responder;<a name="line.73"></a>
+<span class="sourceLineNo">074</span><a name="line.74"></a>
+<span class="sourceLineNo">075</span>  public SimpleServerRpcConnection(SimpleRpcServer rpcServer, SocketChannel channel,<a name="line.75"></a>
+<span class="sourceLineNo">076</span>      long lastContact) {<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    super(rpcServer);<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    this.channel = channel;<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    this.lastContact = lastContact;<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    this.data = null;<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    this.dataLengthBuffer = ByteBuffer.allocate(4);<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    this.socket = channel.socket();<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    this.addr = socket.getInetAddress();<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    if (addr == null) {<a name="line.84"></a>
+<span class="sourceLineNo">085</span>      this.hostAddress = "*Unknown*";<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    } else {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>      this.hostAddress = addr.getHostAddress();<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    }<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    this.remotePort = socket.getPort();<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    if (rpcServer.socketSendBufferSize != 0) {<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      try {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>        socket.setSendBufferSize(rpcServer.socketSendBufferSize);<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      } catch (IOException e) {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>        SimpleRpcServer.LOG.warn(<a name="line.94"></a>
+<span class="sourceLineNo">095</span>          "Connection: unable to set socket send buffer size to " + rpcServer.socketSendBufferSize);<a name="line.95"></a>
+<span class="sourceLineNo">096</span>      }<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    }<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    this.saslCall = new SimpleServerCall(SASL_CALLID, null, null, null, null, null, this, 0, null,<a name="line.98"></a>
+<span class="sourceLineNo">099</span>        null, System.currentTimeMillis(), 0, rpcServer.reservoir, rpcServer.cellBlockBuilder, null,<a name="line.99"></a>
+<span class="sourceLineNo">100</span>        rpcServer.responder);<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    this.setConnectionHeaderResponseCall = new SimpleServerCall(CONNECTION_HEADER_RESPONSE_CALLID,<a name="line.101"></a>
+<span class="sourceLineNo">102</span>        null, null, null, null, null, this, 0, null, null, System.currentTimeMillis(), 0,<a name="line.102"></a>
+<span class="sourceLineNo">103</span>        rpcServer.reservoir, rpcServer.cellBlockBuilder, null, rpcServer.responder);<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    this.authFailedCall = new SimpleServerCall(AUTHORIZATION_FAILED_CALLID, null, null, null, null,<a name="line.104"></a>
+<span class="sourceLineNo">105</span>        null, this, 0, null, null, System.currentTimeMillis(), 0, rpcServer.reservoir,<a name="line.105"></a>
+<span class="sourceLineNo">106</span>        rpcServer.cellBlockBuilder, null, rpcServer.responder);<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    this.responder = rpcServer.responder;<a name="line.107"></a>
+<span class="sourceLineNo">108</span>  }<a name="line.108"></a>
+<span class="sourceLineNo">109</span><a name="line.109"></a>
+<span class="sourceLineNo">110</span>  public void setLastContact(long lastContact) {<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    this.lastContact = lastContact;<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>  public long getLastContact() {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    return lastContact;<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>  /* Return true if the connection has no outstanding rpc */<a name="line.118"></a>
+<span class="sourceLineNo">119</span>  boolean isIdle() {<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    return rpcCount.sum() == 0;<a name="line.120"></a>
+<span class="sourceLineNo">121</span>  }<a name="line.121"></a>
+<span class="sourceLineNo">122</span><a name="line.122"></a>
+<span class="sourceLineNo">123</span>  /* Decrement the outstanding RPC count */<a name="line.123"></a>
+<span class="sourceLineNo">124</span>  protected void decRpcCount() {<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    rpcCount.decrement();<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>  /* Increment the outstanding RPC count */<a name="line.128"></a>
+<span class="sourceLineNo">129</span>  protected void incRpcCount() {<a name="line.129"></a>
+<span class="sourceLineNo">130</span>    rpcCount.increment();<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>
+<span class="sourceLineNo">133</span>  private int readPreamble() throws IOException {<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    if (preambleBuffer == null) {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>      preambleBuffer = ByteBuffer.allocate(6);<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    }<a name="line.136"></a>
+<span class="sourceLineNo">137</span>    int count = this.rpcServer.channelRead(channel, preambleBuffer);<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    if (count &lt; 0 || preambleBuffer.remaining() &gt; 0) {<a name="line.138"></a>
+<span class="sourceLineNo">139</span>      return count;<a name="line.139"></a>
 <span class="sourceLineNo">140</span>    }<a name="line.140"></a>
-<span class="sourceLineNo">141</span>    // Now read the next two bytes, the version and the auth to use.<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    ByteBuffer versionAndAuthBytes = ByteBuffer.allocate(2);<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    count = this.rpcServer.channelRead(channel, versionAndAuthBytes);<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    if (count &lt; 0 || versionAndAuthBytes.remaining() &gt; 0) {<a name="line.144"></a>
-<span class="sourceLineNo">145</span>      return count;<a name="line.145"></a>
-<span class="sourceLineNo">146</span>    }<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    int version = versionAndAuthBytes.get(0);<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    byte authbyte = versionAndAuthBytes.get(1);<a name="line.148"></a>
-<span class="sourceLineNo">149</span>    this.authMethod = AuthMethod.valueOf(authbyte);<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    if (version != SimpleRpcServer.CURRENT_VERSION) {<a name="line.150"></a>
-<span class="sourceLineNo">151</span>      String msg = getFatalConnectionString(version, authbyte);<a name="line.151"></a>
-<span class="sourceLineNo">152</span>      return doBadPreambleHandling(msg, new WrongVersionException(msg));<a name="line.152"></a>
-<span class="sourceLineNo">153</span>    }<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    if (authMethod == null) {<a name="line.154"></a>
+<span class="sourceLineNo">141</span>    // Check for 'HBas' magic.<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    preambleBuffer.flip();<a name="line.142"></a>
+<span class="sourceLineNo">143</span>    for (int i = 0; i &lt; HConstants.RPC_HEADER.length; i++) {<a name="line.143"></a>
+<span class="sourceLineNo">144</span>      if (HConstants.RPC_HEADER[i] != preambleBuffer.get(i)) {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        return doBadPreambleHandling("Expected HEADER=" +<a name="line.145"></a>
+<span class="sourceLineNo">146</span>            Bytes.toStringBinary(HConstants.RPC_HEADER) + " but received HEADER=" +<a name="line.146"></a>
+<span class="sourceLineNo">147</span>            Bytes.toStringBinary(preambleBuffer.array(), 0, HConstants.RPC_HEADER.length) +<a name="line.147"></a>
+<span class="sourceLineNo">148</span>            " from " + toString());<a name="line.148"></a>
+<span class="sourceLineNo">149</span>      }<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    }<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    int version = preambleBuffer.get(HConstants.RPC_HEADER.length);<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    byte authbyte = preambleBuffer.get(HConstants.RPC_HEADER.length + 1);<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    this.authMethod = AuthMethod.valueOf(authbyte);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    if (version != SimpleRpcServer.CURRENT_VERSION) {<a name="line.154"></a>
 <span class="sourceLineNo">155</span>      String msg = getFatalConnectionString(version, authbyte);<a name="line.155"></a>
-<span class="sourceLineNo">156</span>      return doBadPreambleHandling(msg, new BadAuthException(msg));<a name="line.156"></a>
+<span class="sourceLineNo">156</span>      return doBadPreambleHandling(msg, new WrongVersionException(msg));<a name="line.156"></a>
 <span class="sourceLineNo">157</span>    }<a name="line.157"></a>
-<span class="sourceLineNo">158</span>    if (this.rpcServer.isSecurityEnabled &amp;&amp; authMethod == AuthMethod.SIMPLE) {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>      if (this.rpcServer.allowFallbackToSimpleAuth) {<a name="line.159"></a>
-<span class="sourceLineNo">160</span>        this.rpcServer.metrics.authenticationFallback();<a name="line.160"></a>
-<span class="sourceLineNo">161</span>        authenticatedWithFallback = true;<a name="line.161"></a>
-<span class="sourceLineNo">162</span>      } else {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>        AccessDeniedException ae = new AccessDeniedException("Authentication is required");<a name="line.163"></a>
-<span class="sourceLineNo">164</span>        this.rpcServer.setupResponse(authFailedResponse, authFailedCall, ae, ae.getMessage());<a name="line.164"></a>
-<span class="sourceLineNo">165</span>        authFailedCall.sendResponseIfReady();<a name="line.165"></a>
-<span class="sourceLineNo">166</span>        throw ae;<a name="line.166"></a>
-<span class="sourceLineNo">167</span>      }<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    }<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    if (!this.rpcServer.isSecurityEnabled &amp;&amp; authMethod != AuthMethod.SIMPLE) {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>      doRawSaslReply(SaslStatus.SUCCESS, new IntWritable(SaslUtil.SWITCH_TO_SIMPLE_AUTH), null,<a name="line.170"></a>
-<span class="sourceLineNo">171</span>        null);<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      authMethod = AuthMethod.SIMPLE;<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      // client has already sent the initial Sasl message and we<a name="line.173"></a>
-<span class="sourceLineNo">174</span>      // should ignore it. Both client and server should fall back<a name="line.174"></a>
-<span class="sourceLineNo">175</span>      // to simple auth from now on.<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      skipInitialSaslHandshake = true;<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    }<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    if (authMethod != AuthMethod.SIMPLE) {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>      useSasl = true;<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    }<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>    dataLengthBuffer.clear();<a name="line.182"></a>
-<span class="sourceLineNo">183</span>    connectionPreambleRead = true;<a name="line.183"></a>
-<span class="sourceLineNo">184</span>    return count;<a name="line.184"></a>
-<span class="sourceLineNo">185</span>  }<a name="line.185"></a>
-<span class="sourceLineNo">186</span><a name="line.186"></a>
-<span class="sourceLineNo">187</span>  private int read4Bytes() throws IOException {<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    if (this.dataLengthBuffer.remaining() &gt; 0) {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>      return this.rpcServer.channelRead(channel, this.dataLengthBuffer);<a name="line.189"></a>
-<span class="sourceLineNo">190</span>    } else {<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      return 0;<a name="line.191"></a>
-<span class="sourceLineNo">192</span>    }<a name="line.192"></a>
-<span class="sourceLineNo">193</span>  }<a name="line.193"></a>
-<span class="sourceLineNo">194</span><a name="line.194"></a>
-<span class="sourceLineNo">195</span>  /**<a name="line.195"></a>
-<span class="sourceLineNo">196</span>   * Read off the wire. If there is not enough data to read, update the connection state with what<a name="line.196"></a>
-<span class="sourceLineNo">197</span>   * we have and returns.<a name="line.197"></a>
-<span class="sourceLineNo">198</span>   * @return Returns -1 if failure (and caller will close connection), else zero or more.<a name="line.198"></a>
-<span class="sourceLineNo">199</span>   * @throws IOException<a name="line.199"></a>
-<span class="sourceLineNo">200</span>   * @throws InterruptedException<a name="line.200"></a>
-<span class="sourceLineNo">201</span>   */<a name="line.201"></a>
-<span class="sourceLineNo">202</span>  public int readAndProcess() throws IOException, InterruptedException {<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    // Try and read in an int. If new connection, the int will hold the 'HBas' HEADER. If it<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    // does, read in the rest of the connection preamble, the version and the auth method.<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    // Else it will be length of the data to read (or -1 if a ping). We catch the integer<a name="line.205"></a>
-<span class="sourceLineNo">206</span>    // length into the 4-byte this.dataLengthBuffer.<a name="line.206"></a>
-<span class="sourceLineNo">207</span>    int count = read4Bytes();<a name="line.207"></a>
-<span class="sourceLineNo">208</span>    if (count &lt; 0 || dataLengthBuffer.remaining() &gt; 0) {<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      return count;<a name="line.209"></a>
-<span class="sourceLineNo">210</span>    }<a name="line.210"></a>
-<span class="sourceLineNo">211</span><a name="line.211"></a>
-<span class="sourceLineNo">212</span>    // If we have not read the connection setup preamble, look to see if that is on the wire.<a name="line.212"></a>
-<span class="sourceLineNo">213</span>    if (!connectionPreambleRead) {<a name="line.213"></a>
-<span class="sourceLineNo">214</span>      count = readPreamble();<a name="line.214"></a>
-<span class="sourceLineNo">215</span>      if (!connectionPreambleRead) {<a name="line.215"></a>
-<span class="sourceLineNo">216</span>        return count;<a name="line.216"></a>
-<span class="sourceLineNo">217</span>      }<a name="line.217"></a>
-<span class="sourceLineNo">218</span><a name="line.218"></a>
-<span class="sourceLineNo">219</span>      count = read4Bytes();<a name="line.219"></a>
-<span class="sourceLineNo">220</span>      if (count &lt; 0 || dataLengthBuffer.remaining() &gt; 0) {<a name="line.220"></a>
-<span class="sourceLineNo">221</span>        return count;<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>
-<span class="sourceLineNo">225</span>    // We have read a length and we have read the preamble. It is either the connection header<a name="line.225"></a>
-<span class="sourceLineNo">226</span>    // or it is a request.<a name="line.226"></a>
-<span class="sourceLineNo">227</span>    if (data == null) {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>      dataLengthBuffer.flip();<a name="line.228"></a>
-<span class="sourceLineNo">229</span>      int dataLength = dataLengthBuffer.getInt();<a name="line.229"></a>
-<span class="sourceLineNo">230</span>      if (dataLength == RpcClient.PING_CALL_ID) {<a name="line.230"></a>
-<span class="sourceLineNo">231</span>        if (!useWrap) { // covers the !useSasl too<a name="line.231"></a>
-<span class="sourceLineNo">232</span>          dataLengthBuffer.clear();<a name="line.232"></a>
-<span class="sourceLineNo">233</span>          return 0; // ping message<a name="line.233"></a>
-<span class="sourceLineNo">234</span>        }<a name="line.234"></a>
+<span class="sourceLineNo">158</span>    if (authMethod == null) {<a name="line.158"></a>
+<span class="sourceLineNo">159</span>      String msg = getFatalConnectionString(version, authbyte);<a name="line.159"></a>
+<span class="sourceLineNo">160</span>      return doBadPreambleHandling(msg, new BadAuthException(msg));<a name="line.160"></a>
+<span class="sourceLineNo">161</span>    }<a name="line.161"></a>
+<span class="sourceLineNo">162</span>    if (this.rpcServer.isSecurityEnabled &amp;&amp; authMethod == AuthMethod.SIMPLE) {<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      if (this.rpcServer.allowFallbackToSimpleAuth) {<a name="line.163"></a>
+<span class="sourceLineNo">164</span>        this.rpcServer.metrics.authenticationFallback();<a name="line.164"></a>
+<span class="sourceLineNo">165</span>        authenticatedWithFallback = true;<a name="line.165"></a>
+<span class="sourceLineNo">166</span>      } else {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>        AccessDeniedException ae = new AccessDeniedException("Authentication is required");<a name="line.167"></a>
+<span class="sourceLineNo">168</span>        this.rpcServer.setupResponse(authFailedResponse, authFailedCall, ae, ae.getMessage());<a name="line.168"></a>
+<span class="sourceLineNo">169</span>        authFailedCall.sendResponseIfReady();<a name="line.169"></a>
+<span class="sourceLineNo">170</span>        throw ae;<a name="line.170"></a>
+<span class="sourceLineNo">171</span>      }<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    }<a name="line.172"></a>
+<span class="sourceLineNo">173</span>    if (!this.rpcServer.isSecurityEnabled &amp;&amp; authMethod != AuthMethod.SIMPLE) {<a name="line.173"></a>
+<span class="sourceLineNo">174</span>      doRawSaslReply(SaslStatus.SUCCESS, new IntWritable(SaslUtil.SWITCH_TO_SIMPLE_AUTH), null,<a name="line.174"></a>
+<span class="sourceLineNo">175</span>        null);<a name="line.175"></a>
+<span class="sourceLineNo">176</span>      authMethod = AuthMethod.SIMPLE;<a name="line.176"></a>
+<span class="sourceLineNo">177</span>      // client has already sent the initial Sasl message and we<a name="line.177"></a>
+<span class="sourceLineNo">178</span>      // should ignore it. Both client and server should fall back<a name="line.178"></a>
+<span class="sourceLineNo">179</span>      // to simple auth from now on.<a name="line.179"></a>
+<span class="sourceLineNo">180</span>      skipInitialSaslHandshake = true;<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    }<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    if (authMethod != AuthMethod.SIMPLE) {<a name="line.182"></a>
+<span class="sourceLineNo">183</span>      useSasl = true;<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    }<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    preambleBuffer = null; // do not need it anymore<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    connectionPreambleRead = true;<a name="line.186"></a>
+<span class="sourceLineNo">187</span>    return count;<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>  private int read4Bytes() throws IOException {<a name="line.190"></a>
+<span class="sourceLineNo">191</span>    if (this.dataLengthBuffer.remaining() &gt; 0) {<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      return this.rpcServer.channelRead(channel, this.dataLengthBuffer);<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    } else {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>      return 0;<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>   * Read off the wire. If there is not enough data to read, update the connection state with what<a name="line.199"></a>
+<span class="sourceLineNo">200</span>   * we have and returns.<a name="line.200"></a>
+<span class="sourceLineNo">201</span>   * @return Returns -1 if failure (and caller will close connection), else zero or more.<a name="line.201"></a>
+<span class="sourceLineNo">202</span>   * @throws IOException<a name="line.202"></a>
+<span class="sourceLineNo">203</span>   * @throws InterruptedException<a name="line.203"></a>
+<span class="sourceLineNo">204</span>   */<a name="line.204"></a>
+<span class="sourceLineNo">205</span>  public int readAndProcess() throws IOException, InterruptedException {<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    // If we have not read the connection setup preamble, look to see if that is on the wire.<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    if (!connectionPreambleRead) {<a name="line.207"></a>
+<span class="sourceLineNo">208</span>      int count = readPreamble();<a name="line.208"></a>
+<span class="sourceLineNo">209</span>      if (!connectionPreambleRead) {<a name="line.209"></a>
+<span class="sourceLineNo">210</span>        return count;<a name="line.210"></a>
+<span class="sourceLineNo">211</span>      }<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    }<a name="line.212"></a>
+<span class="sourceLineNo">213</span><a name="line.213"></a>
+<span class="sourceLineNo">214</span>    // Try and read in an int. it will be length of the data to read (or -1 if a ping). We catch the<a name="line.214"></a>
+<span class="sourceLineNo">215</span>    // integer length into the 4-byte this.dataLengthBuffer.<a name="line.215"></a>
+<span class="sourceLineNo">216</span>    int count = read4Bytes();<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    if (count &lt; 0 || dataLengthBuffer.remaining() &gt; 0) {<a name="line.217"></a>
+<span class="sourceLineNo">218</span>      return count;<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    }<a name="line.219"></a>
+<span class="sourceLineNo">220</span><a name="line.220"></a>
+<span class="sourceLineNo">221</span>    // We have read a length and we have read the preamble. It is either the connection header<a name="line.221"></a>
+<span class="sourceLineNo">222</span>    // or it is a request.<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    if (data == null) {<a name="line.223"></a>
+<span class="sourceLineNo">224</span>      dataLengthBuffer.flip();<a name="line.224"></a>
+<span class="sourceLineNo">225</span>      int dataLength = dataLengthBuffer.getInt();<a name="line.225"></a>
+<span class="sourceLineNo">226</span>      if (dataLength == RpcClient.PING_CALL_ID) {<a name="line.226"></a>
+<span class="sourceLineNo">227</span>        if (!useWrap) { // covers the !useSasl too<a name="line.227"></a>
+<span class="sourceLineNo">228</span>          dataLengthBuffer.clear();<a name="line.228"></a>
+<span class="sourceLineNo">229</span>          return 0; // ping message<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">232</span>      if (dataLength &lt; 0) { // A data length of zero is legal.<a name="line.232"></a>
+<span class="sourceLineNo">233</span>        throw new DoNotRetryIOException(<a name="line.233"></a>
+<span class="sourceLineNo">234</span>            "Unexpected data length " + dataLength + "!! from " + getHostAddress());<a name="line.234"></a>
 <span class="sourceLineNo">235</span>      }<a name="line.235"></a>
-<span class="sourceLineNo">236</span>      if (dataLength &lt; 0) { // A data length of zero is legal.<a name="line.236"></a>
-<span class="sourceLineNo">237</span>        throw new DoNotRetryIOException(<a name="line.237"></a>
-<span class="sourceLineNo">238</span>            "Unexpected data length " + dataLength + "!! from " + getHostAddress());<a name="line.238"></a>
-<span class="sourceLineNo">239</span>      }<a name="line.239"></a>
-<span class="sourceLineNo">240</span><a name="line.240"></a>
-<span class="sourceLineNo">241</span>      if (dataLength &gt; this.rpcServer.maxRequestSize) {<a name="line.241"></a>
-<span class="sourceLineNo">242</span>        String msg = "RPC data length of " + dataLength + " received from " + getHostAddress() +<a name="line.242"></a>
-<span class="sourceLineNo">243</span>            " is greater than max allowed " + this.rpcServer.maxRequestSize + ". Set \"" +<a name="line.243"></a>
-<span class="sourceLineNo">244</span>            SimpleRpcServer.MAX_REQUEST_SIZE +<a name="line.244"></a>
-<span class="sourceLineNo">245</span>            "\" on server to override this limit (not recommended)";<a name="line.245"></a>
-<span class="sourceLineNo">246</span>        SimpleRpcServer.LOG.warn(msg);<a name="line.246"></a>
-<span class="sourceLineNo">247</span><a name="line.247"></a>
-<span class="sourceLineNo">248</span>        if (connectionHeaderRead &amp;&amp; connectionPreambleRead) {<a name="line.248"></a>
-<span class="sourceLineNo">249</span>          incRpcCount();<a name="line.249"></a>
-<span class="sourceLineNo">250</span>          // Construct InputStream for the non-blocking SocketChannel<a name="line.250"></a>
-<span class="sourceLineNo">251</span>          // We need the InputStream because we want to read only the request header<a name="line.251"></a>
-<span class="sourceLineNo">252</span>          // instead of the whole rpc.<a name="line.252"></a>
-<span class="sourceLineNo">253</span>          ByteBuffer buf = ByteBuffer.allocate(1);<a name="line.253"></a>
-<span class="sourceLineNo">254</span>          InputStream is = new InputStream() {<a name="line.254"></a>
-<span class="sourceLineNo">255</span>            @Override<a name="line.255"></a>
-<span class="sourceLineNo">256</span>            public int read() throws IOException {<a name="line.256"></a>
-<span class="sourceLineNo">257</span>              SimpleServerRpcConnection.this.rpcServer.channelRead(channel, buf);<a name="line.257"></a>
-<span class="sourceLineNo">258</span>              buf.flip();<a name="line.258"></a>
-<span class="sourceLineNo">259</span>              int x = buf.get();<a name="line.259"></a>
-<span class="sourceLineNo">260</span>              buf.flip();<a name="line.260"></a>
-<span class="sourceLineNo">261</span>              return x;<a name="line.261"></a>
-<span class="sourceLineNo">262</span>            }<a name="line.262"></a>
-<span class="sourceLineNo">263</span>          };<a name="line.263"></a>
-<span class="sourceLineNo">264</span>          CodedInputStream cis = CodedInputStream.newInstance(is);<a name="line.264"></a>
-<span class="sourceLineNo">265</span>          int headerSize = cis.readRawVarint32();<a name="line.265"></a>
-<span class="sourceLineNo">266</span>          Message.Builder builder = RequestHeader.newBuilder();<a name="line.266"></a>
-<span class="sourceLineNo">267</span>          ProtobufUtil.mergeFrom(builder, cis, headerSize);<a name="line.267"></a>
-<span class="sourceLineNo">268</span>          RequestHeader header = (RequestHeader) builder.build();<a name="line.268"></a>
-<span class="sourceLineNo">269</span><a name="line.269"></a>
-<span class="sourceLineNo">270</span>          // Notify the client about the offending request<a name="line.270"></a>
-<span class="sourceLineNo">271</span>          SimpleServerCall reqTooBig = new SimpleServerCall(header.getCallId(), this.service, null,<a name="line.271"></a>
-<span class="sourceLineNo">272</span>              null, null, null, this, 0, null, this.addr, System.currentTimeMillis(), 0,<a name="line.272"></a>
-<span class="sourceLineNo">273</span>              this.rpcServer.reservoir, this.rpcServer.cellBlockBuilder, null, responder);<a name="line.273"></a>
-<span class="sourceLineNo">274</span>          this.rpcServer.metrics.exception(SimpleRpcServer.REQUEST_TOO_BIG_EXCEPTION);<a name="line.274"></a>
-<span class="sourceLineNo">275</span>          // Make sure the client recognizes the underlying exception<a name="line.275"></a>
-<span class="sourceLineNo">276</span>          // Otherwise, throw a DoNotRetryIOException.<a name="line.276"></a>
-<span class="sourceLineNo">277</span>          if (VersionInfoUtil.hasMinimumVersion(connectionHeader.getVersionInfo(),<a name="line.277"></a>
-<span class="sourceLineNo">278</span>            RequestTooBigException.MAJOR_VERSION, RequestTooBigException.MINOR_VERSION)) {<a name="line.278"></a>
-<span class="sourceLineNo">279</span>            this.rpcServer.setupResponse(null, reqTooBig, SimpleRpcServer.REQUEST_TOO_BIG_EXCEPTION,<a name="line.279"></a>
-<span class="sourceLineNo">280</span>              msg);<a name="line.280"></a>
-<span class="sourceLineNo">281</span>          } else {<a name="line.281"></a>
-<span class="sourceLineNo">282</span>            this.rpcServer.setupResponse(null, reqTooBig, new DoNotRetryIOException(), msg);<a name="line.282"></a>
-<span class="sourceLineNo">283</span>          }<a name="line.283"></a>
-<span class="sourceLineNo">284</span>          // We are going to close the connection, make sure we process the response<a name="line.284"></a>
-<span class="sourceLineNo">285</span>          // before that. In rare case when this fails, we still close the connection.<a name="line.285"></a>
-<span class="sourceLineNo">286</span>          responseWriteLock.lock();<a name="line.286"></a>
-<span class="sourceLineNo">287</span>          try {<a name="line.287"></a>
-<span class="sourceLineNo">288</span>            this.responder.processResponse(reqTooBig);<a name="line.288"></a>
-<span class="sourceLineNo">289</span>          } finally {<a name="line.289"></a>
-<span class="sourceLineNo">290</span>            responseWriteLock.unlock();<a name="line.290"></a>
-<span class="sourceLineNo">291</span>          }<a name="line.291"></a>
-<span class="sourceLineNo">292</span>        }<a name="line.292"></a>
-<span class="sourceLineNo">293</span>        // Close the connection<a name="line.293"></a>
-<span class="sourceLineNo">294</span>        return -1;<a name="line.294"></a>
-<span class="sourceLineNo">295</span>      }<a name="line.295"></a>
-<span class="sourceLineNo">296</span><a name="line.296"></a>
-<span class="sourceLineNo">297</span>      // Initialize this.data with a ByteBuff.<a name="line.297"></a>
-<span class="sourceLineNo">298</span>      // This call will allocate a ByteBuff to read request into and assign to this.data<a name="line.298"></a>
-<span class="sourceLineNo">299</span>      // Also when we use some buffer(s) from pool, it will create a CallCleanup instance also and<a name="line.299"></a>
-<span class="sourceLineNo">300</span>      // assign to this.callCleanup<a name="line.300"></a>
-<span class="sourceLineNo">301</span>      initByteBuffToReadInto(dataLength);<a name="line.301"></a>
-<span class="sourceLineNo">302</span><a name="line.302"></a>
-<span class="sourceLineNo">303</span>      // Increment the rpc count. This counter will be decreased when we write<a name="line.303"></a>
-<span class="sourceLineNo">304</span>      // the response. If we want the connection to be detected as idle properly, we<a name="line.304"></a>
-<span class="sourceLineNo">305</span>      // need to keep the inc / dec correct.<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      incRpcCount();<a name="line.306"></a>
-<span class="sourceLineNo">307</span>    }<a name="line.307"></a>
-<span class="sourceLineNo">308</span><a name="line.308"></a>
-<span class="sourceLineNo">309</span>    count = channelDataRead(channel, data);<a name="line.309"></a>
+<span class="sourceLineNo">236</span><a name="line.236"></a>
+<span class="sourceLineNo">237</span>      if (dataLength &gt; this.rpcServer.maxRequestSize) {<a name="line.237"></a>
+<span class="sourceLineNo">238</span>        String msg = "RPC data length of " + dataLength + " received from " + getHostAddress() +<a name="line.238"></a>
+<span class="sourceLineNo">239</span>            " is greater than max allowed " + this.rpcServer.maxRequestSize + ". Set \"" +<a name="line.239"></a>
+<span class="sourceLineNo">240</span>            SimpleRpcServer.MAX_REQUEST_SIZE +<a name="line.240"></a>
+<span class="sourceLineNo">241</span>            "\" on server to override this limit (not recommended)";<a name="line.241"></a>
+<span class="sourceLineNo">242</span>        SimpleRpcServer.LOG.warn(msg);<a name="line.242"></a>
+<span class="sourceLineNo">243</span><a name="line.243"></a>
+<span class="sourceLineNo">244</span>        if (connectionHeaderRead &amp;&amp; connectionPreambleRead) {<a name="line.244"></a>
+<span class="sourceLineNo">245</span>          incRpcCount();<a name="line.245"></a>
+<span class="sourceLineNo">246</span>          // Construct InputStream for the non-blocking SocketChannel<a name="line.246"></a>
+<span class="sourceLineNo">247</span>          // We need the InputStream because we want to read only the request header<a name="line.247"></a>
+<span class="sourceLineNo">248</span>          // instead of the whole rpc.<a name="line.248"></a>
+<span class="sourceLineNo">249</span>          ByteBuffer buf = ByteBuffer.allocate(1);<a name="line.249"></a>
+<span class="sourceLineNo">250</span>          InputStream is = new InputStream() {<a name="line.250"></a>
+<span class="sourceLineNo">251</span>            @Override<a name="line.251"></a>
+<span class="sourceLineNo">252</span>            public int read() throws IOException {<a name="line.252"></a>
+<span class="sourceLineNo">253</span>              SimpleServerRpcConnection.this.rpcServer.channelRead(channel, buf);<a name="line.253"></a>
+<span class="sourceLineNo">254</span>              buf.flip();<a name="line.254"></a>
+<span class="sourceLineNo">255</span>              int x = buf.get();<a name="line.255"></a>
+<span class="sourceLineNo">256</span>              buf.flip();<a name="line.256"></a>
+<span class="sourceLineNo">257</span>              return x;<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>          CodedInputStream cis = CodedInputStream.newInstance(is);<a name="line.260"></a>
+<span class="sourceLineNo">261</span>          int headerSize = cis.readRawVarint32();<a name="line.261"></a>
+<span class="sourceLineNo">262</span>          Message.Builder builder = RequestHeader.newBuilder();<a name="line.262"></a>
+<span class="sourceLineNo">263</span>          ProtobufUtil.mergeFrom(builder, cis, headerSize);<a name="line.263"></a>
+<span class="sourceLineNo">264</span>          RequestHeader header = (RequestHeader) builder.build();<a name="line.264"></a>
+<span class="sourceLineNo">265</span><a name="line.265"></a>
+<span class="sourceLineNo">266</span>          // Notify the client about the offending request<a name="line.266"></a>
+<span class="sourceLineNo">267</span>          SimpleServerCall reqTooBig = new SimpleServerCall(header.getCallId(), this.service, null,<a name="line.267"></a>
+<span class="sourceLineNo">268</span>              null, null, null, this, 0, null, this.addr, System.currentTimeMillis(), 0,<a name="line.268"></a>
+<span class="sourceLineNo">269</span>              this.rpcServer.reservoir, this.rpcServer.cellBlockBuilder, null, responder);<a name="line.269"></a>
+<span class="sourceLineNo">270</span>          this.rpcServer.metrics.exception(SimpleRpcServer.REQUEST_TOO_BIG_EXCEPTION);<a name="line.270"></a>
+<span class="sourceLineNo">271</span>          // Make sure the client recognizes the underlying exception<a name="line.271"></a>
+<span class="sourceLineNo">272</span>          // Otherwise, throw a DoNotRetryIOException.<a name="line.272"></a>
+<span class="sourceLineNo">273</span>          if (VersionInfoUtil.hasMinimumVersion(connectionHeader.getVersionInfo(),<a name="line.273"></a>
+<span class="sourceLineNo">274</span>            RequestTooBigException.MAJOR_VERSION, RequestTooBigException.MINOR_VERSION)) {<a name="line.274"></a>
+<span class="sourceLineNo">275</span>            this.rpcServer.setupResponse(null, reqTooBig, SimpleRpcServer.REQUEST_TOO_BIG_EXCEPTION,<a name="line.275"></a>
+<span class="sourceLineNo">276</span>              msg);<a name="line.276"></a>
+<span class="sourceLineNo">277</span>          } else {<a name="line.277"></a>
+<span class="sourceLineNo">278</span>            this.rpcServer.setupResponse(null, reqTooBig, new DoNotRetryIOException(), msg);<a name="line.278"></a>
+<span class="sourceLineNo">279</span>          }<a name="line.279"></a>
+<span class="sourceLineNo">280</span>          // We are going to close the connection, make sure we process the response<a name="line.280"></a>
+<span class="sourceLineNo">281</span>          // before that. In rare case when this fails, we still close the connection.<a name="line.281"></a>
+<span class="sourceLineNo">282</span>          responseWriteLock.lock();<a name="line.282"></a>
+<span class="sourceLineNo">283</span>          try {<a name="line.283"></a>
+<span class="sourceLineNo">284</span>            this.responder.processResponse(reqTooBig);<a name="line.284"></a>
+<span class="sourceLineNo">285</span>          } finally {<a name="line.285"></a>
+<span class="sourceLineNo">286</span>            responseWriteLock.unlock();<a name="line.286"></a>
+<span class="sourceLineNo">287</span>          }<a name="line.287"></a>
+<span class="sourceLineNo">288</span>        }<a name="line.288"></a>
+<span class="sourceLineNo">289</span>        // Close the connection<a name="line.289"></a>
+<span class="sourceLineNo">290</span>        return -1;<a name="line.290"></a>
+<span class="sourceLineNo">291</span>      }<a name="line.291"></a>
+<span class="sourceLineNo">292</span><a name="line.292"></a>
+<span class="sourceLineNo">293</span>      // Initialize this.data with a ByteBuff.<a name="line.293"></a>
+<span class="sourceLineNo">294</span>      // This call will allocate a ByteBuff to read request into and assign to this.data<a name="line.294"></a>
+<span class="sourceLineNo">295</span>      // Also when we use some buffer(s) from pool, it will create a CallCleanup instance also and<a name="line.295"></a>
+<span class="sourceLineNo">296</span>      // assign to this.callCleanup<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      initByteBuffToReadInto(dataLength);<a name="line.297"></a>
+<span class="sourceLineNo">298</span><a name="line.298"></a>
+<span class="sourceLineNo">299</span>      // Increment the rpc count. This counter will be decreased when we write<a name="line.299"></a>
+<span class="sourceLineNo">300</span>      // the response. If we want the connection to be detected as idle properly, we<a name="line.300"></a>
+<span class="sourceLineNo">301</span>      // need to keep the inc / dec correct.<a name="line.301"></a>
+<span class="sourceLineNo">302</span>      incRpcCount();<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>    count = channelDataRead(channel, data);<a name="line.305"></a>
+<span class="sourceLineNo">306</span><a name="line.306"></a>
+<span class="sourceLineNo">307</span>    if (count &gt;= 0 &amp;&amp; data.remaining() == 0) { // count==0 if dataLength == 0<a name="line.307"></a>
+<span class="sourceLineNo">308</span>      process();<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>    if (count &gt;= 0 &amp;&amp; data.remaining() == 0) { // count==0 if dataLength == 0<a name="line.311"></a>
-<span class="sourceLineNo">312</span>      process();<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>    return count;<a name="line.315"></a>
-<span class="sourceLineNo">316</span>  }<a name="line.316"></a>
-<span class="sourceLineNo">317</span><a name="line.317"></a>
-<span class="sourceLineNo">318</span>  // It creates the ByteBuff and CallCleanup and assign to Connection instance.<a name="line.318"></a>
-<span class="sourceLineNo">319</span>  private void initByteBuffToReadInto(int length) {<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    // We create random on heap buffers are read into those when<a name="line.320"></a>
-<span class="sourceLineNo">321</span>    // 1. ByteBufferPool is not there.<a name="line.321"></a>
-<span class="sourceLineNo">322</span>    // 2. When the size of the req is very small. Using a large sized (64 KB) buffer from pool is<a name="line.322"></a>
-<span class="sourceLineNo">323</span>    // waste then. Also if all the reqs are of this size, we will be creating larger sized<a name="line.323"></a>
-<span class="sourceLineNo">324</span>    // buffers and pool them permanently. This include Scan/Get request and DDL kind of reqs like<a name="line.324"></a>
-<span class="sourceLineNo">325</span>    // RegionOpen.<a name="line.325"></a>
-<span class="sourceLineNo">326</span>    // 3. If it is an initial handshake signal or initial connection request. Any way then<a name="line.326"></a>
-<span class="sourceLineNo">327</span>    // condition 2 itself will match<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    // 4. When SASL use is ON.<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    if (this.rpcServer.reservoir == null || skipInitialSaslHandshake || !connectionHeaderRead ||<a name="line.329"></a>
-<span class="sourceLineNo">330</span>        useSasl || length &lt; this.rpcServer.minSizeForReservoirUse) {<a name="line.330"></a>
-<span class="sourceLineNo">331</span>      this.data = new SingleByteBuff(ByteBuffer.allocate(length));<a name="line.331"></a>
-<span class="sourceLineNo">332</span>    } else {<a name="line.332"></a>
-<span class="sourceLineNo">333</span>      Pair&lt;ByteBuff, CallCleanup&gt; pair = RpcServer.allocateByteBuffToReadInto(<a name="line.333"></a>
-<span class="sourceLineNo">334</span>        this.rpcServer.reservoir, this.rpcServer.minSizeForReservoirUse, length);<a name="line.334"></a>
-<span class="sourceLineNo">335</span>      this.data = pair.getFirst();<a name="line.335"></a>
-<span class="sourceLineNo">336</span>      this.callCleanup = pair.getSecond();<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><a name="line.339"></a>
-<span class="sourceLineNo">340</span>  protected int channelDataRead(ReadableByteChannel channel, ByteBuff buf) throws IOException {<a name="line.340"></a>
-<span class="sourceLineNo">341</span>    int count = buf.read(channel);<a name="line.341"></a>
-<span class="sourceLineNo">342</span>    if (count &gt; 0) {<a name="line.342"></a>
-<span class="sourceLineNo">343</span>      this.rpcServer.metrics.receivedBytes(count);<a name="line.343"></a>
-<span class="sourceLineNo">344</span>    }<a name="line.344"></a>
-<span class="sourceLineNo">345</span>    return count;<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>   * Process the data buffer and clean the connection state for the next call.<a name="line.349"></a>
-<span class="sourceLineNo">350</span>   */<a name="line.350"></a>
-<span class="sourceLineNo">351</span>  private void process() throws IOException, InterruptedException {<a name="line.351"></a>
-<span class="sourceLineNo">352</span>    data.rewind();<a name="line.352"></a>
-<span class="sourceLineNo">353</span>    try {<a name="line.353"></a>
-<span class="sourceLineNo">354</span>      if (skipInitialSaslHandshake) {<a name="line.354"></a>
-<span class="sourceLineNo">355</span>        skipInitialSaslHandshake = false;<a name="line.355"></a>
-<span class="sourceLineNo">356</span>        return;<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>      if (useSasl) {<a name="line.359"></a>
-<span class="sourceLineNo">360</span>        saslReadAndProcess(data);<a name="line.360"></a>
-<span class="sourceLineNo">361</span>      } else {<a name="line.361"></a>
-<span class="sourceLineNo">362</span>        processOneRpc(data);<a name="line.362"></a>
-<span class="sourceLineNo">363</span>      }<a name="line.363"></a>
-<span class="sourceLineNo">364</span><a name="line.364"></a>
-<span class="sourceLineNo">365</span>    } finally {<a name="line.365"></a>
-<span class="sourceLineNo">366</span>      dataLengthBuffer.clear(); // Clean for the next call<a name="line.366"></a>
-<span class="sourceLineNo">367</span>      data = null; // For the GC<a name="line.367"></a>
-<span class="sourceLineNo">368</span>      this.callCleanup = null;<a name="line.368"></a>
-<span class="sourceLineNo">369</span>    }<a name="line.369"></a>
+<span class="sourceLineNo">311</span>    return count;<a name="line.311"></a>
+<span class="sourceLineNo">312</span>  }<a name="line.312"></a>
+<span class="sourceLineNo">313</span><a name="line.313"></a>
+<span class="sourceLineNo">314</span>  // It creates the ByteBuff and CallCleanup and assign to Connection instance.<a name="line.314"></a>
+<span class="sourceLineNo">315</span>  private void initByteBuffToReadInto(int length) {<a name="line.315"></a>
+<span class="sourceLineNo">316</span>    // We create random on heap buffers are read into those when<a name="line.316"></a>
+<span class="sourceLineNo">317</span>    // 1. ByteBufferPool is not there.<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    // 2. When the size of the req is very small. Using a large sized (64 KB) buffer from pool is<a name="line.318"></a>
+<span class="sourceLineNo">319</span>    // waste then. Also if all the reqs are of this size, we will be creating larger sized<a name="line.319"></a>
+<span class="sourceLineNo">320</span>    // buffers and pool them permanently. This include Scan/Get request and DDL kind of reqs like<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    // RegionOpen.<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    // 3. If it is an initial handshake signal or initial connection request. Any way then<a name="line.322"></a>
+<span class="sourceLineNo">323</span>    // condition 2 itself will match<a name="line.323"></a>
+<span class="sourceLineNo">324</span>    // 4. When SASL use is ON.<a name="line.324"></a>
+<span class="sourceLineNo">325</span>    if (this.rpcServer.reservoir == null || skipInitialSaslHandshake || !connectionHeaderRead ||<a name="line.325"></a>
+<span class="sourceLineNo">326</span>        useSasl || length &lt; this.rpcServer.minSizeForReservoirUse) {<a name="line.326"></a>
+<span class="sourceLineNo">327</span>      this.data = new SingleByteBuff(ByteBuffer.allocate(length));<a name="line.327"></a>
+<span class="sourceLineNo">328</span>    } else {<a name="line.328"></a>
+<span class="sourceLineNo">329</span>      Pair&lt;ByteBuff, CallCleanup&gt; pair = RpcServer.allocateByteBuffToReadInto(<a name="line.329"></a>
+<span class="sourceLineNo">330</span>        this.rpcServer.reservoir, this.rpcServer.minSizeForReservoirUse, length);<a name="line.330"></a>
+<span class="sourceLineNo">331</span>      this.data = pair.getFirst();<a name="line.331"></a>
+<span class="sourceLineNo">332</span>      this.callCleanup = pair.getSecond();<a name="line.332"></a>
+<span class="sourceLineNo">333</span>    }<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>  protected int channelDataRead(ReadableByteChannel channel, ByteBuff buf) throws IOException {<a name="line.336"></a>
+<span class="sourceLineNo">337</span>    int count = buf.read(channel);<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    if (count &gt; 0) {<a name="line.338"></a>
+<span class="sourceLineNo">339</span>      this.rpcServer.metrics.receivedBytes(count);<a name="line.339"></a>
+<span class="sourceLineNo">340</span>    }<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    return count;<a name="line.341"></a>
+<span class="sourceLineNo">342</span>  }<a name="line.342"></a>
+<span class="sourceLineNo">343</span><a name="line.343"></a>
+<span class="sourceLineNo">344</span>  /**<a name="line.344"></a>
+<span class="sourceLineNo">345</span>   * Process the data buffer and clean the connection state for the next call.<a name="line.345"></a>
+<span class="sourceLineNo">346</span>   */<a name="line.346"></a>
+<span class="sourceLineNo">347</span>  private void process() throws IOException, InterruptedException {<a name="line.347"></a>
+<span class="sourceLineNo">348</span>    data.rewind();<a name="line.348"></a>
+<span class="sourceLineNo">349</span>    try {<a name="line.349"></a>
+<span class="sourceLineNo">350</span>      if (skipInitialSaslHandshake) {<a name="line.350"></a>
+<span class="sourceLineNo">351</span>        skipInitialSaslHandshake = false;<a name="line.351"></a>
+<span class="sourceLineNo">352</span>        return;<a name="line.352"></a>
+<span class="sourceLineNo">353</span>      }<a name="line.353"></a>
+<span class="sourceLineNo">354</span><a name="line.354"></a>
+<span class="sourceLineNo">355</span>      if (useSasl) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>        saslReadAndProcess(data);<a name="line.356"></a>
+<span class="sourceLineNo">357</span>      } else {<a name="line.357"></a>
+<span class="sourceLineNo">358</span>        processOneRpc(data);<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>    } finally {<a name="line.361"></a>
+<span class="sourceLineNo">362</span>      dataLengthBuffer.clear(); // Clean for the next call<a name="line.362"></a>
+<span class="sourceLineNo">363</span>      data = null; // For the GC<a name="line.363"></a>
+<span class="sourceLineNo">364</span>      this.callCleanup = null;<a name="line.364"></a>
+<span class="sourceLineNo">365</span>    }<a name="line.365"></a>
+<span class="sourceLineNo">366</span>  }<a name="line.366"></a>
+<span class="sourceLineNo">367</span><a name="line.367"></a>
+<span class="sourceLineNo">368</span>  private int doBadPreambleHandling(final String msg) throws IOException {<a name="line.368"></a>
+<span class="sourceLineNo">369</span>    return doBadPreambleHandling(msg, new FatalConnectionException(msg));<a name="line.369"></a>
 <span class="sourceLineNo">370</span>  }<a name="line.370"></a>
 <span class="sourceLineNo">371</span><a name="line.371"></a>
-<span class="sourceLineNo">372</span>  private int doBadPreambleHandling(final String msg) throws IOException {<a name="line.372"></a>
-<span class="sourceLineNo">373</span>    return doBadPreambleHandling(msg, new FatalConnectionException(msg));<a name="line.373"></a>
-<span class="sourceLineNo">374</span>  }<a name="line.374"></a>
-<span class="sourceLineNo">375</span><a name="line.375"></a>
-<span class="sourceLineNo">376</span>  private int doBadPreambleHandling(final String msg, final Exception e) throws IOException {<a name="line.376"></a>
-<span class="sourceLineNo">377</span>    SimpleRpcServer.LOG.warn(msg);<a name="line.377"></a>
-<span class="sourceLineNo">378</span>    SimpleServerCall fakeCall = new SimpleServerCall(-1, null, null, null, null, null, this, -1,<a name="line.378"></a>
-<span class="sourceLineNo">379</span>        null, null, System.currentTimeMillis(), 0, this.rpcServer.reservoir,<a name="line.379"></a>
-<span class="sourceLineNo">380</span>        this.rpcServer.cellBlockBuilder, null, responder);<a name="line.380"></a>
-<span class="sourceLineNo">381</span>    this.rpcServer.setupResponse(null, fakeCall, e, msg);<a name="line.381"></a>
-<span class="sourceLineNo">382</span>    this.responder.doRespond(fakeCall);<a name="line.382"></a>
-<span class="sourceLineNo">383</span>    // Returning -1 closes out the connection.<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    return -1;<a name="line.384"></a>
-<span class="sourceLineNo">385</span>  }<a name="line.385"></a>
-<span class="sourceLineNo">386</span><a name="line.386"></a>
-<span class="sourceLineNo">387</span>  @Override<a name="line.387"></a>
-<span class="sourceLineNo">388</span>  public synchronized void close() {<a name="line.388"></a>
-<span class="sourceLineNo">389</span>    disposeSasl();<a name="line.389"></a>
-<span class="sourceLineNo">390</span>    data = null;<a name="line.390"></a>
-<span class="sourceLineNo">391</span>    callCleanup = null;<a name="line.391"></a>
-<span class="sourceLineNo">392</span>    if (!channel.isOpen()) return;<a name="line.392"></a>
-<span class="sourceLineNo">393</span>    try {<a name="line.393"></a>
-<span class="sourceLineNo">394</span>      socket.shutdownOutput();<a name="line.394"></a>
-<span class="sourceLineNo">395</span>    } catch (Exception ignored) {<a name="line.395"></a>
-<span class="sourceLineNo">396</span>      if (SimpleRpcServer.LOG.isTraceEnabled()) {<a name="line.396"></a>
-<span class="sourceLineNo">397</span>        SimpleRpcServer.LOG.trace("Ignored exception", ignored);<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>    if (channel.isOpen()) {<a name="line.400"></a>
-<span class="sourceLineNo">401</span>      try {<a name="line.401"></a>
-<span class="sourceLineNo">402</span>        channel.close();<a name="line.402"></a>
-<span class="sourceLineNo">403</span>      } catch (Exception ignored) {<a name="line.403"></a>
-<span class="sourceLineNo">404</span>      }<a name="line.404"></a>
-<span class="sourceLineNo">405</span>    }<a name="line.405"></a>
-<span class="sourceLineNo">406</span>    try {<a name="line.406"></a>
-<span class="sourceLineNo">407</span>      socket.close();<a name="line.407"></a>
-<span class="sourceLineNo">408</span>    } catch (Exception ignored) {<a name="line.408"></a>
-<span class="sourceLineNo">409</span>      if (SimpleRpcServer.LOG.isTraceEnabled()) {<a name="line.409"></a>
-<span class="sourceLineNo">410</span>        SimpleRpcServer.LOG.trace("Ignored exception", ignored);<a name="line.410"></a>
-<span class="sourceLineNo">411</span>      }<a name="line.411"></a>
-<span class="sourceLineNo">412</span>    }<a name="line.412"></a>
-<span class="sourceLineNo">413</span>  }<a name="line.413"></a>
-<span class="sourceLineNo">414</span><a name="line.414"></a>
-<span class="sourceLineNo">415</span>  @Override<a name="line.415"></a>
-<span class="sourceLineNo">416</span>  public boolean isConnectionOpen() {<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    return channel.isOpen();<a name="line.417"></a>
-<span class="sourceLineNo">418</span>  }<a name="line.418"></a>
-<span class="sourceLineNo">419</span><a name="line.419"></a>
-<span class="sourceLineNo">420</span>  @Override<a name="line.420"></a>
-<span class="sourceLineNo">421</span>  public SimpleServerCall createCall(int id, BlockingService service, MethodDescriptor md,<a name="line.421"></a>
-<span class="sourceLineNo">422</span>      RequestHeader header, Message param, CellScanner cellScanner, long size, TraceInfo tinfo,<a name="line.422"></a>
-<span class="sourceLineNo">423</span>      InetAddress remoteAddress, int timeout, CallCleanup reqCleanup) {<a name="line.423"></a>
-<span class="sourceLineNo">424</span>    return new SimpleServerCall(id, service, md, header, param, cellScanner, this, size, tinfo,<a name="line.424"></a>
-<span class="sourceLineNo">425</span>        remoteAddress, System.currentTimeMillis(), timeout, this.rpcServer.reservoir,<a name="line.425"></a>
-<span class="sourceLineNo">426</span>        this.rpcServer.cellBlockBuilder, reqCleanup, this.responder);<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">372</span>  private int doBadPreambleHandling(final String msg, final Exception e) throws IOException {<a name="line.372"></a>
+<span class="sourceLineNo">373</span>    SimpleRpcServer.LOG.warn(msg);<a name="line.373"></a>
+<span class="sourceLineNo">374</span>    SimpleServerCall fakeCall = new SimpleServerCall(-1, null, null, null, null, null, this, -1,<a name="line.374"></a>
+<span class="sourceLineNo">375</span>        null, null, System.currentTimeMillis(), 0, this.rpcServer.reservoir,<a name="line.375"></a>
+<span class="sourceLineNo">376</span>        this.rpcServer.cellBlockBuilder, null, responder);<a name="line.376"></a>
+<span class="sourceLineNo">377</span>    this.rpcServer.setupResponse(null, fakeCall, e, msg);<a name="line.377"></a>
+<span class="sourceLineNo">378</span>    this.responder.doRespond(fakeCall);<a name="line.378"></a>
+<span class="sourceLineNo">379</span>    // Returning -1 closes out the connection.<a name="line.379"></a>
+<span class="sourceLineNo">380</span>    return -1;<a name="line.380"></a>
+<span class="sourceLineNo">381</span>  }<a name="line.381"></a>
+<span class="sourceLineNo">382</span><a name="line.382"></a>
+<span class="sourceLineNo">383</span>  @Override<a name="line.383"></a>
+<span class="sourceLineNo">384</span>  public synchronized void close() {<a name="line.384"></a>
+<span class="sourceLineNo">385</span>    disposeSasl();<a name="line.385"></a>
+<span class="sourceLineNo">386</span>    data = null;<a name="line.386"></a>
+<span class="sourceLineNo">387</span>    callCleanup = null;<a name="line.387"></a>
+<span class="sourceLineNo">388</span>    if (!channel.isOpen()) return;<a name="line.388"></a>
+<span class="sourceLineNo">389</span>    try {<a name="line.389"></a>
+<span class="sourceLineNo">390</span>      socket.shutdownOutput();<a name="line.390"></a>
+<span class="sourceLineNo">391</span>    } catch (Exception ignored) {<a name="line.391"></a>
+<span class="sourceLineNo">392</span>      if (SimpleRpcServer.LOG.isTraceEnabled()) {<a name="line.392"></a>
+<span class="sourceLineNo">393</span>        SimpleRpcServer.LOG.trace("Ignored exception", ignored);<a name="line.393"></a>
+<span class="sourceLineNo">394</span>      }<a name="line.394"></a>
+<span class="sourceLineNo">395</span>    }<a name="line.395"></a>
+<span class="sourceLineNo">396</span>    if (channel.isOpen()) {<a name="line.396"></a>
+<span class="sourceLineNo">397</span>      try {<a name="line.397"></a>
+<span class="sourceLineNo">398</span>        channel.close();<a name="line.398"></a>
+<span class="sourceLineNo">399</span>      } catch (Exception ignored) {<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>    try {<a name="line.402"></a>
+<span class="sourceLineNo">403</span>      socket.close();<a name="line.403"></a>
+<span class="sourceLineNo">404</span>    } catch (Exception ignored) {<a name="line.404"></a>
+<span class="sourceLineNo">405</span>      if (SimpleRpcServer.LOG.isTraceEnabled()) {<a name="line.405"></a>
+<span class="sourceLineNo">406</span>        SimpleRpcServer.LOG.trace("Ignored exception", ignored);<a name="line.406"></a>
+<span class="sourceLineNo">407</span>      }<a name="line.407"></a>
+<span class="sourceLineNo">408</span>    }<a name="line.408"></a>
+<span class="sourceLineNo">409</span>  }<a name="line.409"></a>
+<span class="sourceLineNo">410</span><a name="line.410"></a>
+<span class="sourceLineNo">411</span>  @Override<a name="line.411"></a>
+<span class="sourceLineNo">412</span>  public boolean isConnectionOpen() {<a name="line.412"></a>
+<span class="sourceLineNo">413</span>    return channel.isOpen();<a name="line.413"></a>
+<span class="sourceLineNo">414</span>  }<a name="line.414"></a>
+<span class="sourceLineNo">415</span><a name="line.415"></a>
+<span class="sourceLineNo">416</span>  @Override<a name="line.416"></a>
+<span class="sourceLineNo">417</span>  public SimpleServerCall createCall(int id, BlockingService service, MethodDescriptor md,<a name="line.417"></a>
+<span class="sourceLineNo">418</span>      RequestHeader header, Message param, CellScanner cellScanner, long size, TraceInfo tinfo,<a name="line.418"></a>
+<span class="sourceLineNo">419</span>      InetAddress remoteAddress, int timeout, CallCleanup reqCleanup) {<a name="line.419"></a>
+<span class="sourceLineNo">420</span>    return new SimpleServerCall(id, service, md, header, param, cellScanner, this, size, tinfo,<a name="line.420"></a>
+<span class="sourceLineNo">421</span>        remoteAddress, System.currentTimeMillis(), timeout, this.rpcServer.reservoir,<a name="line.421"></a>
+<span class="sourceLineNo">422</span>        this.rpcServer.cellBlockBuilder, reqCleanup, this.responder);<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>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1a880974/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.Action.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.Action.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.Action.html
index ec2f33f..510a137 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.Action.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.Action.html
@@ -58,7 +58,7 @@
 <span class="sourceLineNo">050</span>  public static final String COMPACTING_MEMSTORE_THRESHOLD_KEY =<a name="line.50"></a>
 <span class="sourceLineNo">051</span>      "hbase.hregion.compacting.pipeline.segments.limit";<a name="line.51"></a>
 <span class="sourceLineNo">052</span>  // remaining with the same ("infinity") but configurable default for now<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  public static final int COMPACTING_MEMSTORE_THRESHOLD_DEFAULT = 30;<a name="line.53"></a>
+<span class="sourceLineNo">053</span>  public static final int COMPACTING_MEMSTORE_THRESHOLD_DEFAULT = 1;<a name="line.53"></a>
 <span class="sourceLineNo">054</span><a name="line.54"></a>
 <span class="sourceLineNo">055</span>  public static final long DEEP_OVERHEAD = ClassSize<a name="line.55"></a>
 <span class="sourceLineNo">056</span>      .align(ClassSize.OBJECT<a name="line.56"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1a880974/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.html
index ec2f33f..510a137 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.html
@@ -58,7 +58,7 @@
 <span class="sourceLineNo">050</span>  public static final String COMPACTING_MEMSTORE_THRESHOLD_KEY =<a name="line.50"></a>
 <span class="sourceLineNo">051</span>      "hbase.hregion.compacting.pipeline.segments.limit";<a name="line.51"></a>
 <span class="sourceLineNo">052</span>  // remaining with the same ("infinity") but configurable default for now<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  public static final int COMPACTING_MEMSTORE_THRESHOLD_DEFAULT = 30;<a name="line.53"></a>
+<span class="sourceLineNo">053</span>  public static final int COMPACTING_MEMSTORE_THRESHOLD_DEFAULT = 1;<a name="line.53"></a>
 <span class="sourceLineNo">054</span><a name="line.54"></a>
 <span class="sourceLineNo">055</span>  public static final long DEEP_OVERHEAD = ClassSize<a name="line.55"></a>
 <span class="sourceLineNo">056</span>      .align(ClassSize.OBJECT<a name="line.56"></a>


Mime
View raw message