You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/10/21 05:48:34 UTC

[GitHub] [hadoop] anoopsjohn commented on a change in pull request #2392: HADOOP-17308. WASB : PageBlobOutputStream succeeding flush even when …

anoopsjohn commented on a change in pull request #2392:
URL: https://github.com/apache/hadoop/pull/2392#discussion_r509004674



##########
File path: hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/ITestPageBlobOutputStream.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.fs.azure;
+
+import java.io.IOException;
+import java.util.EnumSet;
+
+import org.junit.Test;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.test.LambdaTestUtils;
+
+public class ITestPageBlobOutputStream extends AbstractWasbTestBase {
+
+  private static final Path TEST_FILE_PATH = new Path(
+      "TestPageBlobOutputStream.txt");
+
+  @Override
+  protected AzureBlobStorageTestAccount createTestAccount() throws Exception {
+    Configuration conf = new Configuration();
+    // Configure the page blob directories key so every file created is a page
+    // blob.
+    conf.set(AzureNativeFileSystemStore.KEY_PAGE_BLOB_DIRECTORIES, "/");
+    return AzureBlobStorageTestAccount.create("testpagebloboutputstream",
+        EnumSet.of(AzureBlobStorageTestAccount.CreateOptions.CreateContainer),
+        conf, true);
+  }
+
+  @Test
+  public void testHFlush() throws Exception {
+    Path path = this.fs.makeQualified(TEST_FILE_PATH);
+    FSDataOutputStream os = this.fs.create(path);

Review comment:
       Done. The close will call flush and after that doing checkStreamState() already..  So flush fail as part of close was already throwing IOE.  only the hsync/hflush had issue..  The test checks for close also now




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



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