[4/9] accumulo git commit: ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations
ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f2868c62 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f2868c62 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f2868c62 Branch: refs/heads/1.6 Commit: f2868c6210124afece595fd5adca04479cc827a1 Parents: 7c078c8 57ffd19 Author: Eric C. Newton eric.new...@gmail.com Authored: Tue Feb 24 14:42:20 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Tue Feb 24 14:42:20 2015 -0500 -- --
[2/3] accumulo git commit: ACCUMULO-3638 only warn if the system property is set
ACCUMULO-3638 only warn if the system property is set Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/775cdb1b Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/775cdb1b Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/775cdb1b Branch: refs/heads/master Commit: 775cdb1b9881b1ea9ad5ef1b22ace819fee1102f Parents: ae581d2 Author: Eric C. Newton eric.new...@gmail.com Authored: Wed Mar 4 10:31:35 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Wed Mar 4 10:31:35 2015 -0500 -- test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/775cdb1b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java -- diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java index 41204da..e7c8c2d 100644 --- a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java +++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java @@ -82,7 +82,10 @@ public class AccumuloIT { public Timeout testsShouldTimeout() { int waitLonger = 0; try { - waitLonger = Integer.parseInt(System.getProperty(timeout.factor)); + String timeoutString = System.getProperty(timeout.factor); + if (timeoutString != null !timeoutString.isEmpty()) { +waitLonger = Integer.parseInt(timeoutString); + } } catch (NumberFormatException exception) { log.warn(Could not parse timeout.factor, defaulting to no timeout.); }
[6/9] accumulo git commit: Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6
Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bd13f4a3 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bd13f4a3 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bd13f4a3 Branch: refs/heads/1.6 Commit: bd13f4a3629512613ad10b3caef920982b101e48 Parents: f2868c6 019f99f Author: Eric C. Newton eric.new...@gmail.com Authored: Tue Feb 24 15:35:10 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Tue Feb 24 15:35:10 2015 -0500 -- .../org/apache/accumulo/master/tableOps/DeleteTable.java | 8 1 file changed, 8 deletions(-) --
[3/9] accumulo git commit: ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations
ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/57ffd19c Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/57ffd19c Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/57ffd19c Branch: refs/heads/1.6 Commit: 57ffd19c11de6984bfc2123b301917c807854ca9 Parents: 517757f Author: Eric C. Newton eric.new...@gmail.com Authored: Tue Feb 24 14:41:51 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Tue Feb 24 14:41:51 2015 -0500 -- server/src/main/java/org/apache/accumulo/server/master/Master.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/57ffd19c/server/src/main/java/org/apache/accumulo/server/master/Master.java -- diff --git a/server/src/main/java/org/apache/accumulo/server/master/Master.java b/server/src/main/java/org/apache/accumulo/server/master/Master.java index 8e072e9..61ba7cf 100644 --- a/server/src/main/java/org/apache/accumulo/server/master/Master.java +++ b/server/src/main/java/org/apache/accumulo/server/master/Master.java @@ -2310,8 +2310,8 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt TCredentials systemAuths = SecurityConstants.getSystemCredentials(); final TabletStateStore stores[] = { new ZooTabletStateStore(new ZooStore(zroot)), -new RootTabletStateStore(instance, systemAuths, this), // ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations +new RootTabletStateStore(instance, systemAuths, null), new MetaDataStateStore(instance, systemAuths, null) }; watchers.add(new TabletGroupWatcher(stores[2], null));
[8/9] accumulo git commit: Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6
Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ae581d25 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ae581d25 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ae581d25 Branch: refs/heads/1.6 Commit: ae581d25a90f8143611759f0c942e101f5a4f285 Parents: 939c051 7707793 Author: Eric C. Newton eric.new...@gmail.com Authored: Wed Mar 4 10:08:22 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Wed Mar 4 10:08:22 2015 -0500 -- .../org/apache/accumulo/core/util/shell/Shell.java | 3 +++ .../core/util/shell/ShellSetInstanceTest.java| 4 pom.xml | 4 ++-- .../start/classloader/AccumuloClassLoader.java | 15 +-- 4 files changed, 18 insertions(+), 8 deletions(-) --
[1/9] accumulo git commit: ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations
Repository: accumulo Updated Branches: refs/heads/1.6 7707793cb - 775cdb1b9 ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/517757fe Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/517757fe Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/517757fe Branch: refs/heads/1.6 Commit: 517757fed365a19c2d5633779e70f9617fd481a3 Parents: c92c3c4 Author: Eric C. Newton eric.new...@gmail.com Authored: Tue Feb 24 14:24:56 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Tue Feb 24 14:24:56 2015 -0500 -- .../main/java/org/apache/accumulo/server/master/Master.java | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/517757fe/server/src/main/java/org/apache/accumulo/server/master/Master.java -- diff --git a/server/src/main/java/org/apache/accumulo/server/master/Master.java b/server/src/main/java/org/apache/accumulo/server/master/Master.java index abf7468..8e072e9 100644 --- a/server/src/main/java/org/apache/accumulo/server/master/Master.java +++ b/server/src/main/java/org/apache/accumulo/server/master/Master.java @@ -2308,8 +2308,12 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt }); TCredentials systemAuths = SecurityConstants.getSystemCredentials(); -final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(instance, systemAuths, this), -new MetaDataStateStore(instance, systemAuths, this)}; +final TabletStateStore stores[] = { +new ZooTabletStateStore(new ZooStore(zroot)), +new RootTabletStateStore(instance, systemAuths, this), +// ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations +new MetaDataStateStore(instance, systemAuths, null) +}; watchers.add(new TabletGroupWatcher(stores[2], null)); watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0))); watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));
[2/9] accumulo git commit: ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations
ACCUMULO-3580 ACCUMULO-3618 disable metadata table scanning optimizations Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7c078c89 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7c078c89 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7c078c89 Branch: refs/heads/1.6 Commit: 7c078c89513935f09c662ecea355303870796e94 Parents: 0d6f84c 517757f Author: Eric C. Newton eric.new...@gmail.com Authored: Tue Feb 24 14:41:25 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Tue Feb 24 14:41:25 2015 -0500 -- .../master/src/main/java/org/apache/accumulo/master/Master.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/7c078c89/server/master/src/main/java/org/apache/accumulo/master/Master.java -- diff --cc server/master/src/main/java/org/apache/accumulo/master/Master.java index bc552bc,000..5a96abc mode 100644,00..100644 --- a/server/master/src/main/java/org/apache/accumulo/master/Master.java +++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java @@@ -1,1333 -1,0 +1,1334 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.master; + +import static com.google.common.base.Charsets.UTF_8; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.client.AccumuloException; +import org.apache.accumulo.core.client.AccumuloSecurityException; +import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.core.client.Instance; +import org.apache.accumulo.core.client.Scanner; +import org.apache.accumulo.core.client.TableNotFoundException; +import org.apache.accumulo.core.client.impl.Namespaces; +import org.apache.accumulo.core.client.impl.Tables; +import org.apache.accumulo.core.client.impl.ThriftTransportPool; +import org.apache.accumulo.core.client.impl.thrift.TableOperation; +import org.apache.accumulo.core.client.impl.thrift.TableOperationExceptionType; +import org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException; +import org.apache.accumulo.core.conf.AccumuloConfiguration; +import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.KeyExtent; +import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.master.state.tables.TableState; +import org.apache.accumulo.core.master.thrift.MasterClientService.Iface; +import org.apache.accumulo.core.master.thrift.MasterClientService.Processor; +import org.apache.accumulo.core.master.thrift.MasterGoalState; +import org.apache.accumulo.core.master.thrift.MasterState; +import org.apache.accumulo.core.master.thrift.TabletServerStatus; +import org.apache.accumulo.core.metadata.MetadataTable; +import org.apache.accumulo.core.metadata.RootTable; +import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection; +import org.apache.accumulo.core.security.Authorizations; +import org.apache.accumulo.core.security.Credentials; +import org.apache.accumulo.core.security.NamespacePermission; +import org.apache.accumulo.core.security.TablePermission; +import org.apache.accumulo.core.util.Daemon; +import org.apache.accumulo.core.util.Pair; +import org.apache.accumulo.core.util.UtilWaitThread; +import org.apache.accumulo.core.zookeeper.ZooUtil; +import org.apache.accumulo.fate.AgeOffStore; +import
[9/9] accumulo git commit: ACCUMULO-3638 only warn if the system property is set
ACCUMULO-3638 only warn if the system property is set Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/775cdb1b Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/775cdb1b Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/775cdb1b Branch: refs/heads/1.6 Commit: 775cdb1b9881b1ea9ad5ef1b22ace819fee1102f Parents: ae581d2 Author: Eric C. Newton eric.new...@gmail.com Authored: Wed Mar 4 10:31:35 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Wed Mar 4 10:31:35 2015 -0500 -- test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/775cdb1b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java -- diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java index 41204da..e7c8c2d 100644 --- a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java +++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java @@ -82,7 +82,10 @@ public class AccumuloIT { public Timeout testsShouldTimeout() { int waitLonger = 0; try { - waitLonger = Integer.parseInt(System.getProperty(timeout.factor)); + String timeoutString = System.getProperty(timeout.factor); + if (timeoutString != null !timeoutString.isEmpty()) { +waitLonger = Integer.parseInt(timeoutString); + } } catch (NumberFormatException exception) { log.warn(Could not parse timeout.factor, defaulting to no timeout.); }
[1/3] accumulo git commit: Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6
Repository: accumulo Updated Branches: refs/heads/master 4a9cabea5 - 87208e5de Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ae581d25 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ae581d25 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ae581d25 Branch: refs/heads/master Commit: ae581d25a90f8143611759f0c942e101f5a4f285 Parents: 939c051 7707793 Author: Eric C. Newton eric.new...@gmail.com Authored: Wed Mar 4 10:08:22 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Wed Mar 4 10:08:22 2015 -0500 -- .../org/apache/accumulo/core/util/shell/Shell.java | 3 +++ .../core/util/shell/ShellSetInstanceTest.java| 4 pom.xml | 4 ++-- .../start/classloader/AccumuloClassLoader.java | 15 +-- 4 files changed, 18 insertions(+), 8 deletions(-) --
[5/9] accumulo git commit: Merge branch '1.5' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.5
Merge branch '1.5' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.5 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0c300de2 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0c300de2 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0c300de2 Branch: refs/heads/1.6 Commit: 0c300de23d36391b19d0f45a41de92a7a4593444 Parents: 57ffd19 c59b115 Author: Eric C. Newton eric.new...@gmail.com Authored: Tue Feb 24 15:35:00 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Tue Feb 24 15:35:00 2015 -0500 -- .../apache/accumulo/server/master/tableOps/DeleteTable.java | 8 1 file changed, 8 deletions(-) --
[3/3] accumulo git commit: Merge branch '1.6'
Merge branch '1.6' Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/87208e5d Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/87208e5d Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/87208e5d Branch: refs/heads/master Commit: 87208e5de1aacb5e7b2487dafba7705f6237ec80 Parents: 4a9cabe 775cdb1 Author: Eric C. Newton eric.new...@gmail.com Authored: Wed Mar 4 10:31:47 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Wed Mar 4 10:31:47 2015 -0500 -- test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) --
[7/9] accumulo git commit: Merge branch '1.5' into 1.6
Merge branch '1.5' into 1.6 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/939c0514 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/939c0514 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/939c0514 Branch: refs/heads/1.6 Commit: 939c05142f532ffd5d6867cefc01dc4edf7b0e98 Parents: bd13f4a 0c300de Author: Eric C. Newton eric.new...@gmail.com Authored: Tue Feb 24 15:35:15 2015 -0500 Committer: Eric C. Newton eric.new...@gmail.com Committed: Tue Feb 24 15:35:15 2015 -0500 -- --
accumulo git commit: ACCUMULO-3639 Use original principal in exceptions.
Repository: accumulo Updated Branches: refs/heads/master 87208e5de - 6c6e4f4e7 ACCUMULO-3639 Use original principal in exceptions. Added IT to ensure exception contains principal. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6c6e4f4e Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6c6e4f4e Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6c6e4f4e Branch: refs/heads/master Commit: 6c6e4f4e7cbf1fbec57e648b5f04eb2ab6b7cb45 Parents: 87208e5 Author: Josh Elser els...@apache.org Authored: Wed Mar 4 15:53:44 2015 -0800 Committer: Josh Elser els...@apache.org Committed: Wed Mar 4 15:53:44 2015 -0800 -- .../security/handler/KerberosAuthenticator.java | 4 +- .../java/org/apache/accumulo/test/UsersIT.java | 60 2 files changed, 61 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/6c6e4f4e/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java -- diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java b/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java index 369fa89..fd7d055 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthenticator.java @@ -154,10 +154,8 @@ public class KerberosAuthenticator implements Authenticator { throw new UnsupportedOperationException(Expected a KerberosToken but got a + token.getClass().getSimpleName()); } -principal = Base64.encodeBase64String(principal.getBytes(UTF_8)); - try { - createUserNodeInZk(principal); + createUserNodeInZk(Base64.encodeBase64String(principal.getBytes(UTF_8))); } catch (KeeperException e) { if (e.code().equals(KeeperException.Code.NODEEXISTS)) { log.error(User already exists in ZooKeeper, e); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6c6e4f4e/test/src/test/java/org/apache/accumulo/test/UsersIT.java -- diff --git a/test/src/test/java/org/apache/accumulo/test/UsersIT.java b/test/src/test/java/org/apache/accumulo/test/UsersIT.java new file mode 100644 index 000..579daee --- /dev/null +++ b/test/src/test/java/org/apache/accumulo/test/UsersIT.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.test; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.Set; + +import org.apache.accumulo.cluster.ClusterUser; +import org.apache.accumulo.core.client.AccumuloSecurityException; +import org.apache.accumulo.core.client.ClientConfiguration.ClientProperty; +import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.core.client.security.SecurityErrorCode; +import org.apache.accumulo.core.client.security.tokens.PasswordToken; +import org.apache.accumulo.harness.AccumuloClusterIT; +import org.junit.Test; + +public class UsersIT extends AccumuloClusterIT { + + @Test + public void testCreateExistingUser() throws Exception { +ClusterUser user0 = getUser(0); +Connector conn = getConnector(); +SetString currentUsers = conn.securityOperations().listLocalUsers(); + +// Ensure that the user exists +if (!currentUsers.contains(user0.getPrincipal())) { + PasswordToken token = null; + if (!getCluster().getClientConfig().getBoolean(ClientProperty.INSTANCE_RPC_SASL_ENABLED.getKey(), false)) { +token = new PasswordToken(user0.getPassword()); + } + conn.securityOperations().createLocalUser(user0.getPrincipal(), token); +} + +try { + conn.securityOperations().createLocalUser(user0.getPrincipal(), new PasswordToken(better_fail)); + fail(Creating a user that already