From 7e031c2c18b8812ec9f843ed3b4abe9e6d12bb28 Mon Sep 17 00:00:00 2001 From: Mingliang Liu Date: Tue, 27 Jun 2017 17:32:07 -0700 Subject: [PATCH] HADOOP-14546. Azure: Concurrent I/O does not work when secure.mode is enabled. Contributed by Thomas --- .../fs/azure/AzureNativeFileSystemStore.java | 4 +- .../hadoop/fs/azure/SendRequestIntercept.java | 91 ++----------------- .../fs/azure/AzureBlobStorageTestAccount.java | 7 ++ .../azure/TestAzureConcurrentOutOfBandIo.java | 4 +- ...reConcurrentOutOfBandIoWithSecureMode.java | 50 ++++++++++ 5 files changed, 69 insertions(+), 87 deletions(-) create mode 100644 hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestAzureConcurrentOutOfBandIoWithSecureMode.java diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java index 3fa1a62512..d0262208cb 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java @@ -852,7 +852,6 @@ private void connectToAzureStorageInSecureMode(String accountName, rootDirectory = container.getDirectoryReference(""); canCreateOrModifyContainer = true; - tolerateOobAppends = false; } /** @@ -1911,8 +1910,7 @@ private OperationContext getInstrumentedContext(boolean bindConcurrentOOBIo) { // If reads concurrent to OOB writes are allowed, the interception will reset // the conditional header on all Azure blob storage read requests. if (bindConcurrentOOBIo) { - SendRequestIntercept.bind(storageInteractionLayer.getCredentials(), - operationContext, true); + SendRequestIntercept.bind(operationContext); } if (testHookOperationContext != null) { diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/SendRequestIntercept.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/SendRequestIntercept.java index 25c9eb42ea..924ecd30b3 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/SendRequestIntercept.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/SendRequestIntercept.java @@ -35,7 +35,7 @@ /** * Manages the lifetime of binding on the operation contexts to intercept send - * request events to Azure storage. + * request events to Azure storage and allow concurrent OOB I/Os. */ @InterfaceAudience.Private public final class SendRequestIntercept extends StorageEvent { @@ -43,70 +43,22 @@ public final class SendRequestIntercept extends StorageEvent