hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject [03/52] [partial] hbase-site git commit: Published site at 26a94844f533b95db1f0a58d6a7cc3dc4a7a7098.
Date Sun, 05 Feb 2017 15:49:25 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/62e361eb/apidocs/src-html/org/apache/hadoop/hbase/rest/client/Response.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/rest/client/Response.html b/apidocs/src-html/org/apache/hadoop/hbase/rest/client/Response.html
index 21936c2..226ddc3 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/rest/client/Response.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/rest/client/Response.html
@@ -30,150 +30,153 @@
 <span class="sourceLineNo">022</span>import java.io.IOException;<a name="line.22"></a>
 <span class="sourceLineNo">023</span>import java.io.InputStream;<a name="line.23"></a>
 <span class="sourceLineNo">024</span><a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.http.Header;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.http.HttpResponse;<a name="line.26"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.logging.Log;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.commons.logging.LogFactory;<a name="line.26"></a>
 <span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.27"></a>
 <span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.classification.InterfaceStability;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.mortbay.log.Log;<a name="line.29"></a>
-<span class="sourceLineNo">030</span><a name="line.30"></a>
-<span class="sourceLineNo">031</span>/**<a name="line.31"></a>
-<span class="sourceLineNo">032</span> * The HTTP result code, response headers, and body of a HTTP response.<a name="line.32"></a>
-<span class="sourceLineNo">033</span> */<a name="line.33"></a>
-<span class="sourceLineNo">034</span>@InterfaceAudience.Public<a name="line.34"></a>
-<span class="sourceLineNo">035</span>@InterfaceStability.Stable<a name="line.35"></a>
-<span class="sourceLineNo">036</span>public class Response {<a name="line.36"></a>
-<span class="sourceLineNo">037</span>  private int code;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>  private Header[] headers;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>  private byte[] body;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>  private HttpResponse resp;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>  private InputStream stream;<a name="line.41"></a>
-<span class="sourceLineNo">042</span><a name="line.42"></a>
-<span class="sourceLineNo">043</span>  /**<a name="line.43"></a>
-<span class="sourceLineNo">044</span>   * Constructor<a name="line.44"></a>
-<span class="sourceLineNo">045</span>   * @param code the HTTP response code<a name="line.45"></a>
-<span class="sourceLineNo">046</span>   */<a name="line.46"></a>
-<span class="sourceLineNo">047</span>  public Response(int code) {<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    this(code, null, null);<a name="line.48"></a>
-<span class="sourceLineNo">049</span>  }<a name="line.49"></a>
-<span class="sourceLineNo">050</span><a name="line.50"></a>
-<span class="sourceLineNo">051</span>  /**<a name="line.51"></a>
-<span class="sourceLineNo">052</span>   * Constructor<a name="line.52"></a>
-<span class="sourceLineNo">053</span>   * @param code the HTTP response code<a name="line.53"></a>
-<span class="sourceLineNo">054</span>   * @param headers the HTTP response headers<a name="line.54"></a>
-<span class="sourceLineNo">055</span>   */<a name="line.55"></a>
-<span class="sourceLineNo">056</span>  public Response(int code, Header[] headers) {<a name="line.56"></a>
-<span class="sourceLineNo">057</span>    this(code, headers, null);<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>  /**<a name="line.60"></a>
-<span class="sourceLineNo">061</span>   * Constructor<a name="line.61"></a>
-<span class="sourceLineNo">062</span>   * @param code the HTTP response code<a name="line.62"></a>
-<span class="sourceLineNo">063</span>   * @param headers the HTTP response headers<a name="line.63"></a>
-<span class="sourceLineNo">064</span>   * @param body the response body, can be null<a name="line.64"></a>
-<span class="sourceLineNo">065</span>   */<a name="line.65"></a>
-<span class="sourceLineNo">066</span>  public Response(int code, Header[] headers, byte[] body) {<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    this.code = code;<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    this.headers = headers;<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    this.body = body;<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>  /**<a name="line.72"></a>
-<span class="sourceLineNo">073</span>   * Constructor<a name="line.73"></a>
-<span class="sourceLineNo">074</span>   * @param code the HTTP response code<a name="line.74"></a>
-<span class="sourceLineNo">075</span>   * @param headers headers the HTTP response headers<a name="line.75"></a>
-<span class="sourceLineNo">076</span>   * @param resp the response<a name="line.76"></a>
-<span class="sourceLineNo">077</span>   * @param in Inputstream if the response had one.<a name="line.77"></a>
-<span class="sourceLineNo">078</span>   * Note: this is not thread-safe<a name="line.78"></a>
-<span class="sourceLineNo">079</span>   */<a name="line.79"></a>
-<span class="sourceLineNo">080</span>  public Response(int code, Header[] headers, HttpResponse resp, InputStream in) {<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    this.code = code;<a name="line.81"></a>
-<span class="sourceLineNo">082</span>    this.headers = headers;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    this.body = null;<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    this.resp = resp;<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    this.stream = in;<a name="line.85"></a>
-<span class="sourceLineNo">086</span>  }<a name="line.86"></a>
-<span class="sourceLineNo">087</span><a name="line.87"></a>
-<span class="sourceLineNo">088</span>  /**<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   * @return the HTTP response code<a name="line.89"></a>
-<span class="sourceLineNo">090</span>   */<a name="line.90"></a>
-<span class="sourceLineNo">091</span>  public int getCode() {<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    return code;<a name="line.92"></a>
-<span class="sourceLineNo">093</span>  }<a name="line.93"></a>
-<span class="sourceLineNo">094</span>  <a name="line.94"></a>
-<span class="sourceLineNo">095</span>  /**<a name="line.95"></a>
-<span class="sourceLineNo">096</span>   * Gets the input stream instance.<a name="line.96"></a>
-<span class="sourceLineNo">097</span>   *<a name="line.97"></a>
-<span class="sourceLineNo">098</span>   * @return an instance of InputStream class.<a name="line.98"></a>
-<span class="sourceLineNo">099</span>   */<a name="line.99"></a>
-<span class="sourceLineNo">100</span>  public InputStream getStream(){<a name="line.100"></a>
-<span class="sourceLineNo">101</span>    return this.stream;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>  }<a name="line.102"></a>
-<span class="sourceLineNo">103</span><a name="line.103"></a>
-<span class="sourceLineNo">104</span>  /**<a name="line.104"></a>
-<span class="sourceLineNo">105</span>   * @return the HTTP response headers<a name="line.105"></a>
-<span class="sourceLineNo">106</span>   */<a name="line.106"></a>
-<span class="sourceLineNo">107</span>  public Header[] getHeaders() {<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    return headers;<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>  public String getHeader(String key) {<a name="line.111"></a>
-<span class="sourceLineNo">112</span>    for (Header header: headers) {<a name="line.112"></a>
-<span class="sourceLineNo">113</span>      if (header.getName().equalsIgnoreCase(key)) {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>        return header.getValue();<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 null;<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>  /**<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   * @return the value of the Location header<a name="line.121"></a>
-<span class="sourceLineNo">122</span>   */<a name="line.122"></a>
-<span class="sourceLineNo">123</span>  public String getLocation() {<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    return getHeader("Location");<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>  /**<a name="line.127"></a>
-<span class="sourceLineNo">128</span>   * @return true if a response body was sent<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   */<a name="line.129"></a>
-<span class="sourceLineNo">130</span>  public boolean hasBody() {<a name="line.130"></a>
-<span class="sourceLineNo">131</span>    return body != null;<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>  /**<a name="line.134"></a>
-<span class="sourceLineNo">135</span>   * @return the HTTP response body<a name="line.135"></a>
-<span class="sourceLineNo">136</span>   */<a name="line.136"></a>
-<span class="sourceLineNo">137</span>  public byte[] getBody() {<a name="line.137"></a>
-<span class="sourceLineNo">138</span>    if (body == null) {<a name="line.138"></a>
-<span class="sourceLineNo">139</span>      try {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>        body = Client.getResponseBody(resp);<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      } catch (IOException ioe) {<a name="line.141"></a>
-<span class="sourceLineNo">142</span>        Log.debug("encountered ioe when obtaining body", ioe);<a name="line.142"></a>
-<span class="sourceLineNo">143</span>      }<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    }<a name="line.144"></a>
-<span class="sourceLineNo">145</span>    return body;<a name="line.145"></a>
-<span class="sourceLineNo">146</span>  }<a name="line.146"></a>
-<span class="sourceLineNo">147</span><a name="line.147"></a>
-<span class="sourceLineNo">148</span>  /**<a name="line.148"></a>
-<span class="sourceLineNo">149</span>   * @param code the HTTP response code<a name="line.149"></a>
-<span class="sourceLineNo">150</span>   */<a name="line.150"></a>
-<span class="sourceLineNo">151</span>  public void setCode(int code) {<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    this.code = code;<a name="line.152"></a>
-<span class="sourceLineNo">153</span>  }<a name="line.153"></a>
-<span class="sourceLineNo">154</span><a name="line.154"></a>
-<span class="sourceLineNo">155</span>  /**<a name="line.155"></a>
-<span class="sourceLineNo">156</span>   * @param headers the HTTP response headers<a name="line.156"></a>
-<span class="sourceLineNo">157</span>   */<a name="line.157"></a>
-<span class="sourceLineNo">158</span>  public void setHeaders(Header[] headers) {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>    this.headers = headers;<a name="line.159"></a>
-<span class="sourceLineNo">160</span>  }<a name="line.160"></a>
-<span class="sourceLineNo">161</span><a name="line.161"></a>
-<span class="sourceLineNo">162</span>  /**<a name="line.162"></a>
-<span class="sourceLineNo">163</span>   * @param body the response body<a name="line.163"></a>
-<span class="sourceLineNo">164</span>   */<a name="line.164"></a>
-<span class="sourceLineNo">165</span>  public void setBody(byte[] body) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    this.body = body;<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">029</span>import org.apache.http.Header;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.http.HttpResponse;<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>/**<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * The HTTP result code, response headers, and body of a HTTP response.<a name="line.33"></a>
+<span class="sourceLineNo">034</span> */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>@InterfaceAudience.Public<a name="line.35"></a>
+<span class="sourceLineNo">036</span>@InterfaceStability.Stable<a name="line.36"></a>
+<span class="sourceLineNo">037</span>public class Response {<a name="line.37"></a>
+<span class="sourceLineNo">038</span>  private static final Log LOG = LogFactory.getLog(Response.class);<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span>  private int code;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>  private Header[] headers;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>  private byte[] body;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>  private HttpResponse resp;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>  private InputStream stream;<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>  /**<a name="line.46"></a>
+<span class="sourceLineNo">047</span>   * Constructor<a name="line.47"></a>
+<span class="sourceLineNo">048</span>   * @param code the HTTP response code<a name="line.48"></a>
+<span class="sourceLineNo">049</span>   */<a name="line.49"></a>
+<span class="sourceLineNo">050</span>  public Response(int code) {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    this(code, null, null);<a name="line.51"></a>
+<span class="sourceLineNo">052</span>  }<a name="line.52"></a>
+<span class="sourceLineNo">053</span><a name="line.53"></a>
+<span class="sourceLineNo">054</span>  /**<a name="line.54"></a>
+<span class="sourceLineNo">055</span>   * Constructor<a name="line.55"></a>
+<span class="sourceLineNo">056</span>   * @param code the HTTP response code<a name="line.56"></a>
+<span class="sourceLineNo">057</span>   * @param headers the HTTP response headers<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   */<a name="line.58"></a>
+<span class="sourceLineNo">059</span>  public Response(int code, Header[] headers) {<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    this(code, headers, null);<a name="line.60"></a>
+<span class="sourceLineNo">061</span>  }<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>   * Constructor<a name="line.64"></a>
+<span class="sourceLineNo">065</span>   * @param code the HTTP response code<a name="line.65"></a>
+<span class="sourceLineNo">066</span>   * @param headers the HTTP response headers<a name="line.66"></a>
+<span class="sourceLineNo">067</span>   * @param body the response body, can be null<a name="line.67"></a>
+<span class="sourceLineNo">068</span>   */<a name="line.68"></a>
+<span class="sourceLineNo">069</span>  public Response(int code, Header[] headers, byte[] body) {<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    this.code = code;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    this.headers = headers;<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    this.body = body;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>  }<a name="line.73"></a>
+<span class="sourceLineNo">074</span>  <a name="line.74"></a>
+<span class="sourceLineNo">075</span>  /**<a name="line.75"></a>
+<span class="sourceLineNo">076</span>   * Constructor<a name="line.76"></a>
+<span class="sourceLineNo">077</span>   * @param code the HTTP response code<a name="line.77"></a>
+<span class="sourceLineNo">078</span>   * @param headers headers the HTTP response headers<a name="line.78"></a>
+<span class="sourceLineNo">079</span>   * @param resp the response<a name="line.79"></a>
+<span class="sourceLineNo">080</span>   * @param in Inputstream if the response had one.<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   * Note: this is not thread-safe<a name="line.81"></a>
+<span class="sourceLineNo">082</span>   */<a name="line.82"></a>
+<span class="sourceLineNo">083</span>  public Response(int code, Header[] headers, HttpResponse resp, InputStream in) {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    this.code = code;<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    this.headers = headers;<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    this.body = null;<a name="line.86"></a>
+<span class="sourceLineNo">087</span>    this.resp = resp;<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    this.stream = in;<a name="line.88"></a>
+<span class="sourceLineNo">089</span>  }<a name="line.89"></a>
+<span class="sourceLineNo">090</span><a name="line.90"></a>
+<span class="sourceLineNo">091</span>  /**<a name="line.91"></a>
+<span class="sourceLineNo">092</span>   * @return the HTTP response code<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   */<a name="line.93"></a>
+<span class="sourceLineNo">094</span>  public int getCode() {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>    return code;<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>   * Gets the input stream instance.<a name="line.99"></a>
+<span class="sourceLineNo">100</span>   *<a name="line.100"></a>
+<span class="sourceLineNo">101</span>   * @return an instance of InputStream class.<a name="line.101"></a>
+<span class="sourceLineNo">102</span>   */<a name="line.102"></a>
+<span class="sourceLineNo">103</span>  public InputStream getStream(){<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    return this.stream;<a name="line.104"></a>
+<span class="sourceLineNo">105</span>  }<a name="line.105"></a>
+<span class="sourceLineNo">106</span><a name="line.106"></a>
+<span class="sourceLineNo">107</span>  /**<a name="line.107"></a>
+<span class="sourceLineNo">108</span>   * @return the HTTP response headers<a name="line.108"></a>
+<span class="sourceLineNo">109</span>   */<a name="line.109"></a>
+<span class="sourceLineNo">110</span>  public Header[] getHeaders() {<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    return headers;<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 String getHeader(String key) {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    for (Header header: headers) {<a name="line.115"></a>
+<span class="sourceLineNo">116</span>      if (header.getName().equalsIgnoreCase(key)) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>        return header.getValue();<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 null;<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>   * @return the value of the Location header<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   */<a name="line.125"></a>
+<span class="sourceLineNo">126</span>  public String getLocation() {<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    return getHeader("Location");<a name="line.127"></a>
+<span class="sourceLineNo">128</span>  }<a name="line.128"></a>
+<span class="sourceLineNo">129</span><a name="line.129"></a>
+<span class="sourceLineNo">130</span>  /**<a name="line.130"></a>
+<span class="sourceLineNo">131</span>   * @return true if a response body was sent<a name="line.131"></a>
+<span class="sourceLineNo">132</span>   */<a name="line.132"></a>
+<span class="sourceLineNo">133</span>  public boolean hasBody() {<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    return body != 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>  /**<a name="line.137"></a>
+<span class="sourceLineNo">138</span>   * @return the HTTP response body<a name="line.138"></a>
+<span class="sourceLineNo">139</span>   */<a name="line.139"></a>
+<span class="sourceLineNo">140</span>  public byte[] getBody() {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    if (body == null) {<a name="line.141"></a>
+<span class="sourceLineNo">142</span>      try {<a name="line.142"></a>
+<span class="sourceLineNo">143</span>        body = Client.getResponseBody(resp);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>      } catch (IOException ioe) {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        LOG.debug("encountered ioe when obtaining body", ioe);<a name="line.145"></a>
+<span class="sourceLineNo">146</span>      }<a name="line.146"></a>
+<span class="sourceLineNo">147</span>    }<a name="line.147"></a>
+<span class="sourceLineNo">148</span>    return body;<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>   * @param code the HTTP response code<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   */<a name="line.153"></a>
+<span class="sourceLineNo">154</span>  public void setCode(int code) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    this.code = code;<a name="line.155"></a>
+<span class="sourceLineNo">156</span>  }<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>   * @param headers the HTTP response headers<a name="line.159"></a>
+<span class="sourceLineNo">160</span>   */<a name="line.160"></a>
+<span class="sourceLineNo">161</span>  public void setHeaders(Header[] headers) {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>    this.headers = headers;<a name="line.162"></a>
+<span class="sourceLineNo">163</span>  }<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>  /**<a name="line.165"></a>
+<span class="sourceLineNo">166</span>   * @param body the response body<a name="line.166"></a>
+<span class="sourceLineNo">167</span>   */<a name="line.167"></a>
+<span class="sourceLineNo">168</span>  public void setBody(byte[] body) {<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    this.body = body;<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>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/62e361eb/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
index 9c509cf..6552d0b 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
@@ -1043,79 +1043,87 @@
 <span class="sourceLineNo">1035</span>          .toBuilder()<a name="line.1035"></a>
 <span class="sourceLineNo">1036</span>          .setName(targetName)<a name="line.1036"></a>
 <span class="sourceLineNo">1037</span>          .build();<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>      SnapshotDescriptionUtils.writeSnapshotInfo(snapshotDesc, snapshotTmpDir, outputFs);<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>    }<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span><a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>    // Step 2 - Start MR Job to copy files<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>    // The snapshot references must be copied before the files otherwise the files gets removed<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>    // by the HFileArchiver, since they have no references.<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>    try {<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>      runCopyJob(inputRoot, outputRoot, snapshotName, snapshotDir, verifyChecksum,<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>                 filesUser, filesGroup, filesMode, mappers, bandwidthMB);<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span><a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>      LOG.info("Finalize the Snapshot Export");<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>      if (!skipTmp) {<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>        // Step 3 - Rename fs2:/.snapshot/.tmp/&lt;snapshot&gt; fs2:/.snapshot/&lt;snapshot&gt;<a name="line.1050"></a>
-<span class="sourceLineNo">1051</span>        if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {<a name="line.1051"></a>
-<span class="sourceLineNo">1052</span>          throw new ExportSnapshotException("Unable to rename snapshot directory from=" +<a name="line.1052"></a>
-<span class="sourceLineNo">1053</span>            snapshotTmpDir + " to=" + outputSnapshotDir);<a name="line.1053"></a>
-<span class="sourceLineNo">1054</span>        }<a name="line.1054"></a>
-<span class="sourceLineNo">1055</span>      }<a name="line.1055"></a>
-<span class="sourceLineNo">1056</span><a name="line.1056"></a>
-<span class="sourceLineNo">1057</span>      // Step 4 - Verify snapshot integrity<a name="line.1057"></a>
-<span class="sourceLineNo">1058</span>      if (verifyTarget) {<a name="line.1058"></a>
-<span class="sourceLineNo">1059</span>        LOG.info("Verify snapshot integrity");<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>        verifySnapshot(destConf, outputFs, outputRoot, outputSnapshotDir);<a name="line.1060"></a>
-<span class="sourceLineNo">1061</span>      }<a name="line.1061"></a>
-<span class="sourceLineNo">1062</span><a name="line.1062"></a>
-<span class="sourceLineNo">1063</span>      LOG.info("Export Completed: " + targetName);<a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>      return 0;<a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>    } catch (Exception e) {<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>      LOG.error("Snapshot export failed", e);<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>      if (!skipTmp) {<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span>        outputFs.delete(snapshotTmpDir, true);<a name="line.1068"></a>
+<span class="sourceLineNo">1038</span>      SnapshotDescriptionUtils.writeSnapshotInfo(snapshotDesc, initialOutputSnapshotDir, outputFs);<a name="line.1038"></a>
+<span class="sourceLineNo">1039</span>      if (filesUser != null || filesGroup != null) {<a name="line.1039"></a>
+<span class="sourceLineNo">1040</span>        outputFs.setOwner(new Path(initialOutputSnapshotDir,<a name="line.1040"></a>
+<span class="sourceLineNo">1041</span>          SnapshotDescriptionUtils.SNAPSHOTINFO_FILE), filesUser, filesGroup);<a name="line.1041"></a>
+<span class="sourceLineNo">1042</span>      }<a name="line.1042"></a>
+<span class="sourceLineNo">1043</span>      if (filesMode &gt; 0) {<a name="line.1043"></a>
+<span class="sourceLineNo">1044</span>        outputFs.setPermission(new Path(initialOutputSnapshotDir,<a name="line.1044"></a>
+<span class="sourceLineNo">1045</span>          SnapshotDescriptionUtils.SNAPSHOTINFO_FILE), new FsPermission((short)filesMode));<a name="line.1045"></a>
+<span class="sourceLineNo">1046</span>      }<a name="line.1046"></a>
+<span class="sourceLineNo">1047</span>    }<a name="line.1047"></a>
+<span class="sourceLineNo">1048</span><a name="line.1048"></a>
+<span class="sourceLineNo">1049</span>    // Step 2 - Start MR Job to copy files<a name="line.1049"></a>
+<span class="sourceLineNo">1050</span>    // The snapshot references must be copied before the files otherwise the files gets removed<a name="line.1050"></a>
+<span class="sourceLineNo">1051</span>    // by the HFileArchiver, since they have no references.<a name="line.1051"></a>
+<span class="sourceLineNo">1052</span>    try {<a name="line.1052"></a>
+<span class="sourceLineNo">1053</span>      runCopyJob(inputRoot, outputRoot, snapshotName, snapshotDir, verifyChecksum,<a name="line.1053"></a>
+<span class="sourceLineNo">1054</span>                 filesUser, filesGroup, filesMode, mappers, bandwidthMB);<a name="line.1054"></a>
+<span class="sourceLineNo">1055</span><a name="line.1055"></a>
+<span class="sourceLineNo">1056</span>      LOG.info("Finalize the Snapshot Export");<a name="line.1056"></a>
+<span class="sourceLineNo">1057</span>      if (!skipTmp) {<a name="line.1057"></a>
+<span class="sourceLineNo">1058</span>        // Step 3 - Rename fs2:/.snapshot/.tmp/&lt;snapshot&gt; fs2:/.snapshot/&lt;snapshot&gt;<a name="line.1058"></a>
+<span class="sourceLineNo">1059</span>        if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {<a name="line.1059"></a>
+<span class="sourceLineNo">1060</span>          throw new ExportSnapshotException("Unable to rename snapshot directory from=" +<a name="line.1060"></a>
+<span class="sourceLineNo">1061</span>            snapshotTmpDir + " to=" + outputSnapshotDir);<a name="line.1061"></a>
+<span class="sourceLineNo">1062</span>        }<a name="line.1062"></a>
+<span class="sourceLineNo">1063</span>      }<a name="line.1063"></a>
+<span class="sourceLineNo">1064</span><a name="line.1064"></a>
+<span class="sourceLineNo">1065</span>      // Step 4 - Verify snapshot integrity<a name="line.1065"></a>
+<span class="sourceLineNo">1066</span>      if (verifyTarget) {<a name="line.1066"></a>
+<span class="sourceLineNo">1067</span>        LOG.info("Verify snapshot integrity");<a name="line.1067"></a>
+<span class="sourceLineNo">1068</span>        verifySnapshot(destConf, outputFs, outputRoot, outputSnapshotDir);<a name="line.1068"></a>
 <span class="sourceLineNo">1069</span>      }<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span>      outputFs.delete(outputSnapshotDir, true);<a name="line.1070"></a>
-<span class="sourceLineNo">1071</span>      return 1;<a name="line.1071"></a>
-<span class="sourceLineNo">1072</span>    } finally {<a name="line.1072"></a>
-<span class="sourceLineNo">1073</span>      IOUtils.closeStream(inputFs);<a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>      IOUtils.closeStream(outputFs);<a name="line.1074"></a>
-<span class="sourceLineNo">1075</span>    }<a name="line.1075"></a>
-<span class="sourceLineNo">1076</span>  }<a name="line.1076"></a>
-<span class="sourceLineNo">1077</span><a name="line.1077"></a>
-<span class="sourceLineNo">1078</span>  @Override<a name="line.1078"></a>
-<span class="sourceLineNo">1079</span>  protected void printUsage() {<a name="line.1079"></a>
-<span class="sourceLineNo">1080</span>    super.printUsage();<a name="line.1080"></a>
-<span class="sourceLineNo">1081</span>    System.out.println("\n"<a name="line.1081"></a>
-<span class="sourceLineNo">1082</span>        + "Examples:\n"<a name="line.1082"></a>
-<span class="sourceLineNo">1083</span>        + "  hbase snapshot export \\\n"<a name="line.1083"></a>
-<span class="sourceLineNo">1084</span>        + "    --snapshot MySnapshot --copy-to hdfs://srv2:8082/hbase \\\n"<a name="line.1084"></a>
-<span class="sourceLineNo">1085</span>        + "    --chuser MyUser --chgroup MyGroup --chmod 700 --mappers 16\n"<a name="line.1085"></a>
-<span class="sourceLineNo">1086</span>        + "\n"<a name="line.1086"></a>
-<span class="sourceLineNo">1087</span>        + "  hbase snapshot export \\\n"<a name="line.1087"></a>
-<span class="sourceLineNo">1088</span>        + "    --snapshot MySnapshot --copy-from hdfs://srv2:8082/hbase \\\n"<a name="line.1088"></a>
-<span class="sourceLineNo">1089</span>        + "    --copy-to hdfs://srv1:50070/hbase");<a name="line.1089"></a>
-<span class="sourceLineNo">1090</span>  }<a name="line.1090"></a>
-<span class="sourceLineNo">1091</span><a name="line.1091"></a>
-<span class="sourceLineNo">1092</span>  @Override protected void addOptions() {<a name="line.1092"></a>
-<span class="sourceLineNo">1093</span>    addRequiredOption(Options.SNAPSHOT);<a name="line.1093"></a>
-<span class="sourceLineNo">1094</span>    addOption(Options.COPY_TO);<a name="line.1094"></a>
-<span class="sourceLineNo">1095</span>    addOption(Options.COPY_FROM);<a name="line.1095"></a>
-<span class="sourceLineNo">1096</span>    addOption(Options.TARGET_NAME);<a name="line.1096"></a>
-<span class="sourceLineNo">1097</span>    addOption(Options.NO_CHECKSUM_VERIFY);<a name="line.1097"></a>
-<span class="sourceLineNo">1098</span>    addOption(Options.NO_TARGET_VERIFY);<a name="line.1098"></a>
-<span class="sourceLineNo">1099</span>    addOption(Options.OVERWRITE);<a name="line.1099"></a>
-<span class="sourceLineNo">1100</span>    addOption(Options.CHUSER);<a name="line.1100"></a>
-<span class="sourceLineNo">1101</span>    addOption(Options.CHGROUP);<a name="line.1101"></a>
-<span class="sourceLineNo">1102</span>    addOption(Options.CHMOD);<a name="line.1102"></a>
-<span class="sourceLineNo">1103</span>    addOption(Options.MAPPERS);<a name="line.1103"></a>
-<span class="sourceLineNo">1104</span>    addOption(Options.BANDWIDTH);<a name="line.1104"></a>
-<span class="sourceLineNo">1105</span>  }<a name="line.1105"></a>
-<span class="sourceLineNo">1106</span><a name="line.1106"></a>
-<span class="sourceLineNo">1107</span>  public static void main(String[] args) {<a name="line.1107"></a>
-<span class="sourceLineNo">1108</span>    new ExportSnapshot().doStaticMain(args);<a name="line.1108"></a>
-<span class="sourceLineNo">1109</span>  }<a name="line.1109"></a>
-<span class="sourceLineNo">1110</span>}<a name="line.1110"></a>
+<span class="sourceLineNo">1070</span><a name="line.1070"></a>
+<span class="sourceLineNo">1071</span>      LOG.info("Export Completed: " + targetName);<a name="line.1071"></a>
+<span class="sourceLineNo">1072</span>      return 0;<a name="line.1072"></a>
+<span class="sourceLineNo">1073</span>    } catch (Exception e) {<a name="line.1073"></a>
+<span class="sourceLineNo">1074</span>      LOG.error("Snapshot export failed", e);<a name="line.1074"></a>
+<span class="sourceLineNo">1075</span>      if (!skipTmp) {<a name="line.1075"></a>
+<span class="sourceLineNo">1076</span>        outputFs.delete(snapshotTmpDir, true);<a name="line.1076"></a>
+<span class="sourceLineNo">1077</span>      }<a name="line.1077"></a>
+<span class="sourceLineNo">1078</span>      outputFs.delete(outputSnapshotDir, true);<a name="line.1078"></a>
+<span class="sourceLineNo">1079</span>      return 1;<a name="line.1079"></a>
+<span class="sourceLineNo">1080</span>    } finally {<a name="line.1080"></a>
+<span class="sourceLineNo">1081</span>      IOUtils.closeStream(inputFs);<a name="line.1081"></a>
+<span class="sourceLineNo">1082</span>      IOUtils.closeStream(outputFs);<a name="line.1082"></a>
+<span class="sourceLineNo">1083</span>    }<a name="line.1083"></a>
+<span class="sourceLineNo">1084</span>  }<a name="line.1084"></a>
+<span class="sourceLineNo">1085</span><a name="line.1085"></a>
+<span class="sourceLineNo">1086</span>  @Override<a name="line.1086"></a>
+<span class="sourceLineNo">1087</span>  protected void printUsage() {<a name="line.1087"></a>
+<span class="sourceLineNo">1088</span>    super.printUsage();<a name="line.1088"></a>
+<span class="sourceLineNo">1089</span>    System.out.println("\n"<a name="line.1089"></a>
+<span class="sourceLineNo">1090</span>        + "Examples:\n"<a name="line.1090"></a>
+<span class="sourceLineNo">1091</span>        + "  hbase snapshot export \\\n"<a name="line.1091"></a>
+<span class="sourceLineNo">1092</span>        + "    --snapshot MySnapshot --copy-to hdfs://srv2:8082/hbase \\\n"<a name="line.1092"></a>
+<span class="sourceLineNo">1093</span>        + "    --chuser MyUser --chgroup MyGroup --chmod 700 --mappers 16\n"<a name="line.1093"></a>
+<span class="sourceLineNo">1094</span>        + "\n"<a name="line.1094"></a>
+<span class="sourceLineNo">1095</span>        + "  hbase snapshot export \\\n"<a name="line.1095"></a>
+<span class="sourceLineNo">1096</span>        + "    --snapshot MySnapshot --copy-from hdfs://srv2:8082/hbase \\\n"<a name="line.1096"></a>
+<span class="sourceLineNo">1097</span>        + "    --copy-to hdfs://srv1:50070/hbase");<a name="line.1097"></a>
+<span class="sourceLineNo">1098</span>  }<a name="line.1098"></a>
+<span class="sourceLineNo">1099</span><a name="line.1099"></a>
+<span class="sourceLineNo">1100</span>  @Override protected void addOptions() {<a name="line.1100"></a>
+<span class="sourceLineNo">1101</span>    addRequiredOption(Options.SNAPSHOT);<a name="line.1101"></a>
+<span class="sourceLineNo">1102</span>    addOption(Options.COPY_TO);<a name="line.1102"></a>
+<span class="sourceLineNo">1103</span>    addOption(Options.COPY_FROM);<a name="line.1103"></a>
+<span class="sourceLineNo">1104</span>    addOption(Options.TARGET_NAME);<a name="line.1104"></a>
+<span class="sourceLineNo">1105</span>    addOption(Options.NO_CHECKSUM_VERIFY);<a name="line.1105"></a>
+<span class="sourceLineNo">1106</span>    addOption(Options.NO_TARGET_VERIFY);<a name="line.1106"></a>
+<span class="sourceLineNo">1107</span>    addOption(Options.OVERWRITE);<a name="line.1107"></a>
+<span class="sourceLineNo">1108</span>    addOption(Options.CHUSER);<a name="line.1108"></a>
+<span class="sourceLineNo">1109</span>    addOption(Options.CHGROUP);<a name="line.1109"></a>
+<span class="sourceLineNo">1110</span>    addOption(Options.CHMOD);<a name="line.1110"></a>
+<span class="sourceLineNo">1111</span>    addOption(Options.MAPPERS);<a name="line.1111"></a>
+<span class="sourceLineNo">1112</span>    addOption(Options.BANDWIDTH);<a name="line.1112"></a>
+<span class="sourceLineNo">1113</span>  }<a name="line.1113"></a>
+<span class="sourceLineNo">1114</span><a name="line.1114"></a>
+<span class="sourceLineNo">1115</span>  public static void main(String[] args) {<a name="line.1115"></a>
+<span class="sourceLineNo">1116</span>    new ExportSnapshot().doStaticMain(args);<a name="line.1116"></a>
+<span class="sourceLineNo">1117</span>  }<a name="line.1117"></a>
+<span class="sourceLineNo">1118</span>}<a name="line.1118"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/62e361eb/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html
index 5a9d349..608d19a 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html
@@ -549,7 +549,7 @@
 <span class="sourceLineNo">541</span><a name="line.541"></a>
 <span class="sourceLineNo">542</span>  @Override<a name="line.542"></a>
 <span class="sourceLineNo">543</span>  protected void printUsage() {<a name="line.543"></a>
-<span class="sourceLineNo">544</span>    printUsage("bin/hbase snapshot info [options]", "Options:", "");<a name="line.544"></a>
+<span class="sourceLineNo">544</span>    printUsage("hbase snapshot info [options]", "Options:", "");<a name="line.544"></a>
 <span class="sourceLineNo">545</span>    System.err.println("Examples:");<a name="line.545"></a>
 <span class="sourceLineNo">546</span>    System.err.println("  hbase snapshot info --snapshot MySnapshot --files");<a name="line.546"></a>
 <span class="sourceLineNo">547</span>  }<a name="line.547"></a>
@@ -694,7 +694,7 @@
 <span class="sourceLineNo">686</span>    List&lt;SnapshotDescription&gt; snapshotList = getSnapshotList(conf);<a name="line.686"></a>
 <span class="sourceLineNo">687</span><a name="line.687"></a>
 <span class="sourceLineNo">688</span><a name="line.688"></a>
-<span class="sourceLineNo">689</span>    if (snapshotList.size() == 0) {<a name="line.689"></a>
+<span class="sourceLineNo">689</span>    if (snapshotList.isEmpty()) {<a name="line.689"></a>
 <span class="sourceLineNo">690</span>      return Collections.emptyMap();<a name="line.690"></a>
 <span class="sourceLineNo">691</span>    }<a name="line.691"></a>
 <span class="sourceLineNo">692</span><a name="line.692"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/62e361eb/apidocs/src-html/org/apache/hadoop/hbase/util/FastLongHistogram.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/util/FastLongHistogram.html b/apidocs/src-html/org/apache/hadoop/hbase/util/FastLongHistogram.html
deleted file mode 100644
index 7778113..0000000
--- a/apidocs/src-html/org/apache/hadoop/hbase/util/FastLongHistogram.html
+++ /dev/null
@@ -1,382 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
-<head>
-<title>Source code</title>
-<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
-</head>
-<body>
-<div class="sourceContainer">
-<pre><span class="sourceLineNo">001</span>/**<a name="line.1"></a>
-<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one<a name="line.2"></a>
-<span class="sourceLineNo">003</span> * or more contributor license agreements.  See the NOTICE file<a name="line.3"></a>
-<span class="sourceLineNo">004</span> * distributed with this work for additional information<a name="line.4"></a>
-<span class="sourceLineNo">005</span> * regarding copyright ownership.  The ASF licenses this file<a name="line.5"></a>
-<span class="sourceLineNo">006</span> * to you under the Apache License, Version 2.0 (the<a name="line.6"></a>
-<span class="sourceLineNo">007</span> * "License"); you may not use this file except in compliance<a name="line.7"></a>
-<span class="sourceLineNo">008</span> * with the License.  You may obtain a copy of the License at<a name="line.8"></a>
-<span class="sourceLineNo">009</span> *<a name="line.9"></a>
-<span class="sourceLineNo">010</span> *     http://www.apache.org/licenses/LICENSE-2.0<a name="line.10"></a>
-<span class="sourceLineNo">011</span> *<a name="line.11"></a>
-<span class="sourceLineNo">012</span> * Unless required by applicable law or agreed to in writing, software<a name="line.12"></a>
-<span class="sourceLineNo">013</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.13"></a>
-<span class="sourceLineNo">014</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.14"></a>
-<span class="sourceLineNo">015</span> * See the License for the specific language governing permissions and<a name="line.15"></a>
-<span class="sourceLineNo">016</span> * limitations under the License.<a name="line.16"></a>
-<span class="sourceLineNo">017</span> */<a name="line.17"></a>
-<span class="sourceLineNo">018</span>package org.apache.hadoop.hbase.util;<a name="line.18"></a>
-<span class="sourceLineNo">019</span><a name="line.19"></a>
-<span class="sourceLineNo">020</span>import java.util.Arrays;<a name="line.20"></a>
-<span class="sourceLineNo">021</span>import java.util.concurrent.atomic.AtomicLong;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import java.util.concurrent.atomic.LongAdder;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import java.util.stream.Stream;<a name="line.23"></a>
-<span class="sourceLineNo">024</span><a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.classification.InterfaceStability;<a name="line.26"></a>
-<span class="sourceLineNo">027</span><a name="line.27"></a>
-<span class="sourceLineNo">028</span>/**<a name="line.28"></a>
-<span class="sourceLineNo">029</span> * FastLongHistogram is a thread-safe class that estimate distribution of data and computes the<a name="line.29"></a>
-<span class="sourceLineNo">030</span> * quantiles.<a name="line.30"></a>
-<span class="sourceLineNo">031</span> */<a name="line.31"></a>
-<span class="sourceLineNo">032</span>@InterfaceAudience.Public<a name="line.32"></a>
-<span class="sourceLineNo">033</span>@InterfaceStability.Evolving<a name="line.33"></a>
-<span class="sourceLineNo">034</span>public class FastLongHistogram {<a name="line.34"></a>
-<span class="sourceLineNo">035</span><a name="line.35"></a>
-<span class="sourceLineNo">036</span>  /**<a name="line.36"></a>
-<span class="sourceLineNo">037</span>   * Default number of bins.<a name="line.37"></a>
-<span class="sourceLineNo">038</span>   */<a name="line.38"></a>
-<span class="sourceLineNo">039</span>  public static final int DEFAULT_NBINS = 255;<a name="line.39"></a>
-<span class="sourceLineNo">040</span><a name="line.40"></a>
-<span class="sourceLineNo">041</span>  public static final double[] DEFAULT_QUANTILES =<a name="line.41"></a>
-<span class="sourceLineNo">042</span>      new double[]{0.25, 0.5, 0.75, 0.90, 0.95, 0.98, 0.99, 0.999};<a name="line.42"></a>
-<span class="sourceLineNo">043</span><a name="line.43"></a>
-<span class="sourceLineNo">044</span>  /**<a name="line.44"></a>
-<span class="sourceLineNo">045</span>   * Bins is a class containing a list of buckets(or bins) for estimation histogram of some data.<a name="line.45"></a>
-<span class="sourceLineNo">046</span>   */<a name="line.46"></a>
-<span class="sourceLineNo">047</span>  private static class Bins {<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    private final LongAdder[] counts;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>    // inclusive<a name="line.49"></a>
-<span class="sourceLineNo">050</span>    private final long binsMin;<a name="line.50"></a>
-<span class="sourceLineNo">051</span>    // exclusive<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    private final long binsMax;<a name="line.52"></a>
-<span class="sourceLineNo">053</span>    private final long bins10XMax;<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    private final AtomicLong min = new AtomicLong(Long.MAX_VALUE);<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    private final AtomicLong max = new AtomicLong(0L);<a name="line.55"></a>
-<span class="sourceLineNo">056</span><a name="line.56"></a>
-<span class="sourceLineNo">057</span>    private final LongAdder count = new LongAdder();<a name="line.57"></a>
-<span class="sourceLineNo">058</span>    private final LongAdder total = new LongAdder();<a name="line.58"></a>
-<span class="sourceLineNo">059</span><a name="line.59"></a>
-<span class="sourceLineNo">060</span>    // set to true when any of data has been inserted to the Bins. It is set after the counts are<a name="line.60"></a>
-<span class="sourceLineNo">061</span>    // updated.<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    private volatile boolean hasData = false;<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>     * The constructor for creating a Bins without any prior data.<a name="line.65"></a>
-<span class="sourceLineNo">066</span>     */<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    public Bins(int numBins) {<a name="line.67"></a>
-<span class="sourceLineNo">068</span>      counts = createCounters(numBins);<a name="line.68"></a>
-<span class="sourceLineNo">069</span>      this.binsMin = 1L;<a name="line.69"></a>
-<span class="sourceLineNo">070</span><a name="line.70"></a>
-<span class="sourceLineNo">071</span>      // These two numbers are total guesses<a name="line.71"></a>
-<span class="sourceLineNo">072</span>      // and should be treated as highly suspect.<a name="line.72"></a>
-<span class="sourceLineNo">073</span>      this.binsMax = 1000;<a name="line.73"></a>
-<span class="sourceLineNo">074</span>      this.bins10XMax = binsMax * 10;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    }<a name="line.75"></a>
-<span class="sourceLineNo">076</span><a name="line.76"></a>
-<span class="sourceLineNo">077</span>    /**<a name="line.77"></a>
-<span class="sourceLineNo">078</span>     * The constructor for creating a Bins with last Bins.<a name="line.78"></a>
-<span class="sourceLineNo">079</span>     */<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    public Bins(Bins last, int numBins, double minQ, double maxQ) {<a name="line.80"></a>
-<span class="sourceLineNo">081</span>      long[] values = last.getQuantiles(new double[] { minQ, maxQ });<a name="line.81"></a>
-<span class="sourceLineNo">082</span>      long wd = values[1] - values[0] + 1;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>      // expand minQ and maxQ in two ends back assuming uniform distribution<a name="line.83"></a>
-<span class="sourceLineNo">084</span>      this.binsMin = Math.max(0L, (long) (values[0] - wd * minQ));<a name="line.84"></a>
-<span class="sourceLineNo">085</span>      long binsMax = (long) (values[1] + wd * (1 - maxQ)) + 1;<a name="line.85"></a>
-<span class="sourceLineNo">086</span>      // make sure each of bins is at least of width 1<a name="line.86"></a>
-<span class="sourceLineNo">087</span>      this.binsMax = Math.max(binsMax, this.binsMin + numBins);<a name="line.87"></a>
-<span class="sourceLineNo">088</span>      this.bins10XMax = Math.max((long) (values[1] + (binsMax - 1) * 9), this.binsMax + 1);<a name="line.88"></a>
-<span class="sourceLineNo">089</span><a name="line.89"></a>
-<span class="sourceLineNo">090</span>      this.counts = createCounters(numBins);<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>    private LongAdder[] createCounters(int numBins) {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>      return Stream.generate(LongAdder::new).limit(numBins + 3).toArray(LongAdder[]::new);<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>    private int getIndex(long value) {<a name="line.97"></a>
-<span class="sourceLineNo">098</span>      if (value &lt; this.binsMin) {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>        return 0;<a name="line.99"></a>
-<span class="sourceLineNo">100</span>      } else if (value &gt; this.bins10XMax) {<a name="line.100"></a>
-<span class="sourceLineNo">101</span>        return this.counts.length - 1;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      } else if (value &gt;= this.binsMax) {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>        return this.counts.length - 2;<a name="line.103"></a>
-<span class="sourceLineNo">104</span>      }<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      // compute the position<a name="line.105"></a>
-<span class="sourceLineNo">106</span>      return 1 + (int) ((value - this.binsMin) * (this.counts.length - 3) /<a name="line.106"></a>
-<span class="sourceLineNo">107</span>          (this.binsMax - this.binsMin));<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><a name="line.110"></a>
-<span class="sourceLineNo">111</span>    /**<a name="line.111"></a>
-<span class="sourceLineNo">112</span>     * Adds a value to the histogram.<a name="line.112"></a>
-<span class="sourceLineNo">113</span>     */<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    public void add(long value, long count) {<a name="line.114"></a>
-<span class="sourceLineNo">115</span>      if (value &lt; 0) {<a name="line.115"></a>
-<span class="sourceLineNo">116</span>        // The whole computation is completely thrown off if there are negative numbers<a name="line.116"></a>
-<span class="sourceLineNo">117</span>        //<a name="line.117"></a>
-<span class="sourceLineNo">118</span>        // Normally we would throw an IllegalArgumentException however this is the metrics<a name="line.118"></a>
-<span class="sourceLineNo">119</span>        // system and it should be completely safe at all times.<a name="line.119"></a>
-<span class="sourceLineNo">120</span>        // So silently throw it away.<a name="line.120"></a>
-<span class="sourceLineNo">121</span>        return;<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      }<a name="line.122"></a>
-<span class="sourceLineNo">123</span>      AtomicUtils.updateMin(min, value);<a name="line.123"></a>
-<span class="sourceLineNo">124</span>      AtomicUtils.updateMax(max, value);<a name="line.124"></a>
-<span class="sourceLineNo">125</span><a name="line.125"></a>
-<span class="sourceLineNo">126</span>      this.count.add(count);<a name="line.126"></a>
-<span class="sourceLineNo">127</span>      this.total.add(value * count);<a name="line.127"></a>
-<span class="sourceLineNo">128</span><a name="line.128"></a>
-<span class="sourceLineNo">129</span>      int pos = getIndex(value);<a name="line.129"></a>
-<span class="sourceLineNo">130</span>      this.counts[pos].add(count);<a name="line.130"></a>
-<span class="sourceLineNo">131</span><a name="line.131"></a>
-<span class="sourceLineNo">132</span>      // hasData needs to be updated as last<a name="line.132"></a>
-<span class="sourceLineNo">133</span>      this.hasData = true;<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>    /**<a name="line.136"></a>
-<span class="sourceLineNo">137</span>     * Computes the quantiles give the ratios.<a name="line.137"></a>
-<span class="sourceLineNo">138</span>     */<a name="line.138"></a>
-<span class="sourceLineNo">139</span>    public long[] getQuantiles(double[] quantiles) {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>      if (!hasData) {<a name="line.140"></a>
-<span class="sourceLineNo">141</span>        // No data yet.<a name="line.141"></a>
-<span class="sourceLineNo">142</span>        return new long[quantiles.length];<a name="line.142"></a>
-<span class="sourceLineNo">143</span>      }<a name="line.143"></a>
-<span class="sourceLineNo">144</span><a name="line.144"></a>
-<span class="sourceLineNo">145</span>      // Make a snapshot of lowerCounter, higherCounter and bins.counts to counts.<a name="line.145"></a>
-<span class="sourceLineNo">146</span>      // This is not synchronized, but since the counter are accumulating, the result is a good<a name="line.146"></a>
-<span class="sourceLineNo">147</span>      // estimation of a snapshot.<a name="line.147"></a>
-<span class="sourceLineNo">148</span>      long[] counts = new long[this.counts.length];<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      long total = 0L;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>      for (int i = 0; i &lt; this.counts.length; i++) {<a name="line.150"></a>
-<span class="sourceLineNo">151</span>        counts[i] = this.counts[i].sum();<a name="line.151"></a>
-<span class="sourceLineNo">152</span>        total += counts[i];<a name="line.152"></a>
-<span class="sourceLineNo">153</span>      }<a name="line.153"></a>
-<span class="sourceLineNo">154</span><a name="line.154"></a>
-<span class="sourceLineNo">155</span>      int rIndex = 0;<a name="line.155"></a>
-<span class="sourceLineNo">156</span>      double qCount = total * quantiles[0];<a name="line.156"></a>
-<span class="sourceLineNo">157</span>      long cum = 0L;<a name="line.157"></a>
-<span class="sourceLineNo">158</span><a name="line.158"></a>
-<span class="sourceLineNo">159</span>      long[] res = new long[quantiles.length];<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      countsLoop: for (int i = 0; i &lt; counts.length; i++) {<a name="line.160"></a>
-<span class="sourceLineNo">161</span>        // mn and mx define a value range<a name="line.161"></a>
-<span class="sourceLineNo">162</span>        long mn, mx;<a name="line.162"></a>
-<span class="sourceLineNo">163</span>        if (i == 0) {<a name="line.163"></a>
-<span class="sourceLineNo">164</span>          mn = this.min.get();<a name="line.164"></a>
-<span class="sourceLineNo">165</span>          mx = this.binsMin;<a name="line.165"></a>
-<span class="sourceLineNo">166</span>        } else if (i == counts.length - 1) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>          mn = this.bins10XMax;<a name="line.167"></a>
-<span class="sourceLineNo">168</span>          mx = this.max.get();<a name="line.168"></a>
-<span class="sourceLineNo">169</span>        } else if (i == counts.length - 2) {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>          mn = this.binsMax;<a name="line.170"></a>
-<span class="sourceLineNo">171</span>          mx = this.bins10XMax;<a name="line.171"></a>
-<span class="sourceLineNo">172</span>        } else {<a name="line.172"></a>
-<span class="sourceLineNo">173</span>          mn = this.binsMin + (i - 1) * (this.binsMax - this.binsMin) / (this.counts.length - 3);<a name="line.173"></a>
-<span class="sourceLineNo">174</span>          mx = this.binsMin + i * (this.binsMax - this.binsMin) / (this.counts.length - 3);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>        if (mx &lt; this.min.get()) {<a name="line.177"></a>
-<span class="sourceLineNo">178</span>          continue;<a name="line.178"></a>
-<span class="sourceLineNo">179</span>        }<a name="line.179"></a>
-<span class="sourceLineNo">180</span>        if (mn &gt; this.max.get()) {<a name="line.180"></a>
-<span class="sourceLineNo">181</span>          break;<a name="line.181"></a>
-<span class="sourceLineNo">182</span>        }<a name="line.182"></a>
-<span class="sourceLineNo">183</span>        mn = Math.max(mn, this.min.get());<a name="line.183"></a>
-<span class="sourceLineNo">184</span>        mx = Math.min(mx, this.max.get());<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>        // lastCum/cum are the corresponding counts to mn/mx<a name="line.186"></a>
-<span class="sourceLineNo">187</span>        double lastCum = cum;<a name="line.187"></a>
-<span class="sourceLineNo">188</span>        cum += counts[i];<a name="line.188"></a>
-<span class="sourceLineNo">189</span><a name="line.189"></a>
-<span class="sourceLineNo">190</span>        // fill the results for qCount is within current range.<a name="line.190"></a>
-<span class="sourceLineNo">191</span>        while (qCount &lt;= cum) {<a name="line.191"></a>
-<span class="sourceLineNo">192</span>          if (cum == lastCum) {<a name="line.192"></a>
-<span class="sourceLineNo">193</span>            res[rIndex] = mn;<a name="line.193"></a>
-<span class="sourceLineNo">194</span>          } else {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>            res[rIndex] = (long) ((qCount - lastCum) * (mx - mn) / (cum - lastCum) + mn);<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>          // move to next quantile<a name="line.198"></a>
-<span class="sourceLineNo">199</span>          rIndex++;<a name="line.199"></a>
-<span class="sourceLineNo">200</span>          if (rIndex &gt;= quantiles.length) {<a name="line.200"></a>
-<span class="sourceLineNo">201</span>            break countsLoop;<a name="line.201"></a>
-<span class="sourceLineNo">202</span>          }<a name="line.202"></a>
-<span class="sourceLineNo">203</span>          qCount = total * quantiles[rIndex];<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>      // In case quantiles contains values &gt;= 100%<a name="line.206"></a>
-<span class="sourceLineNo">207</span>      for (; rIndex &lt; quantiles.length; rIndex++) {<a name="line.207"></a>
-<span class="sourceLineNo">208</span>        res[rIndex] = this.max.get();<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      }<a name="line.209"></a>
-<span class="sourceLineNo">210</span><a name="line.210"></a>
-<span class="sourceLineNo">211</span>      return res;<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>    long getNumAtOrBelow(long val) {<a name="line.214"></a>
-<span class="sourceLineNo">215</span>      return Arrays.stream(counts).mapToLong(c -&gt; c.sum()).limit(getIndex(val) + 1).sum();<a name="line.215"></a>
-<span class="sourceLineNo">216</span>    }<a name="line.216"></a>
-<span class="sourceLineNo">217</span>  }<a name="line.217"></a>
-<span class="sourceLineNo">218</span><a name="line.218"></a>
-<span class="sourceLineNo">219</span>  // The bins counting values. It is replaced with a new one in calling of reset().<a name="line.219"></a>
-<span class="sourceLineNo">220</span>  private volatile Bins bins;<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>   * Constructor.<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   */<a name="line.224"></a>
-<span class="sourceLineNo">225</span>  public FastLongHistogram() {<a name="line.225"></a>
-<span class="sourceLineNo">226</span>    this(DEFAULT_NBINS);<a name="line.226"></a>
-<span class="sourceLineNo">227</span>  }<a name="line.227"></a>
-<span class="sourceLineNo">228</span><a name="line.228"></a>
-<span class="sourceLineNo">229</span>  /**<a name="line.229"></a>
-<span class="sourceLineNo">230</span>   * Constructor.<a name="line.230"></a>
-<span class="sourceLineNo">231</span>   * @param numOfBins the number of bins for the histogram. A larger value results in more precise<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   *          results but with lower efficiency, and vice versus.<a name="line.232"></a>
-<span class="sourceLineNo">233</span>   */<a name="line.233"></a>
-<span class="sourceLineNo">234</span>  public FastLongHistogram(int numOfBins) {<a name="line.234"></a>
-<span class="sourceLineNo">235</span>    this.bins = new Bins(numOfBins);<a name="line.235"></a>
-<span class="sourceLineNo">236</span>  }<a name="line.236"></a>
-<span class="sourceLineNo">237</span><a name="line.237"></a>
-<span class="sourceLineNo">238</span>  /**<a name="line.238"></a>
-<span class="sourceLineNo">239</span>   * Constructor setting the bins assuming a uniform distribution within a range.<a name="line.239"></a>
-<span class="sourceLineNo">240</span>   * @param numOfBins the number of bins for the histogram. A larger value results in more precise<a name="line.240"></a>
-<span class="sourceLineNo">241</span>   *          results but with lower efficiency, and vice versus.<a name="line.241"></a>
-<span class="sourceLineNo">242</span>   * @param min lower bound of the region, inclusive.<a name="line.242"></a>
-<span class="sourceLineNo">243</span>   * @param max higher bound of the region, inclusive.<a name="line.243"></a>
-<span class="sourceLineNo">244</span>   */<a name="line.244"></a>
-<span class="sourceLineNo">245</span>  public FastLongHistogram(int numOfBins, long min, long max) {<a name="line.245"></a>
-<span class="sourceLineNo">246</span>    this(numOfBins);<a name="line.246"></a>
-<span class="sourceLineNo">247</span>    Bins bins = new Bins(numOfBins);<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    bins.add(min, 1);<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    bins.add(max, 1);<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    this.bins = new Bins(bins, numOfBins, 0.01, 0.999);<a name="line.250"></a>
-<span class="sourceLineNo">251</span>  }<a name="line.251"></a>
-<span class="sourceLineNo">252</span><a name="line.252"></a>
-<span class="sourceLineNo">253</span>  private FastLongHistogram(Bins bins) {<a name="line.253"></a>
-<span class="sourceLineNo">254</span>    this.bins = bins;<a name="line.254"></a>
-<span class="sourceLineNo">255</span>  }<a name="line.255"></a>
-<span class="sourceLineNo">256</span><a name="line.256"></a>
-<span class="sourceLineNo">257</span>  /**<a name="line.257"></a>
-<span class="sourceLineNo">258</span>   * Adds a value to the histogram.<a name="line.258"></a>
-<span class="sourceLineNo">259</span>   */<a name="line.259"></a>
-<span class="sourceLineNo">260</span>  public void add(long value, long count) {<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    this.bins.add(value, count);<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>  /**<a name="line.264"></a>
-<span class="sourceLineNo">265</span>   * Computes the quantiles give the ratios.<a name="line.265"></a>
-<span class="sourceLineNo">266</span>   */<a name="line.266"></a>
-<span class="sourceLineNo">267</span>  public long[] getQuantiles(double[] quantiles) {<a name="line.267"></a>
-<span class="sourceLineNo">268</span>    return this.bins.getQuantiles(quantiles);<a name="line.268"></a>
-<span class="sourceLineNo">269</span>  }<a name="line.269"></a>
-<span class="sourceLineNo">270</span><a name="line.270"></a>
-<span class="sourceLineNo">271</span>  public long[] getQuantiles() {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    return this.bins.getQuantiles(DEFAULT_QUANTILES);<a name="line.272"></a>
-<span class="sourceLineNo">273</span>  }<a name="line.273"></a>
-<span class="sourceLineNo">274</span><a name="line.274"></a>
-<span class="sourceLineNo">275</span>  public long getMin() {<a name="line.275"></a>
-<span class="sourceLineNo">276</span>    long min = this.bins.min.get();<a name="line.276"></a>
-<span class="sourceLineNo">277</span>    return min == Long.MAX_VALUE ? 0 : min; // in case it is not initialized<a name="line.277"></a>
-<span class="sourceLineNo">278</span>  }<a name="line.278"></a>
-<span class="sourceLineNo">279</span><a name="line.279"></a>
-<span class="sourceLineNo">280</span>  public long getMax() {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>    return this.bins.max.get();<a name="line.281"></a>
-<span class="sourceLineNo">282</span>  }<a name="line.282"></a>
-<span class="sourceLineNo">283</span><a name="line.283"></a>
-<span class="sourceLineNo">284</span>  public long getCount() {<a name="line.284"></a>
-<span class="sourceLineNo">285</span>    return this.bins.count.sum();<a name="line.285"></a>
-<span class="sourceLineNo">286</span>  }<a name="line.286"></a>
-<span class="sourceLineNo">287</span><a name="line.287"></a>
-<span class="sourceLineNo">288</span>  public long getMean() {<a name="line.288"></a>
-<span class="sourceLineNo">289</span>    Bins bins = this.bins;<a name="line.289"></a>
-<span class="sourceLineNo">290</span>    long count = bins.count.sum();<a name="line.290"></a>
-<span class="sourceLineNo">291</span>    long total = bins.total.sum();<a name="line.291"></a>
-<span class="sourceLineNo">292</span>    if (count == 0) {<a name="line.292"></a>
-<span class="sourceLineNo">293</span>      return 0;<a name="line.293"></a>
-<span class="sourceLineNo">294</span>    }<a name="line.294"></a>
-<span class="sourceLineNo">295</span>    return total / count;<a name="line.295"></a>
-<span class="sourceLineNo">296</span>  }<a name="line.296"></a>
-<span class="sourceLineNo">297</span><a name="line.297"></a>
-<span class="sourceLineNo">298</span>  public long getNumAtOrBelow(long value) {<a name="line.298"></a>
-<span class="sourceLineNo">299</span>    return this.bins.getNumAtOrBelow(value);<a name="line.299"></a>
-<span class="sourceLineNo">300</span>  }<a name="line.300"></a>
-<span class="sourceLineNo">301</span><a name="line.301"></a>
-<span class="sourceLineNo">302</span>  /**<a name="line.302"></a>
-<span class="sourceLineNo">303</span>   * Resets the histogram for new counting.<a name="line.303"></a>
-<span class="sourceLineNo">304</span>   */<a name="line.304"></a>
-<span class="sourceLineNo">305</span>  public FastLongHistogram reset() {<a name="line.305"></a>
-<span class="sourceLineNo">306</span>    Bins oldBins = this.bins;<a name="line.306"></a>
-<span class="sourceLineNo">307</span>    this.bins = new Bins(this.bins, this.bins.counts.length - 3, 0.01, 0.99);<a name="line.307"></a>
-<span class="sourceLineNo">308</span>    return new FastLongHistogram(oldBins);<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>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-</pre>
-</div>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/62e361eb/apidocs/src-html/org/apache/hadoop/hbase/util/RegionMover.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/util/RegionMover.html b/apidocs/src-html/org/apache/hadoop/hbase/util/RegionMover.html
index a23c165..27b58df 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/util/RegionMover.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/util/RegionMover.html
@@ -471,17 +471,17 @@
 <span class="sourceLineNo">463</span>      boolean ack, List&lt;HRegionInfo&gt; movedRegions) throws Exception {<a name="line.463"></a>
 <span class="sourceLineNo">464</span>    List&lt;HRegionInfo&gt; regionsToMove = new ArrayList&lt;HRegionInfo&gt;();// FindBugs: DLS_DEAD_LOCAL_STORE<a name="line.464"></a>
 <span class="sourceLineNo">465</span>    regionsToMove = getRegions(this.conf, server);<a name="line.465"></a>
-<span class="sourceLineNo">466</span>    if (regionsToMove.size() == 0) {<a name="line.466"></a>
+<span class="sourceLineNo">466</span>    if (regionsToMove.isEmpty()) {<a name="line.466"></a>
 <span class="sourceLineNo">467</span>      LOG.info("No Regions to move....Quitting now");<a name="line.467"></a>
 <span class="sourceLineNo">468</span>      return;<a name="line.468"></a>
-<span class="sourceLineNo">469</span>    } else if (regionServers.size() == 0) {<a name="line.469"></a>
+<span class="sourceLineNo">469</span>    } else if (regionServers.isEmpty()) {<a name="line.469"></a>
 <span class="sourceLineNo">470</span>      LOG.warn("No Regions were moved - no servers available");<a name="line.470"></a>
 <span class="sourceLineNo">471</span>      throw new Exception("No online region servers");<a name="line.471"></a>
 <span class="sourceLineNo">472</span>    }<a name="line.472"></a>
 <span class="sourceLineNo">473</span>    while (true) {<a name="line.473"></a>
 <span class="sourceLineNo">474</span>      regionsToMove = getRegions(this.conf, server);<a name="line.474"></a>
 <span class="sourceLineNo">475</span>      regionsToMove.removeAll(movedRegions);<a name="line.475"></a>
-<span class="sourceLineNo">476</span>      if (regionsToMove.size() == 0) {<a name="line.476"></a>
+<span class="sourceLineNo">476</span>      if (regionsToMove.isEmpty()) {<a name="line.476"></a>
 <span class="sourceLineNo">477</span>        break;<a name="line.477"></a>
 <span class="sourceLineNo">478</span>      }<a name="line.478"></a>
 <span class="sourceLineNo">479</span>      int counter = 0;<a name="line.479"></a>
@@ -831,7 +831,7 @@
 <span class="sourceLineNo">823</span>  private ArrayList&lt;String&gt; getServers(Admin admin) throws IOException {<a name="line.823"></a>
 <span class="sourceLineNo">824</span>    ArrayList&lt;ServerName&gt; serverInfo =<a name="line.824"></a>
 <span class="sourceLineNo">825</span>        new ArrayList&lt;ServerName&gt;(admin.getClusterStatus().getServers());<a name="line.825"></a>
-<span class="sourceLineNo">826</span>    ArrayList&lt;String&gt; regionServers = new ArrayList&lt;String&gt;();<a name="line.826"></a>
+<span class="sourceLineNo">826</span>    ArrayList&lt;String&gt; regionServers = new ArrayList&lt;String&gt;(serverInfo.size());<a name="line.826"></a>
 <span class="sourceLineNo">827</span>    for (ServerName server : serverInfo) {<a name="line.827"></a>
 <span class="sourceLineNo">828</span>      regionServers.add(server.getServerName());<a name="line.828"></a>
 <span class="sourceLineNo">829</span>    }<a name="line.829"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/62e361eb/apidocs/src-html/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.html b/apidocs/src-html/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.html
index b75d15b..b6da78c 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.html
@@ -358,7 +358,7 @@
 <span class="sourceLineNo">350</span>    LOG.info("Kill the current active ZK servers in the cluster " +<a name="line.350"></a>
 <span class="sourceLineNo">351</span>        "on client port: " + clientPort);<a name="line.351"></a>
 <span class="sourceLineNo">352</span><a name="line.352"></a>
-<span class="sourceLineNo">353</span>    if (standaloneServerFactoryList.size() == 0) {<a name="line.353"></a>
+<span class="sourceLineNo">353</span>    if (standaloneServerFactoryList.isEmpty()) {<a name="line.353"></a>
 <span class="sourceLineNo">354</span>      // there is no backup servers;<a name="line.354"></a>
 <span class="sourceLineNo">355</span>      return -1;<a name="line.355"></a>
 <span class="sourceLineNo">356</span>    }<a name="line.356"></a>


Mime
View raw message