Search in sources :

Example 1 with ChunkInfo

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

the class ExtendedS3ChunkStorage method doGetInfo.

@Override
protected ChunkInfo doGetInfo(String chunkName) throws ChunkStorageException {
    try {
        S3ObjectMetadata result = client.getObjectMetadata(config.getBucket(), getObjectPath(chunkName));
        ChunkInfo information = ChunkInfo.builder().name(chunkName).length(result.getContentLength()).build();
        return information;
    } catch (Exception e) {
        throw convertException(chunkName, "doGetInfo", e);
    }
}
Also used : ChunkInfo(io.pravega.segmentstore.storage.chunklayer.ChunkInfo) S3ObjectMetadata(com.emc.object.s3.S3ObjectMetadata) InvalidOffsetException(io.pravega.segmentstore.storage.chunklayer.InvalidOffsetException) S3Exception(com.emc.object.s3.S3Exception) ChunkStorageException(io.pravega.segmentstore.storage.chunklayer.ChunkStorageException) ChunkNotFoundException(io.pravega.segmentstore.storage.chunklayer.ChunkNotFoundException) ChunkAlreadyExistsException(io.pravega.segmentstore.storage.chunklayer.ChunkAlreadyExistsException)

Aggregations

S3Exception (com.emc.object.s3.S3Exception)1 S3ObjectMetadata (com.emc.object.s3.S3ObjectMetadata)1 ChunkAlreadyExistsException (io.pravega.segmentstore.storage.chunklayer.ChunkAlreadyExistsException)1 ChunkInfo (io.pravega.segmentstore.storage.chunklayer.ChunkInfo)1 ChunkNotFoundException (io.pravega.segmentstore.storage.chunklayer.ChunkNotFoundException)1 ChunkStorageException (io.pravega.segmentstore.storage.chunklayer.ChunkStorageException)1 InvalidOffsetException (io.pravega.segmentstore.storage.chunklayer.InvalidOffsetException)1