Search in sources :

Example 1 with LogException

use of org.exist.storage.journal.LogException in project exist by eXist-db.

the class BlobStoreImpl method redo.

@Override
public void redo(final BlobLoggable blobLoggable) throws LogException {
    try {
        if (blobLoggable instanceof StoreBlobFileLoggable) {
            final StoreBlobFileLoggable storeBlobFileLoggable = (StoreBlobFileLoggable) blobLoggable;
            redoStoreBlobFile(storeBlobFileLoggable.getBlobId(), storeBlobFileLoggable.getStagedUuid());
        } else if (blobLoggable instanceof UpdateBlobRefCountLoggable) {
            final UpdateBlobRefCountLoggable updateBlobRefCountLoggable = (UpdateBlobRefCountLoggable) blobLoggable;
            updateBlogRefCount(updateBlobRefCountLoggable.getBlobId(), updateBlobRefCountLoggable.getNewCount());
        }
    } catch (final IOException e) {
        throw new LogException(e.getMessage(), e);
    }
}
Also used : IOException(java.io.IOException) LogException(org.exist.storage.journal.LogException)

Example 2 with LogException

use of org.exist.storage.journal.LogException in project exist by eXist-db.

the class BlobStoreImpl method undo.

@Override
public void undo(final BlobLoggable blobLoggable) throws LogException {
    try {
        if (blobLoggable instanceof StoreBlobFileLoggable) {
            final StoreBlobFileLoggable storeBlobFileLoggable = (StoreBlobFileLoggable) blobLoggable;
            undoStoreBlobFile(storeBlobFileLoggable.getBlobId(), storeBlobFileLoggable.getStagedUuid());
        } else if (blobLoggable instanceof UpdateBlobRefCountLoggable) {
            final UpdateBlobRefCountLoggable updateBlobRefCountLoggable = (UpdateBlobRefCountLoggable) blobLoggable;
            updateBlogRefCount(updateBlobRefCountLoggable.getBlobId(), updateBlobRefCountLoggable.getCurrentCount());
        }
    } catch (final IOException e) {
        throw new LogException(e.getMessage(), e);
    }
}
Also used : IOException(java.io.IOException) LogException(org.exist.storage.journal.LogException)

Aggregations

IOException (java.io.IOException)2 LogException (org.exist.storage.journal.LogException)2