bgaborg commented on a change in pull request #575: HADOOP-13327 Output Stream 
Specification
URL: https://github.com/apache/hadoop/pull/575#discussion_r264285862
 
 

 ##########
 File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractCreateTest.java
 ##########
 @@ -332,4 +336,78 @@ public void testCreateMakesParentDirs() throws Throwable {
     assertTrue("Grandparent directory does not appear to be a directory",
         fs.getFileStatus(grandparent).isDirectory());
   }
+
+  @Test
+  public void testHSync() throws Throwable {
+    describe("test declared and actual Syncable behaviors");
+    Path path = methodPath();
+    FileSystem fs = getFileSystem();
+    boolean supportsFlush = isSupported(SUPPORTS_HFLUSH);
+    boolean supportsSync = isSupported(SUPPORTS_HSYNC);
+
+    try (FSDataOutputStream out = fs.create(path, true)) {
+
+      boolean doesHFlush = out.hasCapability(
+          StreamCapabilities.StreamCapability.HFLUSH.getValue());
+      if (doesHFlush) {
+        out.hflush();
+      }
+      assertEquals("hflush support", supportsFlush, doesHFlush);
+      boolean doesHSync = out.hasCapability(
+          StreamCapabilities.StreamCapability.HSYNC.getValue());
+      assertEquals("HFlush support", supportsSync, doesHSync);
 
 Review comment:
   > "HFlush support"
   
   This is hsync support, not hflush

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