diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 3d11b712f9..eeca11981f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -533,6 +533,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. 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 d6bc99535a..ec522dcff8 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.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.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 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 @@ protected int getCurrentKeyId() { @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); diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index 5a16423c37..0c7cfc864d 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -71,6 +71,7 @@ ${env.HADOOP_PROTOC_PATH} 3.4.6 + 2.7.1 3.0.0 6.0.41 @@ -916,22 +917,22 @@ org.apache.curator curator-recipes - 2.6.0 + ${curator.version} org.apache.curator curator-client - 2.6.0 + ${curator.version} org.apache.curator curator-framework - 2.6.0 + ${curator.version} org.apache.curator curator-test - 2.6.0 + ${curator.version} org.bouncycastle