Search in sources :

Example 1 with Volume

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);
}
Also used : Exchange(com.persistit.Exchange) Volume(com.persistit.Volume) PermanentStorageException(com.thinkaurelius.titan.diskstorage.PermanentStorageException) PersistitException(com.persistit.exception.PersistitException)

Aggregations

Exchange (com.persistit.Exchange)1 Volume (com.persistit.Volume)1 PersistitException (com.persistit.exception.PersistitException)1 PermanentStorageException (com.thinkaurelius.titan.diskstorage.PermanentStorageException)1