Search in sources :

Example 11 with OLocalHashTableException

use of com.orientechnologies.orient.core.exception.OLocalHashTableException in project orientdb by orientechnologies.

the class OLocalHashTable method delete.

@Override
public void delete() {
    startOperation();
    try {
        final OAtomicOperation atomicOperation;
        try {
            atomicOperation = startAtomicOperation(false);
        } catch (IOException e) {
            throw OException.wrapException(new OLocalHashTableException("Error during hash table deletion", this), e);
        }
        acquireExclusiveLock();
        try {
            directory.delete();
            deleteFile(atomicOperation, fileStateId);
            deleteFile(atomicOperation, fileId);
            if (nullKeyIsSupported)
                deleteFile(atomicOperation, nullBucketFileId);
            endAtomicOperation(false, null);
        } catch (IOException e) {
            rollback(e);
            throw OException.wrapException(new OLocalHashTableException("Exception during index deletion", this), e);
        } catch (Exception e) {
            rollback(e);
            throw OException.wrapException(new OLocalHashTableException("Exception during index deletion", this), e);
        } finally {
            releaseExclusiveLock();
        }
    } finally {
        completeOperation();
    }
}
Also used : OAtomicOperation(com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperation) OLocalHashTableException(com.orientechnologies.orient.core.exception.OLocalHashTableException) IOException(java.io.IOException) OIndexException(com.orientechnologies.orient.core.index.OIndexException) OException(com.orientechnologies.common.exception.OException) IOException(java.io.IOException) OLocalHashTableException(com.orientechnologies.orient.core.exception.OLocalHashTableException) OTooBigIndexKeyException(com.orientechnologies.orient.core.exception.OTooBigIndexKeyException) OStorageException(com.orientechnologies.orient.core.exception.OStorageException)

Aggregations

OLocalHashTableException (com.orientechnologies.orient.core.exception.OLocalHashTableException)11 OAtomicOperation (com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperation)11 IOException (java.io.IOException)11 OCacheEntry (com.orientechnologies.orient.core.storage.cache.OCacheEntry)8 OException (com.orientechnologies.common.exception.OException)3 OStorageException (com.orientechnologies.orient.core.exception.OStorageException)3 OTooBigIndexKeyException (com.orientechnologies.orient.core.exception.OTooBigIndexKeyException)3 OIndexException (com.orientechnologies.orient.core.index.OIndexException)3 OBinarySerializerFactory (com.orientechnologies.orient.core.serialization.serializer.binary.OBinarySerializerFactory)1