Search in sources :

Example 1 with AutoRecoveryMain

use of org.apache.bookkeeper.replication.AutoRecoveryMain in project pulsar by yahoo.

the class BookKeeperClusterTestCase method stopAutoRecoveryService.

private void stopAutoRecoveryService(BookieServer toRemove) throws Exception {
    AutoRecoveryMain autoRecoveryMain = autoRecoveryProcesses.remove(toRemove);
    if (null != autoRecoveryMain && isAutoRecoveryEnabled()) {
        autoRecoveryMain.shutdown();
        LOG.debug("Shutdown auto recovery for bookieserver:" + toRemove.getLocalAddress());
    }
}
Also used : AutoRecoveryMain(org.apache.bookkeeper.replication.AutoRecoveryMain)

Example 2 with AutoRecoveryMain

use of org.apache.bookkeeper.replication.AutoRecoveryMain in project pulsar by yahoo.

the class BookKeeperClusterTestCase method stopBKCluster.

/**
     * Stop cluster. Also, stops all the auto recovery processes for the bookie cluster, if isAutoRecoveryEnabled is
     * true.
     *
     * @throws Exception
     */
protected void stopBKCluster() throws Exception {
    if (bkc != null) {
        bkc.close();
    }
    for (BookieServer server : bs) {
        server.shutdown();
        AutoRecoveryMain autoRecovery = autoRecoveryProcesses.get(server);
        if (autoRecovery != null && isAutoRecoveryEnabled()) {
            autoRecovery.shutdown();
            LOG.debug("Shutdown auto recovery for bookieserver:" + server.getLocalAddress());
        }
    }
    bs.clear();
    for (File f : tmpDirs) {
        FileUtils.deleteDirectory(f);
    }
}
Also used : AutoRecoveryMain(org.apache.bookkeeper.replication.AutoRecoveryMain) BookieServer(org.apache.bookkeeper.proto.BookieServer) File(java.io.File)

Aggregations

AutoRecoveryMain (org.apache.bookkeeper.replication.AutoRecoveryMain)2 File (java.io.File)1 BookieServer (org.apache.bookkeeper.proto.BookieServer)1