mehakmeet commented on a change in pull request #1881: HADOOP-16910 Adding file 
system counters in ABFS
URL: https://github.com/apache/hadoop/pull/1881#discussion_r390494255
 
 

 ##########
 File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java
 ##########
 @@ -59,6 +62,59 @@ public void testEnsureFileCreatedImmediately() throws 
Exception {
     assertIsFile(fs, TEST_FILE_PATH);
   }
 
+  /**
+   * {@link AbfsOutputStream#incrementWriteOps()}
+   *
+   * @throws Exception
+   */
+  @Test
+  public void testWriteOpsMetric() throws Exception {
+    describe("Test to see correct population of write operations in Abfs");
+    final AzureBlobFileSystem fs = getFileSystem();
+    Path smallFile = new Path("testOneCall");
+    Path largeFile = new Path("testLargeCalls");
+    String testWriteOps = "test";
+    FileSystem.Statistics statistics = fs.getFsStatistics();
+    statistics.reset();
+
+    //Test for zero write operation
+    Assert.assertEquals(0, statistics.getWriteOps());
+
+    FSDataOutputStream outForOneCall = fs.create(smallFile);
+    statistics.reset();
+    //Writing "test" 1 time
+    outForOneCall
+        .write(testWriteOps.getBytes(), 0, testWriteOps.getBytes().length);
+
+    //Test for one write operation
+    Assert.assertEquals(1, statistics.getWriteOps());
 
 Review comment:
   Noted.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to