use of com.persistit.Volume in project titan by thinkaurelius.
the class PersistitStoreManager method clearStorage.
@Override
public void clearStorage() throws StorageException {
for (String key : stores.keySet()) {
PersistitKeyValueStore store = stores.remove(key);
store.clear();
}
Volume volume;
String[] treeNames;
try {
volume = db.getVolume(VOLUME_NAME);
treeNames = volume.getTreeNames();
} catch (PersistitException ex) {
throw new PermanentStorageException(ex);
}
for (String treeName : treeNames) {
try {
Exchange ex = new Exchange(db, volume, treeName, false);
ex.removeTree();
} catch (PersistitException ex) {
throw new PermanentStorageException(ex);
}
}
close();
IOUtils.deleteFromDirectory(directory);
}
Aggregations