Search in sources :

Example 1 with DatanodeInfosProto

use of org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.DatanodeInfosProto in project hadoop by apache.

the class PBHelper method convertBlockECReconstructionInfo.

public static BlockECReconstructionInfo convertBlockECReconstructionInfo(BlockECReconstructionInfoProto blockEcReconstructionInfoProto) {
    ExtendedBlockProto blockProto = blockEcReconstructionInfoProto.getBlock();
    ExtendedBlock block = PBHelperClient.convert(blockProto);
    DatanodeInfosProto sourceDnInfosProto = blockEcReconstructionInfoProto.getSourceDnInfos();
    DatanodeInfo[] sourceDnInfos = PBHelperClient.convert(sourceDnInfosProto);
    DatanodeInfosProto targetDnInfosProto = blockEcReconstructionInfoProto.getTargetDnInfos();
    DatanodeInfo[] targetDnInfos = PBHelperClient.convert(targetDnInfosProto);
    HdfsProtos.StorageUuidsProto targetStorageUuidsProto = blockEcReconstructionInfoProto.getTargetStorageUuids();
    String[] targetStorageUuids = convert(targetStorageUuidsProto);
    StorageTypesProto targetStorageTypesProto = blockEcReconstructionInfoProto.getTargetStorageTypes();
    StorageType[] convertStorageTypes = PBHelperClient.convertStorageTypes(targetStorageTypesProto.getStorageTypesList(), targetStorageTypesProto.getStorageTypesList().size());
    byte[] liveBlkIndices = blockEcReconstructionInfoProto.getLiveBlockIndices().toByteArray();
    ErasureCodingPolicy ecPolicy = PBHelperClient.convertErasureCodingPolicy(blockEcReconstructionInfoProto.getEcPolicy());
    return new BlockECReconstructionInfo(block, sourceDnInfos, targetDnInfos, targetStorageUuids, convertStorageTypes, liveBlkIndices, ecPolicy);
}
Also used : BlockECReconstructionInfo(org.apache.hadoop.hdfs.server.protocol.BlockECReconstructionCommand.BlockECReconstructionInfo) DatanodeInfo(org.apache.hadoop.hdfs.protocol.DatanodeInfo) StorageType(org.apache.hadoop.fs.StorageType) ErasureCodingPolicy(org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy) ExtendedBlock(org.apache.hadoop.hdfs.protocol.ExtendedBlock) ByteString(com.google.protobuf.ByteString) HdfsProtos(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos) StorageUuidsProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.StorageUuidsProto) StorageTypesProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.StorageTypesProto) ExtendedBlockProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.ExtendedBlockProto) DatanodeInfosProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.DatanodeInfosProto)

Aggregations

ByteString (com.google.protobuf.ByteString)1 StorageType (org.apache.hadoop.fs.StorageType)1 DatanodeInfo (org.apache.hadoop.hdfs.protocol.DatanodeInfo)1 ErasureCodingPolicy (org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy)1 ExtendedBlock (org.apache.hadoop.hdfs.protocol.ExtendedBlock)1 HdfsProtos (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos)1 DatanodeInfosProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.DatanodeInfosProto)1 ExtendedBlockProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.ExtendedBlockProto)1 StorageTypesProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.StorageTypesProto)1 StorageUuidsProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.StorageUuidsProto)1 BlockECReconstructionInfo (org.apache.hadoop.hdfs.server.protocol.BlockECReconstructionCommand.BlockECReconstructionInfo)1