You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by QiXiangming <qi...@hotmail.com> on 2014/09/23 09:37:41 UTC

is the HDFS BlockReceiver.PacketResponder source code wrong ?

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 !=
 
 
 		 	   		  

RE: is the HDFS BlockReceiver.PacketResponder source code wrong ?

Posted by java8964 <ja...@hotmail.com>.
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 !=
 
 
 		 	   		   		 	   		  

RE: is the HDFS BlockReceiver.PacketResponder source code wrong ?

Posted by java8964 <ja...@hotmail.com>.
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 !=
 
 
 		 	   		   		 	   		  

RE: is the HDFS BlockReceiver.PacketResponder source code wrong ?

Posted by java8964 <ja...@hotmail.com>.
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 !=
 
 
 		 	   		   		 	   		  

RE: is the HDFS BlockReceiver.PacketResponder source code wrong ?

Posted by java8964 <ja...@hotmail.com>.
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 !=