Search in sources :

Example 1 with PartInfo

use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PartInfo in project ozone by apache.

the class OzoneManagerRequestHandler method listParts.

private MultipartUploadListPartsResponse listParts(MultipartUploadListPartsRequest multipartUploadListPartsRequest) throws IOException {
    MultipartUploadListPartsResponse.Builder response = MultipartUploadListPartsResponse.newBuilder();
    OmMultipartUploadListParts omMultipartUploadListParts = impl.listParts(multipartUploadListPartsRequest.getVolume(), multipartUploadListPartsRequest.getBucket(), multipartUploadListPartsRequest.getKey(), multipartUploadListPartsRequest.getUploadID(), multipartUploadListPartsRequest.getPartNumbermarker(), multipartUploadListPartsRequest.getMaxParts());
    List<OmPartInfo> omPartInfoList = omMultipartUploadListParts.getPartInfoList();
    List<PartInfo> partInfoList = new ArrayList<>();
    omPartInfoList.forEach(partInfo -> partInfoList.add(partInfo.getProto()));
    response.setType(omMultipartUploadListParts.getReplicationConfig().getReplicationType());
    response.setFactor(ReplicationConfig.getLegacyFactor(omMultipartUploadListParts.getReplicationConfig()));
    response.setNextPartNumberMarker(omMultipartUploadListParts.getNextPartNumberMarker());
    response.setIsTruncated(omMultipartUploadListParts.isTruncated());
    return response.addAllPartsList(partInfoList).build();
}
Also used : OmMultipartUploadListParts(org.apache.hadoop.ozone.om.helpers.OmMultipartUploadListParts) ArrayList(java.util.ArrayList) MultipartUploadListPartsResponse(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.MultipartUploadListPartsResponse) PartInfo(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PartInfo) OmPartInfo(org.apache.hadoop.ozone.om.helpers.OmPartInfo) OmPartInfo(org.apache.hadoop.ozone.om.helpers.OmPartInfo)

Aggregations

ArrayList (java.util.ArrayList)1 OmMultipartUploadListParts (org.apache.hadoop.ozone.om.helpers.OmMultipartUploadListParts)1 OmPartInfo (org.apache.hadoop.ozone.om.helpers.OmPartInfo)1 MultipartUploadListPartsResponse (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.MultipartUploadListPartsResponse)1 PartInfo (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PartInfo)1