Search in sources :

Example 6 with VoldemortService

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

the class VoldemortServer method stopInner.

/**
     * Attempt to shutdown the server. As much shutdown as possible will be
     * completed, even if intermediate errors are encountered.
     *
     * @throws VoldemortException
     */
@Override
protected void stopInner() throws VoldemortException {
    List<VoldemortException> exceptions = new ArrayList<VoldemortException>();
    logger.info("Stopping services:" + getIdentityNode().getId());
    /* Stop in reverse order */
    exceptions.addAll(stopOnlineServices());
    for (VoldemortService service : Utils.reversed(basicServices)) {
        try {
            service.stop();
        } catch (VoldemortException e) {
            exceptions.add(e);
            logger.error(e);
        }
    }
    logger.info("All services stopped for Node:" + getIdentityNode().getId());
    if (exceptions.size() > 0)
        throw exceptions.get(0);
    // release lock of jvm heap
    JNAUtils.tryMunlockall();
}
Also used : VoldemortService(voldemort.common.service.VoldemortService) ArrayList(java.util.ArrayList) VoldemortException(voldemort.VoldemortException)

Example 7 with VoldemortService

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

the class VoldemortServer method startInner.

@Override
protected void startInner() throws VoldemortException {
    // lock down jvm heap
    JNAUtils.tryMlockall();
    logger.info("Starting " + basicServices.size() + " services.");
    long start = System.currentTimeMillis();
    boolean goOnline;
    if (getMetadataStore().getServerStateUnlocked() == MetadataStore.VoldemortState.OFFLINE_SERVER)
        goOnline = false;
    else
        goOnline = true;
    for (VoldemortService service : basicServices) {
        try {
            service.start();
        } catch (DisabledStoreException e) {
            logger.error("Got a DisabledStoreException from " + service.getType().getDisplayName(), e);
            goOnline = false;
        }
    }
    if (goOnline) {
        startOnlineServices();
    } else {
        goOffline();
    }
    long end = System.currentTimeMillis();
    logger.info("Startup completed in " + (end - start) + " ms.");
}
Also used : DisabledStoreException(voldemort.store.DisabledStoreException) VoldemortService(voldemort.common.service.VoldemortService)

Example 8 with VoldemortService

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

the class JmxService method startInner.

@Override
protected void startInner() {
    registerBean(server, JmxUtils.createObjectName(VoldemortServer.class));
    registerBean(cluster, JmxUtils.createObjectName(Cluster.class));
    for (VoldemortService service : services) registerBean(service, JmxUtils.createObjectName(service.getClass()));
    for (Store<ByteArray, byte[], byte[]> store : this.storeRepository.getAllStorageEngines()) {
        if (server.getVoldemortConfig().isEnableJmxClusterName())
            registerBean(store, JmxUtils.createObjectName(this.cluster.getName() + "." + JmxUtils.getPackageName(store.getClass()), store.getName()));
        else
            registerBean(store, JmxUtils.createObjectName(JmxUtils.getPackageName(store.getClass()), store.getName()));
    }
}
Also used : VoldemortService(voldemort.common.service.VoldemortService) Cluster(voldemort.cluster.Cluster) ByteArray(voldemort.utils.ByteArray) VoldemortServer(voldemort.server.VoldemortServer)

Aggregations

VoldemortService (voldemort.common.service.VoldemortService)8 ArrayList (java.util.ArrayList)5 VoldemortServer (voldemort.server.VoldemortServer)3 StorageService (voldemort.server.storage.StorageService)3 ByteArray (voldemort.utils.ByteArray)3 Properties (java.util.Properties)2 VoldemortConfig (voldemort.server.VoldemortConfig)2 StoreDefinition (voldemort.store.StoreDefinition)2 SocketStoreFactory (voldemort.store.socket.SocketStoreFactory)2 ClientRequestExecutorPool (voldemort.store.socket.clientrequest.ClientRequestExecutorPool)2 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Before (org.junit.Before)1 VoldemortException (voldemort.VoldemortException)1 TimeoutConfig (voldemort.client.TimeoutConfig)1 Cluster (voldemort.cluster.Cluster)1 Node (voldemort.cluster.Node)1 FailureDetectorConfig (voldemort.cluster.failuredetector.FailureDetectorConfig)1 SchedulerService (voldemort.common.service.SchedulerService)1 CoordinatorAdminService (voldemort.rest.coordinator.admin.CoordinatorAdminService)1