hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [37/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Wed, 19 Jul 2017 22:07:53 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/9eba7fcf/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionAdminServiceCallable.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionAdminServiceCallable.html b/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionAdminServiceCallable.html
index 7b499bf..f9cda22 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionAdminServiceCallable.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionAdminServiceCallable.html
@@ -59,154 +59,148 @@
 <span class="sourceLineNo">051</span>  protected final TableName tableName;<a name="line.51"></a>
 <span class="sourceLineNo">052</span>  protected final byte[] row;<a name="line.52"></a>
 <span class="sourceLineNo">053</span>  protected final int replicaId;<a name="line.53"></a>
-<span class="sourceLineNo">054</span>  protected final static int MIN_WAIT_DEAD_SERVER = 10000;<a name="line.54"></a>
-<span class="sourceLineNo">055</span><a name="line.55"></a>
-<span class="sourceLineNo">056</span>  public RegionAdminServiceCallable(ClusterConnection connection,<a name="line.56"></a>
-<span class="sourceLineNo">057</span>      RpcControllerFactory rpcControllerFactory, TableName tableName, byte[] row) {<a name="line.57"></a>
-<span class="sourceLineNo">058</span>    this(connection, rpcControllerFactory, null, tableName, row);<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>  public RegionAdminServiceCallable(ClusterConnection connection,<a name="line.61"></a>
-<span class="sourceLineNo">062</span>      RpcControllerFactory rpcControllerFactory, HRegionLocation location,<a name="line.62"></a>
-<span class="sourceLineNo">063</span>      TableName tableName, byte[] row) {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>    this(connection, rpcControllerFactory, location,<a name="line.64"></a>
-<span class="sourceLineNo">065</span>      tableName, row, RegionReplicaUtil.DEFAULT_REPLICA_ID);<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>  public RegionAdminServiceCallable(ClusterConnection connection,<a name="line.68"></a>
-<span class="sourceLineNo">069</span>      RpcControllerFactory rpcControllerFactory, HRegionLocation location,<a name="line.69"></a>
-<span class="sourceLineNo">070</span>      TableName tableName, byte[] row, int replicaId) {<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    this.connection = connection;<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    this.rpcControllerFactory = rpcControllerFactory;<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    this.location = location;<a name="line.73"></a>
-<span class="sourceLineNo">074</span>    this.tableName = tableName;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    this.row = row;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    this.replicaId = replicaId;<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>
-<span class="sourceLineNo">080</span>  public void prepare(boolean reload) throws IOException {<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    if (Thread.interrupted()) {<a name="line.81"></a>
-<span class="sourceLineNo">082</span>      throw new InterruptedIOException();<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    }<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    if (reload || location == null) {<a name="line.84"></a>
-<span class="sourceLineNo">085</span>      location = getLocation(!reload);<a name="line.85"></a>
-<span class="sourceLineNo">086</span>    }<a name="line.86"></a>
-<span class="sourceLineNo">087</span>    if (location == null) {<a name="line.87"></a>
-<span class="sourceLineNo">088</span>      // With this exception, there will be a retry.<a name="line.88"></a>
-<span class="sourceLineNo">089</span>      throw new HBaseIOException(getExceptionMessage());<a name="line.89"></a>
-<span class="sourceLineNo">090</span>    }<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    this.setStub(connection.getAdmin(location.getServerName()));<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>  protected void setStub(AdminService.BlockingInterface stub) {<a name="line.94"></a>
-<span class="sourceLineNo">095</span>    this.stub = stub;<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>  public HRegionLocation getLocation(boolean useCache) throws IOException {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    RegionLocations rl = getRegionLocations(connection, tableName, row, useCache, replicaId);<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    if (rl == null) {<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      throw new HBaseIOException(getExceptionMessage());<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    }<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    HRegionLocation location = rl.getRegionLocation(replicaId);<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    if (location == null) {<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      throw new HBaseIOException(getExceptionMessage());<a name="line.105"></a>
-<span class="sourceLineNo">106</span>    }<a name="line.106"></a>
-<span class="sourceLineNo">107</span><a name="line.107"></a>
-<span class="sourceLineNo">108</span>    return location;<a name="line.108"></a>
-<span class="sourceLineNo">109</span>  }<a name="line.109"></a>
-<span class="sourceLineNo">110</span><a name="line.110"></a>
-<span class="sourceLineNo">111</span>  @Override<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  public void throwable(Throwable t, boolean retrying) {<a name="line.112"></a>
-<span class="sourceLineNo">113</span>    if (location != null) {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>      connection.updateCachedLocations(tableName, location.getRegionInfo().getRegionName(), row,<a name="line.114"></a>
-<span class="sourceLineNo">115</span>          t, location.getServerName());<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><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  /**<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   * @return {@link Connection} instance used by this Callable.<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   */<a name="line.121"></a>
-<span class="sourceLineNo">122</span>  Connection getConnection() {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>    return this.connection;<a name="line.123"></a>
-<span class="sourceLineNo">124</span>  }<a name="line.124"></a>
-<span class="sourceLineNo">125</span><a name="line.125"></a>
-<span class="sourceLineNo">126</span>  //subclasses can override this.<a name="line.126"></a>
-<span class="sourceLineNo">127</span>  protected String getExceptionMessage() {<a name="line.127"></a>
-<span class="sourceLineNo">128</span>    return "There is no location" + " table=" + tableName<a name="line.128"></a>
-<span class="sourceLineNo">129</span>        + " ,replica=" + replicaId + ", row=" + Bytes.toStringBinary(row);<a name="line.129"></a>
-<span class="sourceLineNo">130</span>  }<a name="line.130"></a>
-<span class="sourceLineNo">131</span><a name="line.131"></a>
-<span class="sourceLineNo">132</span>  @Override<a name="line.132"></a>
-<span class="sourceLineNo">133</span>  public String getExceptionMessageAdditionalDetail() {<a name="line.133"></a>
-<span class="sourceLineNo">134</span>    return null;<a name="line.134"></a>
-<span class="sourceLineNo">135</span>  }<a name="line.135"></a>
-<span class="sourceLineNo">136</span><a name="line.136"></a>
-<span class="sourceLineNo">137</span>  @Override<a name="line.137"></a>
-<span class="sourceLineNo">138</span>  public long sleep(long pause, int tries) {<a name="line.138"></a>
-<span class="sourceLineNo">139</span>    long sleep = ConnectionUtils.getPauseTime(pause, tries);<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    if (sleep &lt; MIN_WAIT_DEAD_SERVER<a name="line.140"></a>
-<span class="sourceLineNo">141</span>        &amp;&amp; (location == null || connection.isDeadServer(location.getServerName()))) {<a name="line.141"></a>
-<span class="sourceLineNo">142</span>      sleep = ConnectionUtils.addJitter(MIN_WAIT_DEAD_SERVER, 0.10f);<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    }<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    return sleep;<a name="line.144"></a>
-<span class="sourceLineNo">145</span>  }<a name="line.145"></a>
-<span class="sourceLineNo">146</span><a name="line.146"></a>
-<span class="sourceLineNo">147</span>  public static RegionLocations getRegionLocations(<a name="line.147"></a>
-<span class="sourceLineNo">148</span>      ClusterConnection connection, TableName tableName, byte[] row,<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      boolean useCache, int replicaId)<a name="line.149"></a>
-<span class="sourceLineNo">150</span>      throws RetriesExhaustedException, DoNotRetryIOException, InterruptedIOException {<a name="line.150"></a>
-<span class="sourceLineNo">151</span>    RegionLocations rl;<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    try {<a name="line.152"></a>
-<span class="sourceLineNo">153</span>      rl = connection.locateRegion(tableName, row, useCache, true, replicaId);<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    } catch (DoNotRetryIOException e) {<a name="line.154"></a>
-<span class="sourceLineNo">155</span>      throw e;<a name="line.155"></a>
-<span class="sourceLineNo">156</span>    } catch (RetriesExhaustedException e) {<a name="line.156"></a>
-<span class="sourceLineNo">157</span>      throw e;<a name="line.157"></a>
-<span class="sourceLineNo">158</span>    } catch (InterruptedIOException e) {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>      throw e;<a name="line.159"></a>
-<span class="sourceLineNo">160</span>    } catch (IOException e) {<a name="line.160"></a>
-<span class="sourceLineNo">161</span>      throw new RetriesExhaustedException("Can't get the location", e);<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    }<a name="line.162"></a>
-<span class="sourceLineNo">163</span>    if (rl == null) {<a name="line.163"></a>
-<span class="sourceLineNo">164</span>      throw new RetriesExhaustedException("Can't get the locations");<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    }<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    return rl;<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>  /**<a name="line.169"></a>
-<span class="sourceLineNo">170</span>   * Override that changes Exception from {@link Exception} to {@link IOException}. It also does<a name="line.170"></a>
-<span class="sourceLineNo">171</span>   * setup of an rpcController and calls through to the unimplemented<a name="line.171"></a>
-<span class="sourceLineNo">172</span>   * call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation.<a name="line.172"></a>
-<span class="sourceLineNo">173</span>   */<a name="line.173"></a>
-<span class="sourceLineNo">174</span>  @Override<a name="line.174"></a>
-<span class="sourceLineNo">175</span>  // Same trick as in RegionServerCallable so users don't have to copy/paste so much boilerplate<a name="line.175"></a>
-<span class="sourceLineNo">176</span>  // and so we contain references to protobuf. We can't set priority on the rpcController as<a name="line.176"></a>
-<span class="sourceLineNo">177</span>  // we do in RegionServerCallable because we don't always have a Table when we call.<a name="line.177"></a>
-<span class="sourceLineNo">178</span>  public T call(int callTimeout) throws IOException {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    this.controller = rpcControllerFactory.newController();<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    this.controller.setPriority(this.tableName);<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    this.controller.setCallTimeout(callTimeout);<a name="line.181"></a>
-<span class="sourceLineNo">182</span>    try {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      return call(this.controller);<a name="line.183"></a>
-<span class="sourceLineNo">184</span>    } catch (Exception e) {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>      throw ProtobufUtil.handleRemoteException(e);<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>
-<span class="sourceLineNo">188</span><a name="line.188"></a>
-<span class="sourceLineNo">189</span>  HBaseRpcController getCurrentPayloadCarryingRpcController() {<a name="line.189"></a>
-<span class="sourceLineNo">190</span>    return this.controller;<a name="line.190"></a>
-<span class="sourceLineNo">191</span>  }<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>   * Run RPC call.<a name="line.194"></a>
-<span class="sourceLineNo">195</span>   * @param rpcController PayloadCarryingRpcController is a mouthful but it at a minimum is a<a name="line.195"></a>
-<span class="sourceLineNo">196</span>   * facade on protobuf so we don't have to put protobuf everywhere; we can keep it behind this<a name="line.196"></a>
-<span class="sourceLineNo">197</span>   * class.<a name="line.197"></a>
-<span class="sourceLineNo">198</span>   * @throws Exception<a name="line.198"></a>
-<span class="sourceLineNo">199</span>   */<a name="line.199"></a>
-<span class="sourceLineNo">200</span>  protected abstract T call(HBaseRpcController rpcController) throws Exception;<a name="line.200"></a>
-<span class="sourceLineNo">201</span>}<a name="line.201"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>  public RegionAdminServiceCallable(ClusterConnection connection,<a name="line.55"></a>
+<span class="sourceLineNo">056</span>      RpcControllerFactory rpcControllerFactory, TableName tableName, byte[] row) {<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    this(connection, rpcControllerFactory, null, tableName, row);<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>  public RegionAdminServiceCallable(ClusterConnection connection,<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      RpcControllerFactory rpcControllerFactory, HRegionLocation location,<a name="line.61"></a>
+<span class="sourceLineNo">062</span>      TableName tableName, byte[] row) {<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    this(connection, rpcControllerFactory, location,<a name="line.63"></a>
+<span class="sourceLineNo">064</span>      tableName, row, RegionReplicaUtil.DEFAULT_REPLICA_ID);<a name="line.64"></a>
+<span class="sourceLineNo">065</span>  }<a name="line.65"></a>
+<span class="sourceLineNo">066</span><a name="line.66"></a>
+<span class="sourceLineNo">067</span>  public RegionAdminServiceCallable(ClusterConnection connection,<a name="line.67"></a>
+<span class="sourceLineNo">068</span>      RpcControllerFactory rpcControllerFactory, HRegionLocation location,<a name="line.68"></a>
+<span class="sourceLineNo">069</span>      TableName tableName, byte[] row, int replicaId) {<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    this.connection = connection;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    this.rpcControllerFactory = rpcControllerFactory;<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    this.location = location;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    this.tableName = tableName;<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    this.row = row;<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    this.replicaId = replicaId;<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>  @Override<a name="line.78"></a>
+<span class="sourceLineNo">079</span>  public void prepare(boolean reload) throws IOException {<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    if (Thread.interrupted()) {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>      throw new InterruptedIOException();<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    }<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    if (reload || location == null) {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>      location = getLocation(!reload);<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    }<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    if (location == null) {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>      // With this exception, there will be a retry.<a name="line.87"></a>
+<span class="sourceLineNo">088</span>      throw new HBaseIOException(getExceptionMessage());<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    }<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    this.setStub(connection.getAdmin(location.getServerName()));<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  }<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>  protected void setStub(AdminService.BlockingInterface stub) {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    this.stub = stub;<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>  public HRegionLocation getLocation(boolean useCache) throws IOException {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    RegionLocations rl = getRegionLocations(connection, tableName, row, useCache, replicaId);<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    if (rl == null) {<a name="line.99"></a>
+<span class="sourceLineNo">100</span>      throw new HBaseIOException(getExceptionMessage());<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    }<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    HRegionLocation location = rl.getRegionLocation(replicaId);<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    if (location == null) {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>      throw new HBaseIOException(getExceptionMessage());<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>    return location;<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>  @Override<a name="line.110"></a>
+<span class="sourceLineNo">111</span>  public void throwable(Throwable t, boolean retrying) {<a name="line.111"></a>
+<span class="sourceLineNo">112</span>    if (location != null) {<a name="line.112"></a>
+<span class="sourceLineNo">113</span>      connection.updateCachedLocations(tableName, location.getRegionInfo().getRegionName(), row,<a name="line.113"></a>
+<span class="sourceLineNo">114</span>          t, location.getServerName());<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    }<a name="line.115"></a>
+<span class="sourceLineNo">116</span>  }<a name="line.116"></a>
+<span class="sourceLineNo">117</span><a name="line.117"></a>
+<span class="sourceLineNo">118</span>  /**<a name="line.118"></a>
+<span class="sourceLineNo">119</span>   * @return {@link Connection} instance used by this Callable.<a name="line.119"></a>
+<span class="sourceLineNo">120</span>   */<a name="line.120"></a>
+<span class="sourceLineNo">121</span>  Connection getConnection() {<a name="line.121"></a>
+<span class="sourceLineNo">122</span>    return this.connection;<a name="line.122"></a>
+<span class="sourceLineNo">123</span>  }<a name="line.123"></a>
+<span class="sourceLineNo">124</span><a name="line.124"></a>
+<span class="sourceLineNo">125</span>  //subclasses can override this.<a name="line.125"></a>
+<span class="sourceLineNo">126</span>  protected String getExceptionMessage() {<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    return "There is no location" + " table=" + tableName<a name="line.127"></a>
+<span class="sourceLineNo">128</span>        + " ,replica=" + replicaId + ", row=" + Bytes.toStringBinary(row);<a name="line.128"></a>
+<span class="sourceLineNo">129</span>  }<a name="line.129"></a>
+<span class="sourceLineNo">130</span><a name="line.130"></a>
+<span class="sourceLineNo">131</span>  @Override<a name="line.131"></a>
+<span class="sourceLineNo">132</span>  public String getExceptionMessageAdditionalDetail() {<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    return null;<a name="line.133"></a>
+<span class="sourceLineNo">134</span>  }<a name="line.134"></a>
+<span class="sourceLineNo">135</span><a name="line.135"></a>
+<span class="sourceLineNo">136</span>  @Override<a name="line.136"></a>
+<span class="sourceLineNo">137</span>  public long sleep(long pause, int tries) {<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    return ConnectionUtils.getPauseTime(pause, tries);<a name="line.138"></a>
+<span class="sourceLineNo">139</span>  }<a name="line.139"></a>
+<span class="sourceLineNo">140</span><a name="line.140"></a>
+<span class="sourceLineNo">141</span>  public static RegionLocations getRegionLocations(<a name="line.141"></a>
+<span class="sourceLineNo">142</span>      ClusterConnection connection, TableName tableName, byte[] row,<a name="line.142"></a>
+<span class="sourceLineNo">143</span>      boolean useCache, int replicaId)<a name="line.143"></a>
+<span class="sourceLineNo">144</span>      throws RetriesExhaustedException, DoNotRetryIOException, InterruptedIOException {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    RegionLocations rl;<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    try {<a name="line.146"></a>
+<span class="sourceLineNo">147</span>      rl = connection.locateRegion(tableName, row, useCache, true, replicaId);<a name="line.147"></a>
+<span class="sourceLineNo">148</span>    } catch (DoNotRetryIOException e) {<a name="line.148"></a>
+<span class="sourceLineNo">149</span>      throw e;<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    } catch (RetriesExhaustedException e) {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>      throw e;<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    } catch (InterruptedIOException e) {<a name="line.152"></a>
+<span class="sourceLineNo">153</span>      throw e;<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    } catch (IOException e) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>      throw new RetriesExhaustedException("Can't get the location", e);<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    }<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    if (rl == null) {<a name="line.157"></a>
+<span class="sourceLineNo">158</span>      throw new RetriesExhaustedException("Can't get the locations");<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    }<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    return rl;<a name="line.160"></a>
+<span class="sourceLineNo">161</span>  }<a name="line.161"></a>
+<span class="sourceLineNo">162</span><a name="line.162"></a>
+<span class="sourceLineNo">163</span>  /**<a name="line.163"></a>
+<span class="sourceLineNo">164</span>   * Override that changes Exception from {@link Exception} to {@link IOException}. It also does<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   * setup of an rpcController and calls through to the unimplemented<a name="line.165"></a>
+<span class="sourceLineNo">166</span>   * call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation.<a name="line.166"></a>
+<span class="sourceLineNo">167</span>   */<a name="line.167"></a>
+<span class="sourceLineNo">168</span>  @Override<a name="line.168"></a>
+<span class="sourceLineNo">169</span>  // Same trick as in RegionServerCallable so users don't have to copy/paste so much boilerplate<a name="line.169"></a>
+<span class="sourceLineNo">170</span>  // and so we contain references to protobuf. We can't set priority on the rpcController as<a name="line.170"></a>
+<span class="sourceLineNo">171</span>  // we do in RegionServerCallable because we don't always have a Table when we call.<a name="line.171"></a>
+<span class="sourceLineNo">172</span>  public T call(int callTimeout) throws IOException {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>    this.controller = rpcControllerFactory.newController();<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    this.controller.setPriority(this.tableName);<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    this.controller.setCallTimeout(callTimeout);<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    try {<a name="line.176"></a>
+<span class="sourceLineNo">177</span>      return call(this.controller);<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    } catch (Exception e) {<a name="line.178"></a>
+<span class="sourceLineNo">179</span>      throw ProtobufUtil.handleRemoteException(e);<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><a name="line.182"></a>
+<span class="sourceLineNo">183</span>  HBaseRpcController getCurrentPayloadCarryingRpcController() {<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    return this.controller;<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>  /**<a name="line.187"></a>
+<span class="sourceLineNo">188</span>   * Run RPC call.<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   * @param rpcController PayloadCarryingRpcController is a mouthful but it at a minimum is a<a name="line.189"></a>
+<span class="sourceLineNo">190</span>   * facade on protobuf so we don't have to put protobuf everywhere; we can keep it behind this<a name="line.190"></a>
+<span class="sourceLineNo">191</span>   * class.<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   * @throws Exception<a name="line.192"></a>
+<span class="sourceLineNo">193</span>   */<a name="line.193"></a>
+<span class="sourceLineNo">194</span>  protected abstract T call(HBaseRpcController rpcController) throws Exception;<a name="line.194"></a>
+<span class="sourceLineNo">195</span>}<a name="line.195"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/9eba7fcf/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionServerCallable.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionServerCallable.html b/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionServerCallable.html
index ecf8de0..b94da37 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionServerCallable.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/RegionServerCallable.html
@@ -66,174 +66,168 @@
 <span class="sourceLineNo">058</span>   * Some subclasses want to set their own location. Make it protected.<a name="line.58"></a>
 <span class="sourceLineNo">059</span>   */<a name="line.59"></a>
 <span class="sourceLineNo">060</span>  protected HRegionLocation location;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  protected final static int MIN_WAIT_DEAD_SERVER = 10000;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>  protected S stub;<a name="line.62"></a>
-<span class="sourceLineNo">063</span><a name="line.63"></a>
-<span class="sourceLineNo">064</span>  /**<a name="line.64"></a>
-<span class="sourceLineNo">065</span>   * This is 99% of the time a HBaseRpcController but also used doing Coprocessor Endpoints and in<a name="line.65"></a>
-<span class="sourceLineNo">066</span>   * this case, it is a ServerRpcControllable which is not a HBaseRpcController.<a name="line.66"></a>
-<span class="sourceLineNo">067</span>   * Can be null!<a name="line.67"></a>
-<span class="sourceLineNo">068</span>   */<a name="line.68"></a>
-<span class="sourceLineNo">069</span>  protected final RpcController rpcController;<a name="line.69"></a>
-<span class="sourceLineNo">070</span><a name="line.70"></a>
-<span class="sourceLineNo">071</span>  /**<a name="line.71"></a>
-<span class="sourceLineNo">072</span>   * @param connection Connection to use.<a name="line.72"></a>
-<span class="sourceLineNo">073</span>   * @param rpcController Controller to use; can be shaded or non-shaded.<a name="line.73"></a>
-<span class="sourceLineNo">074</span>   * @param tableName Table name to which &lt;code&gt;row&lt;/code&gt; belongs.<a name="line.74"></a>
-<span class="sourceLineNo">075</span>   * @param row The row we want in &lt;code&gt;tableName&lt;/code&gt;.<a name="line.75"></a>
-<span class="sourceLineNo">076</span>   */<a name="line.76"></a>
-<span class="sourceLineNo">077</span>  public RegionServerCallable(Connection connection, TableName tableName, byte [] row,<a name="line.77"></a>
-<span class="sourceLineNo">078</span>      RpcController rpcController) {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    super();<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    this.connection = connection;<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    this.tableName = tableName;<a name="line.81"></a>
-<span class="sourceLineNo">082</span>    this.row = row;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    this.rpcController = rpcController;<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>  protected RpcController getRpcController() {<a name="line.86"></a>
-<span class="sourceLineNo">087</span>    return this.rpcController;<a name="line.87"></a>
-<span class="sourceLineNo">088</span>  }<a name="line.88"></a>
-<span class="sourceLineNo">089</span><a name="line.89"></a>
-<span class="sourceLineNo">090</span>  protected void setStub(S stub) {<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    this.stub = stub;<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>  protected S getStub() {<a name="line.94"></a>
-<span class="sourceLineNo">095</span>    return this.stub;<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>  /**<a name="line.98"></a>
-<span class="sourceLineNo">099</span>   * Override that changes call Exception from {@link Exception} to {@link IOException}.<a name="line.99"></a>
-<span class="sourceLineNo">100</span>   * Also does set up of the rpcController.<a name="line.100"></a>
-<span class="sourceLineNo">101</span>   */<a name="line.101"></a>
-<span class="sourceLineNo">102</span>  public T call(int callTimeout) throws IOException {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    try {<a name="line.103"></a>
-<span class="sourceLineNo">104</span>      // Iff non-null and an instance of a SHADED rpcController, do config! Unshaded -- i.e.<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      // com.google.protobuf.RpcController or null -- will just skip over this config.<a name="line.105"></a>
-<span class="sourceLineNo">106</span>      if (getRpcController() != null) {<a name="line.106"></a>
-<span class="sourceLineNo">107</span>        RpcController shadedRpcController = (RpcController)getRpcController();<a name="line.107"></a>
-<span class="sourceLineNo">108</span>        // Do a reset to clear previous states, such as CellScanner.<a name="line.108"></a>
-<span class="sourceLineNo">109</span>        shadedRpcController.reset();<a name="line.109"></a>
-<span class="sourceLineNo">110</span>        if (shadedRpcController instanceof HBaseRpcController) {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>          HBaseRpcController hrc = (HBaseRpcController)getRpcController();<a name="line.111"></a>
-<span class="sourceLineNo">112</span>          // If it is an instance of HBaseRpcController, we can set priority on the controller based<a name="line.112"></a>
-<span class="sourceLineNo">113</span>          // off the tableName. Set call timeout too.<a name="line.113"></a>
-<span class="sourceLineNo">114</span>          hrc.setPriority(tableName);<a name="line.114"></a>
-<span class="sourceLineNo">115</span>          hrc.setCallTimeout(callTimeout);<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 rpcCall();<a name="line.118"></a>
-<span class="sourceLineNo">119</span>    } catch (Exception e) {<a name="line.119"></a>
-<span class="sourceLineNo">120</span>      throw ProtobufUtil.handleRemoteException(e);<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><a name="line.123"></a>
-<span class="sourceLineNo">124</span>  /**<a name="line.124"></a>
-<span class="sourceLineNo">125</span>   * Run the RPC call. Implement this method. To get at the rpcController that has been created<a name="line.125"></a>
-<span class="sourceLineNo">126</span>   * and configured to make this rpc call, use getRpcController(). We are trying to contain<a name="line.126"></a>
-<span class="sourceLineNo">127</span>   * rpcController references so we don't pollute codebase with protobuf references; keep the<a name="line.127"></a>
-<span class="sourceLineNo">128</span>   * protobuf references contained and only present in a few classes rather than all about the<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   * code base.<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   * @throws Exception<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   */<a name="line.131"></a>
-<span class="sourceLineNo">132</span>  protected abstract T rpcCall() throws Exception;<a name="line.132"></a>
-<span class="sourceLineNo">133</span><a name="line.133"></a>
-<span class="sourceLineNo">134</span>  /**<a name="line.134"></a>
-<span class="sourceLineNo">135</span>   * Get the RpcController CellScanner.<a name="line.135"></a>
-<span class="sourceLineNo">136</span>   * If the RpcController is a HBaseRpcController, which it is in all cases except<a name="line.136"></a>
-<span class="sourceLineNo">137</span>   * when we are processing Coprocessor Endpoint, then this method returns a reference to the<a name="line.137"></a>
-<span class="sourceLineNo">138</span>   * CellScanner that the HBaseRpcController is carrying. Do it up here in this Callable<a name="line.138"></a>
-<span class="sourceLineNo">139</span>   * so we don't have to scatter ugly instanceof tests around the codebase. Will return null<a name="line.139"></a>
-<span class="sourceLineNo">140</span>   * if called in a Coproccessor Endpoint context. Should never happen.<a name="line.140"></a>
-<span class="sourceLineNo">141</span>   */<a name="line.141"></a>
-<span class="sourceLineNo">142</span>  protected CellScanner getRpcControllerCellScanner() {<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    return (getRpcController() != null &amp;&amp; getRpcController() instanceof HBaseRpcController)?<a name="line.143"></a>
-<span class="sourceLineNo">144</span>        ((HBaseRpcController)getRpcController()).cellScanner(): null;<a name="line.144"></a>
-<span class="sourceLineNo">145</span>  }<a name="line.145"></a>
-<span class="sourceLineNo">146</span><a name="line.146"></a>
-<span class="sourceLineNo">147</span>  protected void setRpcControllerCellScanner(CellScanner cellScanner) {<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    if (getRpcController() != null &amp;&amp; getRpcController() instanceof HBaseRpcController) {<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      ((HBaseRpcController)this.rpcController).setCellScanner(cellScanner);<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    }<a name="line.150"></a>
-<span class="sourceLineNo">151</span>  }<a name="line.151"></a>
-<span class="sourceLineNo">152</span><a name="line.152"></a>
-<span class="sourceLineNo">153</span>  /**<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   * @return {@link ClusterConnection} instance used by this Callable.<a name="line.154"></a>
-<span class="sourceLineNo">155</span>   */<a name="line.155"></a>
-<span class="sourceLineNo">156</span>  protected ClusterConnection getConnection() {<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    return (ClusterConnection) this.connection;<a name="line.157"></a>
-<span class="sourceLineNo">158</span>  }<a name="line.158"></a>
-<span class="sourceLineNo">159</span><a name="line.159"></a>
-<span class="sourceLineNo">160</span>  protected HRegionLocation getLocation() {<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    return this.location;<a name="line.161"></a>
-<span class="sourceLineNo">162</span>  }<a name="line.162"></a>
-<span class="sourceLineNo">163</span><a name="line.163"></a>
-<span class="sourceLineNo">164</span>  protected void setLocation(final HRegionLocation location) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    this.location = location;<a name="line.165"></a>
-<span class="sourceLineNo">166</span>  }<a name="line.166"></a>
-<span class="sourceLineNo">167</span><a name="line.167"></a>
-<span class="sourceLineNo">168</span>  public TableName getTableName() {<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    return this.tableName;<a name="line.169"></a>
-<span class="sourceLineNo">170</span>  }<a name="line.170"></a>
-<span class="sourceLineNo">171</span><a name="line.171"></a>
-<span class="sourceLineNo">172</span>  public byte [] getRow() {<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    return this.row;<a name="line.173"></a>
-<span class="sourceLineNo">174</span>  }<a name="line.174"></a>
-<span class="sourceLineNo">175</span><a name="line.175"></a>
-<span class="sourceLineNo">176</span>  public void throwable(Throwable t, boolean retrying) {<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    if (location != null) {<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      getConnection().updateCachedLocations(tableName, location.getRegionInfo().getRegionName(),<a name="line.178"></a>
-<span class="sourceLineNo">179</span>          row, t, location.getServerName());<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><a name="line.182"></a>
-<span class="sourceLineNo">183</span>  public String getExceptionMessageAdditionalDetail() {<a name="line.183"></a>
-<span class="sourceLineNo">184</span>    return "row '" + Bytes.toString(row) + "' on table '" + tableName + "' at " + location;<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>  public long sleep(long pause, int tries) {<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    long sleep = ConnectionUtils.getPauseTime(pause, tries);<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    if (sleep &lt; MIN_WAIT_DEAD_SERVER<a name="line.189"></a>
-<span class="sourceLineNo">190</span>        &amp;&amp; (location == null || getConnection().isDeadServer(location.getServerName()))) {<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      sleep = ConnectionUtils.addJitter(MIN_WAIT_DEAD_SERVER, 0.10f);<a name="line.191"></a>
-<span class="sourceLineNo">192</span>    }<a name="line.192"></a>
-<span class="sourceLineNo">193</span>    return sleep;<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>  /**<a name="line.196"></a>
-<span class="sourceLineNo">197</span>   * @return the HRegionInfo for the current region<a name="line.197"></a>
-<span class="sourceLineNo">198</span>   */<a name="line.198"></a>
-<span class="sourceLineNo">199</span>  public HRegionInfo getHRegionInfo() {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    if (this.location == null) {<a name="line.200"></a>
-<span class="sourceLineNo">201</span>      return null;<a name="line.201"></a>
-<span class="sourceLineNo">202</span>    }<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    return this.location.getRegionInfo();<a name="line.203"></a>
-<span class="sourceLineNo">204</span>  }<a name="line.204"></a>
-<span class="sourceLineNo">205</span><a name="line.205"></a>
-<span class="sourceLineNo">206</span>  public void prepare(final boolean reload) throws IOException {<a name="line.206"></a>
-<span class="sourceLineNo">207</span>    // check table state if this is a retry<a name="line.207"></a>
-<span class="sourceLineNo">208</span>    if (reload &amp;&amp; tableName != null &amp;&amp; !tableName.equals(TableName.META_TABLE_NAME)<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        &amp;&amp; getConnection().isTableDisabled(tableName)) {<a name="line.209"></a>
-<span class="sourceLineNo">210</span>      throw new TableNotEnabledException(tableName.getNameAsString() + " is disabled.");<a name="line.210"></a>
-<span class="sourceLineNo">211</span>    }<a name="line.211"></a>
-<span class="sourceLineNo">212</span>    try (RegionLocator regionLocator = connection.getRegionLocator(tableName)) {<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      this.location = regionLocator.getRegionLocation(row);<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    if (this.location == null) {<a name="line.215"></a>
-<span class="sourceLineNo">216</span>      throw new IOException("Failed to find location, tableName=" + tableName +<a name="line.216"></a>
-<span class="sourceLineNo">217</span>          ", row=" + Bytes.toString(row) + ", reload=" + reload);<a name="line.217"></a>
-<span class="sourceLineNo">218</span>    }<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    setStubByServiceName(this.location.getServerName());<a name="line.219"></a>
-<span class="sourceLineNo">220</span>  }<a name="line.220"></a>
-<span class="sourceLineNo">221</span><a name="line.221"></a>
-<span class="sourceLineNo">222</span>  /**<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   * Set the RCP client stub<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   * @param serviceName to get the rpc stub for<a name="line.224"></a>
-<span class="sourceLineNo">225</span>   * @throws IOException When client could not be created<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>  protected abstract void setStubByServiceName(ServerName serviceName) throws IOException;<a name="line.227"></a>
-<span class="sourceLineNo">228</span>}<a name="line.228"></a>
+<span class="sourceLineNo">061</span>  protected S stub;<a name="line.61"></a>
+<span class="sourceLineNo">062</span><a name="line.62"></a>
+<span class="sourceLineNo">063</span>  /**<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   * This is 99% of the time a HBaseRpcController but also used doing Coprocessor Endpoints and in<a name="line.64"></a>
+<span class="sourceLineNo">065</span>   * this case, it is a ServerRpcControllable which is not a HBaseRpcController.<a name="line.65"></a>
+<span class="sourceLineNo">066</span>   * Can be null!<a name="line.66"></a>
+<span class="sourceLineNo">067</span>   */<a name="line.67"></a>
+<span class="sourceLineNo">068</span>  protected final RpcController rpcController;<a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>  /**<a name="line.70"></a>
+<span class="sourceLineNo">071</span>   * @param connection Connection to use.<a name="line.71"></a>
+<span class="sourceLineNo">072</span>   * @param rpcController Controller to use; can be shaded or non-shaded.<a name="line.72"></a>
+<span class="sourceLineNo">073</span>   * @param tableName Table name to which &lt;code&gt;row&lt;/code&gt; belongs.<a name="line.73"></a>
+<span class="sourceLineNo">074</span>   * @param row The row we want in &lt;code&gt;tableName&lt;/code&gt;.<a name="line.74"></a>
+<span class="sourceLineNo">075</span>   */<a name="line.75"></a>
+<span class="sourceLineNo">076</span>  public RegionServerCallable(Connection connection, TableName tableName, byte [] row,<a name="line.76"></a>
+<span class="sourceLineNo">077</span>      RpcController rpcController) {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    super();<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    this.connection = connection;<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    this.tableName = tableName;<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    this.row = row;<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    this.rpcController = rpcController;<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>  protected RpcController getRpcController() {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    return this.rpcController;<a name="line.86"></a>
+<span class="sourceLineNo">087</span>  }<a name="line.87"></a>
+<span class="sourceLineNo">088</span><a name="line.88"></a>
+<span class="sourceLineNo">089</span>  protected void setStub(S stub) {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    this.stub = stub;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  }<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>  protected S getStub() {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    return this.stub;<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>  /**<a name="line.97"></a>
+<span class="sourceLineNo">098</span>   * Override that changes call Exception from {@link Exception} to {@link IOException}.<a name="line.98"></a>
+<span class="sourceLineNo">099</span>   * Also does set up of the rpcController.<a name="line.99"></a>
+<span class="sourceLineNo">100</span>   */<a name="line.100"></a>
+<span class="sourceLineNo">101</span>  public T call(int callTimeout) throws IOException {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    try {<a name="line.102"></a>
+<span class="sourceLineNo">103</span>      // Iff non-null and an instance of a SHADED rpcController, do config! Unshaded -- i.e.<a name="line.103"></a>
+<span class="sourceLineNo">104</span>      // com.google.protobuf.RpcController or null -- will just skip over this config.<a name="line.104"></a>
+<span class="sourceLineNo">105</span>      if (getRpcController() != null) {<a name="line.105"></a>
+<span class="sourceLineNo">106</span>        RpcController shadedRpcController = (RpcController)getRpcController();<a name="line.106"></a>
+<span class="sourceLineNo">107</span>        // Do a reset to clear previous states, such as CellScanner.<a name="line.107"></a>
+<span class="sourceLineNo">108</span>        shadedRpcController.reset();<a name="line.108"></a>
+<span class="sourceLineNo">109</span>        if (shadedRpcController instanceof HBaseRpcController) {<a name="line.109"></a>
+<span class="sourceLineNo">110</span>          HBaseRpcController hrc = (HBaseRpcController)getRpcController();<a name="line.110"></a>
+<span class="sourceLineNo">111</span>          // If it is an instance of HBaseRpcController, we can set priority on the controller based<a name="line.111"></a>
+<span class="sourceLineNo">112</span>          // off the tableName. Set call timeout too.<a name="line.112"></a>
+<span class="sourceLineNo">113</span>          hrc.setPriority(tableName);<a name="line.113"></a>
+<span class="sourceLineNo">114</span>          hrc.setCallTimeout(callTimeout);<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 rpcCall();<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    } catch (Exception e) {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      throw ProtobufUtil.handleRemoteException(e);<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><a name="line.122"></a>
+<span class="sourceLineNo">123</span>  /**<a name="line.123"></a>
+<span class="sourceLineNo">124</span>   * Run the RPC call. Implement this method. To get at the rpcController that has been created<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   * and configured to make this rpc call, use getRpcController(). We are trying to contain<a name="line.125"></a>
+<span class="sourceLineNo">126</span>   * rpcController references so we don't pollute codebase with protobuf references; keep the<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   * protobuf references contained and only present in a few classes rather than all about the<a name="line.127"></a>
+<span class="sourceLineNo">128</span>   * code base.<a name="line.128"></a>
+<span class="sourceLineNo">129</span>   * @throws Exception<a name="line.129"></a>
+<span class="sourceLineNo">130</span>   */<a name="line.130"></a>
+<span class="sourceLineNo">131</span>  protected abstract T rpcCall() throws Exception;<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">134</span>   * Get the RpcController CellScanner.<a name="line.134"></a>
+<span class="sourceLineNo">135</span>   * If the RpcController is a HBaseRpcController, which it is in all cases except<a name="line.135"></a>
+<span class="sourceLineNo">136</span>   * when we are processing Coprocessor Endpoint, then this method returns a reference to the<a name="line.136"></a>
+<span class="sourceLineNo">137</span>   * CellScanner that the HBaseRpcController is carrying. Do it up here in this Callable<a name="line.137"></a>
+<span class="sourceLineNo">138</span>   * so we don't have to scatter ugly instanceof tests around the codebase. Will return null<a name="line.138"></a>
+<span class="sourceLineNo">139</span>   * if called in a Coproccessor Endpoint context. Should never happen.<a name="line.139"></a>
+<span class="sourceLineNo">140</span>   */<a name="line.140"></a>
+<span class="sourceLineNo">141</span>  protected CellScanner getRpcControllerCellScanner() {<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    return (getRpcController() != null &amp;&amp; getRpcController() instanceof HBaseRpcController)?<a name="line.142"></a>
+<span class="sourceLineNo">143</span>        ((HBaseRpcController)getRpcController()).cellScanner(): null;<a name="line.143"></a>
+<span class="sourceLineNo">144</span>  }<a name="line.144"></a>
+<span class="sourceLineNo">145</span><a name="line.145"></a>
+<span class="sourceLineNo">146</span>  protected void setRpcControllerCellScanner(CellScanner cellScanner) {<a name="line.146"></a>
+<span class="sourceLineNo">147</span>    if (getRpcController() != null &amp;&amp; getRpcController() instanceof HBaseRpcController) {<a name="line.147"></a>
+<span class="sourceLineNo">148</span>      ((HBaseRpcController)this.rpcController).setCellScanner(cellScanner);<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><a name="line.151"></a>
+<span class="sourceLineNo">152</span>  /**<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   * @return {@link ClusterConnection} instance used by this Callable.<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   */<a name="line.154"></a>
+<span class="sourceLineNo">155</span>  protected ClusterConnection getConnection() {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    return (ClusterConnection) this.connection;<a name="line.156"></a>
+<span class="sourceLineNo">157</span>  }<a name="line.157"></a>
+<span class="sourceLineNo">158</span><a name="line.158"></a>
+<span class="sourceLineNo">159</span>  protected HRegionLocation getLocation() {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    return this.location;<a name="line.160"></a>
+<span class="sourceLineNo">161</span>  }<a name="line.161"></a>
+<span class="sourceLineNo">162</span><a name="line.162"></a>
+<span class="sourceLineNo">163</span>  protected void setLocation(final HRegionLocation location) {<a name="line.163"></a>
+<span class="sourceLineNo">164</span>    this.location = location;<a name="line.164"></a>
+<span class="sourceLineNo">165</span>  }<a name="line.165"></a>
+<span class="sourceLineNo">166</span><a name="line.166"></a>
+<span class="sourceLineNo">167</span>  public TableName getTableName() {<a name="line.167"></a>
+<span class="sourceLineNo">168</span>    return this.tableName;<a name="line.168"></a>
+<span class="sourceLineNo">169</span>  }<a name="line.169"></a>
+<span class="sourceLineNo">170</span><a name="line.170"></a>
+<span class="sourceLineNo">171</span>  public byte [] getRow() {<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    return this.row;<a name="line.172"></a>
+<span class="sourceLineNo">173</span>  }<a name="line.173"></a>
+<span class="sourceLineNo">174</span><a name="line.174"></a>
+<span class="sourceLineNo">175</span>  public void throwable(Throwable t, boolean retrying) {<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    if (location != null) {<a name="line.176"></a>
+<span class="sourceLineNo">177</span>      getConnection().updateCachedLocations(tableName, location.getRegionInfo().getRegionName(),<a name="line.177"></a>
+<span class="sourceLineNo">178</span>          row, t, location.getServerName());<a name="line.178"></a>
+<span class="sourceLineNo">179</span>    }<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>  public String getExceptionMessageAdditionalDetail() {<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    return "row '" + Bytes.toString(row) + "' on table '" + tableName + "' at " + location;<a name="line.183"></a>
+<span class="sourceLineNo">184</span>  }<a name="line.184"></a>
+<span class="sourceLineNo">185</span><a name="line.185"></a>
+<span class="sourceLineNo">186</span>  public long sleep(long pause, int tries) {<a name="line.186"></a>
+<span class="sourceLineNo">187</span>    return ConnectionUtils.getPauseTime(pause, tries);<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>   * @return the HRegionInfo for the current region<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   */<a name="line.192"></a>
+<span class="sourceLineNo">193</span>  public HRegionInfo getHRegionInfo() {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    if (this.location == null) {<a name="line.194"></a>
+<span class="sourceLineNo">195</span>      return null;<a name="line.195"></a>
+<span class="sourceLineNo">196</span>    }<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    return this.location.getRegionInfo();<a name="line.197"></a>
+<span class="sourceLineNo">198</span>  }<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span>  public void prepare(final boolean reload) throws IOException {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>    // check table state if this is a retry<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    if (reload &amp;&amp; tableName != null &amp;&amp; !tableName.equals(TableName.META_TABLE_NAME)<a name="line.202"></a>
+<span class="sourceLineNo">203</span>        &amp;&amp; getConnection().isTableDisabled(tableName)) {<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      throw new TableNotEnabledException(tableName.getNameAsString() + " is disabled.");<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    try (RegionLocator regionLocator = connection.getRegionLocator(tableName)) {<a name="line.206"></a>
+<span class="sourceLineNo">207</span>      this.location = regionLocator.getRegionLocation(row);<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    }<a name="line.208"></a>
+<span class="sourceLineNo">209</span>    if (this.location == null) {<a name="line.209"></a>
+<span class="sourceLineNo">210</span>      throw new IOException("Failed to find location, tableName=" + tableName +<a name="line.210"></a>
+<span class="sourceLineNo">211</span>          ", row=" + Bytes.toString(row) + ", reload=" + reload);<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    }<a name="line.212"></a>
+<span class="sourceLineNo">213</span>    setStubByServiceName(this.location.getServerName());<a name="line.213"></a>
+<span class="sourceLineNo">214</span>  }<a name="line.214"></a>
+<span class="sourceLineNo">215</span><a name="line.215"></a>
+<span class="sourceLineNo">216</span>  /**<a name="line.216"></a>
+<span class="sourceLineNo">217</span>   * Set the RCP client stub<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   * @param serviceName to get the rpc stub for<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   * @throws IOException When client could not be created<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   */<a name="line.220"></a>
+<span class="sourceLineNo">221</span>  protected abstract void setStubByServiceName(ServerName serviceName) throws IOException;<a name="line.221"></a>
+<span class="sourceLineNo">222</span>}<a name="line.222"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/9eba7fcf/devapidocs/src-html/org/apache/hadoop/hbase/constraint/Constraints.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/constraint/Constraints.html b/devapidocs/src-html/org/apache/hadoop/hbase/constraint/Constraints.html
index d56855a..8dfed95 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/constraint/Constraints.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/constraint/Constraints.html
@@ -622,8 +622,8 @@
 <span class="sourceLineNo">614</span>    @Override<a name="line.614"></a>
 <span class="sourceLineNo">615</span>    public int compare(Constraint c1, Constraint c2) {<a name="line.615"></a>
 <span class="sourceLineNo">616</span>      // compare the priorities of the constraints stored in their configuration<a name="line.616"></a>
-<span class="sourceLineNo">617</span>      return Long.valueOf(c1.getConf().getLong(PRIORITY_KEY, DEFAULT_PRIORITY))<a name="line.617"></a>
-<span class="sourceLineNo">618</span>          .compareTo(c2.getConf().getLong(PRIORITY_KEY, DEFAULT_PRIORITY));<a name="line.618"></a>
+<span class="sourceLineNo">617</span>      return Long.compare(c1.getConf().getLong(PRIORITY_KEY, DEFAULT_PRIORITY),<a name="line.617"></a>
+<span class="sourceLineNo">618</span>          c2.getConf().getLong(PRIORITY_KEY, DEFAULT_PRIORITY));<a name="line.618"></a>
 <span class="sourceLineNo">619</span>    }<a name="line.619"></a>
 <span class="sourceLineNo">620</span>  };<a name="line.620"></a>
 <span class="sourceLineNo">621</span><a name="line.621"></a>


Mime
View raw message