Class PBHelper

java.lang.Object
org.apache.hadoop.hdfs.protocolPB.PBHelper

public class PBHelper extends Object
Utilities for converting protobuf classes to and from implementation classes and other helper utilities to help in dealing with protobuf. Note that when converting from an internal type to protobuf type, the converter never return null for protobuf type. The check for internal type being null must be done before calling the convert() method. For those helper methods that convert HDFS client-side data structures from and to protobuf, see PBHelperClient.
  • Method Details

    • convert

      public static HdfsServerConstants.NamenodeRole convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamenodeRegistrationProto.NamenodeRoleProto role)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamenodeRegistrationProto.NamenodeRoleProto convert(HdfsServerConstants.NamenodeRole role)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.StorageInfoProto convert(StorageInfo info)
    • convert

      public static StorageInfo convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.StorageInfoProto info, HdfsServerConstants.NodeType type)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamenodeRegistrationProto convert(NamenodeRegistration reg)
    • convert

      public static NamenodeRegistration convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamenodeRegistrationProto reg)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlockWithLocationsProto convert(BlocksWithLocations.BlockWithLocations blk)
    • convert

      public static BlocksWithLocations.BlockWithLocations convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlockWithLocationsProto b)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlocksWithLocationsProto convert(BlocksWithLocations blks)
    • convert

      public static BlocksWithLocations convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlocksWithLocationsProto blocks)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlockKeyProto convert(BlockKey key)
    • convert

      public static BlockKey convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlockKeyProto k)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.ExportedBlockKeysProto convert(ExportedBlockKeys keys)
    • convert

      public static ExportedBlockKeys convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.ExportedBlockKeysProto keys)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.CheckpointSignatureProto convert(CheckpointSignature s)
    • convert

      public static CheckpointSignature convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.CheckpointSignatureProto s)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.RemoteEditLogProto convert(RemoteEditLog log)
    • convert

      public static RemoteEditLog convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.RemoteEditLogProto l)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.RemoteEditLogManifestProto convert(RemoteEditLogManifest manifest)
    • convert

      public static RemoteEditLogManifest convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.RemoteEditLogManifestProto manifest)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.CheckpointCommandProto convert(CheckpointCommand cmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamenodeCommandProto convert(NamenodeCommand cmd)
    • convertBlockKeys

      public static BlockKey[] convertBlockKeys(List<org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlockKeyProto> list)
    • convert

      public static NamespaceInfo convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamespaceInfoProto info)
    • convert

      public static NamenodeCommand convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamenodeCommandProto cmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.RecoveringBlockProto convert(BlockRecoveryCommand.RecoveringBlock b)
    • convert

      public static BlockRecoveryCommand.RecoveringBlock convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.RecoveringBlockProto b)
    • convert

      public static HdfsServerConstants.ReplicaState convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.ReplicaStateProto state)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.ReplicaStateProto convert(HdfsServerConstants.ReplicaState state)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.DatanodeRegistrationProto convert(DatanodeRegistration registration)
    • convert

      public static DatanodeRegistration convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.DatanodeRegistrationProto proto)
    • convert

      public static DatanodeCommand convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.DatanodeCommandProto proto)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BalancerBandwidthCommandProto convert(BalancerBandwidthCommand bbCmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.KeyUpdateCommandProto convert(KeyUpdateCommand cmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockRecoveryCommandProto convert(BlockRecoveryCommand cmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.FinalizeCommandProto convert(FinalizeCommand cmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto convert(BlockCommand cmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockIdCommandProto convert(BlockIdCommand cmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.DatanodeCommandProto convert(DatanodeCommand datanodeCommand)
    • convert

      public static KeyUpdateCommand convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.KeyUpdateCommandProto keyUpdateCmd)
    • convert

      public static FinalizeCommand convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.FinalizeCommandProto finalizeCmd)
    • convert

      public static BlockRecoveryCommand convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockRecoveryCommandProto recoveryCmd)
    • convert

      public static BlockCommand convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto blkCmd)
    • convert

      public static BlockIdCommand convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockIdCommandProto blkIdCmd)
    • convert

      public static BalancerBandwidthCommand convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BalancerBandwidthCommandProto balancerCmd)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.ReceivedDeletedBlockInfoProto convert(ReceivedDeletedBlockInfo receivedDeletedBlockInfo)
    • convert

      public static ReceivedDeletedBlockInfo convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.ReceivedDeletedBlockInfoProto proto)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamespaceInfoProto convert(NamespaceInfo info)
    • convert

      public static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NNHAStatusHeartbeatProto.State s)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NNHAStatusHeartbeatProto.State convert(org.apache.hadoop.ha.HAServiceProtocol.HAServiceState s)
    • convert

      public static NNHAStatusHeartbeat convert(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NNHAStatusHeartbeatProto s)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NNHAStatusHeartbeatProto convert(NNHAStatusHeartbeat hb)
    • convertVolumeFailureSummary

      public static VolumeFailureSummary convertVolumeFailureSummary(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.VolumeFailureSummaryProto proto)
    • convertVolumeFailureSummary

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.VolumeFailureSummaryProto convertVolumeFailureSummary(VolumeFailureSummary volumeFailureSummary)
    • convertSlowPeerInfo

      public static List<org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.SlowPeerReportProto> convertSlowPeerInfo(org.apache.hadoop.hdfs.server.protocol.SlowPeerReports slowPeers)
    • convertSlowPeerInfo

      public static org.apache.hadoop.hdfs.server.protocol.SlowPeerReports convertSlowPeerInfo(List<org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.SlowPeerReportProto> slowPeerProtos)
    • convertSlowDiskInfo

      public static List<org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.SlowDiskReportProto> convertSlowDiskInfo(org.apache.hadoop.hdfs.server.protocol.SlowDiskReports slowDisks)
    • convertSlowDiskInfo

      public static org.apache.hadoop.hdfs.server.protocol.SlowDiskReports convertSlowDiskInfo(List<org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.SlowDiskReportProto> slowDiskProtos)
    • convert

      public static JournalInfo convert(org.apache.hadoop.hdfs.protocol.proto.JournalProtocolProtos.JournalInfoProto info)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.JournalProtocolProtos.JournalInfoProto convert(JournalInfo j)
      Method used for converting JournalProtocolProtos.JournalInfoProto sent from Namenode to Journal receivers to NamenodeRegistration.
    • convert

      public static BlockReportContext convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockReportContextProto proto)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockReportContextProto convert(BlockReportContext context)
    • convertBlockECReconstructionInfo

      public static BlockECReconstructionCommand.BlockECReconstructionInfo convertBlockECReconstructionInfo(org.apache.hadoop.hdfs.protocol.proto.ErasureCodingProtos.BlockECReconstructionInfoProto blockEcReconstructionInfoProto)
    • convertBlockECRecoveryInfo

      public static org.apache.hadoop.hdfs.protocol.proto.ErasureCodingProtos.BlockECReconstructionInfoProto convertBlockECRecoveryInfo(BlockECReconstructionCommand.BlockECReconstructionInfo blockEcRecoveryInfo)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockECReconstructionCommandProto convert(BlockECReconstructionCommand blkECReconstructionCmd)
    • convert

      public static BlockECReconstructionCommand convert(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockECReconstructionCommandProto blkECReconstructionCmdProto)
    • convert

      public static org.apache.hadoop.hdfs.protocol.proto.AliasMapProtocolProtos.KeyValueProto convert(FileRegion fileRegion)
    • convert

      public static FileRegion convert(org.apache.hadoop.hdfs.protocol.proto.AliasMapProtocolProtos.KeyValueProto keyValueProto)