public org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto buildPartial() { org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto result = new org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
public Builder mergeFrom(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto other) { if (other == org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto.getDefaultInstance()) return this; if (other.hasAction()) { setAction(other.getAction()); if (other.hasBlockPoolId()) { bitField0_ |= 0x00000002; blockPoolId_ = other.blockPoolId_; this.mergeUnknownFields(other.getUnknownFields()); return this;
public static BlockCommand convert(BlockCommandProto blkCmd) { List<BlockProto> blockProtoList = blkCmd.getBlocksList(); Block[] blocks = new Block[blockProtoList.size()]; for (int i = 0; i < blockProtoList.size(); i++) { blocks[i] = PBHelperClient.convert(blockProtoList.get(i)); List<DatanodeInfosProto> targetList = blkCmd.getTargetsList(); DatanodeInfo[][] targets = new DatanodeInfo[targetList.size()][]; for (int i = 0; i < targetList.size(); i++) { List<StorageTypesProto> targetStorageTypesList = blkCmd.getTargetStorageTypesList(); if (targetStorageTypesList.isEmpty()) { // missing storage types for(int i = 0; i < targetStorageTypes.length; i++) { List<StorageUuidsProto> targetStorageUuidsList = blkCmd.getTargetStorageUuidsList(); String[][] targetStorageIDs = new String[targetStorageUuidsList.size()][]; for(int i = 0; i < targetStorageIDs.length; i++) { switch (blkCmd.getAction()) { case TRANSFER: action = DatanodeProtocol.DNA_TRANSFER; break; default: throw new AssertionError("Unknown action type: " + blkCmd.getAction()); return new BlockCommand(action, blkCmd.getBlockPoolId(), blocks, targets, targetStorageTypes, targetStorageIDs);
public Builder mergeFrom(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto other) { if (other == org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto.getDefaultInstance()) return this; if (other.hasAction()) { setAction(other.getAction()); if (other.hasBlockPoolId()) { bitField0_ |= 0x00000002; blockPoolId_ = other.blockPoolId_; this.mergeUnknownFields(other.getUnknownFields()); return this;
public Builder mergeFrom(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto other) { if (other == org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto.getDefaultInstance()) return this; if (other.hasAction()) { setAction(other.getAction()); if (other.hasBlockPoolId()) { bitField0_ |= 0x00000002; blockPoolId_ = other.blockPoolId_; this.mergeUnknownFields(other.getUnknownFields()); return this;
public org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto buildPartial() { org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto result = new org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
blkCmd_ = org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto.getDefaultInstance(); } else { blkCmdBuilder_.clear();
if (hasBlkCmd()) { result = result && getBlkCmd() .equals(other.getBlkCmd());
if (hasBlkCmd()) { result = result && getBlkCmd() .equals(other.getBlkCmd());
public static BlockCommand convert(BlockCommandProto blkCmd) { List<BlockProto> blockProtoList = blkCmd.getBlocksList(); Block[] blocks = new Block[blockProtoList.size()]; for (int i = 0; i < blockProtoList.size(); i++) { blocks[i] = PBHelper.convert(blockProtoList.get(i)); List<DatanodeInfosProto> targetList = blkCmd.getTargetsList(); DatanodeInfo[][] targets = new DatanodeInfo[targetList.size()][]; for (int i = 0; i < targetList.size(); i++) { List<StorageTypesProto> targetStorageTypesList = blkCmd.getTargetStorageTypesList(); if (targetStorageTypesList.isEmpty()) { // missing storage types for(int i = 0; i < targetStorageTypes.length; i++) { List<StorageUuidsProto> targetStorageUuidsList = blkCmd.getTargetStorageUuidsList(); String[][] targetStorageIDs = new String[targetStorageUuidsList.size()][]; for(int i = 0; i < targetStorageIDs.length; i++) { switch (blkCmd.getAction()) { case TRANSFER: action = DatanodeProtocol.DNA_TRANSFER; break; default: throw new AssertionError("Unknown action type: " + blkCmd.getAction()); return new BlockCommand(action, blkCmd.getBlockPoolId(), blocks, targets, targetStorageTypes, targetStorageIDs);
public org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto buildPartial() { org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto result = new org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
blkCmd_ = org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockCommandProto.getDefaultInstance(); } else { blkCmdBuilder_.clear();
public static BlockCommand convert(BlockCommandProto blkCmd) { List<BlockProto> blockProtoList = blkCmd.getBlocksList(); Block[] blocks = new Block[blockProtoList.size()]; for (int i = 0; i < blockProtoList.size(); i++) { blocks[i] = PBHelper.convert(blockProtoList.get(i)); List<DatanodeInfosProto> targetList = blkCmd.getTargetsList(); DatanodeInfo[][] targets = new DatanodeInfo[targetList.size()][]; for (int i = 0; i < targetList.size(); i++) { List<StorageTypesProto> targetStorageTypesList = blkCmd.getTargetStorageTypesList(); if (targetStorageTypesList.isEmpty()) { // missing storage types for(int i = 0; i < targetStorageTypes.length; i++) { List<StorageUuidsProto> targetStorageUuidsList = blkCmd.getTargetStorageUuidsList(); String[][] targetStorageIDs = new String[targetStorageUuidsList.size()][]; for(int i = 0; i < targetStorageIDs.length; i++) { switch (blkCmd.getAction()) { case TRANSFER: action = DatanodeProtocol.DNA_TRANSFER; break; default: throw new AssertionError("Unknown action type: " + blkCmd.getAction()); return new BlockCommand(action, blkCmd.getBlockPoolId(), blocks, targets, targetStorageTypes, targetStorageIDs);
.computeBytesSize(2, getBlockPoolIdBytes()); .computeMessageSize(6, targetStorageTypes_.get(i)); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
.computeBytesSize(2, getBlockPoolIdBytes()); .computeMessageSize(6, targetStorageTypes_.get(i)); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
result = result && (hasAction() == other.hasAction()); if (hasAction()) { result = result && (getAction() == other.getAction()); result = result && (hasBlockPoolId() == other.hasBlockPoolId()); if (hasBlockPoolId()) { result = result && getBlockPoolId() .equals(other.getBlockPoolId()); result = result && getBlocksList() .equals(other.getBlocksList()); result = result && getTargetsList() .equals(other.getTargetsList()); result = result && getTargetStorageUuidsList() .equals(other.getTargetStorageUuidsList()); result = result && getTargetStorageTypesList() .equals(other.getTargetStorageTypesList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result;
result = result && (hasAction() == other.hasAction()); if (hasAction()) { result = result && (getAction() == other.getAction()); result = result && (hasBlockPoolId() == other.hasBlockPoolId()); if (hasBlockPoolId()) { result = result && getBlockPoolId() .equals(other.getBlockPoolId()); result = result && getBlocksList() .equals(other.getBlocksList()); result = result && getTargetsList() .equals(other.getTargetsList()); result = result && getTargetStorageUuidsList() .equals(other.getTargetStorageUuidsList()); result = result && getTargetStorageTypesList() .equals(other.getTargetStorageTypesList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result;
hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasAction()) { hash = (37 * hash) + ACTION_FIELD_NUMBER; hash = (53 * hash) + hashEnum(getAction()); if (hasBlockPoolId()) { hash = (37 * hash) + BLOCKPOOLID_FIELD_NUMBER; hash = (53 * hash) + getBlockPoolId().hashCode(); if (getBlocksCount() > 0) { hash = (37 * hash) + BLOCKS_FIELD_NUMBER; hash = (53 * hash) + getBlocksList().hashCode(); if (getTargetsCount() > 0) { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargetsList().hashCode(); if (getTargetStorageUuidsCount() > 0) { hash = (37 * hash) + TARGETSTORAGEUUIDS_FIELD_NUMBER; hash = (53 * hash) + getTargetStorageUuidsList().hashCode(); if (getTargetStorageTypesCount() > 0) { hash = (37 * hash) + TARGETSTORAGETYPES_FIELD_NUMBER; hash = (53 * hash) + getTargetStorageTypesList().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash;
hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasAction()) { hash = (37 * hash) + ACTION_FIELD_NUMBER; hash = (53 * hash) + hashEnum(getAction()); if (hasBlockPoolId()) { hash = (37 * hash) + BLOCKPOOLID_FIELD_NUMBER; hash = (53 * hash) + getBlockPoolId().hashCode(); if (getBlocksCount() > 0) { hash = (37 * hash) + BLOCKS_FIELD_NUMBER; hash = (53 * hash) + getBlocksList().hashCode(); if (getTargetsCount() > 0) { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargetsList().hashCode(); if (getTargetStorageUuidsCount() > 0) { hash = (37 * hash) + TARGETSTORAGEUUIDS_FIELD_NUMBER; hash = (53 * hash) + getTargetStorageUuidsList().hashCode(); if (getTargetStorageTypesCount() > 0) { hash = (37 * hash) + TARGETSTORAGETYPES_FIELD_NUMBER; hash = (53 * hash) + getTargetStorageTypesList().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash;
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasAction()) { memoizedIsInitialized = 0; return false; } if (!hasBlockPoolId()) { memoizedIsInitialized = 0; return false; } for (int i = 0; i < getBlocksCount(); i++) { if (!getBlocks(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } for (int i = 0; i < getTargetsCount(); i++) { if (!getTargets(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }