hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [01/30] hbase-site git commit: Published site at .
Date Fri, 18 Aug 2017 15:06:28 GMT
Repository: hbase-site
Updated Branches:
  refs/heads/asf-site f6c74dcd5 -> cef8af03a


http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cef8af03/testdevapidocs/src-html/org/apache/hadoop/hbase/RESTApiClusterManager.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/RESTApiClusterManager.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/RESTApiClusterManager.html
index 0d46b6f..680bc31 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/RESTApiClusterManager.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/RESTApiClusterManager.html
@@ -26,185 +26,185 @@
 <span class="sourceLineNo">018</span><a name="line.18"></a>
 <span class="sourceLineNo">019</span>package org.apache.hadoop.hbase;<a name="line.19"></a>
 <span class="sourceLineNo">020</span><a name="line.20"></a>
-<span class="sourceLineNo">021</span>import com.sun.jersey.api.client.Client;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import com.sun.jersey.api.client.ClientResponse;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;<a name="line.23"></a>
-<span class="sourceLineNo">024</span><a name="line.24"></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.conf.Configuration;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.conf.Configured;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.util.ReflectionUtils;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.codehaus.jackson.JsonNode;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.codehaus.jackson.map.ObjectMapper;<a name="line.31"></a>
-<span class="sourceLineNo">032</span><a name="line.32"></a>
-<span class="sourceLineNo">033</span>import javax.ws.rs.core.MediaType;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import javax.ws.rs.core.Response;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import javax.ws.rs.core.UriBuilder;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import javax.xml.ws.http.HTTPException;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import java.io.IOException;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>import java.net.URI;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import java.util.HashMap;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>import java.util.Locale;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>import java.util.Map;<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> * A ClusterManager implementation designed to control Cloudera Manager (http://www.cloudera.com)<a name="line.44"></a>
-<span class="sourceLineNo">045</span> * clusters via REST API. This API uses HTTP GET requests against the cluster manager server to<a name="line.45"></a>
-<span class="sourceLineNo">046</span> * retrieve information and POST/PUT requests to perform actions. As a simple example, to retrieve a<a name="line.46"></a>
-<span class="sourceLineNo">047</span> * list of hosts from a CM server with login credentials admin:admin, a simple curl command would be<a name="line.47"></a>
-<span class="sourceLineNo">048</span> *     curl -X POST -H "Content-Type:application/json" -u admin:admin \<a name="line.48"></a>
-<span class="sourceLineNo">049</span> *         "http://this.is.my.server.com:7180/api/v8/hosts"<a name="line.49"></a>
-<span class="sourceLineNo">050</span> *<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * This command would return a JSON result, which would need to be parsed to retrieve relevant<a name="line.51"></a>
-<span class="sourceLineNo">052</span> * information. This action and many others are covered by this class.<a name="line.52"></a>
-<span class="sourceLineNo">053</span> *<a name="line.53"></a>
-<span class="sourceLineNo">054</span> * A note on nomenclature: while the ClusterManager interface uses a ServiceType enum when<a name="line.54"></a>
-<span class="sourceLineNo">055</span> * referring to things like RegionServers and DataNodes, cluster managers often use different<a name="line.55"></a>
-<span class="sourceLineNo">056</span> * terminology. As an example, Cloudera Manager (http://www.cloudera.com) would refer to a<a name="line.56"></a>
-<span class="sourceLineNo">057</span> * RegionServer as a "role" of the HBase "service." It would further refer to "hbase" as the<a name="line.57"></a>
-<span class="sourceLineNo">058</span> * "serviceType." Apache Ambari (http://ambari.apache.org) would call the RegionServer a<a name="line.58"></a>
-<span class="sourceLineNo">059</span> * "component" of the HBase "service."<a name="line.59"></a>
-<span class="sourceLineNo">060</span> *<a name="line.60"></a>
-<span class="sourceLineNo">061</span> * This class will defer to the ClusterManager terminology in methods that it implements from<a name="line.61"></a>
-<span class="sourceLineNo">062</span> * that interface, but uses Cloudera Manager's terminology when dealing with its API directly.<a name="line.62"></a>
-<span class="sourceLineNo">063</span> */<a name="line.63"></a>
-<span class="sourceLineNo">064</span>public class RESTApiClusterManager extends Configured implements ClusterManager {<a name="line.64"></a>
-<span class="sourceLineNo">065</span>  // Properties that need to be in the Configuration object to interact with the REST API cluster<a name="line.65"></a>
-<span class="sourceLineNo">066</span>  // manager. Most easily defined in hbase-site.xml, but can also be passed on the command line.<a name="line.66"></a>
-<span class="sourceLineNo">067</span>  private static final String REST_API_CLUSTER_MANAGER_HOSTNAME =<a name="line.67"></a>
-<span class="sourceLineNo">068</span>      "hbase.it.clustermanager.restapi.hostname";<a name="line.68"></a>
-<span class="sourceLineNo">069</span>  private static final String REST_API_CLUSTER_MANAGER_USERNAME =<a name="line.69"></a>
-<span class="sourceLineNo">070</span>      "hbase.it.clustermanager.restapi.username";<a name="line.70"></a>
-<span class="sourceLineNo">071</span>  private static final String REST_API_CLUSTER_MANAGER_PASSWORD =<a name="line.71"></a>
-<span class="sourceLineNo">072</span>      "hbase.it.clustermanager.restapi.password";<a name="line.72"></a>
-<span class="sourceLineNo">073</span>  private static final String REST_API_CLUSTER_MANAGER_CLUSTER_NAME =<a name="line.73"></a>
-<span class="sourceLineNo">074</span>      "hbase.it.clustermanager.restapi.clustername";<a name="line.74"></a>
-<span class="sourceLineNo">075</span><a name="line.75"></a>
-<span class="sourceLineNo">076</span>  // Some default values for the above properties.<a name="line.76"></a>
-<span class="sourceLineNo">077</span>  private static final String DEFAULT_SERVER_HOSTNAME = "http://localhost:7180";<a name="line.77"></a>
-<span class="sourceLineNo">078</span>  private static final String DEFAULT_SERVER_USERNAME = "admin";<a name="line.78"></a>
-<span class="sourceLineNo">079</span>  private static final String DEFAULT_SERVER_PASSWORD = "admin";<a name="line.79"></a>
-<span class="sourceLineNo">080</span>  private static final String DEFAULT_CLUSTER_NAME = "Cluster 1";<a name="line.80"></a>
-<span class="sourceLineNo">081</span><a name="line.81"></a>
-<span class="sourceLineNo">082</span>  // Fields for the hostname, username, password, and cluster name of the cluster management server<a name="line.82"></a>
-<span class="sourceLineNo">083</span>  // to be used.<a name="line.83"></a>
-<span class="sourceLineNo">084</span>  private String serverHostname;<a name="line.84"></a>
-<span class="sourceLineNo">085</span>  private String serverUsername;<a name="line.85"></a>
-<span class="sourceLineNo">086</span>  private String serverPassword;<a name="line.86"></a>
-<span class="sourceLineNo">087</span>  private String clusterName;<a name="line.87"></a>
-<span class="sourceLineNo">088</span><a name="line.88"></a>
-<span class="sourceLineNo">089</span>  // Each version of Cloudera Manager supports a particular API versions. Version 6 of this API<a name="line.89"></a>
-<span class="sourceLineNo">090</span>  // provides all the features needed by this class.<a name="line.90"></a>
-<span class="sourceLineNo">091</span>  private static final String API_VERSION = "v6";<a name="line.91"></a>
-<span class="sourceLineNo">092</span><a name="line.92"></a>
-<span class="sourceLineNo">093</span>  // Client instances are expensive, so use the same one for all our REST queries.<a name="line.93"></a>
-<span class="sourceLineNo">094</span>  private Client client = Client.create();<a name="line.94"></a>
-<span class="sourceLineNo">095</span><a name="line.95"></a>
-<span class="sourceLineNo">096</span>  // An instance of HBaseClusterManager is used for methods like the kill, resume, and suspend<a name="line.96"></a>
-<span class="sourceLineNo">097</span>  // because cluster managers don't tend to implement these operations.<a name="line.97"></a>
-<span class="sourceLineNo">098</span>  private ClusterManager hBaseClusterManager;<a name="line.98"></a>
-<span class="sourceLineNo">099</span><a name="line.99"></a>
-<span class="sourceLineNo">100</span>  private static final Log LOG = LogFactory.getLog(RESTApiClusterManager.class);<a name="line.100"></a>
-<span class="sourceLineNo">101</span><a name="line.101"></a>
-<span class="sourceLineNo">102</span>  RESTApiClusterManager() {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    hBaseClusterManager = ReflectionUtils.newInstance(HBaseClusterManager.class,<a name="line.103"></a>
-<span class="sourceLineNo">104</span>        new IntegrationTestingUtility().getConfiguration());<a name="line.104"></a>
-<span class="sourceLineNo">105</span>  }<a name="line.105"></a>
-<span class="sourceLineNo">106</span><a name="line.106"></a>
-<span class="sourceLineNo">107</span>  @Override<a name="line.107"></a>
-<span class="sourceLineNo">108</span>  public void setConf(Configuration conf) {<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    super.setConf(conf);<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    if (conf == null) {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>      // Configured gets passed null before real conf. Why? I don't know.<a name="line.111"></a>
-<span class="sourceLineNo">112</span>      return;<a name="line.112"></a>
-<span class="sourceLineNo">113</span>    }<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    serverHostname = conf.get(REST_API_CLUSTER_MANAGER_HOSTNAME, DEFAULT_SERVER_HOSTNAME);<a name="line.114"></a>
-<span class="sourceLineNo">115</span>    serverUsername = conf.get(REST_API_CLUSTER_MANAGER_USERNAME, DEFAULT_SERVER_USERNAME);<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    serverPassword = conf.get(REST_API_CLUSTER_MANAGER_PASSWORD, DEFAULT_SERVER_PASSWORD);<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    clusterName = conf.get(REST_API_CLUSTER_MANAGER_CLUSTER_NAME, DEFAULT_CLUSTER_NAME);<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>    // Add filter to Client instance to enable server authentication.<a name="line.119"></a>
-<span class="sourceLineNo">120</span>    client.addFilter(new HTTPBasicAuthFilter(serverUsername, serverPassword));<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>  @Override<a name="line.123"></a>
-<span class="sourceLineNo">124</span>  public void start(ServiceType service, String hostname, int port) throws IOException {<a name="line.124"></a>
-<span class="sourceLineNo">125</span>    performClusterManagerCommand(service, hostname, RoleCommand.START);<a name="line.125"></a>
-<span class="sourceLineNo">126</span>  }<a name="line.126"></a>
-<span class="sourceLineNo">127</span><a name="line.127"></a>
-<span class="sourceLineNo">128</span>  @Override<a name="line.128"></a>
-<span class="sourceLineNo">129</span>  public void stop(ServiceType service, String hostname, int port) throws IOException {<a name="line.129"></a>
-<span class="sourceLineNo">130</span>    performClusterManagerCommand(service, hostname, RoleCommand.STOP);<a name="line.130"></a>
-<span class="sourceLineNo">131</span>  }<a name="line.131"></a>
-<span class="sourceLineNo">132</span><a name="line.132"></a>
-<span class="sourceLineNo">133</span>  @Override<a name="line.133"></a>
-<span class="sourceLineNo">134</span>  public void restart(ServiceType service, String hostname, int port) throws IOException {<a name="line.134"></a>
-<span class="sourceLineNo">135</span>    performClusterManagerCommand(service, hostname, RoleCommand.RESTART);<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>  @Override<a name="line.138"></a>
-<span class="sourceLineNo">139</span>  public boolean isRunning(ServiceType service, String hostname, int port) throws IOException {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    String serviceName = getServiceName(roleServiceType.get(service));<a name="line.140"></a>
-<span class="sourceLineNo">141</span>    String hostId = getHostId(hostname);<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    String roleState = getRoleState(serviceName, service.toString(), hostId);<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    String healthSummary = getHealthSummary(serviceName, service.toString(), hostId);<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    boolean isRunning = false;<a name="line.144"></a>
-<span class="sourceLineNo">145</span><a name="line.145"></a>
-<span class="sourceLineNo">146</span>    // Use Yoda condition to prevent NullPointerException. roleState will be null if the "service<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    // type" does not exist on the specified hostname.<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    if ("STARTED".equals(roleState) &amp;&amp; "GOOD".equals(healthSummary)) {<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      isRunning = true;<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>    return isRunning;<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>  @Override<a name="line.155"></a>
-<span class="sourceLineNo">156</span>  public void kill(ServiceType service, String hostname, int port) throws IOException {<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    hBaseClusterManager.kill(service, hostname, port);<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>  @Override<a name="line.160"></a>
-<span class="sourceLineNo">161</span>  public void suspend(ServiceType service, String hostname, int port) throws IOException {<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    hBaseClusterManager.suspend(service, hostname, port);<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>  @Override<a name="line.165"></a>
-<span class="sourceLineNo">166</span>  public void resume(ServiceType service, String hostname, int port) throws IOException {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>    hBaseClusterManager.resume(service, hostname, port);<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">021</span>import org.apache.commons.logging.Log;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.commons.logging.LogFactory;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.hadoop.conf.Configuration;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.hadoop.conf.Configured;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.util.ReflectionUtils;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.codehaus.jackson.JsonNode;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.codehaus.jackson.map.ObjectMapper;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import javax.ws.rs.client.Client;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import javax.ws.rs.client.ClientBuilder;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import javax.ws.rs.client.Entity;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import javax.ws.rs.client.Invocation;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import javax.ws.rs.client.WebTarget;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import javax.ws.rs.core.MediaType;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import javax.ws.rs.core.Response;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import javax.ws.rs.core.UriBuilder;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import javax.xml.ws.http.HTTPException;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import java.io.IOException;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import java.net.URI;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import java.util.HashMap;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>import java.util.Locale;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>import java.util.Map;<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> * A ClusterManager implementation designed to control Cloudera Manager (http://www.cloudera.com)<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * clusters via REST API. This API uses HTTP GET requests against the cluster manager server to<a name="line.46"></a>
+<span class="sourceLineNo">047</span> * retrieve information and POST/PUT requests to perform actions. As a simple example, to retrieve a<a name="line.47"></a>
+<span class="sourceLineNo">048</span> * list of hosts from a CM server with login credentials admin:admin, a simple curl command would be<a name="line.48"></a>
+<span class="sourceLineNo">049</span> *     curl -X POST -H "Content-Type:application/json" -u admin:admin \<a name="line.49"></a>
+<span class="sourceLineNo">050</span> *         "http://this.is.my.server.com:7180/api/v8/hosts"<a name="line.50"></a>
+<span class="sourceLineNo">051</span> *<a name="line.51"></a>
+<span class="sourceLineNo">052</span> * This command would return a JSON result, which would need to be parsed to retrieve relevant<a name="line.52"></a>
+<span class="sourceLineNo">053</span> * information. This action and many others are covered by this class.<a name="line.53"></a>
+<span class="sourceLineNo">054</span> *<a name="line.54"></a>
+<span class="sourceLineNo">055</span> * A note on nomenclature: while the ClusterManager interface uses a ServiceType enum when<a name="line.55"></a>
+<span class="sourceLineNo">056</span> * referring to things like RegionServers and DataNodes, cluster managers often use different<a name="line.56"></a>
+<span class="sourceLineNo">057</span> * terminology. As an example, Cloudera Manager (http://www.cloudera.com) would refer to a<a name="line.57"></a>
+<span class="sourceLineNo">058</span> * RegionServer as a "role" of the HBase "service." It would further refer to "hbase" as the<a name="line.58"></a>
+<span class="sourceLineNo">059</span> * "serviceType." Apache Ambari (http://ambari.apache.org) would call the RegionServer a<a name="line.59"></a>
+<span class="sourceLineNo">060</span> * "component" of the HBase "service."<a name="line.60"></a>
+<span class="sourceLineNo">061</span> *<a name="line.61"></a>
+<span class="sourceLineNo">062</span> * This class will defer to the ClusterManager terminology in methods that it implements from<a name="line.62"></a>
+<span class="sourceLineNo">063</span> * that interface, but uses Cloudera Manager's terminology when dealing with its API directly.<a name="line.63"></a>
+<span class="sourceLineNo">064</span> */<a name="line.64"></a>
+<span class="sourceLineNo">065</span>public class RESTApiClusterManager extends Configured implements ClusterManager {<a name="line.65"></a>
+<span class="sourceLineNo">066</span>  // Properties that need to be in the Configuration object to interact with the REST API cluster<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  // manager. Most easily defined in hbase-site.xml, but can also be passed on the command line.<a name="line.67"></a>
+<span class="sourceLineNo">068</span>  private static final String REST_API_CLUSTER_MANAGER_HOSTNAME =<a name="line.68"></a>
+<span class="sourceLineNo">069</span>      "hbase.it.clustermanager.restapi.hostname";<a name="line.69"></a>
+<span class="sourceLineNo">070</span>  private static final String REST_API_CLUSTER_MANAGER_USERNAME =<a name="line.70"></a>
+<span class="sourceLineNo">071</span>      "hbase.it.clustermanager.restapi.username";<a name="line.71"></a>
+<span class="sourceLineNo">072</span>  private static final String REST_API_CLUSTER_MANAGER_PASSWORD =<a name="line.72"></a>
+<span class="sourceLineNo">073</span>      "hbase.it.clustermanager.restapi.password";<a name="line.73"></a>
+<span class="sourceLineNo">074</span>  private static final String REST_API_CLUSTER_MANAGER_CLUSTER_NAME =<a name="line.74"></a>
+<span class="sourceLineNo">075</span>      "hbase.it.clustermanager.restapi.clustername";<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>  // Some default values for the above properties.<a name="line.77"></a>
+<span class="sourceLineNo">078</span>  private static final String DEFAULT_SERVER_HOSTNAME = "http://localhost:7180";<a name="line.78"></a>
+<span class="sourceLineNo">079</span>  private static final String DEFAULT_SERVER_USERNAME = "admin";<a name="line.79"></a>
+<span class="sourceLineNo">080</span>  private static final String DEFAULT_SERVER_PASSWORD = "admin";<a name="line.80"></a>
+<span class="sourceLineNo">081</span>  private static final String DEFAULT_CLUSTER_NAME = "Cluster 1";<a name="line.81"></a>
+<span class="sourceLineNo">082</span><a name="line.82"></a>
+<span class="sourceLineNo">083</span>  // Fields for the hostname, username, password, and cluster name of the cluster management server<a name="line.83"></a>
+<span class="sourceLineNo">084</span>  // to be used.<a name="line.84"></a>
+<span class="sourceLineNo">085</span>  private String serverHostname;<a name="line.85"></a>
+<span class="sourceLineNo">086</span>  private String serverUsername;<a name="line.86"></a>
+<span class="sourceLineNo">087</span>  private String serverPassword;<a name="line.87"></a>
+<span class="sourceLineNo">088</span>  private String clusterName;<a name="line.88"></a>
+<span class="sourceLineNo">089</span><a name="line.89"></a>
+<span class="sourceLineNo">090</span>  // Each version of Cloudera Manager supports a particular API versions. Version 6 of this API<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  // provides all the features needed by this class.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>  private static final String API_VERSION = "v6";<a name="line.92"></a>
+<span class="sourceLineNo">093</span><a name="line.93"></a>
+<span class="sourceLineNo">094</span>  // Client instances are expensive, so use the same one for all our REST queries.<a name="line.94"></a>
+<span class="sourceLineNo">095</span>  private Client client = ClientBuilder.newClient();<a name="line.95"></a>
+<span class="sourceLineNo">096</span><a name="line.96"></a>
+<span class="sourceLineNo">097</span>  // An instance of HBaseClusterManager is used for methods like the kill, resume, and suspend<a name="line.97"></a>
+<span class="sourceLineNo">098</span>  // because cluster managers don't tend to implement these operations.<a name="line.98"></a>
+<span class="sourceLineNo">099</span>  private ClusterManager hBaseClusterManager;<a name="line.99"></a>
+<span class="sourceLineNo">100</span><a name="line.100"></a>
+<span class="sourceLineNo">101</span>  private static final Log LOG = LogFactory.getLog(RESTApiClusterManager.class);<a name="line.101"></a>
+<span class="sourceLineNo">102</span><a name="line.102"></a>
+<span class="sourceLineNo">103</span>  RESTApiClusterManager() {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    hBaseClusterManager = ReflectionUtils.newInstance(HBaseClusterManager.class,<a name="line.104"></a>
+<span class="sourceLineNo">105</span>        new IntegrationTestingUtility().getConfiguration());<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>  @Override<a name="line.108"></a>
+<span class="sourceLineNo">109</span>  public void setConf(Configuration conf) {<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    super.setConf(conf);<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    if (conf == null) {<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      // Configured gets passed null before real conf. Why? I don't know.<a name="line.112"></a>
+<span class="sourceLineNo">113</span>      return;<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    }<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    serverHostname = conf.get(REST_API_CLUSTER_MANAGER_HOSTNAME, DEFAULT_SERVER_HOSTNAME);<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    serverUsername = conf.get(REST_API_CLUSTER_MANAGER_USERNAME, DEFAULT_SERVER_USERNAME);<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    serverPassword = conf.get(REST_API_CLUSTER_MANAGER_PASSWORD, DEFAULT_SERVER_PASSWORD);<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    clusterName = conf.get(REST_API_CLUSTER_MANAGER_CLUSTER_NAME, DEFAULT_CLUSTER_NAME);<a name="line.118"></a>
+<span class="sourceLineNo">119</span><a name="line.119"></a>
+<span class="sourceLineNo">120</span>    // Add filter to Client instance to enable server authentication.<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    client.register(HttpAuthenticationFeature.basic(serverUsername, serverPassword));<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>  @Override<a name="line.124"></a>
+<span class="sourceLineNo">125</span>  public void start(ServiceType service, String hostname, int port) throws IOException {<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    performClusterManagerCommand(service, hostname, RoleCommand.START);<a name="line.126"></a>
+<span class="sourceLineNo">127</span>  }<a name="line.127"></a>
+<span class="sourceLineNo">128</span><a name="line.128"></a>
+<span class="sourceLineNo">129</span>  @Override<a name="line.129"></a>
+<span class="sourceLineNo">130</span>  public void stop(ServiceType service, String hostname, int port) throws IOException {<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    performClusterManagerCommand(service, hostname, RoleCommand.STOP);<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>  @Override<a name="line.134"></a>
+<span class="sourceLineNo">135</span>  public void restart(ServiceType service, String hostname, int port) throws IOException {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    performClusterManagerCommand(service, hostname, RoleCommand.RESTART);<a name="line.136"></a>
+<span class="sourceLineNo">137</span>  }<a name="line.137"></a>
+<span class="sourceLineNo">138</span><a name="line.138"></a>
+<span class="sourceLineNo">139</span>  @Override<a name="line.139"></a>
+<span class="sourceLineNo">140</span>  public boolean isRunning(ServiceType service, String hostname, int port) throws IOException {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    String serviceName = getServiceName(roleServiceType.get(service));<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    String hostId = getHostId(hostname);<a name="line.142"></a>
+<span class="sourceLineNo">143</span>    String roleState = getRoleState(serviceName, service.toString(), hostId);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    String healthSummary = getHealthSummary(serviceName, service.toString(), hostId);<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    boolean isRunning = false;<a name="line.145"></a>
+<span class="sourceLineNo">146</span><a name="line.146"></a>
+<span class="sourceLineNo">147</span>    // Use Yoda condition to prevent NullPointerException. roleState will be null if the "service<a name="line.147"></a>
+<span class="sourceLineNo">148</span>    // type" does not exist on the specified hostname.<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    if ("STARTED".equals(roleState) &amp;&amp; "GOOD".equals(healthSummary)) {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>      isRunning = true;<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 isRunning;<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>  @Override<a name="line.156"></a>
+<span class="sourceLineNo">157</span>  public void kill(ServiceType service, String hostname, int port) throws IOException {<a name="line.157"></a>
+<span class="sourceLineNo">158</span>    hBaseClusterManager.kill(service, hostname, port);<a name="line.158"></a>
+<span class="sourceLineNo">159</span>  }<a name="line.159"></a>
+<span class="sourceLineNo">160</span><a name="line.160"></a>
+<span class="sourceLineNo">161</span>  @Override<a name="line.161"></a>
+<span class="sourceLineNo">162</span>  public void suspend(ServiceType service, String hostname, int port) throws IOException {<a name="line.162"></a>
+<span class="sourceLineNo">163</span>    hBaseClusterManager.suspend(service, hostname, port);<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>  @Override<a name="line.166"></a>
+<span class="sourceLineNo">167</span>  public void resume(ServiceType service, String hostname, int port) throws IOException {<a name="line.167"></a>
+<span class="sourceLineNo">168</span>    hBaseClusterManager.resume(service, hostname, port);<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>  // Convenience method to execute command against role on hostname. Only graceful commands are<a name="line.171"></a>
-<span class="sourceLineNo">172</span>  // supported since cluster management APIs don't tend to let you SIGKILL things.<a name="line.172"></a>
-<span class="sourceLineNo">173</span>  private void performClusterManagerCommand(ServiceType role, String hostname, RoleCommand command)<a name="line.173"></a>
-<span class="sourceLineNo">174</span>      throws IOException {<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    LOG.info("Performing " + command + " command against " + role + " on " + hostname + "...");<a name="line.175"></a>
-<span class="sourceLineNo">176</span>    String serviceName = getServiceName(roleServiceType.get(role));<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    String hostId = getHostId(hostname);<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    String roleName = getRoleName(serviceName, role.toString(), hostId);<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    doRoleCommand(serviceName, roleName, command);<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>  // Performing a command (e.g. starting or stopping a role) requires a POST instead of a GET.<a name="line.182"></a>
-<span class="sourceLineNo">183</span>  private void doRoleCommand(String serviceName, String roleName, RoleCommand roleCommand) {<a name="line.183"></a>
-<span class="sourceLineNo">184</span>    URI uri = UriBuilder.fromUri(serverHostname)<a name="line.184"></a>
-<span class="sourceLineNo">185</span>        .path("api")<a name="line.185"></a>
-<span class="sourceLineNo">186</span>        .path(API_VERSION)<a name="line.186"></a>
-<span class="sourceLineNo">187</span>        .path("clusters")<a name="line.187"></a>
-<span class="sourceLineNo">188</span>        .path(clusterName)<a name="line.188"></a>
-<span class="sourceLineNo">189</span>        .path("services")<a name="line.189"></a>
-<span class="sourceLineNo">190</span>        .path(serviceName)<a name="line.190"></a>
-<span class="sourceLineNo">191</span>        .path("roleCommands")<a name="line.191"></a>
-<span class="sourceLineNo">192</span>        .path(roleCommand.toString())<a name="line.192"></a>
-<span class="sourceLineNo">193</span>        .build();<a name="line.193"></a>
-<span class="sourceLineNo">194</span>    String body = "{ \"items\": [ \"" + roleName + "\" ] }";<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    LOG.info("Executing POST against " + uri + " with body " + body + "...");<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    ClientResponse response = client.resource(uri)<a name="line.196"></a>
-<span class="sourceLineNo">197</span>        .type(MediaType.APPLICATION_JSON)<a name="line.197"></a>
-<span class="sourceLineNo">198</span>        .post(ClientResponse.class, body);<a name="line.198"></a>
-<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">171</span><a name="line.171"></a>
+<span class="sourceLineNo">172</span>  // Convenience method to execute command against role on hostname. Only graceful commands are<a name="line.172"></a>
+<span class="sourceLineNo">173</span>  // supported since cluster management APIs don't tend to let you SIGKILL things.<a name="line.173"></a>
+<span class="sourceLineNo">174</span>  private void performClusterManagerCommand(ServiceType role, String hostname, RoleCommand command)<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      throws IOException {<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    LOG.info("Performing " + command + " command against " + role + " on " + hostname + "...");<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    String serviceName = getServiceName(roleServiceType.get(role));<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    String hostId = getHostId(hostname);<a name="line.178"></a>
+<span class="sourceLineNo">179</span>    String roleName = getRoleName(serviceName, role.toString(), hostId);<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    doRoleCommand(serviceName, roleName, command);<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>  // Performing a command (e.g. starting or stopping a role) requires a POST instead of a GET.<a name="line.183"></a>
+<span class="sourceLineNo">184</span>  private void doRoleCommand(String serviceName, String roleName, RoleCommand roleCommand) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    URI uri = UriBuilder.fromUri(serverHostname)<a name="line.185"></a>
+<span class="sourceLineNo">186</span>        .path("api")<a name="line.186"></a>
+<span class="sourceLineNo">187</span>        .path(API_VERSION)<a name="line.187"></a>
+<span class="sourceLineNo">188</span>        .path("clusters")<a name="line.188"></a>
+<span class="sourceLineNo">189</span>        .path(clusterName)<a name="line.189"></a>
+<span class="sourceLineNo">190</span>        .path("services")<a name="line.190"></a>
+<span class="sourceLineNo">191</span>        .path(serviceName)<a name="line.191"></a>
+<span class="sourceLineNo">192</span>        .path("roleCommands")<a name="line.192"></a>
+<span class="sourceLineNo">193</span>        .path(roleCommand.toString())<a name="line.193"></a>
+<span class="sourceLineNo">194</span>        .build();<a name="line.194"></a>
+<span class="sourceLineNo">195</span>    String body = "{ \"items\": [ \"" + roleName + "\" ] }";<a name="line.195"></a>
+<span class="sourceLineNo">196</span>    LOG.info("Executing POST against " + uri + " with body " + body + "...");<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    WebTarget webTarget = client.target(uri);<a name="line.197"></a>
+<span class="sourceLineNo">198</span>    Invocation.Builder invocationBuilder =  webTarget.request(MediaType.APPLICATION_JSON);<a name="line.198"></a>
+<span class="sourceLineNo">199</span>    Response response = invocationBuilder.post(Entity.json(body));<a name="line.199"></a>
 <span class="sourceLineNo">200</span>    int statusCode = response.getStatus();<a name="line.200"></a>
 <span class="sourceLineNo">201</span>    if (statusCode != Response.Status.OK.getStatusCode()) {<a name="line.201"></a>
 <span class="sourceLineNo">202</span>      throw new HTTPException(statusCode);<a name="line.202"></a>
@@ -245,16 +245,16 @@
 <span class="sourceLineNo">237</span>  // Execute GET against URI, returning a JsonNode object to be traversed.<a name="line.237"></a>
 <span class="sourceLineNo">238</span>  private JsonNode getJsonNodeFromURIGet(URI uri) throws IOException {<a name="line.238"></a>
 <span class="sourceLineNo">239</span>    LOG.info("Executing GET against " + uri + "...");<a name="line.239"></a>
-<span class="sourceLineNo">240</span>    ClientResponse response = client.resource(uri)<a name="line.240"></a>
-<span class="sourceLineNo">241</span>        .accept(MediaType.APPLICATION_JSON_TYPE)<a name="line.241"></a>
-<span class="sourceLineNo">242</span>        .get(ClientResponse.class);<a name="line.242"></a>
-<span class="sourceLineNo">243</span><a name="line.243"></a>
-<span class="sourceLineNo">244</span>    int statusCode = response.getStatus();<a name="line.244"></a>
-<span class="sourceLineNo">245</span>    if (statusCode != Response.Status.OK.getStatusCode()) {<a name="line.245"></a>
-<span class="sourceLineNo">246</span>      throw new HTTPException(statusCode);<a name="line.246"></a>
-<span class="sourceLineNo">247</span>    }<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    // This API folds information as the value to an "items" attribute.<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    return new ObjectMapper().readTree(response.getEntity(String.class)).get("items");<a name="line.249"></a>
+<span class="sourceLineNo">240</span>    WebTarget webTarget = client.target(uri);<a name="line.240"></a>
+<span class="sourceLineNo">241</span>    Invocation.Builder invocationBuilder =  webTarget.request(MediaType.APPLICATION_JSON);<a name="line.241"></a>
+<span class="sourceLineNo">242</span>    Response response = invocationBuilder.get();<a name="line.242"></a>
+<span class="sourceLineNo">243</span>    int statusCode = response.getStatus();<a name="line.243"></a>
+<span class="sourceLineNo">244</span>    if (statusCode != Response.Status.OK.getStatusCode()) {<a name="line.244"></a>
+<span class="sourceLineNo">245</span>      throw new HTTPException(statusCode);<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    }<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    // This API folds information as the value to an "items" attribute.<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    return new ObjectMapper().readTree(response.readEntity(String.class)).get("items");<a name="line.248"></a>
+<span class="sourceLineNo">249</span><a name="line.249"></a>
 <span class="sourceLineNo">250</span>  }<a name="line.250"></a>
 <span class="sourceLineNo">251</span><a name="line.251"></a>
 <span class="sourceLineNo">252</span>  // This API assigns a unique role name to each host's instance of a role.<a name="line.252"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cef8af03/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.AllocRecord.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.AllocRecord.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.AllocRecord.html
index 044344b..22f9fdb 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.AllocRecord.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.AllocRecord.html
@@ -255,69 +255,71 @@
 <span class="sourceLineNo">247</span>        }<a name="line.247"></a>
 <span class="sourceLineNo">248</span>      }<a name="line.248"></a>
 <span class="sourceLineNo">249</span>      // none of the chunkIds would have been returned back<a name="line.249"></a>
-<span class="sourceLineNo">250</span>      assertTrue("All the chunks must have been cleared", ChunkCreator.INSTANCE.size() != 0);<a name="line.250"></a>
-<span class="sourceLineNo">251</span>      // close the mslab<a name="line.251"></a>
-<span class="sourceLineNo">252</span>      mslab.close();<a name="line.252"></a>
-<span class="sourceLineNo">253</span>      // make sure all chunks reclaimed or removed from chunk queue<a name="line.253"></a>
-<span class="sourceLineNo">254</span>      int queueLength = mslab.getPooledChunks().size();<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      assertTrue("All chunks in chunk queue should be reclaimed or removed"<a name="line.255"></a>
-<span class="sourceLineNo">256</span>          + " after mslab closed but actually: " + queueLength,<a name="line.256"></a>
-<span class="sourceLineNo">257</span>        queueLength == 0);<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    } finally {<a name="line.258"></a>
-<span class="sourceLineNo">259</span>      ChunkCreator.INSTANCE = oldInstance;<a name="line.259"></a>
-<span class="sourceLineNo">260</span>    }<a name="line.260"></a>
-<span class="sourceLineNo">261</span>  }<a name="line.261"></a>
-<span class="sourceLineNo">262</span><a name="line.262"></a>
-<span class="sourceLineNo">263</span>  private Thread getChunkQueueTestThread(final MemStoreLABImpl mslab, String threadName,<a name="line.263"></a>
-<span class="sourceLineNo">264</span>      Cell cellToCopyInto) {<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    Thread thread = new Thread() {<a name="line.265"></a>
-<span class="sourceLineNo">266</span>      volatile boolean stopped = false;<a name="line.266"></a>
-<span class="sourceLineNo">267</span><a name="line.267"></a>
-<span class="sourceLineNo">268</span>      @Override<a name="line.268"></a>
-<span class="sourceLineNo">269</span>      public void run() {<a name="line.269"></a>
-<span class="sourceLineNo">270</span>        while (!stopped) {<a name="line.270"></a>
-<span class="sourceLineNo">271</span>          // keep triggering chunk retirement<a name="line.271"></a>
-<span class="sourceLineNo">272</span>          mslab.copyCellInto(cellToCopyInto);<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><a name="line.275"></a>
-<span class="sourceLineNo">276</span>      @Override<a name="line.276"></a>
-<span class="sourceLineNo">277</span>      public void interrupt() {<a name="line.277"></a>
-<span class="sourceLineNo">278</span>        this.stopped = true;<a name="line.278"></a>
-<span class="sourceLineNo">279</span>      }<a name="line.279"></a>
-<span class="sourceLineNo">280</span>    };<a name="line.280"></a>
-<span class="sourceLineNo">281</span>    thread.setName(threadName);<a name="line.281"></a>
-<span class="sourceLineNo">282</span>    thread.setDaemon(true);<a name="line.282"></a>
-<span class="sourceLineNo">283</span>    return thread;<a name="line.283"></a>
-<span class="sourceLineNo">284</span>  }<a name="line.284"></a>
-<span class="sourceLineNo">285</span><a name="line.285"></a>
-<span class="sourceLineNo">286</span>  private static class AllocRecord implements Comparable&lt;AllocRecord&gt;{<a name="line.286"></a>
-<span class="sourceLineNo">287</span>    private final ByteBuffer alloc;<a name="line.287"></a>
-<span class="sourceLineNo">288</span>    private final int offset;<a name="line.288"></a>
-<span class="sourceLineNo">289</span>    private final int size;<a name="line.289"></a>
-<span class="sourceLineNo">290</span><a name="line.290"></a>
-<span class="sourceLineNo">291</span>    public AllocRecord(ByteBuffer alloc, int offset, int size) {<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      super();<a name="line.292"></a>
-<span class="sourceLineNo">293</span>      this.alloc = alloc;<a name="line.293"></a>
-<span class="sourceLineNo">294</span>      this.offset = offset;<a name="line.294"></a>
-<span class="sourceLineNo">295</span>      this.size = size;<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>    @Override<a name="line.298"></a>
-<span class="sourceLineNo">299</span>    public int compareTo(AllocRecord e) {<a name="line.299"></a>
-<span class="sourceLineNo">300</span>      if (alloc != e.alloc) {<a name="line.300"></a>
-<span class="sourceLineNo">301</span>        throw new RuntimeException("Can only compare within a particular array");<a name="line.301"></a>
-<span class="sourceLineNo">302</span>      }<a name="line.302"></a>
-<span class="sourceLineNo">303</span>      return Ints.compare(this.offset, e.offset);<a name="line.303"></a>
-<span class="sourceLineNo">304</span>    }<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    <a name="line.305"></a>
-<span class="sourceLineNo">306</span>    @Override<a name="line.306"></a>
-<span class="sourceLineNo">307</span>    public String toString() {<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      return "AllocRecord(offset=" + this.offset + ", size=" + size + ")";<a name="line.308"></a>
-<span class="sourceLineNo">309</span>    }<a name="line.309"></a>
-<span class="sourceLineNo">310</span>  }<a name="line.310"></a>
-<span class="sourceLineNo">311</span>}<a name="line.311"></a>
-<span class="sourceLineNo">312</span><a name="line.312"></a>
+<span class="sourceLineNo">250</span>      assertTrue("All the chunks must have been cleared",<a name="line.250"></a>
+<span class="sourceLineNo">251</span>          ChunkCreator.INSTANCE.numberOfMappedChunks() != 0);<a name="line.251"></a>
+<span class="sourceLineNo">252</span>      int pooledChunksNum = mslab.getPooledChunks().size();<a name="line.252"></a>
+<span class="sourceLineNo">253</span>      // close the mslab<a name="line.253"></a>
+<span class="sourceLineNo">254</span>      mslab.close();<a name="line.254"></a>
+<span class="sourceLineNo">255</span>      // make sure all chunks where reclaimed back to pool<a name="line.255"></a>
+<span class="sourceLineNo">256</span>      int queueLength = mslab.getNumOfChunksReturnedToPool();<a name="line.256"></a>
+<span class="sourceLineNo">257</span>      assertTrue("All chunks in chunk queue should be reclaimed or removed"<a name="line.257"></a>
+<span class="sourceLineNo">258</span>          + " after mslab closed but actually: " + (pooledChunksNum-queueLength),<a name="line.258"></a>
+<span class="sourceLineNo">259</span>          pooledChunksNum-queueLength == 0);<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    } finally {<a name="line.260"></a>
+<span class="sourceLineNo">261</span>      ChunkCreator.INSTANCE = oldInstance;<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>  private Thread getChunkQueueTestThread(final MemStoreLABImpl mslab, String threadName,<a name="line.265"></a>
+<span class="sourceLineNo">266</span>      Cell cellToCopyInto) {<a name="line.266"></a>
+<span class="sourceLineNo">267</span>    Thread thread = new Thread() {<a name="line.267"></a>
+<span class="sourceLineNo">268</span>      volatile boolean stopped = false;<a name="line.268"></a>
+<span class="sourceLineNo">269</span><a name="line.269"></a>
+<span class="sourceLineNo">270</span>      @Override<a name="line.270"></a>
+<span class="sourceLineNo">271</span>      public void run() {<a name="line.271"></a>
+<span class="sourceLineNo">272</span>        while (!stopped) {<a name="line.272"></a>
+<span class="sourceLineNo">273</span>          // keep triggering chunk retirement<a name="line.273"></a>
+<span class="sourceLineNo">274</span>          mslab.copyCellInto(cellToCopyInto);<a name="line.274"></a>
+<span class="sourceLineNo">275</span>        }<a name="line.275"></a>
+<span class="sourceLineNo">276</span>      }<a name="line.276"></a>
+<span class="sourceLineNo">277</span><a name="line.277"></a>
+<span class="sourceLineNo">278</span>      @Override<a name="line.278"></a>
+<span class="sourceLineNo">279</span>      public void interrupt() {<a name="line.279"></a>
+<span class="sourceLineNo">280</span>        this.stopped = true;<a name="line.280"></a>
+<span class="sourceLineNo">281</span>      }<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    };<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    thread.setName(threadName);<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    thread.setDaemon(true);<a name="line.284"></a>
+<span class="sourceLineNo">285</span>    return thread;<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>  private static class AllocRecord implements Comparable&lt;AllocRecord&gt;{<a name="line.288"></a>
+<span class="sourceLineNo">289</span>    private final ByteBuffer alloc;<a name="line.289"></a>
+<span class="sourceLineNo">290</span>    private final int offset;<a name="line.290"></a>
+<span class="sourceLineNo">291</span>    private final int size;<a name="line.291"></a>
+<span class="sourceLineNo">292</span><a name="line.292"></a>
+<span class="sourceLineNo">293</span>    public AllocRecord(ByteBuffer alloc, int offset, int size) {<a name="line.293"></a>
+<span class="sourceLineNo">294</span>      super();<a name="line.294"></a>
+<span class="sourceLineNo">295</span>      this.alloc = alloc;<a name="line.295"></a>
+<span class="sourceLineNo">296</span>      this.offset = offset;<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      this.size = size;<a name="line.297"></a>
+<span class="sourceLineNo">298</span>    }<a name="line.298"></a>
+<span class="sourceLineNo">299</span><a name="line.299"></a>
+<span class="sourceLineNo">300</span>    @Override<a name="line.300"></a>
+<span class="sourceLineNo">301</span>    public int compareTo(AllocRecord e) {<a name="line.301"></a>
+<span class="sourceLineNo">302</span>      if (alloc != e.alloc) {<a name="line.302"></a>
+<span class="sourceLineNo">303</span>        throw new RuntimeException("Can only compare within a particular array");<a name="line.303"></a>
+<span class="sourceLineNo">304</span>      }<a name="line.304"></a>
+<span class="sourceLineNo">305</span>      return Ints.compare(this.offset, e.offset);<a name="line.305"></a>
+<span class="sourceLineNo">306</span>    }<a name="line.306"></a>
+<span class="sourceLineNo">307</span>    <a name="line.307"></a>
+<span class="sourceLineNo">308</span>    @Override<a name="line.308"></a>
+<span class="sourceLineNo">309</span>    public String toString() {<a name="line.309"></a>
+<span class="sourceLineNo">310</span>      return "AllocRecord(offset=" + this.offset + ", size=" + size + ")";<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    }<a name="line.311"></a>
+<span class="sourceLineNo">312</span>  }<a name="line.312"></a>
+<span class="sourceLineNo">313</span>}<a name="line.313"></a>
+<span class="sourceLineNo">314</span><a name="line.314"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cef8af03/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.html
index 044344b..22f9fdb 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.html
@@ -255,69 +255,71 @@
 <span class="sourceLineNo">247</span>        }<a name="line.247"></a>
 <span class="sourceLineNo">248</span>      }<a name="line.248"></a>
 <span class="sourceLineNo">249</span>      // none of the chunkIds would have been returned back<a name="line.249"></a>
-<span class="sourceLineNo">250</span>      assertTrue("All the chunks must have been cleared", ChunkCreator.INSTANCE.size() != 0);<a name="line.250"></a>
-<span class="sourceLineNo">251</span>      // close the mslab<a name="line.251"></a>
-<span class="sourceLineNo">252</span>      mslab.close();<a name="line.252"></a>
-<span class="sourceLineNo">253</span>      // make sure all chunks reclaimed or removed from chunk queue<a name="line.253"></a>
-<span class="sourceLineNo">254</span>      int queueLength = mslab.getPooledChunks().size();<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      assertTrue("All chunks in chunk queue should be reclaimed or removed"<a name="line.255"></a>
-<span class="sourceLineNo">256</span>          + " after mslab closed but actually: " + queueLength,<a name="line.256"></a>
-<span class="sourceLineNo">257</span>        queueLength == 0);<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    } finally {<a name="line.258"></a>
-<span class="sourceLineNo">259</span>      ChunkCreator.INSTANCE = oldInstance;<a name="line.259"></a>
-<span class="sourceLineNo">260</span>    }<a name="line.260"></a>
-<span class="sourceLineNo">261</span>  }<a name="line.261"></a>
-<span class="sourceLineNo">262</span><a name="line.262"></a>
-<span class="sourceLineNo">263</span>  private Thread getChunkQueueTestThread(final MemStoreLABImpl mslab, String threadName,<a name="line.263"></a>
-<span class="sourceLineNo">264</span>      Cell cellToCopyInto) {<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    Thread thread = new Thread() {<a name="line.265"></a>
-<span class="sourceLineNo">266</span>      volatile boolean stopped = false;<a name="line.266"></a>
-<span class="sourceLineNo">267</span><a name="line.267"></a>
-<span class="sourceLineNo">268</span>      @Override<a name="line.268"></a>
-<span class="sourceLineNo">269</span>      public void run() {<a name="line.269"></a>
-<span class="sourceLineNo">270</span>        while (!stopped) {<a name="line.270"></a>
-<span class="sourceLineNo">271</span>          // keep triggering chunk retirement<a name="line.271"></a>
-<span class="sourceLineNo">272</span>          mslab.copyCellInto(cellToCopyInto);<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><a name="line.275"></a>
-<span class="sourceLineNo">276</span>      @Override<a name="line.276"></a>
-<span class="sourceLineNo">277</span>      public void interrupt() {<a name="line.277"></a>
-<span class="sourceLineNo">278</span>        this.stopped = true;<a name="line.278"></a>
-<span class="sourceLineNo">279</span>      }<a name="line.279"></a>
-<span class="sourceLineNo">280</span>    };<a name="line.280"></a>
-<span class="sourceLineNo">281</span>    thread.setName(threadName);<a name="line.281"></a>
-<span class="sourceLineNo">282</span>    thread.setDaemon(true);<a name="line.282"></a>
-<span class="sourceLineNo">283</span>    return thread;<a name="line.283"></a>
-<span class="sourceLineNo">284</span>  }<a name="line.284"></a>
-<span class="sourceLineNo">285</span><a name="line.285"></a>
-<span class="sourceLineNo">286</span>  private static class AllocRecord implements Comparable&lt;AllocRecord&gt;{<a name="line.286"></a>
-<span class="sourceLineNo">287</span>    private final ByteBuffer alloc;<a name="line.287"></a>
-<span class="sourceLineNo">288</span>    private final int offset;<a name="line.288"></a>
-<span class="sourceLineNo">289</span>    private final int size;<a name="line.289"></a>
-<span class="sourceLineNo">290</span><a name="line.290"></a>
-<span class="sourceLineNo">291</span>    public AllocRecord(ByteBuffer alloc, int offset, int size) {<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      super();<a name="line.292"></a>
-<span class="sourceLineNo">293</span>      this.alloc = alloc;<a name="line.293"></a>
-<span class="sourceLineNo">294</span>      this.offset = offset;<a name="line.294"></a>
-<span class="sourceLineNo">295</span>      this.size = size;<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>    @Override<a name="line.298"></a>
-<span class="sourceLineNo">299</span>    public int compareTo(AllocRecord e) {<a name="line.299"></a>
-<span class="sourceLineNo">300</span>      if (alloc != e.alloc) {<a name="line.300"></a>
-<span class="sourceLineNo">301</span>        throw new RuntimeException("Can only compare within a particular array");<a name="line.301"></a>
-<span class="sourceLineNo">302</span>      }<a name="line.302"></a>
-<span class="sourceLineNo">303</span>      return Ints.compare(this.offset, e.offset);<a name="line.303"></a>
-<span class="sourceLineNo">304</span>    }<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    <a name="line.305"></a>
-<span class="sourceLineNo">306</span>    @Override<a name="line.306"></a>
-<span class="sourceLineNo">307</span>    public String toString() {<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      return "AllocRecord(offset=" + this.offset + ", size=" + size + ")";<a name="line.308"></a>
-<span class="sourceLineNo">309</span>    }<a name="line.309"></a>
-<span class="sourceLineNo">310</span>  }<a name="line.310"></a>
-<span class="sourceLineNo">311</span>}<a name="line.311"></a>
-<span class="sourceLineNo">312</span><a name="line.312"></a>
+<span class="sourceLineNo">250</span>      assertTrue("All the chunks must have been cleared",<a name="line.250"></a>
+<span class="sourceLineNo">251</span>          ChunkCreator.INSTANCE.numberOfMappedChunks() != 0);<a name="line.251"></a>
+<span class="sourceLineNo">252</span>      int pooledChunksNum = mslab.getPooledChunks().size();<a name="line.252"></a>
+<span class="sourceLineNo">253</span>      // close the mslab<a name="line.253"></a>
+<span class="sourceLineNo">254</span>      mslab.close();<a name="line.254"></a>
+<span class="sourceLineNo">255</span>      // make sure all chunks where reclaimed back to pool<a name="line.255"></a>
+<span class="sourceLineNo">256</span>      int queueLength = mslab.getNumOfChunksReturnedToPool();<a name="line.256"></a>
+<span class="sourceLineNo">257</span>      assertTrue("All chunks in chunk queue should be reclaimed or removed"<a name="line.257"></a>
+<span class="sourceLineNo">258</span>          + " after mslab closed but actually: " + (pooledChunksNum-queueLength),<a name="line.258"></a>
+<span class="sourceLineNo">259</span>          pooledChunksNum-queueLength == 0);<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    } finally {<a name="line.260"></a>
+<span class="sourceLineNo">261</span>      ChunkCreator.INSTANCE = oldInstance;<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>  private Thread getChunkQueueTestThread(final MemStoreLABImpl mslab, String threadName,<a name="line.265"></a>
+<span class="sourceLineNo">266</span>      Cell cellToCopyInto) {<a name="line.266"></a>
+<span class="sourceLineNo">267</span>    Thread thread = new Thread() {<a name="line.267"></a>
+<span class="sourceLineNo">268</span>      volatile boolean stopped = false;<a name="line.268"></a>
+<span class="sourceLineNo">269</span><a name="line.269"></a>
+<span class="sourceLineNo">270</span>      @Override<a name="line.270"></a>
+<span class="sourceLineNo">271</span>      public void run() {<a name="line.271"></a>
+<span class="sourceLineNo">272</span>        while (!stopped) {<a name="line.272"></a>
+<span class="sourceLineNo">273</span>          // keep triggering chunk retirement<a name="line.273"></a>
+<span class="sourceLineNo">274</span>          mslab.copyCellInto(cellToCopyInto);<a name="line.274"></a>
+<span class="sourceLineNo">275</span>        }<a name="line.275"></a>
+<span class="sourceLineNo">276</span>      }<a name="line.276"></a>
+<span class="sourceLineNo">277</span><a name="line.277"></a>
+<span class="sourceLineNo">278</span>      @Override<a name="line.278"></a>
+<span class="sourceLineNo">279</span>      public void interrupt() {<a name="line.279"></a>
+<span class="sourceLineNo">280</span>        this.stopped = true;<a name="line.280"></a>
+<span class="sourceLineNo">281</span>      }<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    };<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    thread.setName(threadName);<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    thread.setDaemon(true);<a name="line.284"></a>
+<span class="sourceLineNo">285</span>    return thread;<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>  private static class AllocRecord implements Comparable&lt;AllocRecord&gt;{<a name="line.288"></a>
+<span class="sourceLineNo">289</span>    private final ByteBuffer alloc;<a name="line.289"></a>
+<span class="sourceLineNo">290</span>    private final int offset;<a name="line.290"></a>
+<span class="sourceLineNo">291</span>    private final int size;<a name="line.291"></a>
+<span class="sourceLineNo">292</span><a name="line.292"></a>
+<span class="sourceLineNo">293</span>    public AllocRecord(ByteBuffer alloc, int offset, int size) {<a name="line.293"></a>
+<span class="sourceLineNo">294</span>      super();<a name="line.294"></a>
+<span class="sourceLineNo">295</span>      this.alloc = alloc;<a name="line.295"></a>
+<span class="sourceLineNo">296</span>      this.offset = offset;<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      this.size = size;<a name="line.297"></a>
+<span class="sourceLineNo">298</span>    }<a name="line.298"></a>
+<span class="sourceLineNo">299</span><a name="line.299"></a>
+<span class="sourceLineNo">300</span>    @Override<a name="line.300"></a>
+<span class="sourceLineNo">301</span>    public int compareTo(AllocRecord e) {<a name="line.301"></a>
+<span class="sourceLineNo">302</span>      if (alloc != e.alloc) {<a name="line.302"></a>
+<span class="sourceLineNo">303</span>        throw new RuntimeException("Can only compare within a particular array");<a name="line.303"></a>
+<span class="sourceLineNo">304</span>      }<a name="line.304"></a>
+<span class="sourceLineNo">305</span>      return Ints.compare(this.offset, e.offset);<a name="line.305"></a>
+<span class="sourceLineNo">306</span>    }<a name="line.306"></a>
+<span class="sourceLineNo">307</span>    <a name="line.307"></a>
+<span class="sourceLineNo">308</span>    @Override<a name="line.308"></a>
+<span class="sourceLineNo">309</span>    public String toString() {<a name="line.309"></a>
+<span class="sourceLineNo">310</span>      return "AllocRecord(offset=" + this.offset + ", size=" + size + ")";<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    }<a name="line.311"></a>
+<span class="sourceLineNo">312</span>  }<a name="line.312"></a>
+<span class="sourceLineNo">313</span>}<a name="line.313"></a>
+<span class="sourceLineNo">314</span><a name="line.314"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cef8af03/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemstoreLABWithoutPool.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemstoreLABWithoutPool.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemstoreLABWithoutPool.html
index 5fdf185..a5b3b10 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemstoreLABWithoutPool.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestMemstoreLABWithoutPool.html
@@ -148,32 +148,33 @@
 <span class="sourceLineNo">140</span>      mslab[i].close();<a name="line.140"></a>
 <span class="sourceLineNo">141</span>    }<a name="line.141"></a>
 <span class="sourceLineNo">142</span>    // all of the chunkIds would have been returned back<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    assertTrue("All the chunks must have been cleared", ChunkCreator.INSTANCE.size() == 0);<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>  private Thread getChunkQueueTestThread(final MemStoreLABImpl mslab, String threadName,<a name="line.146"></a>
-<span class="sourceLineNo">147</span>      Cell cellToCopyInto) {<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    Thread thread = new Thread() {<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      volatile boolean stopped = false;<a name="line.149"></a>
-<span class="sourceLineNo">150</span><a name="line.150"></a>
-<span class="sourceLineNo">151</span>      @Override<a name="line.151"></a>
-<span class="sourceLineNo">152</span>      public void run() {<a name="line.152"></a>
-<span class="sourceLineNo">153</span>        while (!stopped) {<a name="line.153"></a>
-<span class="sourceLineNo">154</span>          // keep triggering chunk retirement<a name="line.154"></a>
-<span class="sourceLineNo">155</span>          mslab.copyCellInto(cellToCopyInto);<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>      @Override<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      public void interrupt() {<a name="line.160"></a>
-<span class="sourceLineNo">161</span>        this.stopped = true;<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>    thread.setName(threadName);<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    thread.setDaemon(true);<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    return thread;<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">143</span>    assertTrue("All the chunks must have been cleared",<a name="line.143"></a>
+<span class="sourceLineNo">144</span>        ChunkCreator.INSTANCE.numberOfMappedChunks() == 0);<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>  private Thread getChunkQueueTestThread(final MemStoreLABImpl mslab, String threadName,<a name="line.147"></a>
+<span class="sourceLineNo">148</span>      Cell cellToCopyInto) {<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    Thread thread = new Thread() {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>      volatile boolean stopped = false;<a name="line.150"></a>
+<span class="sourceLineNo">151</span><a name="line.151"></a>
+<span class="sourceLineNo">152</span>      @Override<a name="line.152"></a>
+<span class="sourceLineNo">153</span>      public void run() {<a name="line.153"></a>
+<span class="sourceLineNo">154</span>        while (!stopped) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>          // keep triggering chunk retirement<a name="line.155"></a>
+<span class="sourceLineNo">156</span>          mslab.copyCellInto(cellToCopyInto);<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><a name="line.159"></a>
+<span class="sourceLineNo">160</span>      @Override<a name="line.160"></a>
+<span class="sourceLineNo">161</span>      public void interrupt() {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>        this.stopped = true;<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>    thread.setName(threadName);<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    thread.setDaemon(true);<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    return thread;<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>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cef8af03/testdevapidocs/src-html/org/apache/hadoop/hbase/rest/TestVersionResource.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/rest/TestVersionResource.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/rest/TestVersionResource.html
index 527d675..473f1a2 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/rest/TestVersionResource.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/rest/TestVersionResource.html
@@ -43,14 +43,14 @@
 <span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.testclassification.MediumTests;<a name="line.35"></a>
 <span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.testclassification.RestTests;<a name="line.36"></a>
 <span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.37"></a>
-<span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>import static org.junit.Assert.*;<a name="line.39"></a>
-<span class="sourceLineNo">040</span><a name="line.40"></a>
-<span class="sourceLineNo">041</span>import org.junit.AfterClass;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import org.junit.BeforeClass;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import org.junit.Test;<a name="line.43"></a>
-<span class="sourceLineNo">044</span><a name="line.44"></a>
-<span class="sourceLineNo">045</span>import com.sun.jersey.spi.container.servlet.ServletContainer;<a name="line.45"></a>
+<span class="sourceLineNo">038</span>import org.glassfish.jersey.servlet.ServletContainer;<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span>import static org.junit.Assert.*;<a name="line.40"></a>
+<span class="sourceLineNo">041</span><a name="line.41"></a>
+<span class="sourceLineNo">042</span>import org.junit.AfterClass;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>import org.junit.BeforeClass;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>import org.junit.Test;<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
 <span class="sourceLineNo">046</span>import org.junit.experimental.categories.Category;<a name="line.46"></a>
 <span class="sourceLineNo">047</span><a name="line.47"></a>
 <span class="sourceLineNo">048</span>@Category({RestTests.class, MediumTests.class})<a name="line.48"></a>
@@ -97,7 +97,7 @@
 <span class="sourceLineNo">089</span>    assertNotNull(model.getServerVersion());<a name="line.89"></a>
 <span class="sourceLineNo">090</span>    String jerseyVersion = model.getJerseyVersion();<a name="line.90"></a>
 <span class="sourceLineNo">091</span>    assertNotNull(jerseyVersion);<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    assertEquals(jerseyVersion, ServletContainer.class.getPackage()<a name="line.92"></a>
+<span class="sourceLineNo">092</span>    assertEquals(jerseyVersion, ServletContainer.class.getClass().getPackage()<a name="line.92"></a>
 <span class="sourceLineNo">093</span>      .getImplementationVersion());<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>
@@ -115,7 +115,7 @@
 <span class="sourceLineNo">107</span>    assertTrue(body.contains(System.getProperty("os.name")));<a name="line.107"></a>
 <span class="sourceLineNo">108</span>    assertTrue(body.contains(System.getProperty("os.version")));<a name="line.108"></a>
 <span class="sourceLineNo">109</span>    assertTrue(body.contains(System.getProperty("os.arch")));<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    assertTrue(body.contains(ServletContainer.class.getPackage()<a name="line.110"></a>
+<span class="sourceLineNo">110</span>    assertTrue(body.contains(ServletContainer.class.getClass().getPackage()<a name="line.110"></a>
 <span class="sourceLineNo">111</span>      .getImplementationVersion()));<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>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cef8af03/testdevapidocs/src-html/org/apache/hadoop/hbase/zookeeper/TestZooKeeperWatcher.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/zookeeper/TestZooKeeperWatcher.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/zookeeper/TestZooKeeperWatcher.html
index ecd1554..47953b6 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/zookeeper/TestZooKeeperWatcher.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/zookeeper/TestZooKeeperWatcher.html
@@ -31,41 +31,88 @@
 <span class="sourceLineNo">023</span><a name="line.23"></a>
 <span class="sourceLineNo">024</span>import java.io.IOException;<a name="line.24"></a>
 <span class="sourceLineNo">025</span><a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.HBaseConfiguration;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.ZooKeeperConnectionException;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.testclassification.SmallTests;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.junit.Test;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.junit.experimental.categories.Category;<a name="line.30"></a>
-<span class="sourceLineNo">031</span><a name="line.31"></a>
-<span class="sourceLineNo">032</span>@Category({ SmallTests.class })<a name="line.32"></a>
-<span class="sourceLineNo">033</span>public class TestZooKeeperWatcher {<a name="line.33"></a>
-<span class="sourceLineNo">034</span><a name="line.34"></a>
-<span class="sourceLineNo">035</span>  @Test<a name="line.35"></a>
-<span class="sourceLineNo">036</span>  public void testIsClientReadable() throws ZooKeeperConnectionException, IOException {<a name="line.36"></a>
-<span class="sourceLineNo">037</span>    ZooKeeperWatcher watcher = new ZooKeeperWatcher(HBaseConfiguration.create(),<a name="line.37"></a>
-<span class="sourceLineNo">038</span>        "testIsClientReadable", null, false);<a name="line.38"></a>
-<span class="sourceLineNo">039</span><a name="line.39"></a>
-<span class="sourceLineNo">040</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.baseZNode));<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.getZNodeForReplica(0)));<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.masterAddressZNode));<a name="line.42"></a>
-<span class="sourceLineNo">043</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.clusterIdZNode));<a name="line.43"></a>
-<span class="sourceLineNo">044</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.tableZNode));<a name="line.44"></a>
-<span class="sourceLineNo">045</span>    assertTrue(watcher.isClientReadable(ZKUtil.joinZNode(watcher.znodePaths.tableZNode, "foo")));<a name="line.45"></a>
-<span class="sourceLineNo">046</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.rsZNode));<a name="line.46"></a>
+<span class="sourceLineNo">026</span>import org.apache.commons.logging.Log;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.commons.logging.LogFactory;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.conf.Configuration;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.Abortable;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.HBaseConfiguration;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.ZooKeeperConnectionException;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.testclassification.SmallTests;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.zookeeper.WatchedEvent;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.apache.zookeeper.Watcher;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import org.junit.Test;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import org.junit.experimental.categories.Category;<a name="line.37"></a>
+<span class="sourceLineNo">038</span><a name="line.38"></a>
+<span class="sourceLineNo">039</span>@Category({ SmallTests.class })<a name="line.39"></a>
+<span class="sourceLineNo">040</span>public class TestZooKeeperWatcher {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>  private final static Log LOG = LogFactory.getLog(TestZooKeeperWatcher.class);<a name="line.41"></a>
+<span class="sourceLineNo">042</span><a name="line.42"></a>
+<span class="sourceLineNo">043</span>  @Test<a name="line.43"></a>
+<span class="sourceLineNo">044</span>  public void testIsClientReadable() throws ZooKeeperConnectionException, IOException {<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    ZooKeeperWatcher watcher = new ZooKeeperWatcher(HBaseConfiguration.create(),<a name="line.45"></a>
+<span class="sourceLineNo">046</span>        "testIsClientReadable", null, false);<a name="line.46"></a>
 <span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.tableLockZNode));<a name="line.48"></a>
-<span class="sourceLineNo">049</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.balancerZNode));<a name="line.49"></a>
-<span class="sourceLineNo">050</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.regionNormalizerZNode));<a name="line.50"></a>
-<span class="sourceLineNo">051</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.clusterStateZNode));<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.drainingZNode));<a name="line.52"></a>
-<span class="sourceLineNo">053</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.recoveringRegionsZNode));<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.splitLogZNode));<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.backupMasterAddressesZNode));<a name="line.55"></a>
-<span class="sourceLineNo">056</span><a name="line.56"></a>
-<span class="sourceLineNo">057</span>    watcher.close();<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">048</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.baseZNode));<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.getZNodeForReplica(0)));<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.masterAddressZNode));<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.clusterIdZNode));<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.tableZNode));<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    assertTrue(watcher.isClientReadable(ZKUtil.joinZNode(watcher.znodePaths.tableZNode, "foo")));<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    assertTrue(watcher.isClientReadable(watcher.znodePaths.rsZNode));<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.tableLockZNode));<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.balancerZNode));<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.regionNormalizerZNode));<a name="line.58"></a>
+<span class="sourceLineNo">059</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.clusterStateZNode));<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.drainingZNode));<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.recoveringRegionsZNode));<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.splitLogZNode));<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    assertFalse(watcher.isClientReadable(watcher.znodePaths.backupMasterAddressesZNode));<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>    watcher.close();<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>  @Test<a name="line.68"></a>
+<span class="sourceLineNo">069</span>  public void testConnectionEvent() throws ZooKeeperConnectionException, IOException {<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    long zkSessionTimeout = 15000l;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    Configuration conf = HBaseConfiguration.create();<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    conf.set("zookeeper.session.timeout", "15000");<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>    Abortable abortable = new Abortable() {<a name="line.74"></a>
+<span class="sourceLineNo">075</span>      boolean aborted = false;<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>      @Override<a name="line.77"></a>
+<span class="sourceLineNo">078</span>      public void abort(String why, Throwable e) {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>        aborted = true;<a name="line.79"></a>
+<span class="sourceLineNo">080</span>        LOG.error(why, e);<a name="line.80"></a>
+<span class="sourceLineNo">081</span>      }<a name="line.81"></a>
+<span class="sourceLineNo">082</span><a name="line.82"></a>
+<span class="sourceLineNo">083</span>      @Override<a name="line.83"></a>
+<span class="sourceLineNo">084</span>      public boolean isAborted() {<a name="line.84"></a>
+<span class="sourceLineNo">085</span>        return aborted;<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>    ZooKeeperWatcher watcher = new ZooKeeperWatcher(conf, "testConnectionEvent", abortable, false, true);<a name="line.88"></a>
+<span class="sourceLineNo">089</span><a name="line.89"></a>
+<span class="sourceLineNo">090</span>    WatchedEvent event =<a name="line.90"></a>
+<span class="sourceLineNo">091</span>        new WatchedEvent(Watcher.Event.EventType.None, Watcher.Event.KeeperState.Disconnected, null);<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>    long startTime = EnvironmentEdgeManager.currentTime();<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    while (!abortable.isAborted()<a name="line.94"></a>
+<span class="sourceLineNo">095</span>        &amp;&amp; (EnvironmentEdgeManager.currentTime() - startTime &lt; zkSessionTimeout)) {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>      watcher.process(event);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>      try {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        Thread.sleep(1000);<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      } catch (InterruptedException e) {<a name="line.99"></a>
+<span class="sourceLineNo">100</span>        Thread.currentThread().interrupt();<a name="line.100"></a>
+<span class="sourceLineNo">101</span>      }<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>    assertTrue(abortable.isAborted());<a name="line.104"></a>
+<span class="sourceLineNo">105</span>    watcher.close();<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>
 
 
 


Mime
View raw message