Search in sources :

Example 1 with RestService

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);
        }
    }
}
Also used : HttpService(voldemort.server.http.HttpService) ClientRequestHandlerFactory(voldemort.server.protocol.ClientRequestHandlerFactory) SocketRequestHandlerFactory(voldemort.server.protocol.SocketRequestHandlerFactory) ClientRequestHandlerFactory(voldemort.server.protocol.ClientRequestHandlerFactory) RequestHandlerFactory(voldemort.server.protocol.RequestHandlerFactory) NioSocketService(voldemort.server.niosocket.NioSocketService) NioSocketService(voldemort.server.niosocket.NioSocketService) SocketService(voldemort.server.socket.SocketService) RestService(voldemort.rest.server.RestService)

Aggregations

RestService (voldemort.rest.server.RestService)1 HttpService (voldemort.server.http.HttpService)1 NioSocketService (voldemort.server.niosocket.NioSocketService)1 ClientRequestHandlerFactory (voldemort.server.protocol.ClientRequestHandlerFactory)1 RequestHandlerFactory (voldemort.server.protocol.RequestHandlerFactory)1 SocketRequestHandlerFactory (voldemort.server.protocol.SocketRequestHandlerFactory)1 SocketService (voldemort.server.socket.SocketService)1