hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject hadoop git commit: HADOOP-11492. Bump up curator version to 2.7.1. (Arun Suresh and Karthik Kambatla via kasha) (cherry picked from commit 55235d28c3641ff5f1c05c53dd7271cafc131926)
Date Wed, 04 Feb 2015 22:00:53 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 c330bca83 -> fcf3dc597


HADOOP-11492. Bump up curator version to 2.7.1. (Arun Suresh and Karthik Kambatla via kasha)
(cherry picked from commit 55235d28c3641ff5f1c05c53dd7271cafc131926)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/fcf3dc59
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/fcf3dc59
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/fcf3dc59

Branch: refs/heads/branch-2
Commit: fcf3dc597731a9fcb54e3c9ff2c7ede40917e473
Parents: c330bca
Author: Karthik Kambatla <kasha@apache.org>
Authored: Wed Feb 4 13:05:11 2015 -0800
Committer: Karthik Kambatla <kasha@apache.org>
Committed: Wed Feb 4 14:00:44 2015 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt |  3 +++
 .../ZKDelegationTokenSecretManager.java         | 26 +++++++++++++-------
 hadoop-project/pom.xml                          |  9 ++++---
 3 files changed, 25 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/fcf3dc59/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 3168a81..3f6adce 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -172,6 +172,9 @@ Release 2.7.0 - UNRELEASED
     HADOOP-11544. Remove unused configuration keys for tracing. (Masatake
     Iwasaki via aajisaka)
 
+    HADOOP-11492. Bump up curator version to 2.7.1. (Arun Suresh and
+    Karthik Kambatla via kasha)
+
   OPTIMIZATIONS
 
     HADOOP-11323. WritableComparator#compare keeps reference to byte array.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fcf3dc59/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java
index d6bc995..ec522dcf 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java
@@ -45,6 +45,7 @@ import org.apache.curator.framework.recipes.cache.PathChildrenCache.StartMode;
 import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
 import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
 import org.apache.curator.framework.recipes.shared.SharedCount;
+import org.apache.curator.framework.recipes.shared.VersionedValue;
 import org.apache.curator.retry.RetryNTimes;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceAudience.Private;
@@ -58,7 +59,6 @@ import org.apache.zookeeper.ZooDefs.Perms;
 import org.apache.zookeeper.client.ZooKeeperSaslClient;
 import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Id;
-import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -109,10 +109,10 @@ public abstract class ZKDelegationTokenSecretManager<TokenIdent extends
Abstract
       "ZKDelegationTokenSecretManagerClient";
 
   private static final String ZK_DTSM_NAMESPACE = "ZKDTSMRoot";
-  private static final String ZK_DTSM_SEQNUM_ROOT = "ZKDTSMSeqNumRoot";
-  private static final String ZK_DTSM_KEYID_ROOT = "ZKDTSMKeyIdRoot";
-  private static final String ZK_DTSM_TOKENS_ROOT = "ZKDTSMTokensRoot";
-  private static final String ZK_DTSM_MASTER_KEY_ROOT = "ZKDTSMMasterKeyRoot";
+  private static final String ZK_DTSM_SEQNUM_ROOT = "/ZKDTSMSeqNumRoot";
+  private static final String ZK_DTSM_KEYID_ROOT = "/ZKDTSMKeyIdRoot";
+  private static final String ZK_DTSM_TOKENS_ROOT = "/ZKDTSMTokensRoot";
+  private static final String ZK_DTSM_MASTER_KEY_ROOT = "/ZKDTSMMasterKeyRoot";
 
   private static final String DELEGATION_KEY_PREFIX = "DK_";
   private static final String DELEGATION_TOKEN_PREFIX = "DT_";
@@ -505,11 +505,20 @@ public abstract class ZKDelegationTokenSecretManager<TokenIdent extends
Abstract
     return delTokSeqCounter.getCount();
   }
 
+  private void incrSharedCount(SharedCount sharedCount) throws Exception {
+    while (true) {
+      // Loop until we successfully increment the counter
+      VersionedValue<Integer> versionedValue = sharedCount.getVersionedValue();
+      if (sharedCount.trySetCount(versionedValue, versionedValue.getValue() + 1)) {
+        break;
+      }
+    }
+  }
+
   @Override
   protected int incrementDelegationTokenSeqNum() {
     try {
-      while (!delTokSeqCounter.trySetCount(delTokSeqCounter.getCount() + 1)) {
-      }
+      incrSharedCount(delTokSeqCounter);
     } catch (InterruptedException e) {
       // The ExpirationThread is just finishing.. so dont do anything..
       LOG.debug("Thread interrupted while performing token counter increment", e);
@@ -537,8 +546,7 @@ public abstract class ZKDelegationTokenSecretManager<TokenIdent extends
Abstract
   @Override
   protected int incrementCurrentKeyId() {
     try {
-      while (!keyIdSeqCounter.trySetCount(keyIdSeqCounter.getCount() + 1)) {
-      }
+      incrSharedCount(keyIdSeqCounter);
     } catch (InterruptedException e) {
       // The ExpirationThread is just finishing.. so dont do anything..
       LOG.debug("Thread interrupted while performing keyId increment", e);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fcf3dc59/hadoop-project/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml
index b898233..569b292 100644
--- a/hadoop-project/pom.xml
+++ b/hadoop-project/pom.xml
@@ -71,6 +71,7 @@
     <protoc.path>${env.HADOOP_PROTOC_PATH}</protoc.path>
 
     <zookeeper.version>3.4.6</zookeeper.version>
+    <curator.version>2.7.1</curator.version>
     <findbugs.version>3.0.0</findbugs.version>
 
     <tomcat.version>6.0.41</tomcat.version>
@@ -920,22 +921,22 @@
      <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-recipes</artifactId>
-       <version>2.6.0</version>
+       <version>${curator.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-client</artifactId>
-       <version>2.6.0</version>
+       <version>${curator.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-framework</artifactId>
-       <version>2.6.0</version>
+       <version>${curator.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-test</artifactId>
-       <version>2.6.0</version>
+       <version>${curator.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>


Mime
View raw message