use of com.twitter.distributedlog.client.serverset.DLZkServerSet in project distributedlog by twitter.
the class ReaderWorker method close.
@Override
public void close() throws IOException {
this.running = false;
for (AsyncLogReader reader : logReaders) {
if (null != reader) {
FutureUtils.result(reader.asyncClose());
}
}
for (DistributedLogManager dlm : dlms) {
if (null != dlm) {
dlm.close();
}
}
namespace.close();
SchedulerUtils.shutdownScheduler(executorService, 2, TimeUnit.MINUTES);
SchedulerUtils.shutdownScheduler(callbackExecutor, 2, TimeUnit.MINUTES);
if (this.dlc != null) {
this.dlc.close();
}
for (DLZkServerSet serverSet : serverSets) {
serverSet.close();
}
}
use of com.twitter.distributedlog.client.serverset.DLZkServerSet in project distributedlog by twitter.
the class WriterWorker method close.
@Override
public void close() throws IOException {
this.running = false;
SchedulerUtils.shutdownScheduler(this.executorService, 2, TimeUnit.MINUTES);
for (DLZkServerSet serverSet : serverSets) {
serverSet.close();
}
}
use of com.twitter.distributedlog.client.serverset.DLZkServerSet in project distributedlog by twitter.
the class MonitorService method close.
/**
* Close the server
*/
public void close() {
logger.info("Closing monitor service.");
if (null != dlClient) {
dlClient.close();
}
if (null != zkServerSets) {
for (DLZkServerSet zkServerSet : zkServerSets) {
zkServerSet.close();
}
}
if (null != dlNamespace) {
dlNamespace.close();
}
executorService.shutdown();
try {
if (!executorService.awaitTermination(1, TimeUnit.MINUTES)) {
executorService.shutdownNow();
}
} catch (InterruptedException e) {
logger.error("Interrupted on waiting shutting down monitor executor service : ", e);
}
if (null != statsProvider) {
statsProvider.stop();
}
keepAliveLatch.countDown();
logger.info("Closed monitor service.");
}
Aggregations