/** * Destroy the store * * @throws IOException if it has difficulty removing the log files */ public void destroy() throws IOException { // Prep all the sub-stores to be destroyed for (SubStore subStore : subStores) { subStore.prepareDestroy(); } log.deletePersistentStore(); FileSystem.destroy(storeLocation, true); }
/** * Inform the store of a sub-store * * @param subStore The SubStore to add * @throws StoreException if the SubStore cannot be added */ public void addSubStore(SubStore subStore) throws StoreException { try { final String subDir = subStore.subDirectory(); if (subDir == null) { subStore.setDirectory(storeLocation); } else { subStore.setDirectory(new File(storeLocation, subDir)); } subStores.add(subStore); } catch (IOException e) { throw new StoreException("Failure adding substore " + subStore, e); } }