[ 
https://issues.apache.org/jira/browse/HDFS-12861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249676#comment-17249676
 ] 

huhaiyang commented on HDFS-12861:
----------------------------------

 
{code:java}
// code placeholder
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/PipelineAck.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/PipelineAck.java
index be822d664f8..ea216bc04e3 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/PipelineAck.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/PipelineAck.java
@@ -165,6 +165,19 @@ public long getDownstreamAckTimeNanos() {
     return proto.getDownstreamAckTimeNanos();
   }
 
+  /**
+   * Get packet processing time of datanode at the given index in the pipeline.
+   * @param i - datanode index in the pipeline
+   */
+  public long getPacketProcessingTime(int i) {
+    if (proto.getPacketProcessingTimeNanosCount() > i) {
+      return proto.getPacketProcessingTimeNanos(i);
+    } else {
+      // Return -1 if datanode at this index didn't send this info
+      return -1;
+    }
+  }
+  
   /**
    * Check if this ack contains error status
    * @return true if all statuses are SUCCESS
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto
index 2356201f04d..dfededb7619 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto
@@ -260,6 +260,7 @@ message PipelineAckProto {
   repeated Status reply = 2;
   optional uint64 downstreamAckTimeNanos = 3 [default = 0];
   repeated uint32 flag = 4 [packed=true];
+  repeated uint64 packetProcessingTimeNanos = 100;
 }
{code}
hi [~elgoiri]  Consult, I found that there is no set packetProcessingTimeNanos 
value method found in the current patch?
Looking forward to your reply, Thanks!

 

> Track speed in DFSClient
> ------------------------
>
>                 Key: HDFS-12861
>                 URL: https://issues.apache.org/jira/browse/HDFS-12861
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Íñigo Goiri
>            Assignee: María Fernanda Borge
>            Priority: Major
>         Attachments: HDFS-12861-10-april-18.patch
>
>
> Sometimes we get slow jobs because of the access to HDFS. However, is hard to 
> tell what is the actual speed. We propose to add a log line with something 
> like:
> {code}
> 2017-11-19 09:55:26,309 INFO [main] hdfs.DFSClient: blk_1107222019_38144502 
> READ 129500B in 7ms 17.6MB/s
> 2017-11-27 19:01:04,141 INFO [DataStreamer for file 
> /hdfs-federation/stats/2017/11/27/1511838000000.json] hdfs.DFSClient: 
> blk_1135792057_86833357 WRITE 131072B in 10ms 12.5MB/s
> 2017-11-27 19:01:14,219 INFO [DataStreamer for file 
> /hdfs-federation/stats/2017/11/27/1511838000000.json] hdfs.DFSClient: 
> blk_1135792069_86833369 WRITE 131072B in 12ms 10.4MB/s
> 2017-11-27 19:01:24,282 INFO [DataStreamer for file 
> /hdfs-federation/stats/2017/11/27/1511838000000.json] hdfs.DFSClient: 
> blk_1135792081_86833381 WRITE 131072B in 11ms 11.4MB/s
> 2017-11-27 19:01:34,330 INFO [DataStreamer for file 
> /hdfs-federation/stats/2017/11/27/1511838000000.json] hdfs.DFSClient: 
> blk_1135792093_86833393 WRITE 131072B in 11ms 11.4MB/s
> 2017-11-27 19:01:44,408 INFO [DataStreamer for file 
> /hdfs-federation/stats/2017/11/27/1511838000000.json] hdfs.DFSClient: 
> blk_1135792105_86833405 WRITE 131072B in 11ms 11.4MB/s
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to