hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [4/8] hbase-site git commit: Published site at .
Date Sun, 10 Sep 2017 15:13:47 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/devapidocs/src-html/org/apache/hadoop/hbase/rest/RESTServer.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/rest/RESTServer.html b/devapidocs/src-html/org/apache/hadoop/hbase/rest/RESTServer.html
index eeb641b..bd0c853 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/rest/RESTServer.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/rest/RESTServer.html
@@ -49,324 +49,323 @@
 <span class="sourceLineNo">041</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.41"></a>
 <span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.http.InfoServer;<a name="line.42"></a>
 <span class="sourceLineNo">043</span>import org.apache.hadoop.hbase.rest.filter.AuthFilter;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>import org.apache.hadoop.hbase.rest.filter.GzipFilter;<a name="line.44"></a>
-<span class="sourceLineNo">045</span>import org.apache.hadoop.hbase.rest.filter.RestCsrfPreventionFilter;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>import org.apache.hadoop.hbase.security.UserProvider;<a name="line.46"></a>
-<span class="sourceLineNo">047</span>import org.apache.hadoop.hbase.util.DNS;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>import org.apache.hadoop.hbase.util.HttpServerUtil;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>import org.apache.hadoop.hbase.util.Pair;<a name="line.49"></a>
-<span class="sourceLineNo">050</span>import org.apache.hadoop.hbase.util.Strings;<a name="line.50"></a>
-<span class="sourceLineNo">051</span>import org.apache.hadoop.hbase.util.VersionInfo;<a name="line.51"></a>
-<span class="sourceLineNo">052</span>import org.apache.hadoop.util.StringUtils;<a name="line.52"></a>
-<span class="sourceLineNo">053</span><a name="line.53"></a>
-<span class="sourceLineNo">054</span>import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;<a name="line.54"></a>
-<span class="sourceLineNo">055</span><a name="line.55"></a>
-<span class="sourceLineNo">056</span>import org.eclipse.jetty.http.HttpVersion;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>import org.eclipse.jetty.server.Server;<a name="line.57"></a>
-<span class="sourceLineNo">058</span>import org.eclipse.jetty.server.HttpConnectionFactory;<a name="line.58"></a>
-<span class="sourceLineNo">059</span>import org.eclipse.jetty.server.SslConnectionFactory;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>import org.eclipse.jetty.server.HttpConfiguration;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>import org.eclipse.jetty.server.ServerConnector;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>import org.eclipse.jetty.server.SecureRequestCustomizer;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>import org.eclipse.jetty.util.ssl.SslContextFactory;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>import org.eclipse.jetty.servlet.ServletContextHandler;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>import org.eclipse.jetty.servlet.ServletHolder;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>import org.eclipse.jetty.util.thread.QueuedThreadPool;<a name="line.66"></a>
-<span class="sourceLineNo">067</span>import org.eclipse.jetty.jmx.MBeanContainer;<a name="line.67"></a>
-<span class="sourceLineNo">068</span>import org.eclipse.jetty.servlet.FilterHolder;<a name="line.68"></a>
-<span class="sourceLineNo">069</span><a name="line.69"></a>
-<span class="sourceLineNo">070</span>import org.glassfish.jersey.jackson1.Jackson1Feature;<a name="line.70"></a>
-<span class="sourceLineNo">071</span>import org.glassfish.jersey.server.ResourceConfig;<a name="line.71"></a>
-<span class="sourceLineNo">072</span>import org.glassfish.jersey.servlet.ServletContainer;<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>import javax.servlet.DispatcherType;<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> * Main class for launching REST gateway as a servlet hosted by Jetty.<a name="line.77"></a>
-<span class="sourceLineNo">078</span> * &lt;p&gt;<a name="line.78"></a>
-<span class="sourceLineNo">079</span> * The following options are supported:<a name="line.79"></a>
-<span class="sourceLineNo">080</span> * &lt;ul&gt;<a name="line.80"></a>
-<span class="sourceLineNo">081</span> * &lt;li&gt;-p --port : service port&lt;/li&gt;<a name="line.81"></a>
-<span class="sourceLineNo">082</span> * &lt;li&gt;-ro --readonly : server mode&lt;/li&gt;<a name="line.82"></a>
-<span class="sourceLineNo">083</span> * &lt;/ul&gt;<a name="line.83"></a>
-<span class="sourceLineNo">084</span> */<a name="line.84"></a>
-<span class="sourceLineNo">085</span>@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS)<a name="line.85"></a>
-<span class="sourceLineNo">086</span>public class RESTServer implements Constants {<a name="line.86"></a>
-<span class="sourceLineNo">087</span>  static Log LOG = LogFactory.getLog("RESTServer");<a name="line.87"></a>
-<span class="sourceLineNo">088</span><a name="line.88"></a>
-<span class="sourceLineNo">089</span>  static String REST_CSRF_ENABLED_KEY = "hbase.rest.csrf.enabled";<a name="line.89"></a>
-<span class="sourceLineNo">090</span>  static boolean REST_CSRF_ENABLED_DEFAULT = false;<a name="line.90"></a>
-<span class="sourceLineNo">091</span>  static boolean restCSRFEnabled = false;<a name="line.91"></a>
-<span class="sourceLineNo">092</span>  static String REST_CSRF_CUSTOM_HEADER_KEY ="hbase.rest.csrf.custom.header";<a name="line.92"></a>
-<span class="sourceLineNo">093</span>  static String REST_CSRF_CUSTOM_HEADER_DEFAULT = "X-XSRF-HEADER";<a name="line.93"></a>
-<span class="sourceLineNo">094</span>  static String REST_CSRF_METHODS_TO_IGNORE_KEY = "hbase.rest.csrf.methods.to.ignore";<a name="line.94"></a>
-<span class="sourceLineNo">095</span>  static String REST_CSRF_METHODS_TO_IGNORE_DEFAULT = "GET,OPTIONS,HEAD,TRACE";<a name="line.95"></a>
-<span class="sourceLineNo">096</span><a name="line.96"></a>
-<span class="sourceLineNo">097</span>  private static final String PATH_SPEC_ANY = "/*";<a name="line.97"></a>
-<span class="sourceLineNo">098</span><a name="line.98"></a>
-<span class="sourceLineNo">099</span>  private static void printUsageAndExit(Options options, int exitCode) {<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    HelpFormatter formatter = new HelpFormatter();<a name="line.100"></a>
-<span class="sourceLineNo">101</span>    formatter.printHelp("hbase rest start", "", options,<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      "\nTo run the REST server as a daemon, execute " +<a name="line.102"></a>
-<span class="sourceLineNo">103</span>      "hbase-daemon.sh start|stop rest [--infoport &lt;port&gt;] [-p &lt;port&gt;] [-ro]\n", true);<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    System.exit(exitCode);<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>   * Returns a list of strings from a comma-delimited configuration value.<a name="line.108"></a>
-<span class="sourceLineNo">109</span>   *<a name="line.109"></a>
-<span class="sourceLineNo">110</span>   * @param conf configuration to check<a name="line.110"></a>
-<span class="sourceLineNo">111</span>   * @param name configuration property name<a name="line.111"></a>
-<span class="sourceLineNo">112</span>   * @param defaultValue default value if no value found for name<a name="line.112"></a>
-<span class="sourceLineNo">113</span>   * @return list of strings from comma-delimited configuration value, or an<a name="line.113"></a>
-<span class="sourceLineNo">114</span>   *     empty list if not found<a name="line.114"></a>
-<span class="sourceLineNo">115</span>   */<a name="line.115"></a>
-<span class="sourceLineNo">116</span>  private static List&lt;String&gt; getTrimmedStringList(Configuration conf,<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    String name, String defaultValue) {<a name="line.117"></a>
-<span class="sourceLineNo">118</span>    String valueString = conf.get(name, defaultValue);<a name="line.118"></a>
-<span class="sourceLineNo">119</span>    if (valueString == null) {<a name="line.119"></a>
-<span class="sourceLineNo">120</span>      return new ArrayList&lt;&gt;();<a name="line.120"></a>
-<span class="sourceLineNo">121</span>    }<a name="line.121"></a>
-<span class="sourceLineNo">122</span>    return new ArrayList&lt;&gt;(StringUtils.getTrimmedStringCollection(valueString));<a name="line.122"></a>
-<span class="sourceLineNo">123</span>  }<a name="line.123"></a>
-<span class="sourceLineNo">124</span><a name="line.124"></a>
-<span class="sourceLineNo">125</span>  static String REST_CSRF_BROWSER_USERAGENTS_REGEX_KEY = "hbase.rest-csrf.browser-useragents-regex";<a name="line.125"></a>
-<span class="sourceLineNo">126</span>  static void addCSRFFilter(ServletContextHandler ctxHandler, Configuration conf) {<a name="line.126"></a>
-<span class="sourceLineNo">127</span>    restCSRFEnabled = conf.getBoolean(REST_CSRF_ENABLED_KEY, REST_CSRF_ENABLED_DEFAULT);<a name="line.127"></a>
-<span class="sourceLineNo">128</span>    if (restCSRFEnabled) {<a name="line.128"></a>
-<span class="sourceLineNo">129</span>      Map&lt;String, String&gt; restCsrfParams = RestCsrfPreventionFilter<a name="line.129"></a>
-<span class="sourceLineNo">130</span>          .getFilterParams(conf, "hbase.rest-csrf.");<a name="line.130"></a>
-<span class="sourceLineNo">131</span>      FilterHolder holder = new FilterHolder();<a name="line.131"></a>
-<span class="sourceLineNo">132</span>      holder.setName("csrf");<a name="line.132"></a>
-<span class="sourceLineNo">133</span>      holder.setClassName(RestCsrfPreventionFilter.class.getName());<a name="line.133"></a>
-<span class="sourceLineNo">134</span>      holder.setInitParameters(restCsrfParams);<a name="line.134"></a>
-<span class="sourceLineNo">135</span>      ctxHandler.addFilter(holder, PATH_SPEC_ANY, EnumSet.allOf(DispatcherType.class));<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><a name="line.138"></a>
-<span class="sourceLineNo">139</span>  // login the server principal (if using secure Hadoop)<a name="line.139"></a>
-<span class="sourceLineNo">140</span>  private static Pair&lt;FilterHolder, Class&lt;? extends ServletContainer&gt;&gt; loginServerPrincipal(<a name="line.140"></a>
-<span class="sourceLineNo">141</span>    UserProvider userProvider, Configuration conf) throws Exception {<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    Class&lt;? extends ServletContainer&gt; containerClass = ServletContainer.class;<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    if (userProvider.isHadoopSecurityEnabled() &amp;&amp; userProvider.isHBaseSecurityEnabled()) {<a name="line.143"></a>
-<span class="sourceLineNo">144</span>      String machineName = Strings.domainNamePointerToHostName(<a name="line.144"></a>
-<span class="sourceLineNo">145</span>        DNS.getDefaultHost(conf.get(REST_DNS_INTERFACE, "default"),<a name="line.145"></a>
-<span class="sourceLineNo">146</span>          conf.get(REST_DNS_NAMESERVER, "default")));<a name="line.146"></a>
-<span class="sourceLineNo">147</span>      String keytabFilename = conf.get(REST_KEYTAB_FILE);<a name="line.147"></a>
-<span class="sourceLineNo">148</span>      Preconditions.checkArgument(keytabFilename != null &amp;&amp; !keytabFilename.isEmpty(),<a name="line.148"></a>
-<span class="sourceLineNo">149</span>        REST_KEYTAB_FILE + " should be set if security is enabled");<a name="line.149"></a>
-<span class="sourceLineNo">150</span>      String principalConfig = conf.get(REST_KERBEROS_PRINCIPAL);<a name="line.150"></a>
-<span class="sourceLineNo">151</span>      Preconditions.checkArgument(principalConfig != null &amp;&amp; !principalConfig.isEmpty(),<a name="line.151"></a>
-<span class="sourceLineNo">152</span>        REST_KERBEROS_PRINCIPAL + " should be set if security is enabled");<a name="line.152"></a>
-<span class="sourceLineNo">153</span>      userProvider.login(REST_KEYTAB_FILE, REST_KERBEROS_PRINCIPAL, machineName);<a name="line.153"></a>
-<span class="sourceLineNo">154</span>      if (conf.get(REST_AUTHENTICATION_TYPE) != null) {<a name="line.154"></a>
-<span class="sourceLineNo">155</span>        containerClass = RESTServletContainer.class;<a name="line.155"></a>
-<span class="sourceLineNo">156</span>        FilterHolder authFilter = new FilterHolder();<a name="line.156"></a>
-<span class="sourceLineNo">157</span>        authFilter.setClassName(AuthFilter.class.getName());<a name="line.157"></a>
-<span class="sourceLineNo">158</span>        authFilter.setName("AuthenticationFilter");<a name="line.158"></a>
-<span class="sourceLineNo">159</span>        return new Pair&lt;&gt;(authFilter,containerClass);<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      }<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    }<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    return new Pair&lt;&gt;(null, containerClass);<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>  private static void parseCommandLine(String[] args, RESTServlet servlet) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    Options options = new Options();<a name="line.166"></a>
-<span class="sourceLineNo">167</span>    options.addOption("p", "port", true, "Port to bind to [default: " + DEFAULT_LISTEN_PORT + "]");<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    options.addOption("ro", "readonly", false, "Respond only to GET HTTP " +<a name="line.168"></a>
-<span class="sourceLineNo">169</span>      "method requests [default: false]");<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    options.addOption(null, "infoport", true, "Port for web UI");<a name="line.170"></a>
-<span class="sourceLineNo">171</span><a name="line.171"></a>
-<span class="sourceLineNo">172</span>    CommandLine commandLine = null;<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    try {<a name="line.173"></a>
-<span class="sourceLineNo">174</span>      commandLine = new PosixParser().parse(options, args);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    } catch (ParseException e) {<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      LOG.error("Could not parse: ", e);<a name="line.176"></a>
-<span class="sourceLineNo">177</span>      printUsageAndExit(options, -1);<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    }<a name="line.178"></a>
-<span class="sourceLineNo">179</span><a name="line.179"></a>
-<span class="sourceLineNo">180</span>    // check for user-defined port setting, if so override the conf<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    if (commandLine != null &amp;&amp; commandLine.hasOption("port")) {<a name="line.181"></a>
-<span class="sourceLineNo">182</span>      String val = commandLine.getOptionValue("port");<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      servlet.getConfiguration().setInt("hbase.rest.port", Integer.parseInt(val));<a name="line.183"></a>
-<span class="sourceLineNo">184</span>      if (LOG.isDebugEnabled()) {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>        LOG.debug("port set to " + val);<a name="line.185"></a>
-<span class="sourceLineNo">186</span>      }<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    }<a name="line.187"></a>
-<span class="sourceLineNo">188</span><a name="line.188"></a>
-<span class="sourceLineNo">189</span>    // check if server should only process GET requests, if so override the conf<a name="line.189"></a>
-<span class="sourceLineNo">190</span>    if (commandLine != null &amp;&amp; commandLine.hasOption("readonly")) {<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      servlet.getConfiguration().setBoolean("hbase.rest.readonly", true);<a name="line.191"></a>
-<span class="sourceLineNo">192</span>      if (LOG.isDebugEnabled()) {<a name="line.192"></a>
-<span class="sourceLineNo">193</span>        LOG.debug("readonly set to true");<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      }<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    }<a name="line.195"></a>
-<span class="sourceLineNo">196</span><a name="line.196"></a>
-<span class="sourceLineNo">197</span>    // check for user-defined info server port setting, if so override the conf<a name="line.197"></a>
-<span class="sourceLineNo">198</span>    if (commandLine != null &amp;&amp; commandLine.hasOption("infoport")) {<a name="line.198"></a>
-<span class="sourceLineNo">199</span>      String val = commandLine.getOptionValue("infoport");<a name="line.199"></a>
-<span class="sourceLineNo">200</span>      servlet.getConfiguration().setInt("hbase.rest.info.port", Integer.parseInt(val));<a name="line.200"></a>
-<span class="sourceLineNo">201</span>      if (LOG.isDebugEnabled()) {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>        LOG.debug("Web UI port set to " + val);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      }<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>    @SuppressWarnings("unchecked")<a name="line.206"></a>
-<span class="sourceLineNo">207</span>    List&lt;String&gt; remainingArgs = commandLine != null ? commandLine.getArgList() : new ArrayList&lt;&gt;();<a name="line.207"></a>
-<span class="sourceLineNo">208</span>    if (remainingArgs.size() != 1) {<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      printUsageAndExit(options, 1);<a name="line.209"></a>
-<span class="sourceLineNo">210</span>    }<a name="line.210"></a>
-<span class="sourceLineNo">211</span><a name="line.211"></a>
-<span class="sourceLineNo">212</span>    String command = remainingArgs.get(0);<a name="line.212"></a>
-<span class="sourceLineNo">213</span>    if ("start".equals(command)) {<a name="line.213"></a>
-<span class="sourceLineNo">214</span>      // continue and start container<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    } else if ("stop".equals(command)) {<a name="line.215"></a>
-<span class="sourceLineNo">216</span>      System.exit(1);<a name="line.216"></a>
-<span class="sourceLineNo">217</span>    } else {<a name="line.217"></a>
-<span class="sourceLineNo">218</span>      printUsageAndExit(options, 1);<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    }<a name="line.219"></a>
-<span class="sourceLineNo">220</span>  }<a name="line.220"></a>
-<span class="sourceLineNo">221</span><a name="line.221"></a>
-<span class="sourceLineNo">222</span>  /**<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   * The main method for the HBase rest server.<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   * @param args command-line arguments<a name="line.224"></a>
-<span class="sourceLineNo">225</span>   * @throws Exception exception<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>  public static void main(String[] args) throws Exception {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    LOG.info("***** STARTING service '" + RESTServer.class.getSimpleName() + "' *****");<a name="line.228"></a>
-<span class="sourceLineNo">229</span>    VersionInfo.logVersion();<a name="line.229"></a>
-<span class="sourceLineNo">230</span>    Configuration conf = HBaseConfiguration.create();<a name="line.230"></a>
-<span class="sourceLineNo">231</span>    UserProvider userProvider = UserProvider.instantiate(conf);<a name="line.231"></a>
-<span class="sourceLineNo">232</span>    Pair&lt;FilterHolder, Class&lt;? extends ServletContainer&gt;&gt; pair = loginServerPrincipal(<a name="line.232"></a>
-<span class="sourceLineNo">233</span>      userProvider, conf);<a name="line.233"></a>
-<span class="sourceLineNo">234</span>    FilterHolder authFilter = pair.getFirst();<a name="line.234"></a>
-<span class="sourceLineNo">235</span>    RESTServlet servlet = RESTServlet.getInstance(conf, userProvider);<a name="line.235"></a>
-<span class="sourceLineNo">236</span><a name="line.236"></a>
-<span class="sourceLineNo">237</span>    parseCommandLine(args, servlet);<a name="line.237"></a>
-<span class="sourceLineNo">238</span><a name="line.238"></a>
-<span class="sourceLineNo">239</span>    // set up the Jersey servlet container for Jetty<a name="line.239"></a>
-<span class="sourceLineNo">240</span>    ResourceConfig application = new ResourceConfig().<a name="line.240"></a>
-<span class="sourceLineNo">241</span>        packages("org.apache.hadoop.hbase.rest").register(Jackson1Feature.class);<a name="line.241"></a>
-<span class="sourceLineNo">242</span>    ServletHolder sh = new ServletHolder(new ServletContainer(application));<a name="line.242"></a>
-<span class="sourceLineNo">243</span><a name="line.243"></a>
-<span class="sourceLineNo">244</span>    // Set the default max thread number to 100 to limit<a name="line.244"></a>
-<span class="sourceLineNo">245</span>    // the number of concurrent requests so that REST server doesn't OOM easily.<a name="line.245"></a>
-<span class="sourceLineNo">246</span>    // Jetty set the default max thread number to 250, if we don't set it.<a name="line.246"></a>
-<span class="sourceLineNo">247</span>    //<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    // Our default min thread number 2 is the same as that used by Jetty.<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    int maxThreads = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREADS_MAX, 100);<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    int minThreads = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREADS_MIN, 2);<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    // Use the default queue (unbounded with Jetty 9.3) if the queue size is negative, otherwise use<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    // bounded {@link ArrayBlockingQueue} with the given size<a name="line.252"></a>
-<span class="sourceLineNo">253</span>    int queueSize = servlet.getConfiguration().getInt(REST_THREAD_POOL_TASK_QUEUE_SIZE, -1);<a name="line.253"></a>
-<span class="sourceLineNo">254</span>    int idleTimeout = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREAD_IDLE_TIMEOUT, 60000);<a name="line.254"></a>
-<span class="sourceLineNo">255</span>    QueuedThreadPool threadPool = queueSize &gt; 0 ?<a name="line.255"></a>
-<span class="sourceLineNo">256</span>        new QueuedThreadPool(maxThreads, minThreads, idleTimeout, new ArrayBlockingQueue&lt;&gt;(queueSize)) :<a name="line.256"></a>
-<span class="sourceLineNo">257</span>        new QueuedThreadPool(maxThreads, minThreads, idleTimeout);<a name="line.257"></a>
-<span class="sourceLineNo">258</span><a name="line.258"></a>
-<span class="sourceLineNo">259</span>    Server server = new Server(threadPool);<a name="line.259"></a>
-<span class="sourceLineNo">260</span><a name="line.260"></a>
-<span class="sourceLineNo">261</span>    // Setup JMX<a name="line.261"></a>
-<span class="sourceLineNo">262</span>    MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());<a name="line.262"></a>
-<span class="sourceLineNo">263</span>    server.addEventListener(mbContainer);<a name="line.263"></a>
-<span class="sourceLineNo">264</span>    server.addBean(mbContainer);<a name="line.264"></a>
+<span class="sourceLineNo">044</span>import org.apache.hadoop.hbase.rest.filter.RestCsrfPreventionFilter;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>import org.apache.hadoop.hbase.security.UserProvider;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>import org.apache.hadoop.hbase.util.DNS;<a name="line.46"></a>
+<span class="sourceLineNo">047</span>import org.apache.hadoop.hbase.util.HttpServerUtil;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>import org.apache.hadoop.hbase.util.Pair;<a name="line.48"></a>
+<span class="sourceLineNo">049</span>import org.apache.hadoop.hbase.util.Strings;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>import org.apache.hadoop.hbase.util.VersionInfo;<a name="line.50"></a>
+<span class="sourceLineNo">051</span>import org.apache.hadoop.util.StringUtils;<a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span>import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>import org.eclipse.jetty.http.HttpVersion;<a name="line.55"></a>
+<span class="sourceLineNo">056</span>import org.eclipse.jetty.server.Server;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>import org.eclipse.jetty.server.HttpConnectionFactory;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>import org.eclipse.jetty.server.SslConnectionFactory;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>import org.eclipse.jetty.server.HttpConfiguration;<a name="line.59"></a>
+<span class="sourceLineNo">060</span>import org.eclipse.jetty.server.ServerConnector;<a name="line.60"></a>
+<span class="sourceLineNo">061</span>import org.eclipse.jetty.server.SecureRequestCustomizer;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>import org.eclipse.jetty.util.ssl.SslContextFactory;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>import org.eclipse.jetty.servlet.ServletContextHandler;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>import org.eclipse.jetty.servlet.ServletHolder;<a name="line.64"></a>
+<span class="sourceLineNo">065</span>import org.eclipse.jetty.util.thread.QueuedThreadPool;<a name="line.65"></a>
+<span class="sourceLineNo">066</span>import org.eclipse.jetty.jmx.MBeanContainer;<a name="line.66"></a>
+<span class="sourceLineNo">067</span>import org.eclipse.jetty.servlet.FilterHolder;<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>import org.glassfish.jersey.jackson1.Jackson1Feature;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>import org.glassfish.jersey.server.ResourceConfig;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>import org.glassfish.jersey.servlet.ServletContainer;<a name="line.71"></a>
+<span class="sourceLineNo">072</span><a name="line.72"></a>
+<span class="sourceLineNo">073</span>import javax.servlet.DispatcherType;<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> * Main class for launching REST gateway as a servlet hosted by Jetty.<a name="line.76"></a>
+<span class="sourceLineNo">077</span> * &lt;p&gt;<a name="line.77"></a>
+<span class="sourceLineNo">078</span> * The following options are supported:<a name="line.78"></a>
+<span class="sourceLineNo">079</span> * &lt;ul&gt;<a name="line.79"></a>
+<span class="sourceLineNo">080</span> * &lt;li&gt;-p --port : service port&lt;/li&gt;<a name="line.80"></a>
+<span class="sourceLineNo">081</span> * &lt;li&gt;-ro --readonly : server mode&lt;/li&gt;<a name="line.81"></a>
+<span class="sourceLineNo">082</span> * &lt;/ul&gt;<a name="line.82"></a>
+<span class="sourceLineNo">083</span> */<a name="line.83"></a>
+<span class="sourceLineNo">084</span>@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS)<a name="line.84"></a>
+<span class="sourceLineNo">085</span>public class RESTServer implements Constants {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>  static Log LOG = LogFactory.getLog("RESTServer");<a name="line.86"></a>
+<span class="sourceLineNo">087</span><a name="line.87"></a>
+<span class="sourceLineNo">088</span>  static String REST_CSRF_ENABLED_KEY = "hbase.rest.csrf.enabled";<a name="line.88"></a>
+<span class="sourceLineNo">089</span>  static boolean REST_CSRF_ENABLED_DEFAULT = false;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>  static boolean restCSRFEnabled = false;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  static String REST_CSRF_CUSTOM_HEADER_KEY ="hbase.rest.csrf.custom.header";<a name="line.91"></a>
+<span class="sourceLineNo">092</span>  static String REST_CSRF_CUSTOM_HEADER_DEFAULT = "X-XSRF-HEADER";<a name="line.92"></a>
+<span class="sourceLineNo">093</span>  static String REST_CSRF_METHODS_TO_IGNORE_KEY = "hbase.rest.csrf.methods.to.ignore";<a name="line.93"></a>
+<span class="sourceLineNo">094</span>  static String REST_CSRF_METHODS_TO_IGNORE_DEFAULT = "GET,OPTIONS,HEAD,TRACE";<a name="line.94"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>  private static final String PATH_SPEC_ANY = "/*";<a name="line.96"></a>
+<span class="sourceLineNo">097</span><a name="line.97"></a>
+<span class="sourceLineNo">098</span>  private static void printUsageAndExit(Options options, int exitCode) {<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    HelpFormatter formatter = new HelpFormatter();<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    formatter.printHelp("hbase rest start", "", options,<a name="line.100"></a>
+<span class="sourceLineNo">101</span>      "\nTo run the REST server as a daemon, execute " +<a name="line.101"></a>
+<span class="sourceLineNo">102</span>      "hbase-daemon.sh start|stop rest [--infoport &lt;port&gt;] [-p &lt;port&gt;] [-ro]\n", true);<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    System.exit(exitCode);<a name="line.103"></a>
+<span class="sourceLineNo">104</span>  }<a name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>  /**<a name="line.106"></a>
+<span class="sourceLineNo">107</span>   * Returns a list of strings from a comma-delimited configuration value.<a name="line.107"></a>
+<span class="sourceLineNo">108</span>   *<a name="line.108"></a>
+<span class="sourceLineNo">109</span>   * @param conf configuration to check<a name="line.109"></a>
+<span class="sourceLineNo">110</span>   * @param name configuration property name<a name="line.110"></a>
+<span class="sourceLineNo">111</span>   * @param defaultValue default value if no value found for name<a name="line.111"></a>
+<span class="sourceLineNo">112</span>   * @return list of strings from comma-delimited configuration value, or an<a name="line.112"></a>
+<span class="sourceLineNo">113</span>   *     empty list if not found<a name="line.113"></a>
+<span class="sourceLineNo">114</span>   */<a name="line.114"></a>
+<span class="sourceLineNo">115</span>  private static List&lt;String&gt; getTrimmedStringList(Configuration conf,<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    String name, String defaultValue) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    String valueString = conf.get(name, defaultValue);<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    if (valueString == null) {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      return new ArrayList&lt;&gt;();<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    }<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    return new ArrayList&lt;&gt;(StringUtils.getTrimmedStringCollection(valueString));<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>  static String REST_CSRF_BROWSER_USERAGENTS_REGEX_KEY = "hbase.rest-csrf.browser-useragents-regex";<a name="line.124"></a>
+<span class="sourceLineNo">125</span>  static void addCSRFFilter(ServletContextHandler ctxHandler, Configuration conf) {<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    restCSRFEnabled = conf.getBoolean(REST_CSRF_ENABLED_KEY, REST_CSRF_ENABLED_DEFAULT);<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    if (restCSRFEnabled) {<a name="line.127"></a>
+<span class="sourceLineNo">128</span>      Map&lt;String, String&gt; restCsrfParams = RestCsrfPreventionFilter<a name="line.128"></a>
+<span class="sourceLineNo">129</span>          .getFilterParams(conf, "hbase.rest-csrf.");<a name="line.129"></a>
+<span class="sourceLineNo">130</span>      FilterHolder holder = new FilterHolder();<a name="line.130"></a>
+<span class="sourceLineNo">131</span>      holder.setName("csrf");<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      holder.setClassName(RestCsrfPreventionFilter.class.getName());<a name="line.132"></a>
+<span class="sourceLineNo">133</span>      holder.setInitParameters(restCsrfParams);<a name="line.133"></a>
+<span class="sourceLineNo">134</span>      ctxHandler.addFilter(holder, PATH_SPEC_ANY, EnumSet.allOf(DispatcherType.class));<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>  // login the server principal (if using secure Hadoop)<a name="line.138"></a>
+<span class="sourceLineNo">139</span>  private static Pair&lt;FilterHolder, Class&lt;? extends ServletContainer&gt;&gt; loginServerPrincipal(<a name="line.139"></a>
+<span class="sourceLineNo">140</span>    UserProvider userProvider, Configuration conf) throws Exception {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    Class&lt;? extends ServletContainer&gt; containerClass = ServletContainer.class;<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    if (userProvider.isHadoopSecurityEnabled() &amp;&amp; userProvider.isHBaseSecurityEnabled()) {<a name="line.142"></a>
+<span class="sourceLineNo">143</span>      String machineName = Strings.domainNamePointerToHostName(<a name="line.143"></a>
+<span class="sourceLineNo">144</span>        DNS.getDefaultHost(conf.get(REST_DNS_INTERFACE, "default"),<a name="line.144"></a>
+<span class="sourceLineNo">145</span>          conf.get(REST_DNS_NAMESERVER, "default")));<a name="line.145"></a>
+<span class="sourceLineNo">146</span>      String keytabFilename = conf.get(REST_KEYTAB_FILE);<a name="line.146"></a>
+<span class="sourceLineNo">147</span>      Preconditions.checkArgument(keytabFilename != null &amp;&amp; !keytabFilename.isEmpty(),<a name="line.147"></a>
+<span class="sourceLineNo">148</span>        REST_KEYTAB_FILE + " should be set if security is enabled");<a name="line.148"></a>
+<span class="sourceLineNo">149</span>      String principalConfig = conf.get(REST_KERBEROS_PRINCIPAL);<a name="line.149"></a>
+<span class="sourceLineNo">150</span>      Preconditions.checkArgument(principalConfig != null &amp;&amp; !principalConfig.isEmpty(),<a name="line.150"></a>
+<span class="sourceLineNo">151</span>        REST_KERBEROS_PRINCIPAL + " should be set if security is enabled");<a name="line.151"></a>
+<span class="sourceLineNo">152</span>      userProvider.login(REST_KEYTAB_FILE, REST_KERBEROS_PRINCIPAL, machineName);<a name="line.152"></a>
+<span class="sourceLineNo">153</span>      if (conf.get(REST_AUTHENTICATION_TYPE) != null) {<a name="line.153"></a>
+<span class="sourceLineNo">154</span>        containerClass = RESTServletContainer.class;<a name="line.154"></a>
+<span class="sourceLineNo">155</span>        FilterHolder authFilter = new FilterHolder();<a name="line.155"></a>
+<span class="sourceLineNo">156</span>        authFilter.setClassName(AuthFilter.class.getName());<a name="line.156"></a>
+<span class="sourceLineNo">157</span>        authFilter.setName("AuthenticationFilter");<a name="line.157"></a>
+<span class="sourceLineNo">158</span>        return new Pair&lt;&gt;(authFilter,containerClass);<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>    return new Pair&lt;&gt;(null, containerClass);<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>  private static void parseCommandLine(String[] args, RESTServlet servlet) {<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    Options options = new Options();<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    options.addOption("p", "port", true, "Port to bind to [default: " + DEFAULT_LISTEN_PORT + "]");<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    options.addOption("ro", "readonly", false, "Respond only to GET HTTP " +<a name="line.167"></a>
+<span class="sourceLineNo">168</span>      "method requests [default: false]");<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    options.addOption(null, "infoport", true, "Port for web UI");<a name="line.169"></a>
+<span class="sourceLineNo">170</span><a name="line.170"></a>
+<span class="sourceLineNo">171</span>    CommandLine commandLine = null;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    try {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>      commandLine = new PosixParser().parse(options, args);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    } catch (ParseException e) {<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      LOG.error("Could not parse: ", e);<a name="line.175"></a>
+<span class="sourceLineNo">176</span>      printUsageAndExit(options, -1);<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    }<a name="line.177"></a>
+<span class="sourceLineNo">178</span><a name="line.178"></a>
+<span class="sourceLineNo">179</span>    // check for user-defined port setting, if so override the conf<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    if (commandLine != null &amp;&amp; commandLine.hasOption("port")) {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>      String val = commandLine.getOptionValue("port");<a name="line.181"></a>
+<span class="sourceLineNo">182</span>      servlet.getConfiguration().setInt("hbase.rest.port", Integer.parseInt(val));<a name="line.182"></a>
+<span class="sourceLineNo">183</span>      if (LOG.isDebugEnabled()) {<a name="line.183"></a>
+<span class="sourceLineNo">184</span>        LOG.debug("port set to " + val);<a name="line.184"></a>
+<span class="sourceLineNo">185</span>      }<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    }<a name="line.186"></a>
+<span class="sourceLineNo">187</span><a name="line.187"></a>
+<span class="sourceLineNo">188</span>    // check if server should only process GET requests, if so override the conf<a name="line.188"></a>
+<span class="sourceLineNo">189</span>    if (commandLine != null &amp;&amp; commandLine.hasOption("readonly")) {<a name="line.189"></a>
+<span class="sourceLineNo">190</span>      servlet.getConfiguration().setBoolean("hbase.rest.readonly", true);<a name="line.190"></a>
+<span class="sourceLineNo">191</span>      if (LOG.isDebugEnabled()) {<a name="line.191"></a>
+<span class="sourceLineNo">192</span>        LOG.debug("readonly set to true");<a name="line.192"></a>
+<span class="sourceLineNo">193</span>      }<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    }<a name="line.194"></a>
+<span class="sourceLineNo">195</span><a name="line.195"></a>
+<span class="sourceLineNo">196</span>    // check for user-defined info server port setting, if so override the conf<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    if (commandLine != null &amp;&amp; commandLine.hasOption("infoport")) {<a name="line.197"></a>
+<span class="sourceLineNo">198</span>      String val = commandLine.getOptionValue("infoport");<a name="line.198"></a>
+<span class="sourceLineNo">199</span>      servlet.getConfiguration().setInt("hbase.rest.info.port", Integer.parseInt(val));<a name="line.199"></a>
+<span class="sourceLineNo">200</span>      if (LOG.isDebugEnabled()) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>        LOG.debug("Web UI port set to " + val);<a name="line.201"></a>
+<span class="sourceLineNo">202</span>      }<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    }<a name="line.203"></a>
+<span class="sourceLineNo">204</span><a name="line.204"></a>
+<span class="sourceLineNo">205</span>    @SuppressWarnings("unchecked")<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    List&lt;String&gt; remainingArgs = commandLine != null ? commandLine.getArgList() : new ArrayList&lt;&gt;();<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    if (remainingArgs.size() != 1) {<a name="line.207"></a>
+<span class="sourceLineNo">208</span>      printUsageAndExit(options, 1);<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>    String command = remainingArgs.get(0);<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    if ("start".equals(command)) {<a name="line.212"></a>
+<span class="sourceLineNo">213</span>      // continue and start container<a name="line.213"></a>
+<span class="sourceLineNo">214</span>    } else if ("stop".equals(command)) {<a name="line.214"></a>
+<span class="sourceLineNo">215</span>      System.exit(1);<a name="line.215"></a>
+<span class="sourceLineNo">216</span>    } else {<a name="line.216"></a>
+<span class="sourceLineNo">217</span>      printUsageAndExit(options, 1);<a name="line.217"></a>
+<span class="sourceLineNo">218</span>    }<a name="line.218"></a>
+<span class="sourceLineNo">219</span>  }<a name="line.219"></a>
+<span class="sourceLineNo">220</span><a name="line.220"></a>
+<span class="sourceLineNo">221</span>  /**<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   * The main method for the HBase rest server.<a name="line.222"></a>
+<span class="sourceLineNo">223</span>   * @param args command-line arguments<a name="line.223"></a>
+<span class="sourceLineNo">224</span>   * @throws Exception exception<a name="line.224"></a>
+<span class="sourceLineNo">225</span>   */<a name="line.225"></a>
+<span class="sourceLineNo">226</span>  public static void main(String[] args) throws Exception {<a name="line.226"></a>
+<span class="sourceLineNo">227</span>    LOG.info("***** STARTING service '" + RESTServer.class.getSimpleName() + "' *****");<a name="line.227"></a>
+<span class="sourceLineNo">228</span>    VersionInfo.logVersion();<a name="line.228"></a>
+<span class="sourceLineNo">229</span>    Configuration conf = HBaseConfiguration.create();<a name="line.229"></a>
+<span class="sourceLineNo">230</span>    UserProvider userProvider = UserProvider.instantiate(conf);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>    Pair&lt;FilterHolder, Class&lt;? extends ServletContainer&gt;&gt; pair = loginServerPrincipal(<a name="line.231"></a>
+<span class="sourceLineNo">232</span>      userProvider, conf);<a name="line.232"></a>
+<span class="sourceLineNo">233</span>    FilterHolder authFilter = pair.getFirst();<a name="line.233"></a>
+<span class="sourceLineNo">234</span>    RESTServlet servlet = RESTServlet.getInstance(conf, userProvider);<a name="line.234"></a>
+<span class="sourceLineNo">235</span><a name="line.235"></a>
+<span class="sourceLineNo">236</span>    parseCommandLine(args, servlet);<a name="line.236"></a>
+<span class="sourceLineNo">237</span><a name="line.237"></a>
+<span class="sourceLineNo">238</span>    // set up the Jersey servlet container for Jetty<a name="line.238"></a>
+<span class="sourceLineNo">239</span>    ResourceConfig application = new ResourceConfig().<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        packages("org.apache.hadoop.hbase.rest").register(Jackson1Feature.class);<a name="line.240"></a>
+<span class="sourceLineNo">241</span>    ServletHolder sh = new ServletHolder(new ServletContainer(application));<a name="line.241"></a>
+<span class="sourceLineNo">242</span><a name="line.242"></a>
+<span class="sourceLineNo">243</span>    // Set the default max thread number to 100 to limit<a name="line.243"></a>
+<span class="sourceLineNo">244</span>    // the number of concurrent requests so that REST server doesn't OOM easily.<a name="line.244"></a>
+<span class="sourceLineNo">245</span>    // Jetty set the default max thread number to 250, if we don't set it.<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    //<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    // Our default min thread number 2 is the same as that used by Jetty.<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    int maxThreads = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREADS_MAX, 100);<a name="line.248"></a>
+<span class="sourceLineNo">249</span>    int minThreads = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREADS_MIN, 2);<a name="line.249"></a>
+<span class="sourceLineNo">250</span>    // Use the default queue (unbounded with Jetty 9.3) if the queue size is negative, otherwise use<a name="line.250"></a>
+<span class="sourceLineNo">251</span>    // bounded {@link ArrayBlockingQueue} with the given size<a name="line.251"></a>
+<span class="sourceLineNo">252</span>    int queueSize = servlet.getConfiguration().getInt(REST_THREAD_POOL_TASK_QUEUE_SIZE, -1);<a name="line.252"></a>
+<span class="sourceLineNo">253</span>    int idleTimeout = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREAD_IDLE_TIMEOUT, 60000);<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    QueuedThreadPool threadPool = queueSize &gt; 0 ?<a name="line.254"></a>
+<span class="sourceLineNo">255</span>        new QueuedThreadPool(maxThreads, minThreads, idleTimeout, new ArrayBlockingQueue&lt;&gt;(queueSize)) :<a name="line.255"></a>
+<span class="sourceLineNo">256</span>        new QueuedThreadPool(maxThreads, minThreads, idleTimeout);<a name="line.256"></a>
+<span class="sourceLineNo">257</span><a name="line.257"></a>
+<span class="sourceLineNo">258</span>    Server server = new Server(threadPool);<a name="line.258"></a>
+<span class="sourceLineNo">259</span><a name="line.259"></a>
+<span class="sourceLineNo">260</span>    // Setup JMX<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    server.addEventListener(mbContainer);<a name="line.262"></a>
+<span class="sourceLineNo">263</span>    server.addBean(mbContainer);<a name="line.263"></a>
+<span class="sourceLineNo">264</span><a name="line.264"></a>
 <span class="sourceLineNo">265</span><a name="line.265"></a>
-<span class="sourceLineNo">266</span><a name="line.266"></a>
-<span class="sourceLineNo">267</span>    String host = servlet.getConfiguration().get("hbase.rest.host", "0.0.0.0");<a name="line.267"></a>
-<span class="sourceLineNo">268</span>    int servicePort = servlet.getConfiguration().getInt("hbase.rest.port", 8080);<a name="line.268"></a>
-<span class="sourceLineNo">269</span>    HttpConfiguration httpConfig = new HttpConfiguration();<a name="line.269"></a>
-<span class="sourceLineNo">270</span>    httpConfig.setSecureScheme("https");<a name="line.270"></a>
-<span class="sourceLineNo">271</span>    httpConfig.setSecurePort(servicePort);<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    httpConfig.setSendServerVersion(false);<a name="line.272"></a>
-<span class="sourceLineNo">273</span>    httpConfig.setSendDateHeader(false);<a name="line.273"></a>
-<span class="sourceLineNo">274</span><a name="line.274"></a>
-<span class="sourceLineNo">275</span>    ServerConnector serverConnector;<a name="line.275"></a>
-<span class="sourceLineNo">276</span>    if (conf.getBoolean(REST_SSL_ENABLED, false)) {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>      HttpConfiguration httpsConfig = new HttpConfiguration(httpConfig);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>      httpsConfig.addCustomizer(new SecureRequestCustomizer());<a name="line.278"></a>
-<span class="sourceLineNo">279</span><a name="line.279"></a>
-<span class="sourceLineNo">280</span>      SslContextFactory sslCtxFactory = new SslContextFactory();<a name="line.280"></a>
-<span class="sourceLineNo">281</span>      String keystore = conf.get(REST_SSL_KEYSTORE_STORE);<a name="line.281"></a>
-<span class="sourceLineNo">282</span>      String password = HBaseConfiguration.getPassword(conf,<a name="line.282"></a>
-<span class="sourceLineNo">283</span>          REST_SSL_KEYSTORE_PASSWORD, null);<a name="line.283"></a>
-<span class="sourceLineNo">284</span>      String keyPassword = HBaseConfiguration.getPassword(conf,<a name="line.284"></a>
-<span class="sourceLineNo">285</span>          REST_SSL_KEYSTORE_KEYPASSWORD, password);<a name="line.285"></a>
-<span class="sourceLineNo">286</span>      sslCtxFactory.setKeyStorePath(keystore);<a name="line.286"></a>
-<span class="sourceLineNo">287</span>      sslCtxFactory.setKeyStorePassword(password);<a name="line.287"></a>
-<span class="sourceLineNo">288</span>      sslCtxFactory.setKeyManagerPassword(keyPassword);<a name="line.288"></a>
-<span class="sourceLineNo">289</span><a name="line.289"></a>
-<span class="sourceLineNo">290</span>      String[] excludeCiphers = servlet.getConfiguration().getStrings(<a name="line.290"></a>
-<span class="sourceLineNo">291</span>          REST_SSL_EXCLUDE_CIPHER_SUITES, ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      if (excludeCiphers.length != 0) {<a name="line.292"></a>
-<span class="sourceLineNo">293</span>        sslCtxFactory.setExcludeCipherSuites(excludeCiphers);<a name="line.293"></a>
-<span class="sourceLineNo">294</span>      }<a name="line.294"></a>
-<span class="sourceLineNo">295</span>      String[] includeCiphers = servlet.getConfiguration().getStrings(<a name="line.295"></a>
-<span class="sourceLineNo">296</span>          REST_SSL_INCLUDE_CIPHER_SUITES, ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.296"></a>
-<span class="sourceLineNo">297</span>      if (includeCiphers.length != 0) {<a name="line.297"></a>
-<span class="sourceLineNo">298</span>        sslCtxFactory.setIncludeCipherSuites(includeCiphers);<a name="line.298"></a>
-<span class="sourceLineNo">299</span>      }<a name="line.299"></a>
-<span class="sourceLineNo">300</span><a name="line.300"></a>
-<span class="sourceLineNo">301</span>      String[] excludeProtocols = servlet.getConfiguration().getStrings(<a name="line.301"></a>
-<span class="sourceLineNo">302</span>          REST_SSL_EXCLUDE_PROTOCOLS, ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.302"></a>
-<span class="sourceLineNo">303</span>      if (excludeProtocols.length != 0) {<a name="line.303"></a>
-<span class="sourceLineNo">304</span>        sslCtxFactory.setExcludeProtocols(excludeProtocols);<a name="line.304"></a>
-<span class="sourceLineNo">305</span>      }<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      String[] includeProtocols = servlet.getConfiguration().getStrings(<a name="line.306"></a>
-<span class="sourceLineNo">307</span>          REST_SSL_INCLUDE_PROTOCOLS, ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      if (includeProtocols.length != 0) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>        sslCtxFactory.setIncludeProtocols(includeProtocols);<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>      serverConnector = new ServerConnector(server,<a name="line.312"></a>
-<span class="sourceLineNo">313</span>          new SslConnectionFactory(sslCtxFactory, HttpVersion.HTTP_1_1.toString()),<a name="line.313"></a>
-<span class="sourceLineNo">314</span>          new HttpConnectionFactory(httpsConfig));<a name="line.314"></a>
-<span class="sourceLineNo">315</span>    } else {<a name="line.315"></a>
-<span class="sourceLineNo">316</span>      serverConnector = new ServerConnector(server, new HttpConnectionFactory(httpConfig));<a name="line.316"></a>
-<span class="sourceLineNo">317</span>    }<a name="line.317"></a>
-<span class="sourceLineNo">318</span><a name="line.318"></a>
-<span class="sourceLineNo">319</span>    int acceptQueueSize = servlet.getConfiguration().getInt(REST_CONNECTOR_ACCEPT_QUEUE_SIZE, -1);<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    if (acceptQueueSize &gt;= 0) {<a name="line.320"></a>
-<span class="sourceLineNo">321</span>      serverConnector.setAcceptQueueSize(acceptQueueSize);<a name="line.321"></a>
-<span class="sourceLineNo">322</span>    }<a name="line.322"></a>
-<span class="sourceLineNo">323</span><a name="line.323"></a>
-<span class="sourceLineNo">324</span>    serverConnector.setPort(servicePort);<a name="line.324"></a>
-<span class="sourceLineNo">325</span>    serverConnector.setHost(host);<a name="line.325"></a>
-<span class="sourceLineNo">326</span><a name="line.326"></a>
-<span class="sourceLineNo">327</span>    server.addConnector(serverConnector);<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    server.setStopAtShutdown(true);<a name="line.328"></a>
-<span class="sourceLineNo">329</span><a name="line.329"></a>
-<span class="sourceLineNo">330</span>    // set up context<a name="line.330"></a>
-<span class="sourceLineNo">331</span>    ServletContextHandler ctxHandler = new ServletContextHandler(server, "/", ServletContextHandler.SESSIONS);<a name="line.331"></a>
-<span class="sourceLineNo">332</span>    ctxHandler.addServlet(sh, PATH_SPEC_ANY);<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    if (authFilter != null) {<a name="line.333"></a>
-<span class="sourceLineNo">334</span>      ctxHandler.addFilter(authFilter, PATH_SPEC_ANY, EnumSet.of(DispatcherType.REQUEST));<a name="line.334"></a>
-<span class="sourceLineNo">335</span>    }<a name="line.335"></a>
-<span class="sourceLineNo">336</span><a name="line.336"></a>
-<span class="sourceLineNo">337</span>    // Load filters from configuration.<a name="line.337"></a>
-<span class="sourceLineNo">338</span>    String[] filterClasses = servlet.getConfiguration().getStrings(FILTER_CLASSES,<a name="line.338"></a>
-<span class="sourceLineNo">339</span>        GzipFilter.class.getName());<a name="line.339"></a>
-<span class="sourceLineNo">340</span>    for (String filter : filterClasses) {<a name="line.340"></a>
-<span class="sourceLineNo">341</span>      filter = filter.trim();<a name="line.341"></a>
-<span class="sourceLineNo">342</span>      ctxHandler.addFilter(filter, PATH_SPEC_ANY, EnumSet.of(DispatcherType.REQUEST));<a name="line.342"></a>
-<span class="sourceLineNo">343</span>    }<a name="line.343"></a>
-<span class="sourceLineNo">344</span>    addCSRFFilter(ctxHandler, conf);<a name="line.344"></a>
-<span class="sourceLineNo">345</span>    HttpServerUtil.constrainHttpMethods(ctxHandler);<a name="line.345"></a>
-<span class="sourceLineNo">346</span><a name="line.346"></a>
-<span class="sourceLineNo">347</span>    // Put up info server.<a name="line.347"></a>
-<span class="sourceLineNo">348</span>    int port = conf.getInt("hbase.rest.info.port", 8085);<a name="line.348"></a>
-<span class="sourceLineNo">349</span>    if (port &gt;= 0) {<a name="line.349"></a>
-<span class="sourceLineNo">350</span>      conf.setLong("startcode", System.currentTimeMillis());<a name="line.350"></a>
-<span class="sourceLineNo">351</span>      String a = conf.get("hbase.rest.info.bindAddress", "0.0.0.0");<a name="line.351"></a>
-<span class="sourceLineNo">352</span>      InfoServer infoServer = new InfoServer("rest", a, port, false, conf);<a name="line.352"></a>
-<span class="sourceLineNo">353</span>      infoServer.setAttribute("hbase.conf", conf);<a name="line.353"></a>
-<span class="sourceLineNo">354</span>      infoServer.start();<a name="line.354"></a>
-<span class="sourceLineNo">355</span>    }<a name="line.355"></a>
-<span class="sourceLineNo">356</span>    // start server<a name="line.356"></a>
-<span class="sourceLineNo">357</span>    server.start();<a name="line.357"></a>
-<span class="sourceLineNo">358</span>    server.join();<a name="line.358"></a>
-<span class="sourceLineNo">359</span>    LOG.info("***** STOPPING service '" + RESTServer.class.getSimpleName() + "' *****");<a name="line.359"></a>
-<span class="sourceLineNo">360</span>  }<a name="line.360"></a>
-<span class="sourceLineNo">361</span>}<a name="line.361"></a>
+<span class="sourceLineNo">266</span>    String host = servlet.getConfiguration().get("hbase.rest.host", "0.0.0.0");<a name="line.266"></a>
+<span class="sourceLineNo">267</span>    int servicePort = servlet.getConfiguration().getInt("hbase.rest.port", 8080);<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    HttpConfiguration httpConfig = new HttpConfiguration();<a name="line.268"></a>
+<span class="sourceLineNo">269</span>    httpConfig.setSecureScheme("https");<a name="line.269"></a>
+<span class="sourceLineNo">270</span>    httpConfig.setSecurePort(servicePort);<a name="line.270"></a>
+<span class="sourceLineNo">271</span>    httpConfig.setSendServerVersion(false);<a name="line.271"></a>
+<span class="sourceLineNo">272</span>    httpConfig.setSendDateHeader(false);<a name="line.272"></a>
+<span class="sourceLineNo">273</span><a name="line.273"></a>
+<span class="sourceLineNo">274</span>    ServerConnector serverConnector;<a name="line.274"></a>
+<span class="sourceLineNo">275</span>    if (conf.getBoolean(REST_SSL_ENABLED, false)) {<a name="line.275"></a>
+<span class="sourceLineNo">276</span>      HttpConfiguration httpsConfig = new HttpConfiguration(httpConfig);<a name="line.276"></a>
+<span class="sourceLineNo">277</span>      httpsConfig.addCustomizer(new SecureRequestCustomizer());<a name="line.277"></a>
+<span class="sourceLineNo">278</span><a name="line.278"></a>
+<span class="sourceLineNo">279</span>      SslContextFactory sslCtxFactory = new SslContextFactory();<a name="line.279"></a>
+<span class="sourceLineNo">280</span>      String keystore = conf.get(REST_SSL_KEYSTORE_STORE);<a name="line.280"></a>
+<span class="sourceLineNo">281</span>      String password = HBaseConfiguration.getPassword(conf,<a name="line.281"></a>
+<span class="sourceLineNo">282</span>          REST_SSL_KEYSTORE_PASSWORD, null);<a name="line.282"></a>
+<span class="sourceLineNo">283</span>      String keyPassword = HBaseConfiguration.getPassword(conf,<a name="line.283"></a>
+<span class="sourceLineNo">284</span>          REST_SSL_KEYSTORE_KEYPASSWORD, password);<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      sslCtxFactory.setKeyStorePath(keystore);<a name="line.285"></a>
+<span class="sourceLineNo">286</span>      sslCtxFactory.setKeyStorePassword(password);<a name="line.286"></a>
+<span class="sourceLineNo">287</span>      sslCtxFactory.setKeyManagerPassword(keyPassword);<a name="line.287"></a>
+<span class="sourceLineNo">288</span><a name="line.288"></a>
+<span class="sourceLineNo">289</span>      String[] excludeCiphers = servlet.getConfiguration().getStrings(<a name="line.289"></a>
+<span class="sourceLineNo">290</span>          REST_SSL_EXCLUDE_CIPHER_SUITES, ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.290"></a>
+<span class="sourceLineNo">291</span>      if (excludeCiphers.length != 0) {<a name="line.291"></a>
+<span class="sourceLineNo">292</span>        sslCtxFactory.setExcludeCipherSuites(excludeCiphers);<a name="line.292"></a>
+<span class="sourceLineNo">293</span>      }<a name="line.293"></a>
+<span class="sourceLineNo">294</span>      String[] includeCiphers = servlet.getConfiguration().getStrings(<a name="line.294"></a>
+<span class="sourceLineNo">295</span>          REST_SSL_INCLUDE_CIPHER_SUITES, ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.295"></a>
+<span class="sourceLineNo">296</span>      if (includeCiphers.length != 0) {<a name="line.296"></a>
+<span class="sourceLineNo">297</span>        sslCtxFactory.setIncludeCipherSuites(includeCiphers);<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>      String[] excludeProtocols = servlet.getConfiguration().getStrings(<a name="line.300"></a>
+<span class="sourceLineNo">301</span>          REST_SSL_EXCLUDE_PROTOCOLS, ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.301"></a>
+<span class="sourceLineNo">302</span>      if (excludeProtocols.length != 0) {<a name="line.302"></a>
+<span class="sourceLineNo">303</span>        sslCtxFactory.setExcludeProtocols(excludeProtocols);<a name="line.303"></a>
+<span class="sourceLineNo">304</span>      }<a name="line.304"></a>
+<span class="sourceLineNo">305</span>      String[] includeProtocols = servlet.getConfiguration().getStrings(<a name="line.305"></a>
+<span class="sourceLineNo">306</span>          REST_SSL_INCLUDE_PROTOCOLS, ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.306"></a>
+<span class="sourceLineNo">307</span>      if (includeProtocols.length != 0) {<a name="line.307"></a>
+<span class="sourceLineNo">308</span>        sslCtxFactory.setIncludeProtocols(includeProtocols);<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>      serverConnector = new ServerConnector(server,<a name="line.311"></a>
+<span class="sourceLineNo">312</span>          new SslConnectionFactory(sslCtxFactory, HttpVersion.HTTP_1_1.toString()),<a name="line.312"></a>
+<span class="sourceLineNo">313</span>          new HttpConnectionFactory(httpsConfig));<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    } else {<a name="line.314"></a>
+<span class="sourceLineNo">315</span>      serverConnector = new ServerConnector(server, new HttpConnectionFactory(httpConfig));<a name="line.315"></a>
+<span class="sourceLineNo">316</span>    }<a name="line.316"></a>
+<span class="sourceLineNo">317</span><a name="line.317"></a>
+<span class="sourceLineNo">318</span>    int acceptQueueSize = servlet.getConfiguration().getInt(REST_CONNECTOR_ACCEPT_QUEUE_SIZE, -1);<a name="line.318"></a>
+<span class="sourceLineNo">319</span>    if (acceptQueueSize &gt;= 0) {<a name="line.319"></a>
+<span class="sourceLineNo">320</span>      serverConnector.setAcceptQueueSize(acceptQueueSize);<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    }<a name="line.321"></a>
+<span class="sourceLineNo">322</span><a name="line.322"></a>
+<span class="sourceLineNo">323</span>    serverConnector.setPort(servicePort);<a name="line.323"></a>
+<span class="sourceLineNo">324</span>    serverConnector.setHost(host);<a name="line.324"></a>
+<span class="sourceLineNo">325</span><a name="line.325"></a>
+<span class="sourceLineNo">326</span>    server.addConnector(serverConnector);<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    server.setStopAtShutdown(true);<a name="line.327"></a>
+<span class="sourceLineNo">328</span><a name="line.328"></a>
+<span class="sourceLineNo">329</span>    // set up context<a name="line.329"></a>
+<span class="sourceLineNo">330</span>    ServletContextHandler ctxHandler = new ServletContextHandler(server, "/", ServletContextHandler.SESSIONS);<a name="line.330"></a>
+<span class="sourceLineNo">331</span>    ctxHandler.addServlet(sh, PATH_SPEC_ANY);<a name="line.331"></a>
+<span class="sourceLineNo">332</span>    if (authFilter != null) {<a name="line.332"></a>
+<span class="sourceLineNo">333</span>      ctxHandler.addFilter(authFilter, PATH_SPEC_ANY, EnumSet.of(DispatcherType.REQUEST));<a name="line.333"></a>
+<span class="sourceLineNo">334</span>    }<a name="line.334"></a>
+<span class="sourceLineNo">335</span><a name="line.335"></a>
+<span class="sourceLineNo">336</span>    // Load filters from configuration.<a name="line.336"></a>
+<span class="sourceLineNo">337</span>    String[] filterClasses = servlet.getConfiguration().getStrings(FILTER_CLASSES,<a name="line.337"></a>
+<span class="sourceLineNo">338</span>      ArrayUtils.EMPTY_STRING_ARRAY);<a name="line.338"></a>
+<span class="sourceLineNo">339</span>    for (String filter : filterClasses) {<a name="line.339"></a>
+<span class="sourceLineNo">340</span>      filter = filter.trim();<a name="line.340"></a>
+<span class="sourceLineNo">341</span>      ctxHandler.addFilter(filter, PATH_SPEC_ANY, EnumSet.of(DispatcherType.REQUEST));<a name="line.341"></a>
+<span class="sourceLineNo">342</span>    }<a name="line.342"></a>
+<span class="sourceLineNo">343</span>    addCSRFFilter(ctxHandler, conf);<a name="line.343"></a>
+<span class="sourceLineNo">344</span>    HttpServerUtil.constrainHttpMethods(ctxHandler);<a name="line.344"></a>
+<span class="sourceLineNo">345</span><a name="line.345"></a>
+<span class="sourceLineNo">346</span>    // Put up info server.<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    int port = conf.getInt("hbase.rest.info.port", 8085);<a name="line.347"></a>
+<span class="sourceLineNo">348</span>    if (port &gt;= 0) {<a name="line.348"></a>
+<span class="sourceLineNo">349</span>      conf.setLong("startcode", System.currentTimeMillis());<a name="line.349"></a>
+<span class="sourceLineNo">350</span>      String a = conf.get("hbase.rest.info.bindAddress", "0.0.0.0");<a name="line.350"></a>
+<span class="sourceLineNo">351</span>      InfoServer infoServer = new InfoServer("rest", a, port, false, conf);<a name="line.351"></a>
+<span class="sourceLineNo">352</span>      infoServer.setAttribute("hbase.conf", conf);<a name="line.352"></a>
+<span class="sourceLineNo">353</span>      infoServer.start();<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    }<a name="line.354"></a>
+<span class="sourceLineNo">355</span>    // start server<a name="line.355"></a>
+<span class="sourceLineNo">356</span>    server.start();<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    server.join();<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    LOG.info("***** STOPPING service '" + RESTServer.class.getSimpleName() + "' *****");<a name="line.358"></a>
+<span class="sourceLineNo">359</span>  }<a name="line.359"></a>
+<span class="sourceLineNo">360</span>}<a name="line.360"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/devapidocs/src-html/org/apache/hadoop/hbase/util/FSHDFSUtils.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/util/FSHDFSUtils.html b/devapidocs/src-html/org/apache/hadoop/hbase/util/FSHDFSUtils.html
index f8a1095..58ee58e 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/util/FSHDFSUtils.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/util/FSHDFSUtils.html
@@ -209,11 +209,11 @@
 <span class="sourceLineNo">201</span>    // This setting should be a little bit above what the cluster dfs heartbeat is set to.<a name="line.201"></a>
 <span class="sourceLineNo">202</span>    long firstPause = conf.getInt("hbase.lease.recovery.first.pause", 4000);<a name="line.202"></a>
 <span class="sourceLineNo">203</span>    // This should be set to how long it'll take for us to timeout against primary datanode if it<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    // is dead.  We set it to 64 seconds, 4 second than the default READ_TIMEOUT in HDFS, the<a name="line.204"></a>
+<span class="sourceLineNo">204</span>    // is dead.  We set it to 61 seconds, 1 second than the default READ_TIMEOUT in HDFS, the<a name="line.204"></a>
 <span class="sourceLineNo">205</span>    // default value for DFS_CLIENT_SOCKET_TIMEOUT_KEY. If recovery is still failing after this<a name="line.205"></a>
 <span class="sourceLineNo">206</span>    // timeout, then further recovery will take liner backoff with this base, to avoid endless<a name="line.206"></a>
 <span class="sourceLineNo">207</span>    // preemptions when this value is not properly configured.<a name="line.207"></a>
-<span class="sourceLineNo">208</span>    long subsequentPauseBase = conf.getLong("hbase.lease.recovery.dfs.timeout", 64 * 1000);<a name="line.208"></a>
+<span class="sourceLineNo">208</span>    long subsequentPauseBase = conf.getLong("hbase.lease.recovery.dfs.timeout", 61 * 1000);<a name="line.208"></a>
 <span class="sourceLineNo">209</span><a name="line.209"></a>
 <span class="sourceLineNo">210</span>    Method isFileClosedMeth = null;<a name="line.210"></a>
 <span class="sourceLineNo">211</span>    // whether we need to look for isFileClosed method<a name="line.211"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/export_control.html
----------------------------------------------------------------------
diff --git a/export_control.html b/export_control.html
index 4a9e8a4..55cdd6d 100644
--- a/export_control.html
+++ b/export_control.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013; 
       Export Control
@@ -336,7 +336,7 @@ for more details.</p>
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/dependencies.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/dependencies.html b/hbase-build-configuration/dependencies.html
index df755ea..250fb92 100644
--- a/hbase-build-configuration/dependencies.html
+++ b/hbase-build-configuration/dependencies.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Build Configuration &#x2013; Project Dependencies</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -272,7 +272,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/dependency-convergence.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/dependency-convergence.html b/hbase-build-configuration/dependency-convergence.html
index 4067e99..593e790 100644
--- a/hbase-build-configuration/dependency-convergence.html
+++ b/hbase-build-configuration/dependency-convergence.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Build Configuration &#x2013; Reactor Dependency Convergence</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -669,7 +669,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/dependency-info.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/dependency-info.html b/hbase-build-configuration/dependency-info.html
index dfd4118..1905151 100644
--- a/hbase-build-configuration/dependency-info.html
+++ b/hbase-build-configuration/dependency-info.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Build Configuration &#x2013; Dependency Information</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -148,7 +148,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/dependency-management.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/dependency-management.html b/hbase-build-configuration/dependency-management.html
index e1ee4d6..42f88a0 100644
--- a/hbase-build-configuration/dependency-management.html
+++ b/hbase-build-configuration/dependency-management.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Build Configuration &#x2013; Project Dependency Management</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -766,7 +766,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/checkstyle.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/checkstyle.html b/hbase-build-configuration/hbase-annotations/checkstyle.html
index 23a6a0f..531407d 100644
--- a/hbase-build-configuration/hbase-annotations/checkstyle.html
+++ b/hbase-build-configuration/hbase-annotations/checkstyle.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; Checkstyle Results</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -273,7 +273,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/dependencies.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/dependencies.html b/hbase-build-configuration/hbase-annotations/dependencies.html
index ecdb5ee..59a6d44 100644
--- a/hbase-build-configuration/hbase-annotations/dependencies.html
+++ b/hbase-build-configuration/hbase-annotations/dependencies.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; Project Dependencies</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -295,7 +295,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/dependency-convergence.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/dependency-convergence.html b/hbase-build-configuration/hbase-annotations/dependency-convergence.html
index 5009dc8..2dd2bc7 100644
--- a/hbase-build-configuration/hbase-annotations/dependency-convergence.html
+++ b/hbase-build-configuration/hbase-annotations/dependency-convergence.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; Reactor Dependency Convergence</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -669,7 +669,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/dependency-info.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/dependency-info.html b/hbase-build-configuration/hbase-annotations/dependency-info.html
index d1ef406..25aba9c 100644
--- a/hbase-build-configuration/hbase-annotations/dependency-info.html
+++ b/hbase-build-configuration/hbase-annotations/dependency-info.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; Dependency Information</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -147,7 +147,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/dependency-management.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/dependency-management.html b/hbase-build-configuration/hbase-annotations/dependency-management.html
index b4e684a..fc0b974 100644
--- a/hbase-build-configuration/hbase-annotations/dependency-management.html
+++ b/hbase-build-configuration/hbase-annotations/dependency-management.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; Project Dependency Management</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -766,7 +766,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/index.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/index.html b/hbase-build-configuration/hbase-annotations/index.html
index a8b3871..c2b5b17 100644
--- a/hbase-build-configuration/hbase-annotations/index.html
+++ b/hbase-build-configuration/hbase-annotations/index.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; About</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -119,7 +119,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/integration.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/integration.html b/hbase-build-configuration/hbase-annotations/integration.html
index 7e03c7b..ce69d9f 100644
--- a/hbase-build-configuration/hbase-annotations/integration.html
+++ b/hbase-build-configuration/hbase-annotations/integration.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; CI Management</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -126,7 +126,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/issue-tracking.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/issue-tracking.html b/hbase-build-configuration/hbase-annotations/issue-tracking.html
index 7c5af06..b314b51 100644
--- a/hbase-build-configuration/hbase-annotations/issue-tracking.html
+++ b/hbase-build-configuration/hbase-annotations/issue-tracking.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; Issue Management</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -123,7 +123,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e7a83f43/hbase-build-configuration/hbase-annotations/license.html
----------------------------------------------------------------------
diff --git a/hbase-build-configuration/hbase-annotations/license.html b/hbase-build-configuration/hbase-annotations/license.html
index 9d5defd..0993209 100644
--- a/hbase-build-configuration/hbase-annotations/license.html
+++ b/hbase-build-configuration/hbase-annotations/license.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20170909" />
+    <meta name="Date-Revision-yyyymmdd" content="20170910" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase - Annotations &#x2013; Project Licenses</title>
     <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
@@ -326,7 +326,7 @@
                         <a href="https://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2017-09-09</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-10</li>
             </p>
                 </div>
 


Mime
View raw message