use of voldemort.rest.server.RestService in project voldemort by voldemort.
the class VoldemortServer method createOnlineServices.
public void createOnlineServices() {
onlineServices = Lists.newArrayList();
if (voldemortConfig.isHttpServerEnabled()) {
/*
* TODO: Get rid of HTTP Service.
*/
HttpService httpService = new HttpService(this, storageService, storeRepository, RequestFormatType.VOLDEMORT_V1, voldemortConfig.getMaxThreads(), identityNode.getHttpPort());
onlineServices.add(httpService);
}
if (voldemortConfig.isRestServiceEnabled()) {
RestService restService = new RestService(voldemortConfig, identityNode.getRestPort(), storeRepository, identityNode.getZoneId(), metadata.getStoreDefList());
onlineServices.add(restService);
}
if (voldemortConfig.isSocketServerEnabled()) {
RequestHandlerFactory clientRequestHandlerFactory = new ClientRequestHandlerFactory(this.storeRepository);
if (voldemortConfig.getUseNioConnector()) {
logger.info("Using NIO Connector.");
NioSocketService nioSocketService = new NioSocketService(clientRequestHandlerFactory, identityNode.getSocketPort(), voldemortConfig.getSocketBufferSize(), voldemortConfig.isNioConnectorKeepAlive(), voldemortConfig.getNioConnectorSelectors(), "nio-socket-server", voldemortConfig.isJmxEnabled(), voldemortConfig.getNioAcceptorBacklog(), voldemortConfig.getNioSelectorMaxHeartBeatTimeMs());
onlineServices.add(nioSocketService);
} else {
logger.info("Using BIO Connector.");
SocketService socketService = new SocketService(clientRequestHandlerFactory, identityNode.getSocketPort(), voldemortConfig.getCoreThreads(), voldemortConfig.getMaxThreads(), voldemortConfig.getSocketBufferSize(), "socket-server", voldemortConfig.isJmxEnabled());
onlineServices.add(socketService);
}
}
}
Aggregations