You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2014/01/30 22:57:18 UTC
[3/9] git commit: Revert "ACCUMULO-2086 Use the tableID instead of
the tableName where necessary."
Revert "ACCUMULO-2086 Use the tableID instead of the tableName where necessary."
This reverts commit e8c9aae904380f22e55a31e3a7422ecd4597b0b0.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ca6c82bb
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ca6c82bb
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ca6c82bb
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: ca6c82bbd02f18aaa9281aa12d8033e1475c441c
Parents: 12aa01e
Author: John Vines <vi...@apache.org>
Authored: Thu Jan 30 11:29:28 2014 -0500
Committer: John Vines <vi...@apache.org>
Committed: Thu Jan 30 11:29:28 2014 -0500
----------------------------------------------------------------------
.../test/randomwalk/security/TableOp.java | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/ca6c82bb/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
index 0215365..a636355 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
@@ -64,18 +64,12 @@ public class TableOp extends Test {
tp = TablePermission.valueOf(action);
}
- final boolean tableExists = WalkingSecurity.get(state).getTableExists();
- final String tableName = WalkingSecurity.get(state).getTableName();
- final String tableId = conn.tableOperations().tableIdMap().get(tableName);
-
- if (null == tableId) {
- log.error("Could not determine tableID from name " + tableName);
- return;
- }
+ boolean tableExists = WalkingSecurity.get(state).getTableExists();
+ String tableName = WalkingSecurity.get(state).getTableName();
switch (tp) {
case READ: {
- boolean canRead = WalkingSecurity.get(state).canScan(WalkingSecurity.get(state).getTabCredentials(), tableId);
+ boolean canRead = WalkingSecurity.get(state).canScan(WalkingSecurity.get(state).getTabCredentials(), tableName);
Authorizations auths = WalkingSecurity.get(state).getUserAuthorizations(WalkingSecurity.get(state).getTabCredentials());
boolean ambiguousZone = WalkingSecurity.get(state).inAmbiguousZone(conn.whoami(), tp);
boolean ambiguousAuths = WalkingSecurity.get(state).ambiguousAuthorizations(conn.whoami());
@@ -146,7 +140,7 @@ public class TableOp extends Test {
break;
}
case WRITE:
- boolean canWrite = WalkingSecurity.get(state).canWrite(WalkingSecurity.get(state).getTabCredentials(), tableId);
+ boolean canWrite = WalkingSecurity.get(state).canWrite(WalkingSecurity.get(state).getTabCredentials(), tableName);
boolean ambiguousZone = WalkingSecurity.get(state).inAmbiguousZone(conn.whoami(), tp);
String key = WalkingSecurity.get(state).getLastKey() + "1";
@@ -220,7 +214,7 @@ public class TableOp extends Test {
return;
} catch (AccumuloSecurityException ae) {
if (ae.getSecurityErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
- if (WalkingSecurity.get(state).canBulkImport(WalkingSecurity.get(state).getTabCredentials(), tableId))
+ if (WalkingSecurity.get(state).canBulkImport(WalkingSecurity.get(state).getTabCredentials(), tableName))
throw new AccumuloException("Bulk Import failed when it should have worked: " + tableName);
return;
} else if (ae.getSecurityErrorCode().equals(SecurityErrorCode.BAD_CREDENTIALS)) {
@@ -234,12 +228,12 @@ public class TableOp extends Test {
fs.delete(dir, true);
fs.delete(fail, true);
- if (!WalkingSecurity.get(state).canBulkImport(WalkingSecurity.get(state).getTabCredentials(), tableId))
+ if (!WalkingSecurity.get(state).canBulkImport(WalkingSecurity.get(state).getTabCredentials(), tableName))
throw new AccumuloException("Bulk Import succeeded when it should have failed: " + dir + " table " + tableName);
break;
case ALTER_TABLE:
AlterTable.renameTable(conn, state, tableName, tableName + "plus",
- WalkingSecurity.get(state).canAlterTable(WalkingSecurity.get(state).getTabCredentials(), tableId), tableExists);
+ WalkingSecurity.get(state).canAlterTable(WalkingSecurity.get(state).getTabCredentials(), tableName), tableExists);
break;
case GRANT: