Search in sources :

Example 6 with ChunkNotFoundException

use of io.pravega.segmentstore.storage.chunklayer.ChunkNotFoundException in project pravega by pravega.

the class NoOpChunkStorage method doConcat.

@Override
protected int doConcat(ConcatArgument[] chunks) throws ChunkStorageException {
    int total = 0;
    for (ConcatArgument chunk : chunks) {
        val chunkData = chunkMetadata.get(chunk.getName());
        if (null == chunkData) {
            throw new ChunkNotFoundException(chunk.getName(), "NoOpChunkStorage::doConcat");
        }
        Preconditions.checkState(chunkData.length >= chunk.getLength());
        total += chunk.getLength();
    }
    val targetChunkData = chunkMetadata.get(chunks[0].getName());
    targetChunkData.length = total;
    return total;
}
Also used : ConcatArgument(io.pravega.segmentstore.storage.chunklayer.ConcatArgument) lombok.val(lombok.val) ChunkNotFoundException(io.pravega.segmentstore.storage.chunklayer.ChunkNotFoundException)

Aggregations

ChunkNotFoundException (io.pravega.segmentstore.storage.chunklayer.ChunkNotFoundException)6 ChunkAlreadyExistsException (io.pravega.segmentstore.storage.chunklayer.ChunkAlreadyExistsException)5 ChunkStorageException (io.pravega.segmentstore.storage.chunklayer.ChunkStorageException)5 lombok.val (lombok.val)3 S3Exception (software.amazon.awssdk.services.s3.model.S3Exception)3 S3Exception (com.emc.object.s3.S3Exception)2 S3ObjectMetadata (com.emc.object.s3.S3ObjectMetadata)1 CopyPartResult (com.emc.object.s3.bean.CopyPartResult)1 MultipartPartETag (com.emc.object.s3.bean.MultipartPartETag)1 AbortMultipartUploadRequest (com.emc.object.s3.request.AbortMultipartUploadRequest)1 CompleteMultipartUploadRequest (com.emc.object.s3.request.CompleteMultipartUploadRequest)1 CopyPartRequest (com.emc.object.s3.request.CopyPartRequest)1 ConcatArgument (io.pravega.segmentstore.storage.chunklayer.ConcatArgument)1 InvalidOffsetException (io.pravega.segmentstore.storage.chunklayer.InvalidOffsetException)1 TreeSet (java.util.TreeSet)1 CompletedMultipartUpload (software.amazon.awssdk.services.s3.model.CompletedMultipartUpload)1 CompletedPart (software.amazon.awssdk.services.s3.model.CompletedPart)1 DeleteObjectRequest (software.amazon.awssdk.services.s3.model.DeleteObjectRequest)1 UploadPartCopyRequest (software.amazon.awssdk.services.s3.model.UploadPartCopyRequest)1