DefaultReplicationStoreManager extends AbstractLifecycleObservable implements ReplicationStoreManager { @Override public void destroy() throws Exception { logger.info("[destroy]{}", this); ReplicationStore currentReplicationStore = getCurrent(); if(currentReplicationStore != null){ try{ currentReplicationStore.destroy(); }catch(Throwable th){ logger.error("[destroy]", th); } } FileUtils.recursiveDelete(this.baseDir); } DefaultReplicationStoreManager(KeeperConfig keeperConfig, String clusterName, String shardName, String keeperRunid, File baseDir, KeeperMonitor keeperMonitor); @Override synchronized ReplicationStore createIfNotExist(); @Override synchronized ReplicationStore create(); @Override synchronized ReplicationStore getCurrent(); @Override String getClusterName(); @Override String getShardName(); @Override void destroy(); long getGcCount(); @Override String toString(); File getBaseDir();  }
@Test public void testDestroy() throws Exception{ DefaultReplicationStoreManager replicationStoreManager = (DefaultReplicationStoreManager) createReplicationStoreManager( keeperConfig); LifecycleHelper.initializeIfPossible(replicationStoreManager); LifecycleHelper.startIfPossible(replicationStoreManager); DefaultReplicationStore store = (DefaultReplicationStore) replicationStoreManager.create(); Assert.assertTrue(store.getBaseDir().exists()); replicationStoreManager.destroy(); Assert.assertTrue(!store.getBaseDir().exists()); }