Search in sources :

Example 11 with SchedulerService

use of voldemort.common.service.SchedulerService in project voldemort by voldemort.

the class VoldemortServer method createBasicServices.

private List<VoldemortService> createBasicServices() {
    /* Services are given in the order they must be started */
    List<VoldemortService> services = new ArrayList<VoldemortService>();
    SchedulerService scheduler = new SchedulerService(voldemortConfig.getSchedulerThreads(), SystemTime.INSTANCE, voldemortConfig.canInterruptService());
    storageService = new StorageService(storeRepository, metadata, scheduler, voldemortConfig);
    asyncService = new AsyncOperationService(scheduler, ASYNC_REQUEST_CACHE_SIZE);
    jmxService = null;
    services.add(storageService);
    services.add(scheduler);
    services.add(asyncService);
    if (voldemortConfig.isAdminServerEnabled()) {
        Rebalancer rebalancer = null;
        if (voldemortConfig.isEnableRebalanceService()) {
            RebalancerService rebalancerService = new RebalancerService(storeRepository, metadata, voldemortConfig, asyncService, scheduler);
            services.add(rebalancerService);
            rebalancer = rebalancerService.getRebalancer();
        }
        SocketRequestHandlerFactory adminRequestHandlerFactory = new SocketRequestHandlerFactory(storageService, this.storeRepository, this.metadata, this.voldemortConfig, this.asyncService, scheduler, rebalancer, this);
        if (voldemortConfig.getUseNioConnector()) {
            logger.info("Using NIO Connector for Admin Service.");
            services.add(new NioSocketService(adminRequestHandlerFactory, identityNode.getAdminPort(), voldemortConfig.getAdminSocketBufferSize(), voldemortConfig.isNioAdminConnectorKeepAlive(), voldemortConfig.getNioAdminConnectorSelectors(), "admin-server", voldemortConfig.isJmxEnabled(), voldemortConfig.getNioAcceptorBacklog(), voldemortConfig.getNioSelectorMaxHeartBeatTimeMs()));
        } else {
            logger.info("Using BIO Connector for Admin Service.");
            services.add(new SocketService(adminRequestHandlerFactory, identityNode.getAdminPort(), voldemortConfig.getAdminCoreThreads(), voldemortConfig.getAdminMaxThreads(), voldemortConfig.getAdminSocketBufferSize(), "admin-server", voldemortConfig.isJmxEnabled()));
        }
    }
    if (voldemortConfig.isGossipEnabled()) {
        services.add(new GossipService(this.metadata, scheduler, voldemortConfig));
    }
    if (voldemortConfig.isJmxEnabled()) {
        jmxService = new JmxService(this, this.metadata.getCluster(), storeRepository, services);
        services.add(jmxService);
    }
    return ImmutableList.copyOf(services);
}
Also used : SchedulerService(voldemort.common.service.SchedulerService) Rebalancer(voldemort.server.rebalance.Rebalancer) JmxService(voldemort.server.jmx.JmxService) ArrayList(java.util.ArrayList) NioSocketService(voldemort.server.niosocket.NioSocketService) NioSocketService(voldemort.server.niosocket.NioSocketService) SocketService(voldemort.server.socket.SocketService) AsyncOperationService(voldemort.server.protocol.admin.AsyncOperationService) RebalancerService(voldemort.server.rebalance.RebalancerService) StorageService(voldemort.server.storage.StorageService) GossipService(voldemort.server.gossip.GossipService) VoldemortService(voldemort.common.service.VoldemortService) SocketRequestHandlerFactory(voldemort.server.protocol.SocketRequestHandlerFactory)

Aggregations

SchedulerService (voldemort.common.service.SchedulerService)11 Date (java.util.Date)4 Before (org.junit.Before)4 MockTime (voldemort.MockTime)4 File (java.io.File)3 Properties (java.util.Properties)3 ClientConfig (voldemort.client.ClientConfig)3 SystemStoreRepository (voldemort.client.SystemStoreRepository)3 VoldemortServer (voldemort.server.VoldemortServer)3 ArrayList (java.util.ArrayList)2 Callable (java.util.concurrent.Callable)2 Test (org.junit.Test)2 SystemStoreClientFactory (voldemort.client.SystemStoreClientFactory)2 AsyncMetadataVersionManager (voldemort.client.scheduler.AsyncMetadataVersionManager)2 StoreRepository (voldemort.server.StoreRepository)2 VoldemortConfig (voldemort.server.VoldemortConfig)2 DataCleanupJob (voldemort.server.scheduler.DataCleanupJob)2 ScanPermitWrapper (voldemort.server.storage.ScanPermitWrapper)2 ClientRequestExecutorPool (voldemort.store.socket.clientrequest.ClientRequestExecutorPool)2 StoreDefinitionsMapper (voldemort.xml.StoreDefinitionsMapper)2