HDFS-4044. Duplicate ChecksumType definition in HDFS .proto files. Contributed by Binglin Chang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1397580 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2012-10-12 14:32:16 +00:00
parent 62c70a228f
commit 89b66da42c
3 changed files with 6 additions and 8 deletions

View File

@ -431,6 +431,9 @@ Release 2.0.3-alpha - Unreleased
HDFS-4021. Misleading error message when resources are low on the NameNode. HDFS-4021. Misleading error message when resources are low on the NameNode.
(Christopher Conner via atm) (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 Release 2.0.2-alpha - 2012-09-07
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -24,9 +24,9 @@ import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
import org.apache.hadoop.hdfs.protocol.HdfsProtoUtil; import org.apache.hadoop.hdfs.protocol.HdfsProtoUtil;
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.BaseHeaderProto; 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;
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.ClientOperationHeaderProto;
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpWriteBlockProto; 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.hdfs.security.token.block.BlockTokenIdentifier;
import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.Token;
import org.apache.hadoop.util.DataChecksum; import org.apache.hadoop.util.DataChecksum;
@ -52,7 +52,7 @@ public abstract class DataTransferProtoUtil {
} }
public static ChecksumProto toProto(DataChecksum checksum) { public static ChecksumProto toProto(DataChecksum checksum) {
ChecksumType type = ChecksumType.valueOf(checksum.getChecksumType().name()); ChecksumTypeProto type = ChecksumTypeProto.valueOf(checksum.getChecksumType().name());
if (type == null) { if (type == null) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Can't convert checksum to protobuf: " + checksum); "Can't convert checksum to protobuf: " + checksum);

View File

@ -54,12 +54,7 @@ message OpReadBlockProto {
message ChecksumProto { message ChecksumProto {
enum ChecksumType { required ChecksumTypeProto type = 1;
NULL = 0;
CRC32 = 1;
CRC32C = 2;
}
required ChecksumType type = 1;
required uint32 bytesPerChecksum = 2; required uint32 bytesPerChecksum = 2;
} }