// set up Jetty and run the embedded server
Server server = new Server();
Connector connector = new SelectChannelConnector();
if(conf.getBoolean(REST_SSL_ENABLED, false)) {
SslSelectChannelConnector sslConnector = new SslSelectChannelConnector();
String keystore = conf.get(REST_SSL_KEYSTORE_STORE);
String password = conf.get(REST_SSL_KEYSTORE_PASSWORD);
String keyPassword = conf.get(REST_SSL_KEYSTORE_KEYPASSWORD, password);
sslConnector.setKeystore(keystore);
sslConnector.setPassword(password);
sslConnector.setKeyPassword(keyPassword);
connector = sslConnector;
}
connector.setPort(servlet.getConfiguration().getInt("hbase.rest.port", 8080));
connector.setHost(servlet.getConfiguration().get("hbase.rest.host", "0.0.0.0"));
server.addConnector(connector);
// Set the default max thread number to 100 to limit
// the number of concurrent requests so that REST server doesn't OOM easily.