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();
}
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.");
}
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()));
}
}
Aggregations