Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CFFA317460 for ; Wed, 25 Feb 2015 17:14:33 +0000 (UTC) Received: (qmail 41487 invoked by uid 500); 25 Feb 2015 17:14:30 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 41417 invoked by uid 500); 25 Feb 2015 17:14:30 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 41408 invoked by uid 99); 25 Feb 2015 17:14:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2015 17:14:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 70678E08ED; Wed, 25 Feb 2015 17:14:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cnauroth@apache.org To: common-commits@hadoop.apache.org Date: Wed, 25 Feb 2015 17:14:30 -0000 Message-Id: <0b9838d4e5754a6b8d5d6ab41e84ef34@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] hadoop git commit: HADOOP-11629. WASB filesystem should not start BandwidthGaugeUpdater if fs.azure.skip.metrics set to true. Contributed by Shanyu Zhao. Repository: hadoop Updated Branches: refs/heads/branch-2 257087417 -> 1bc4c6808 refs/heads/trunk 1a68fc434 -> 5731c0e0d HADOOP-11629. WASB filesystem should not start BandwidthGaugeUpdater if fs.azure.skip.metrics set to true. Contributed by Shanyu Zhao. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5731c0e0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5731c0e0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5731c0e0 Branch: refs/heads/trunk Commit: 5731c0e0d08c3048fafdf62a14ca7611be4df5d7 Parents: 1a68fc4 Author: cnauroth Authored: Wed Feb 25 09:08:55 2015 -0800 Committer: cnauroth Committed: Wed Feb 25 09:08:55 2015 -0800 ---------------------------------------------------------------------- hadoop-common-project/hadoop-common/CHANGES.txt | 3 ++ .../fs/azure/AzureNativeFileSystemStore.java | 29 ++++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/5731c0e0/hadoop-common-project/hadoop-common/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 988eed0..0d452f7 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -1002,6 +1002,9 @@ Release 2.7.0 - UNRELEASED HADOOP-11480. Typo in hadoop-aws/index.md uses wrong scheme for test.fs.s3.name. (Ted Yu via aajisaka) + HADOOP-11629. WASB filesystem should not start BandwidthGaugeUpdater if + fs.azure.skip.metrics set to true. (Shanyu Zhao via cnauroth) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/5731c0e0/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.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 2412698..6bed8bb 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 @@ -387,9 +387,8 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore { if (null == instrumentation) { throw new IllegalArgumentException("Null instrumentation"); } - this.instrumentation = instrumentation; - this.bandwidthGaugeUpdater = new BandwidthGaugeUpdater(instrumentation); + if (null == this.storageInteractionLayer) { this.storageInteractionLayer = new StorageInterfaceImpl(); } @@ -405,7 +404,13 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore { // if (null == conf) { throw new IllegalArgumentException( - "Cannot initialize WASB file system, URI is null"); + "Cannot initialize WASB file system, conf is null"); + } + + if(!conf.getBoolean( + NativeAzureFileSystem.SKIP_AZURE_METRICS_PROPERTY_NAME, false)) { + //If not skip azure metrics, create bandwidthGaugeUpdater + this.bandwidthGaugeUpdater = new BandwidthGaugeUpdater(instrumentation); } // Incoming parameters validated. Capture the URI and the job configuration @@ -1782,11 +1787,14 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore { selfThrottlingWriteFactor); } - ResponseReceivedMetricUpdater.hook( - operationContext, - instrumentation, - bandwidthGaugeUpdater); - + if(bandwidthGaugeUpdater != null) { + //bandwidthGaugeUpdater is null when we config to skip azure metrics + ResponseReceivedMetricUpdater.hook( + operationContext, + instrumentation, + bandwidthGaugeUpdater); + } + // Bind operation context to receive send request callbacks on this operation. // If reads concurrent to OOB writes are allowed, the interception will reset // the conditional header on all Azure blob storage read requests. @@ -2561,7 +2569,10 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore { @Override public void close() { - bandwidthGaugeUpdater.close(); + if(bandwidthGaugeUpdater != null) { + bandwidthGaugeUpdater.close(); + bandwidthGaugeUpdater = null; + } } // Finalizer to ensure complete shutdown