hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From java8964 <java8...@hotmail.com>
Subject RE: is the HDFS BlockReceiver.PacketResponder source code wrong ?
Date Tue, 23 Sep 2014 13:41:32 GMT
Why do you say so? Does it cause a bug in your case? If so, can you explain the problem you
are facing?
Yong

From: qixiangming@hotmail.com
To: user@hadoop.apache.org
Subject: is the HDFS BlockReceiver.PacketResponder  source code wrong ?
Date: Tue, 23 Sep 2014 07:37:41 +0000




In org.apache.hadoop.hdfs.server.datanode.BlockReceiver class, defined a inner class PacketResponder.
 
in the the contructor of PacketResponder
 
    PacketResponder(final DataOutputStream upstreamOut,
        final DataInputStream downstreamIn,
        final DatanodeInfo[] downstreams) {
      this.downstreamIn = downstreamIn;
      this.upstreamOut = upstreamOut;
      this.type = downstreams == null? PacketResponderType.NON_PIPELINE
          : downstreams.length == 0? PacketResponderType.LAST_IN_PIPELINE
              : PacketResponderType.HAS_DOWNSTREAM_IN_PIPELINE;
      final StringBuilder b = new StringBuilder(getClass().getSimpleName())
          .append(": ").append(block).append(", type=").append(type);
      if (type != PacketResponderType.HAS_DOWNSTREAM_IN_PIPELINE) {
        b.append(", downstreams=").append(downstreams.length)
            .append(":").append(Arrays.asList(downstreams));
      }
      this.myString = b.toString();
    }

has there mistakes ? 
 
 if (type != PacketResponderType.HAS_DOWNSTREAM_IN_PIPELINE) {
        b.append(", downstreams=").append(downstreams.length)
            .append(":").append(Arrays.asList(downstreams));
      }
 
the if criteria shoud be ==, not !=
 
 
 		 	   		   		 	   		  
Mime
View raw message