use of org.apache.bookkeeper.meta.LayoutManager in project incubator-pulsar by apache.
the class PulsarRegistrationManager method nukeExistingCluster.
@Override
public boolean nukeExistingCluster() throws Exception {
log.info("Nuking metadata of existing cluster, ledger root path: {}", ledgersRootPath);
if (!store.exists(ledgersRootPath + "/" + INSTANCEID).join()) {
log.info("There is no existing cluster with ledgersRootPath: {}, so exiting nuke operation", ledgersRootPath);
return true;
}
@Cleanup RegistrationClient registrationClient = new PulsarRegistrationClient(store, ledgersRootPath);
Collection<BookieId> rwBookies = registrationClient.getWritableBookies().join().getValue();
if (rwBookies != null && !rwBookies.isEmpty()) {
log.error("Bookies are still up and connected to this cluster, " + "stop all bookies before nuking the cluster");
return false;
}
Collection<BookieId> roBookies = registrationClient.getReadOnlyBookies().join().getValue();
if (roBookies != null && !roBookies.isEmpty()) {
log.error("Readonly Bookies are still up and connected to this cluster, " + "stop all bookies before nuking the cluster");
return false;
}
LayoutManager layoutManager = new PulsarLayoutManager(store, ledgersRootPath);
LedgerManagerFactory ledgerManagerFactory = new PulsarLedgerManagerFactory();
ledgerManagerFactory.initialize(conf, layoutManager, LegacyHierarchicalLedgerManagerFactory.CUR_VERSION);
return ledgerManagerFactory.validateAndNukeExistingCluster(conf, layoutManager);
}
use of org.apache.bookkeeper.meta.LayoutManager in project pulsar by yahoo.
the class PulsarRegistrationManager method nukeExistingCluster.
@Override
public boolean nukeExistingCluster() throws Exception {
log.info("Nuking metadata of existing cluster, ledger root path: {}", ledgersRootPath);
if (!store.exists(ledgersRootPath + "/" + INSTANCEID).join()) {
log.info("There is no existing cluster with ledgersRootPath: {}, so exiting nuke operation", ledgersRootPath);
return true;
}
@Cleanup RegistrationClient registrationClient = new PulsarRegistrationClient(store, ledgersRootPath);
Collection<BookieId> rwBookies = registrationClient.getWritableBookies().join().getValue();
if (rwBookies != null && !rwBookies.isEmpty()) {
log.error("Bookies are still up and connected to this cluster, " + "stop all bookies before nuking the cluster");
return false;
}
Collection<BookieId> roBookies = registrationClient.getReadOnlyBookies().join().getValue();
if (roBookies != null && !roBookies.isEmpty()) {
log.error("Readonly Bookies are still up and connected to this cluster, " + "stop all bookies before nuking the cluster");
return false;
}
LayoutManager layoutManager = new PulsarLayoutManager(store, ledgersRootPath);
LedgerManagerFactory ledgerManagerFactory = new PulsarLedgerManagerFactory();
ledgerManagerFactory.initialize(conf, layoutManager, LegacyHierarchicalLedgerManagerFactory.CUR_VERSION);
return ledgerManagerFactory.validateAndNukeExistingCluster(conf, layoutManager);
}
use of org.apache.bookkeeper.meta.LayoutManager in project pulsar by apache.
the class PulsarRegistrationManager method nukeExistingCluster.
@Override
public boolean nukeExistingCluster() throws Exception {
log.info("Nuking metadata of existing cluster, ledger root path: {}", ledgersRootPath);
if (!store.exists(ledgersRootPath + "/" + INSTANCEID).join()) {
log.info("There is no existing cluster with ledgersRootPath: {}, so exiting nuke operation", ledgersRootPath);
return true;
}
@Cleanup RegistrationClient registrationClient = new PulsarRegistrationClient(store, ledgersRootPath);
Collection<BookieId> rwBookies = registrationClient.getWritableBookies().join().getValue();
if (rwBookies != null && !rwBookies.isEmpty()) {
log.error("Bookies are still up and connected to this cluster, " + "stop all bookies before nuking the cluster");
return false;
}
Collection<BookieId> roBookies = registrationClient.getReadOnlyBookies().join().getValue();
if (roBookies != null && !roBookies.isEmpty()) {
log.error("Readonly Bookies are still up and connected to this cluster, " + "stop all bookies before nuking the cluster");
return false;
}
LayoutManager layoutManager = new PulsarLayoutManager(store, ledgersRootPath);
LedgerManagerFactory ledgerManagerFactory = new PulsarLedgerManagerFactory();
ledgerManagerFactory.initialize(conf, layoutManager, LegacyHierarchicalLedgerManagerFactory.CUR_VERSION);
return ledgerManagerFactory.validateAndNukeExistingCluster(conf, layoutManager);
}
Aggregations