From 5f571ab8694200bf028b699bcaac1e57a17e7ba4 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Fri, 12 Oct 2012 14:34:42 +0000 Subject: [PATCH] HDFS-4044. Merging change 1397580 from trunk. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1397584 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hdfs/protocol/datatransfer/DataTransferProtoUtil.java | 4 ++-- .../hadoop-hdfs/src/main/proto/datatransfer.proto | 7 +------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index dbf4c9d425c..3e98ae3cb19 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -97,6 +97,9 @@ Release 2.0.3-alpha - Unreleased HDFS-4021. Misleading error message when resources are low on the NameNode. (Christopher Conner via atm) + HDFS-4044. Duplicate ChecksumType definition in HDFS .proto files. + (Binglin Chang via suresh) + Release 2.0.2-alpha - 2012-09-07 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/DataTransferProtoUtil.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/DataTransferProtoUtil.java index 0a4d20fa958..dd9beb535bc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/DataTransferProtoUtil.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/DataTransferProtoUtil.java @@ -24,9 +24,9 @@ import org.apache.hadoop.hdfs.protocol.ExtendedBlock; import org.apache.hadoop.hdfs.protocol.HdfsProtoUtil; import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.BaseHeaderProto; import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ChecksumProto; -import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ChecksumProto.ChecksumType; import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ClientOperationHeaderProto; import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpWriteBlockProto; +import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.ChecksumTypeProto; import org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.util.DataChecksum; @@ -52,7 +52,7 @@ public abstract class DataTransferProtoUtil { } public static ChecksumProto toProto(DataChecksum checksum) { - ChecksumType type = ChecksumType.valueOf(checksum.getChecksumType().name()); + ChecksumTypeProto type = ChecksumTypeProto.valueOf(checksum.getChecksumType().name()); if (type == null) { throw new IllegalArgumentException( "Can't convert checksum to protobuf: " + checksum); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/datatransfer.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/datatransfer.proto index e02451a9aab..3ccad5efbe1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/datatransfer.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/datatransfer.proto @@ -54,12 +54,7 @@ message OpReadBlockProto { message ChecksumProto { - enum ChecksumType { - NULL = 0; - CRC32 = 1; - CRC32C = 2; - } - required ChecksumType type = 1; + required ChecksumTypeProto type = 1; required uint32 bytesPerChecksum = 2; }