You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2016/06/22 18:32:02 UTC
[1/7] accumulo git commit: ACCUMULO-4348 Deprecate KerberosToken
constructor with side effects
Repository: accumulo
Updated Branches:
refs/heads/1.8 782135bfe -> 5ba1c88de
refs/heads/master 8c2ecf823 -> e3bd30eda
ACCUMULO-4348 Deprecate KerberosToken constructor with side effects
`KerberosToken(String, File, boolean)` is deprecated in favor of `KerberosToken(String, File)`.
The boolean flag would log in the requested user with Hadoop's `UserGroupInformation` class. This
changed global state about who the active user was. In a multi-user environment, this potentially
made little sense as other users could overwrite eachother.
This patch includes a convenience constructor that doesn't have any side effects, but has the same
semantics as logging in a user with a keytab.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/1ddc7257
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/1ddc7257
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/1ddc7257
Branch: refs/heads/1.8
Commit: 1ddc7257073f18a3ddeeee9e00955e230f285b5d
Parents: f45a65c
Author: Bill Slacum <bi...@minerkasch.com>
Authored: Tue Jun 21 15:26:07 2016 -0400
Committer: Bill Slacum <bi...@minerkasch.com>
Committed: Tue Jun 21 15:47:13 2016 -0400
----------------------------------------------------------------------
.../core/client/security/tokens/KerberosToken.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/1ddc7257/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
index 284a838..1a4869d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
@@ -59,6 +59,20 @@ public class KerberosToken implements AuthenticationToken {
}
/**
+ * Creates a Kerberos token for the specified principal using the provided keytab. The principal and keytab combination are verified by attempting a log in.
+ * <p>
+ * This constructor does not have any side effects.
+ *
+ * @param principal
+ * The Kerberos principal
+ * @param keytab
+ * A keytab file containing the principal's credentials.
+ */
+ public KerberosToken(String principal, File keytab) throws IOException {
+ this(principal, keytab, false);
+ }
+
+ /**
* Creates a token and logs in via {@link UserGroupInformation} using the provided principal and keytab. A key for the principal must exist in the keytab,
* otherwise login will fail.
*
@@ -68,7 +82,9 @@ public class KerberosToken implements AuthenticationToken {
* A keytab file
* @param replaceCurrentUser
* Should the current Hadoop user be replaced with this user
+ * @deprecated since 1.8.0, @see #KerberosToken(String, File)
*/
+ @Deprecated
public KerberosToken(String principal, File keytab, boolean replaceCurrentUser) throws IOException {
requireNonNull(principal, "Principal was null");
requireNonNull(keytab, "Keytab was null");
[5/7] accumulo git commit: ACCUMULO-4348 Limit use of deprecated
method
Posted by ct...@apache.org.
ACCUMULO-4348 Limit use of deprecated method
Move off the deprecated KerberosToken constructor where possible, and
suppress warnings where not immediately possible.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5ba1c88d
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5ba1c88d
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5ba1c88d
Branch: refs/heads/master
Commit: 5ba1c88de0bd99c66ddf21b7ba0085692d25422b
Parents: dbfef0a
Author: Christopher Tubbs <ct...@apache.org>
Authored: Wed Jun 22 14:19:55 2016 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Jun 22 14:19:55 2016 -0400
----------------------------------------------------------------------
.../main/java/org/apache/accumulo/cluster/ClusterUser.java | 4 +++-
.../accumulo/tserver/replication/AccumuloReplicaSystem.java | 2 +-
.../org/apache/accumulo/harness/AccumuloClusterHarness.java | 4 +++-
.../org/apache/accumulo/harness/SharedMiniClusterBase.java | 8 ++++++--
.../harness/conf/AccumuloMiniClusterConfiguration.java | 4 +++-
.../harness/conf/StandaloneAccumuloClusterConfiguration.java | 4 +++-
.../org/apache/accumulo/test/randomwalk/Environment.java | 4 +++-
7 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java b/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java
index 6644d44..e99ca0b 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java
@@ -81,7 +81,9 @@ public class ClusterUser {
if (null != password) {
return new PasswordToken(password);
} else if (null != keytab) {
- return new KerberosToken(principal, keytab, true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(principal, keytab, true);
+ return krbToken;
}
throw new IllegalStateException("One of password and keytab must be non-null");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
index 0bd467c..589f07f 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
@@ -193,7 +193,7 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
KerberosToken token;
try {
// Do *not* replace the current user
- token = new KerberosToken(principal, keytab, false);
+ token = new KerberosToken(principal, keytab);
} catch (IOException e) {
log.error("Failed to create KerberosToken", e);
return status;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
index ba95f2b..7483184 100644
--- a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
+++ b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
@@ -170,7 +170,9 @@ public abstract class AccumuloClusterHarness extends AccumuloITBase implements M
UserGroupInformation.loginUserFromKeytab(systemUser.getPrincipal(), systemUser.getKeytab().getAbsolutePath());
// Open a connector as the system user (ensures the user will exist for us to assign permissions to)
- Connector conn = cluster.getConnector(systemUser.getPrincipal(), new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true));
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true);
+ Connector conn = cluster.getConnector(systemUser.getPrincipal(), krbToken);
// Then, log back in as the "root" user and do the grant
UserGroupInformation.loginUserFromKeytab(rootUser.getPrincipal(), rootUser.getKeytab().getAbsolutePath());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java b/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
index 79340f2..5b90597 100644
--- a/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
+++ b/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
@@ -75,7 +75,9 @@ public abstract class SharedMiniClusterBase extends AccumuloITBase implements Cl
ClusterUser rootUser = krb.getRootUser();
// Get the krb token
principal = rootUser.getPrincipal();
- token = new KerberosToken(principal, rootUser.getKeytab(), true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(principal, rootUser.getKeytab(), true);
+ token = krbToken;
} else {
rootPassword = "rootPasswordShared1";
token = new PasswordToken(rootPassword);
@@ -89,7 +91,9 @@ public abstract class SharedMiniClusterBase extends AccumuloITBase implements Cl
final ClusterUser systemUser = krb.getAccumuloServerUser(), rootUser = krb.getRootUser();
// Login as the trace user
// Open a connector as the system user (ensures the user will exist for us to assign permissions to)
- Connector conn = cluster.getConnector(systemUser.getPrincipal(), new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true));
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true);
+ Connector conn = cluster.getConnector(systemUser.getPrincipal(), krbToken);
// Then, log back in as the "root" user and do the grant
UserGroupInformation.loginUserFromKeytab(rootUser.getPrincipal(), rootUser.getKeytab().getAbsolutePath());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java b/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
index 0a43621..63f90ea 100644
--- a/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
+++ b/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
@@ -86,7 +86,9 @@ public class AccumuloMiniClusterConfiguration extends AccumuloClusterPropertyCon
ClusterUser rootUser = AccumuloClusterHarness.getKdc().getRootUser();
try {
- return new KerberosToken(rootUser.getPrincipal(), rootUser.getKeytab(), true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(rootUser.getPrincipal(), rootUser.getKeytab(), true);
+ return krbToken;
} catch (IOException e) {
throw new RuntimeException(e);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java b/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
index ba9dcef..e72d965 100644
--- a/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
+++ b/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
@@ -162,7 +162,9 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
if (clientConf.getBoolean(ClientProperty.INSTANCE_RPC_SASL_ENABLED.getKey(), false)) {
File keytab = getAdminKeytab();
try {
- return new KerberosToken(getAdminPrincipal(), keytab, true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(getAdminPrincipal(), keytab, true);
+ return krbToken;
} catch (IOException e) {
// The user isn't logged in
throw new RuntimeException("Failed to create KerberosToken", e);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
index c162a38..b5036b7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
@@ -169,7 +169,9 @@ public class Environment {
throw new IllegalArgumentException("Provided keytab is not a normal file: " + keytab);
}
try {
- return new KerberosToken(getUserName(), keytabFile, true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(getUserName(), keytabFile, true);
+ return krbToken;
} catch (IOException e) {
throw new RuntimeException("Failed to login", e);
}
[2/7] accumulo git commit: ACCUMULO-4348 Deprecate KerberosToken
constructor with side effects
Posted by ct...@apache.org.
ACCUMULO-4348 Deprecate KerberosToken constructor with side effects
`KerberosToken(String, File, boolean)` is deprecated in favor of `KerberosToken(String, File)`.
The boolean flag would log in the requested user with Hadoop's `UserGroupInformation` class. This
changed global state about who the active user was. In a multi-user environment, this potentially
made little sense as other users could overwrite eachother.
This patch includes a convenience constructor that doesn't have any side effects, but has the same
semantics as logging in a user with a keytab.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/1ddc7257
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/1ddc7257
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/1ddc7257
Branch: refs/heads/master
Commit: 1ddc7257073f18a3ddeeee9e00955e230f285b5d
Parents: f45a65c
Author: Bill Slacum <bi...@minerkasch.com>
Authored: Tue Jun 21 15:26:07 2016 -0400
Committer: Bill Slacum <bi...@minerkasch.com>
Committed: Tue Jun 21 15:47:13 2016 -0400
----------------------------------------------------------------------
.../core/client/security/tokens/KerberosToken.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/1ddc7257/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
index 284a838..1a4869d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
@@ -59,6 +59,20 @@ public class KerberosToken implements AuthenticationToken {
}
/**
+ * Creates a Kerberos token for the specified principal using the provided keytab. The principal and keytab combination are verified by attempting a log in.
+ * <p>
+ * This constructor does not have any side effects.
+ *
+ * @param principal
+ * The Kerberos principal
+ * @param keytab
+ * A keytab file containing the principal's credentials.
+ */
+ public KerberosToken(String principal, File keytab) throws IOException {
+ this(principal, keytab, false);
+ }
+
+ /**
* Creates a token and logs in via {@link UserGroupInformation} using the provided principal and keytab. A key for the principal must exist in the keytab,
* otherwise login will fail.
*
@@ -68,7 +82,9 @@ public class KerberosToken implements AuthenticationToken {
* A keytab file
* @param replaceCurrentUser
* Should the current Hadoop user be replaced with this user
+ * @deprecated since 1.8.0, @see #KerberosToken(String, File)
*/
+ @Deprecated
public KerberosToken(String principal, File keytab, boolean replaceCurrentUser) throws IOException {
requireNonNull(principal, "Principal was null");
requireNonNull(keytab, "Keytab was null");
[6/7] accumulo git commit: ACCUMULO-4348 Limit use of deprecated
method
Posted by ct...@apache.org.
ACCUMULO-4348 Limit use of deprecated method
Move off the deprecated KerberosToken constructor where possible, and
suppress warnings where not immediately possible.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5ba1c88d
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5ba1c88d
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5ba1c88d
Branch: refs/heads/1.8
Commit: 5ba1c88de0bd99c66ddf21b7ba0085692d25422b
Parents: dbfef0a
Author: Christopher Tubbs <ct...@apache.org>
Authored: Wed Jun 22 14:19:55 2016 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Jun 22 14:19:55 2016 -0400
----------------------------------------------------------------------
.../main/java/org/apache/accumulo/cluster/ClusterUser.java | 4 +++-
.../accumulo/tserver/replication/AccumuloReplicaSystem.java | 2 +-
.../org/apache/accumulo/harness/AccumuloClusterHarness.java | 4 +++-
.../org/apache/accumulo/harness/SharedMiniClusterBase.java | 8 ++++++--
.../harness/conf/AccumuloMiniClusterConfiguration.java | 4 +++-
.../harness/conf/StandaloneAccumuloClusterConfiguration.java | 4 +++-
.../org/apache/accumulo/test/randomwalk/Environment.java | 4 +++-
7 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java b/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java
index 6644d44..e99ca0b 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/ClusterUser.java
@@ -81,7 +81,9 @@ public class ClusterUser {
if (null != password) {
return new PasswordToken(password);
} else if (null != keytab) {
- return new KerberosToken(principal, keytab, true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(principal, keytab, true);
+ return krbToken;
}
throw new IllegalStateException("One of password and keytab must be non-null");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
index 0bd467c..589f07f 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
@@ -193,7 +193,7 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
KerberosToken token;
try {
// Do *not* replace the current user
- token = new KerberosToken(principal, keytab, false);
+ token = new KerberosToken(principal, keytab);
} catch (IOException e) {
log.error("Failed to create KerberosToken", e);
return status;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
index ba95f2b..7483184 100644
--- a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
+++ b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
@@ -170,7 +170,9 @@ public abstract class AccumuloClusterHarness extends AccumuloITBase implements M
UserGroupInformation.loginUserFromKeytab(systemUser.getPrincipal(), systemUser.getKeytab().getAbsolutePath());
// Open a connector as the system user (ensures the user will exist for us to assign permissions to)
- Connector conn = cluster.getConnector(systemUser.getPrincipal(), new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true));
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true);
+ Connector conn = cluster.getConnector(systemUser.getPrincipal(), krbToken);
// Then, log back in as the "root" user and do the grant
UserGroupInformation.loginUserFromKeytab(rootUser.getPrincipal(), rootUser.getKeytab().getAbsolutePath());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java b/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
index 79340f2..5b90597 100644
--- a/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
+++ b/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
@@ -75,7 +75,9 @@ public abstract class SharedMiniClusterBase extends AccumuloITBase implements Cl
ClusterUser rootUser = krb.getRootUser();
// Get the krb token
principal = rootUser.getPrincipal();
- token = new KerberosToken(principal, rootUser.getKeytab(), true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(principal, rootUser.getKeytab(), true);
+ token = krbToken;
} else {
rootPassword = "rootPasswordShared1";
token = new PasswordToken(rootPassword);
@@ -89,7 +91,9 @@ public abstract class SharedMiniClusterBase extends AccumuloITBase implements Cl
final ClusterUser systemUser = krb.getAccumuloServerUser(), rootUser = krb.getRootUser();
// Login as the trace user
// Open a connector as the system user (ensures the user will exist for us to assign permissions to)
- Connector conn = cluster.getConnector(systemUser.getPrincipal(), new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true));
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true);
+ Connector conn = cluster.getConnector(systemUser.getPrincipal(), krbToken);
// Then, log back in as the "root" user and do the grant
UserGroupInformation.loginUserFromKeytab(rootUser.getPrincipal(), rootUser.getKeytab().getAbsolutePath());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java b/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
index 0a43621..63f90ea 100644
--- a/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
+++ b/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
@@ -86,7 +86,9 @@ public class AccumuloMiniClusterConfiguration extends AccumuloClusterPropertyCon
ClusterUser rootUser = AccumuloClusterHarness.getKdc().getRootUser();
try {
- return new KerberosToken(rootUser.getPrincipal(), rootUser.getKeytab(), true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(rootUser.getPrincipal(), rootUser.getKeytab(), true);
+ return krbToken;
} catch (IOException e) {
throw new RuntimeException(e);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java b/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
index ba9dcef..e72d965 100644
--- a/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
+++ b/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
@@ -162,7 +162,9 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
if (clientConf.getBoolean(ClientProperty.INSTANCE_RPC_SASL_ENABLED.getKey(), false)) {
File keytab = getAdminKeytab();
try {
- return new KerberosToken(getAdminPrincipal(), keytab, true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(getAdminPrincipal(), keytab, true);
+ return krbToken;
} catch (IOException e) {
// The user isn't logged in
throw new RuntimeException("Failed to create KerberosToken", e);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ba1c88d/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
index c162a38..b5036b7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
@@ -169,7 +169,9 @@ public class Environment {
throw new IllegalArgumentException("Provided keytab is not a normal file: " + keytab);
}
try {
- return new KerberosToken(getUserName(), keytabFile, true);
+ @SuppressWarnings("deprecation")
+ KerberosToken krbToken = new KerberosToken(getUserName(), keytabFile, true);
+ return krbToken;
} catch (IOException e) {
throw new RuntimeException("Failed to login", e);
}
[7/7] accumulo git commit: Merge branch '1.8'
Posted by ct...@apache.org.
Merge branch '1.8'
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/e3bd30ed
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/e3bd30ed
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/e3bd30ed
Branch: refs/heads/master
Commit: e3bd30edabcde8ccf418b6e9172692ef58de0779
Parents: 8c2ecf8 5ba1c88
Author: Christopher Tubbs <ct...@apache.org>
Authored: Wed Jun 22 14:21:53 2016 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Jun 22 14:21:53 2016 -0400
----------------------------------------------------------------------
.../core/client/security/tokens/KerberosToken.java | 16 ++++++++++++++++
.../org/apache/accumulo/cluster/ClusterUser.java | 4 +++-
.../tserver/replication/AccumuloReplicaSystem.java | 2 +-
.../accumulo/harness/AccumuloClusterHarness.java | 4 +++-
.../accumulo/harness/SharedMiniClusterBase.java | 8 ++++++--
.../conf/AccumuloMiniClusterConfiguration.java | 4 +++-
.../StandaloneAccumuloClusterConfiguration.java | 4 +++-
.../accumulo/test/randomwalk/Environment.java | 4 +++-
8 files changed, 38 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
[4/7] accumulo git commit: Merge branch 'pr-119' into 1.8
Posted by ct...@apache.org.
Merge branch 'pr-119' into 1.8
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/dbfef0a6
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/dbfef0a6
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/dbfef0a6
Branch: refs/heads/1.8
Commit: dbfef0a64e57cba0eb60afa3c71ffe28755818ca
Parents: 782135b 1ddc725
Author: Christopher Tubbs <ct...@apache.org>
Authored: Wed Jun 22 13:16:52 2016 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Jun 22 13:16:52 2016 -0400
----------------------------------------------------------------------
.../core/client/security/tokens/KerberosToken.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
[3/7] accumulo git commit: Merge branch 'pr-119' into 1.8
Posted by ct...@apache.org.
Merge branch 'pr-119' into 1.8
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/dbfef0a6
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/dbfef0a6
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/dbfef0a6
Branch: refs/heads/master
Commit: dbfef0a64e57cba0eb60afa3c71ffe28755818ca
Parents: 782135b 1ddc725
Author: Christopher Tubbs <ct...@apache.org>
Authored: Wed Jun 22 13:16:52 2016 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Jun 22 13:16:52 2016 -0400
----------------------------------------------------------------------
.../core/client/security/tokens/KerberosToken.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------