hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hadoop] steveloughran commented on a change in pull request #1899: HADOOP-16914 Adding Output Stream Counters in ABFS
Date Fri, 20 Mar 2020 16:35:39 GMT
steveloughran commented on a change in pull request #1899: HADOOP-16914 Adding Output Stream
Counters in ABFS
URL: https://github.com/apache/hadoop/pull/1899#discussion_r395746252
 
 

 ##########
 File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsOutputStreamStatisticsImpl.java
 ##########
 @@ -0,0 +1,102 @@
+package org.apache.hadoop.fs.azurebfs.services;
+
+/**
+ * OutputStream Statistics Implementation for Abfs.
+ * timeSpendOnTaskWait - Time spend on waiting for tasks to be complete on
+ * Blocking Queue in AbfsOutputStream.
+ *
+ * queueShrink - Number of times Blocking Queue was shrunk after writing
+ * data.
+ *
+ * WriteCurrentBufferOperations - Number of times
+ * {@codes writeCurrentBufferToService()} calls were made.
+ */
+public class AbfsOutputStreamStatisticsImpl
+    implements AbfsOutputStreamStatistics {
+  public volatile long bytesToUpload;
+  public volatile long bytesUploadSuccessful;
+  public volatile long bytesUploadFailed;
+  public volatile long timeSpendOnTaskWait;
+  public volatile long queueShrink;
+  public volatile long writeCurrentBufferOperations;
+
+  /**
+   * Number of bytes uploaded only when bytes passed are positive.
+   *
+   * @param bytes negative values are ignored
+   */
+  @Override
+  public void bytesToUpload(long bytes) {
+    if (bytes > 0) {
+      bytesToUpload += bytes;
+    }
+  }
+
+  @Override
+  public void bytesUploadedSuccessfully(long bytes) {
+    if (bytes > 0) {
+      bytesUploadSuccessful += bytes;
+    }
+  }
+
+  /**
+   * Number of bytes that weren't uploaded.
+   *
+   * @param bytes negative values are ignored
+   */
+  @Override
+  public void bytesFailed(long bytes) {
+    if (bytes > 0) {
+      bytesUploadFailed += bytes;
+    }
+  }
+
+  /**
+   * Time spend for waiting a task to be completed.
+   *
+   * @param startTime on calling {@link AbfsOutputStream#waitForTaskToComplete()}
+   * @param endTime   on method completing
+   */
+  @Override
+  public void timeSpendTaskWait(long startTime, long endTime) {
+    timeSpendOnTaskWait += endTime - startTime;
+  }
+
+  /**
+   * Number of calls to {@link AbfsOutputStream#shrinkWriteOperationQueue()}.
 
 Review comment:
   see above comment about javadocs

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message