Skip to content

Commit

Permalink
HADOOP-10611. KMS, keyVersion name should not be assumed to be keyNam…
Browse files Browse the repository at this point in the history
…e@versionNumber. (tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1598775 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Alejandro Abdelnur committed May 30, 2014
1 parent 05d8586 commit 12cf175
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
3 changes: 3 additions & 0 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ Trunk (Unreleased)

HADOOP-10645. TestKMS fails because race condition writing acl files. (tucu)

HADOOP-10611. KMS, keyVersion name should not be assumed to be
keyName@versionNumber. (tucu)

OPTIMIZATIONS

HADOOP-7761. Improve the performance of raw comparisons. (todd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,4 @@ public void flush() throws IOException {
// the server should not keep in memory state on behalf of clients either.
}

@VisibleForTesting
public static String buildVersionName(String name, int version) {
return KeyProvider.buildVersionName(name, version);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,11 @@ public KeyVersion createKey(String name,

@Override
public void deleteKey(String name) throws IOException {
Metadata metadata = provider.getMetadata(name);
List<String> versions = new ArrayList<String>(metadata.getVersions());
for (int i = 0; i < metadata.getVersions(); i++) {
versions.add(KeyProvider.buildVersionName(name, i));
}
provider.deleteKey(name);
currentKeyCache.invalidate(name);
keyVersionCache.invalidateAll(versions);
// invalidating all key versions as we don't know which ones belonged to the
// deleted key
keyVersionCache.invalidateAll();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,9 @@ public Void run() throws Exception {
Assert.fail(ex.toString());
}
try {
kp.getKeyVersion(KMSClientProvider.buildVersionName("k", 0));
// we are using JavaKeyStoreProvider for testing, so we know how
// the keyversion is created.
kp.getKeyVersion("k@0");
Assert.fail();
} catch (AuthorizationException ex) {
//NOP
Expand Down

0 comments on commit 12cf175

Please sign in to comment.