Search in sources :

Example 1 with DLZkServerSet

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();
    }
}
Also used : AsyncLogReader(com.twitter.distributedlog.AsyncLogReader) DistributedLogManager(com.twitter.distributedlog.DistributedLogManager) DLZkServerSet(com.twitter.distributedlog.client.serverset.DLZkServerSet)

Example 2 with DLZkServerSet

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();
    }
}
Also used : DLZkServerSet(com.twitter.distributedlog.client.serverset.DLZkServerSet)

Example 3 with DLZkServerSet

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.");
}
Also used : DLZkServerSet(com.twitter.distributedlog.client.serverset.DLZkServerSet)

Aggregations

DLZkServerSet (com.twitter.distributedlog.client.serverset.DLZkServerSet)3 AsyncLogReader (com.twitter.distributedlog.AsyncLogReader)1 DistributedLogManager (com.twitter.distributedlog.DistributedLogManager)1