use of io.pravega.segmentstore.storage.metadata.StorageMetadataWritesFencedOutException in project pravega by pravega.
the class WriteOperation method handleException.
private Object handleException(Throwable e) {
log.debug("{} write - exception op={}, segment={}, offset={}, length={}.", chunkedSegmentStorage.getLogPrefix(), System.identityHashCode(this), handle.getSegmentName(), offset, length);
val ex = Exceptions.unwrap(e);
if (ex instanceof StorageMetadataWritesFencedOutException) {
throw new CompletionException(new StorageNotPrimaryException(handle.getSegmentName(), ex));
}
if (ex instanceof ChunkStorageFullException) {
throw new CompletionException(new StorageFullException(handle.getSegmentName(), ex));
}
throw new CompletionException(ex);
}
use of io.pravega.segmentstore.storage.metadata.StorageMetadataWritesFencedOutException in project pravega by pravega.
the class ConcatOperation method handleException.
private Void handleException(Throwable e) {
log.debug("{} concat - exception op={}, target={}, source={}, offset={}.", chunkedSegmentStorage.getLogPrefix(), System.identityHashCode(this), targetHandle.getSegmentName(), sourceSegment, offset);
val ex = Exceptions.unwrap(e);
if (ex instanceof StorageMetadataWritesFencedOutException) {
throw new CompletionException(new StorageNotPrimaryException(targetHandle.getSegmentName(), ex));
}
if (ex instanceof ChunkStorageFullException) {
throw new CompletionException(new StorageFullException(targetHandle.getSegmentName(), ex));
}
throw new CompletionException(ex);
}
use of io.pravega.segmentstore.storage.metadata.StorageMetadataWritesFencedOutException in project pravega by pravega.
the class ChunkedSegmentStorageMockTests method testStorageMetadataWritesFencedOutExceptionDuringCommit.
@Test
public void testStorageMetadataWritesFencedOutExceptionDuringCommit() throws Exception {
Exception exceptionToThrow = new StorageMetadataWritesFencedOutException("Test Exception");
val clazz = StorageNotPrimaryException.class;
testExceptionDuringCommit(exceptionToThrow, clazz);
}
use of io.pravega.segmentstore.storage.metadata.StorageMetadataWritesFencedOutException in project pravega by pravega.
the class TruncateOperation method handleException.
private Void handleException(Void value, Throwable e) {
if (null != e) {
log.debug("{} truncate - exception op={}, segment={}, offset={}.", chunkedSegmentStorage.getLogPrefix(), System.identityHashCode(this), handle.getSegmentName(), offset);
val ex = Exceptions.unwrap(e);
if (ex instanceof StorageMetadataWritesFencedOutException) {
throw new CompletionException(new StorageNotPrimaryException(handle.getSegmentName(), ex));
}
throw new CompletionException(ex);
}
return value;
}
Aggregations