You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2015/05/17 16:37:39 UTC
[1/7] accumulo git commit: ACCUMULO-3821 Switch CleanTmpIT back to
minicluster only
Repository: accumulo
Updated Branches:
refs/heads/1.7 c85361a98 -> 4eda9ec74
refs/heads/master f98ddc2a7 -> 61f927901
ACCUMULO-3821 Switch CleanTmpIT back to minicluster only
On a system with separate users and hdfs permissions enabled,
there's no good way to make the tmp file in HDFS without
special sudo'ing logic.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/11c16006
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/11c16006
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/11c16006
Branch: refs/heads/1.7
Commit: 11c16006033716a2335446afa067cba4a0266051
Parents: c85361a
Author: Josh Elser <el...@apache.org>
Authored: Sat May 16 21:10:33 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Sat May 16 21:10:33 2015 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/test/functional/CleanTmpIT.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/11c16006/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
index d384ca4..921d661 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
@@ -35,8 +35,6 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.harness.AccumuloClusterIT;
-import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
@@ -49,11 +47,11 @@ import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
-public class CleanTmpIT extends AccumuloClusterIT {
+public class CleanTmpIT extends ConfigurableMacIT {
private static final Logger log = LoggerFactory.getLogger(CleanTmpIT.class);
@Override
- public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
+ public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
cfg.setProperty(Property.INSTANCE_ZK_TIMEOUT, "3s");
cfg.setNumTservers(1);
// use raw local file system so walogs sync and flush will work
@@ -95,7 +93,7 @@ public class CleanTmpIT extends AccumuloClusterIT {
Entry<Key,Value> entry = Iterables.getOnlyElement(s);
Path file = new Path(entry.getKey().getColumnQualifier().toString());
- FileSystem fs = getFileSystem();
+ FileSystem fs = getCluster().getFileSystem();
assertTrue("Could not find file: " + file, fs.exists(file));
Path tabletDir = file.getParent();
assertNotNull("Tablet dir should not be null", tabletDir);
@@ -103,8 +101,8 @@ public class CleanTmpIT extends AccumuloClusterIT {
// Make the file
fs.create(tmp).close();
log.info("Created tmp file {}", tmp.toString());
- getClusterControl().stopAllServers(ServerType.TABLET_SERVER);
- getClusterControl().startAllServers(ServerType.TABLET_SERVER);
+ getCluster().stop();
+ getCluster().start();
Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY);
assertEquals(2, Iterators.size(scanner.iterator()));
[5/7] accumulo git commit: ACCUMULO-3823 Separate out client/server
ACCUMULO_CONF_DIR
Posted by el...@apache.org.
ACCUMULO-3823 Separate out client/server ACCUMULO_CONF_DIR
Can't blindly use one if we're supporting both. Things will
break when we try to use the server's conf without sudo'ing.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4eda9ec7
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4eda9ec7
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4eda9ec7
Branch: refs/heads/master
Commit: 4eda9ec74869aabbc5f982a0cbb6770eadfcaea2
Parents: 8894000
Author: Josh Elser <el...@apache.org>
Authored: Sat May 16 23:38:17 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Sun May 17 10:15:19 2015 -0400
----------------------------------------------------------------------
.../standalone/StandaloneAccumuloCluster.java | 21 ++++++++++++++------
.../standalone/StandaloneClusterControl.java | 17 ++++++++--------
.../StandaloneClusterControlTest.java | 6 +++---
.../accumulo/harness/AccumuloClusterIT.java | 3 ++-
.../StandaloneAccumuloClusterConfiguration.java | 11 +++++++---
5 files changed, 37 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
index dc0bc18..40fcfae 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
@@ -49,7 +49,7 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
private Instance instance;
private ClientConfiguration clientConf;
- private String accumuloHome, accumuloConfDir, hadoopConfDir;
+ private String accumuloHome, clientAccumuloConfDir, serverAccumuloConfDir, hadoopConfDir;
private Path tmp;
private List<ClusterUser> users;
private String serverUser;
@@ -74,12 +74,20 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
this.accumuloHome = accumuloHome;
}
- public String getAccumuloConfDir() {
- return accumuloConfDir;
+ public String getClientAccumuloConfDir() {
+ return clientAccumuloConfDir;
}
- public void setAccumuloConfDir(String accumuloConfDir) {
- this.accumuloConfDir = accumuloConfDir;
+ public void setClientAccumuloConfDir(String accumuloConfDir) {
+ this.clientAccumuloConfDir = accumuloConfDir;
+ }
+
+ public String getServerAccumuloConfDir() {
+ return serverAccumuloConfDir;
+ }
+
+ public void setServerAccumuloConfDir(String accumuloConfDir) {
+ this.serverAccumuloConfDir = accumuloConfDir;
}
public String getHadoopConfDir() {
@@ -119,7 +127,8 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
@Override
public StandaloneClusterControl getClusterControl() {
return new StandaloneClusterControl(serverUser, null == accumuloHome ? System.getenv("ACCUMULO_HOME") : accumuloHome,
- null == accumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : accumuloConfDir);
+ null == clientAccumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : clientAccumuloConfDir,
+ null == serverAccumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : serverAccumuloConfDir);
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java
index c652b0b..b3b1634 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java
@@ -52,20 +52,21 @@ public class StandaloneClusterControl implements ClusterControl {
private static final String ACCUMULO_CONF_DIR = "ACCUMULO_CONF_DIR=";
protected String user;
- protected String accumuloHome, accumuloConfDir;
+ protected String accumuloHome, clientAccumuloConfDir, serverAccumuloConfDir;
protected RemoteShellOptions options;
protected String startServerPath, accumuloPath, toolPath;
public StandaloneClusterControl(String user) {
- this(user, System.getenv("ACCUMULO_HOME"), System.getenv("ACCUMULO_CONF_DIR"));
+ this(user, System.getenv("ACCUMULO_HOME"), System.getenv("ACCUMULO_CONF_DIR"), System.getenv("ACCUMULO_CONF_DIR"));
}
- public StandaloneClusterControl(String user, String accumuloHome, String accumuloConfDir) {
+ public StandaloneClusterControl(String user, String accumuloHome, String clientAccumuloConfDir, String serverAccumuloConfDir) {
this.user = user;
this.options = new RemoteShellOptions();
this.accumuloHome = accumuloHome;
- this.accumuloConfDir = accumuloConfDir;
+ this.clientAccumuloConfDir = clientAccumuloConfDir;
+ this.serverAccumuloConfDir = serverAccumuloConfDir;
File bin = new File(accumuloHome, "bin");
this.startServerPath = new File(bin, START_SERVER_SCRIPT).getAbsolutePath();
@@ -100,7 +101,7 @@ public class StandaloneClusterControl implements ClusterControl {
String master = getHosts(new File(confDir, "masters")).get(0);
String[] cmd = new String[3 + args.length];
// Make sure we always set the right ACCUMULO_CONF_DIR
- cmd[0] = ACCUMULO_CONF_DIR + confDir;
+ cmd[0] = ACCUMULO_CONF_DIR + clientAccumuloConfDir;
cmd[1] = accumuloPath;
cmd[2] = clz.getName();
// Quote the arguments to prevent shell expansion
@@ -138,7 +139,7 @@ public class StandaloneClusterControl implements ClusterControl {
public void adminStopAll() throws IOException {
File confDir = getConfDir();
String master = getHosts(new File(confDir, "masters")).get(0);
- String[] cmd = new String[] {SUDO_CMD, "-u", user, ACCUMULO_CONF_DIR + accumuloConfDir, accumuloPath, Admin.class.getName(), "stopAll"};
+ String[] cmd = new String[] {SUDO_CMD, "-u", user, ACCUMULO_CONF_DIR + serverAccumuloConfDir, accumuloPath, Admin.class.getName(), "stopAll"};
// Directly invoke the RemoteShell
Entry<Integer,String> pair = exec(master, cmd);
if (0 != pair.getKey().intValue()) {
@@ -192,7 +193,7 @@ public class StandaloneClusterControl implements ClusterControl {
@Override
public void start(ServerType server, String hostname) throws IOException {
- String[] cmd = new String[] {SUDO_CMD, "-u", user, ACCUMULO_CONF_DIR + accumuloConfDir, startServerPath, hostname, getProcessString(server)};
+ String[] cmd = new String[] {SUDO_CMD, "-u", user, ACCUMULO_CONF_DIR + serverAccumuloConfDir, startServerPath, hostname, getProcessString(server)};
Entry<Integer,String> pair = exec(hostname, cmd);
if (0 != pair.getKey()) {
throw new IOException("Start " + server + " on " + hostname + " failed for execute successfully");
@@ -319,7 +320,7 @@ public class StandaloneClusterControl implements ClusterControl {
}
protected File getConfDir() {
- String confPath = null == accumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : accumuloConfDir;
+ String confPath = null == clientAccumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : clientAccumuloConfDir;
File confDir;
if (null == confPath) {
String homePath = null == accumuloHome ? System.getenv("ACCUMULO_HOME") : accumuloHome;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java b/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
index 2849273..22632be 100644
--- a/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
@@ -24,12 +24,12 @@ public class StandaloneClusterControlTest {
@Test
public void testPaths() {
- String accumuloHome = "/usr/lib/accumulo", accumuloConfDir = "/etc/accumulo/conf";
+ String accumuloHome = "/usr/lib/accumulo", accumuloConfDir = "/etc/accumulo/conf", accumuloServerConfDir = "/etc/accumulo/conf/server";
- StandaloneClusterControl control = new StandaloneClusterControl("accumulo", accumuloHome, accumuloConfDir);
+ StandaloneClusterControl control = new StandaloneClusterControl("accumulo", accumuloHome, accumuloConfDir, accumuloServerConfDir);
assertEquals(accumuloHome, control.accumuloHome);
- assertEquals(accumuloConfDir, control.accumuloConfDir);
+ assertEquals(accumuloConfDir, control.clientAccumuloConfDir);
assertEquals(accumuloHome + "/bin/accumulo", control.accumuloPath);
assertEquals(accumuloHome + "/bin/start-server.sh", control.startServerPath);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
index a0cca46..16460ed 100644
--- a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
+++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
@@ -133,7 +133,8 @@ public abstract class AccumuloClusterIT extends AccumuloIT implements MiniCluste
conf.getAccumuloServerUser());
// If these are provided in the configuration, pass them into the cluster
standaloneCluster.setAccumuloHome(conf.getAccumuloHome());
- standaloneCluster.setAccumuloConfDir(conf.getAccumuloConfDir());
+ standaloneCluster.setClientAccumuloConfDir(conf.getClientAccumuloConfDir());
+ standaloneCluster.setServerAccumuloConfDir(conf.getServerAccumuloConfDir());
standaloneCluster.setHadoopConfDir(conf.getHadoopConfDir());
// For SASL, we need to get the Hadoop configuration files as well otherwise UGI will log in as SIMPLE instead of KERBEROS
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java b/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
index 53e30c2..e04c10c 100644
--- a/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
+++ b/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
@@ -68,7 +68,8 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
public static final String ACCUMULO_STANDALONE_USER_PASSWORDS_KEY = ACCUMULO_STANDALONE_PREFIX + "passwords.";
public static final String ACCUMULO_STANDALONE_HOME = ACCUMULO_STANDALONE_PREFIX + "home";
- public static final String ACCUMULO_STANDALONE_CONF = ACCUMULO_STANDALONE_PREFIX + "conf";
+ public static final String ACCUMULO_STANDALONE_CLIENT_CONF = ACCUMULO_STANDALONE_PREFIX + "client.conf";
+ public static final String ACCUMULO_STANDALONE_SERVER_CONF = ACCUMULO_STANDALONE_PREFIX + "server.conf";
public static final String ACCUMULO_STANDALONE_HADOOP_CONF = ACCUMULO_STANDALONE_PREFIX + "hadoop.conf";
private Map<String,String> conf;
@@ -214,8 +215,12 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
return conf.get(ACCUMULO_STANDALONE_HOME);
}
- public String getAccumuloConfDir() {
- return conf.get(ACCUMULO_STANDALONE_CONF);
+ public String getClientAccumuloConfDir() {
+ return conf.get(ACCUMULO_STANDALONE_CLIENT_CONF);
+ }
+
+ public String getServerAccumuloConfDir() {
+ return conf.get(ACCUMULO_STANDALONE_SERVER_CONF);
}
@Override
[6/7] accumulo git commit: ACCUMULO-3823 Separate out client/server
ACCUMULO_CONF_DIR
Posted by el...@apache.org.
ACCUMULO-3823 Separate out client/server ACCUMULO_CONF_DIR
Can't blindly use one if we're supporting both. Things will
break when we try to use the server's conf without sudo'ing.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4eda9ec7
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4eda9ec7
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4eda9ec7
Branch: refs/heads/1.7
Commit: 4eda9ec74869aabbc5f982a0cbb6770eadfcaea2
Parents: 8894000
Author: Josh Elser <el...@apache.org>
Authored: Sat May 16 23:38:17 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Sun May 17 10:15:19 2015 -0400
----------------------------------------------------------------------
.../standalone/StandaloneAccumuloCluster.java | 21 ++++++++++++++------
.../standalone/StandaloneClusterControl.java | 17 ++++++++--------
.../StandaloneClusterControlTest.java | 6 +++---
.../accumulo/harness/AccumuloClusterIT.java | 3 ++-
.../StandaloneAccumuloClusterConfiguration.java | 11 +++++++---
5 files changed, 37 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
index dc0bc18..40fcfae 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
@@ -49,7 +49,7 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
private Instance instance;
private ClientConfiguration clientConf;
- private String accumuloHome, accumuloConfDir, hadoopConfDir;
+ private String accumuloHome, clientAccumuloConfDir, serverAccumuloConfDir, hadoopConfDir;
private Path tmp;
private List<ClusterUser> users;
private String serverUser;
@@ -74,12 +74,20 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
this.accumuloHome = accumuloHome;
}
- public String getAccumuloConfDir() {
- return accumuloConfDir;
+ public String getClientAccumuloConfDir() {
+ return clientAccumuloConfDir;
}
- public void setAccumuloConfDir(String accumuloConfDir) {
- this.accumuloConfDir = accumuloConfDir;
+ public void setClientAccumuloConfDir(String accumuloConfDir) {
+ this.clientAccumuloConfDir = accumuloConfDir;
+ }
+
+ public String getServerAccumuloConfDir() {
+ return serverAccumuloConfDir;
+ }
+
+ public void setServerAccumuloConfDir(String accumuloConfDir) {
+ this.serverAccumuloConfDir = accumuloConfDir;
}
public String getHadoopConfDir() {
@@ -119,7 +127,8 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
@Override
public StandaloneClusterControl getClusterControl() {
return new StandaloneClusterControl(serverUser, null == accumuloHome ? System.getenv("ACCUMULO_HOME") : accumuloHome,
- null == accumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : accumuloConfDir);
+ null == clientAccumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : clientAccumuloConfDir,
+ null == serverAccumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : serverAccumuloConfDir);
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java
index c652b0b..b3b1634 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java
@@ -52,20 +52,21 @@ public class StandaloneClusterControl implements ClusterControl {
private static final String ACCUMULO_CONF_DIR = "ACCUMULO_CONF_DIR=";
protected String user;
- protected String accumuloHome, accumuloConfDir;
+ protected String accumuloHome, clientAccumuloConfDir, serverAccumuloConfDir;
protected RemoteShellOptions options;
protected String startServerPath, accumuloPath, toolPath;
public StandaloneClusterControl(String user) {
- this(user, System.getenv("ACCUMULO_HOME"), System.getenv("ACCUMULO_CONF_DIR"));
+ this(user, System.getenv("ACCUMULO_HOME"), System.getenv("ACCUMULO_CONF_DIR"), System.getenv("ACCUMULO_CONF_DIR"));
}
- public StandaloneClusterControl(String user, String accumuloHome, String accumuloConfDir) {
+ public StandaloneClusterControl(String user, String accumuloHome, String clientAccumuloConfDir, String serverAccumuloConfDir) {
this.user = user;
this.options = new RemoteShellOptions();
this.accumuloHome = accumuloHome;
- this.accumuloConfDir = accumuloConfDir;
+ this.clientAccumuloConfDir = clientAccumuloConfDir;
+ this.serverAccumuloConfDir = serverAccumuloConfDir;
File bin = new File(accumuloHome, "bin");
this.startServerPath = new File(bin, START_SERVER_SCRIPT).getAbsolutePath();
@@ -100,7 +101,7 @@ public class StandaloneClusterControl implements ClusterControl {
String master = getHosts(new File(confDir, "masters")).get(0);
String[] cmd = new String[3 + args.length];
// Make sure we always set the right ACCUMULO_CONF_DIR
- cmd[0] = ACCUMULO_CONF_DIR + confDir;
+ cmd[0] = ACCUMULO_CONF_DIR + clientAccumuloConfDir;
cmd[1] = accumuloPath;
cmd[2] = clz.getName();
// Quote the arguments to prevent shell expansion
@@ -138,7 +139,7 @@ public class StandaloneClusterControl implements ClusterControl {
public void adminStopAll() throws IOException {
File confDir = getConfDir();
String master = getHosts(new File(confDir, "masters")).get(0);
- String[] cmd = new String[] {SUDO_CMD, "-u", user, ACCUMULO_CONF_DIR + accumuloConfDir, accumuloPath, Admin.class.getName(), "stopAll"};
+ String[] cmd = new String[] {SUDO_CMD, "-u", user, ACCUMULO_CONF_DIR + serverAccumuloConfDir, accumuloPath, Admin.class.getName(), "stopAll"};
// Directly invoke the RemoteShell
Entry<Integer,String> pair = exec(master, cmd);
if (0 != pair.getKey().intValue()) {
@@ -192,7 +193,7 @@ public class StandaloneClusterControl implements ClusterControl {
@Override
public void start(ServerType server, String hostname) throws IOException {
- String[] cmd = new String[] {SUDO_CMD, "-u", user, ACCUMULO_CONF_DIR + accumuloConfDir, startServerPath, hostname, getProcessString(server)};
+ String[] cmd = new String[] {SUDO_CMD, "-u", user, ACCUMULO_CONF_DIR + serverAccumuloConfDir, startServerPath, hostname, getProcessString(server)};
Entry<Integer,String> pair = exec(hostname, cmd);
if (0 != pair.getKey()) {
throw new IOException("Start " + server + " on " + hostname + " failed for execute successfully");
@@ -319,7 +320,7 @@ public class StandaloneClusterControl implements ClusterControl {
}
protected File getConfDir() {
- String confPath = null == accumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : accumuloConfDir;
+ String confPath = null == clientAccumuloConfDir ? System.getenv("ACCUMULO_CONF_DIR") : clientAccumuloConfDir;
File confDir;
if (null == confPath) {
String homePath = null == accumuloHome ? System.getenv("ACCUMULO_HOME") : accumuloHome;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java b/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
index 2849273..22632be 100644
--- a/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
@@ -24,12 +24,12 @@ public class StandaloneClusterControlTest {
@Test
public void testPaths() {
- String accumuloHome = "/usr/lib/accumulo", accumuloConfDir = "/etc/accumulo/conf";
+ String accumuloHome = "/usr/lib/accumulo", accumuloConfDir = "/etc/accumulo/conf", accumuloServerConfDir = "/etc/accumulo/conf/server";
- StandaloneClusterControl control = new StandaloneClusterControl("accumulo", accumuloHome, accumuloConfDir);
+ StandaloneClusterControl control = new StandaloneClusterControl("accumulo", accumuloHome, accumuloConfDir, accumuloServerConfDir);
assertEquals(accumuloHome, control.accumuloHome);
- assertEquals(accumuloConfDir, control.accumuloConfDir);
+ assertEquals(accumuloConfDir, control.clientAccumuloConfDir);
assertEquals(accumuloHome + "/bin/accumulo", control.accumuloPath);
assertEquals(accumuloHome + "/bin/start-server.sh", control.startServerPath);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
index a0cca46..16460ed 100644
--- a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
+++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
@@ -133,7 +133,8 @@ public abstract class AccumuloClusterIT extends AccumuloIT implements MiniCluste
conf.getAccumuloServerUser());
// If these are provided in the configuration, pass them into the cluster
standaloneCluster.setAccumuloHome(conf.getAccumuloHome());
- standaloneCluster.setAccumuloConfDir(conf.getAccumuloConfDir());
+ standaloneCluster.setClientAccumuloConfDir(conf.getClientAccumuloConfDir());
+ standaloneCluster.setServerAccumuloConfDir(conf.getServerAccumuloConfDir());
standaloneCluster.setHadoopConfDir(conf.getHadoopConfDir());
// For SASL, we need to get the Hadoop configuration files as well otherwise UGI will log in as SIMPLE instead of KERBEROS
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4eda9ec7/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java b/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
index 53e30c2..e04c10c 100644
--- a/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
+++ b/test/src/test/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
@@ -68,7 +68,8 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
public static final String ACCUMULO_STANDALONE_USER_PASSWORDS_KEY = ACCUMULO_STANDALONE_PREFIX + "passwords.";
public static final String ACCUMULO_STANDALONE_HOME = ACCUMULO_STANDALONE_PREFIX + "home";
- public static final String ACCUMULO_STANDALONE_CONF = ACCUMULO_STANDALONE_PREFIX + "conf";
+ public static final String ACCUMULO_STANDALONE_CLIENT_CONF = ACCUMULO_STANDALONE_PREFIX + "client.conf";
+ public static final String ACCUMULO_STANDALONE_SERVER_CONF = ACCUMULO_STANDALONE_PREFIX + "server.conf";
public static final String ACCUMULO_STANDALONE_HADOOP_CONF = ACCUMULO_STANDALONE_PREFIX + "hadoop.conf";
private Map<String,String> conf;
@@ -214,8 +215,12 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
return conf.get(ACCUMULO_STANDALONE_HOME);
}
- public String getAccumuloConfDir() {
- return conf.get(ACCUMULO_STANDALONE_CONF);
+ public String getClientAccumuloConfDir() {
+ return conf.get(ACCUMULO_STANDALONE_CLIENT_CONF);
+ }
+
+ public String getServerAccumuloConfDir() {
+ return conf.get(ACCUMULO_STANDALONE_SERVER_CONF);
}
@Override
[2/7] accumulo git commit: ACCUMULO-3821 Switch CleanTmpIT back to
minicluster only
Posted by el...@apache.org.
ACCUMULO-3821 Switch CleanTmpIT back to minicluster only
On a system with separate users and hdfs permissions enabled,
there's no good way to make the tmp file in HDFS without
special sudo'ing logic.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/11c16006
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/11c16006
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/11c16006
Branch: refs/heads/master
Commit: 11c16006033716a2335446afa067cba4a0266051
Parents: c85361a
Author: Josh Elser <el...@apache.org>
Authored: Sat May 16 21:10:33 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Sat May 16 21:10:33 2015 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/test/functional/CleanTmpIT.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/11c16006/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
index d384ca4..921d661 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
@@ -35,8 +35,6 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.harness.AccumuloClusterIT;
-import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
@@ -49,11 +47,11 @@ import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
-public class CleanTmpIT extends AccumuloClusterIT {
+public class CleanTmpIT extends ConfigurableMacIT {
private static final Logger log = LoggerFactory.getLogger(CleanTmpIT.class);
@Override
- public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
+ public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
cfg.setProperty(Property.INSTANCE_ZK_TIMEOUT, "3s");
cfg.setNumTservers(1);
// use raw local file system so walogs sync and flush will work
@@ -95,7 +93,7 @@ public class CleanTmpIT extends AccumuloClusterIT {
Entry<Key,Value> entry = Iterables.getOnlyElement(s);
Path file = new Path(entry.getKey().getColumnQualifier().toString());
- FileSystem fs = getFileSystem();
+ FileSystem fs = getCluster().getFileSystem();
assertTrue("Could not find file: " + file, fs.exists(file));
Path tabletDir = file.getParent();
assertNotNull("Tablet dir should not be null", tabletDir);
@@ -103,8 +101,8 @@ public class CleanTmpIT extends AccumuloClusterIT {
// Make the file
fs.create(tmp).close();
log.info("Created tmp file {}", tmp.toString());
- getClusterControl().stopAllServers(ServerType.TABLET_SERVER);
- getClusterControl().startAllServers(ServerType.TABLET_SERVER);
+ getCluster().stop();
+ getCluster().start();
Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY);
assertEquals(2, Iterators.size(scanner.iterator()));
[3/7] accumulo git commit: ACCUMULO-3822 chmod 777 the import and
export directory
Posted by el...@apache.org.
ACCUMULO-3822 chmod 777 the import and export directory
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/88940000
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/88940000
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/88940000
Branch: refs/heads/master
Commit: 88940000f50636eca6ff45d740027806584d6119
Parents: 11c1600
Author: Josh Elser <el...@apache.org>
Authored: Sat May 16 21:11:38 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Sun May 17 10:15:10 2015 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/test/ImportExportIT.java | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/88940000/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java b/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
index 1472d9f..f30a970 100644
--- a/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
@@ -16,6 +16,9 @@
*/
package org.apache.accumulo.test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
@@ -37,6 +40,7 @@ import org.apache.accumulo.harness.AccumuloClusterIT;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileUtil;
+import org.apache.hadoop.fs.FsShell;
import org.apache.hadoop.fs.Path;
import org.junit.Assert;
import org.junit.Test;
@@ -85,15 +89,23 @@ public class ImportExportIT extends AccumuloClusterIT {
// Must exist on the filesystem the cluster is running.
FileSystem fs = cluster.getFileSystem();
Path tmp = cluster.getTemporaryPath();
+ log.info("Using FileSystem: " + fs);
Path baseDir = new Path(tmp, getClass().getName());
- fs.mkdirs(baseDir);
+ if (fs.exists(baseDir)) {
+ log.info("{} exists on filesystem, deleting", baseDir);
+ assertTrue("Failed to deleted " + baseDir, fs.delete(baseDir, true));
+ }
+ log.info("Creating {}", baseDir);
+ assertTrue("Failed to create " + baseDir, fs.mkdirs(baseDir));
Path exportDir = new Path(baseDir, "export");
Path importDir = new Path(baseDir, "import");
for (Path p : new Path[] {exportDir, importDir}) {
- fs.delete(p, true);
- fs.mkdirs(p);
+ assertTrue("Failed to create " + baseDir, fs.mkdirs(p));
}
+ FsShell fsShell = new FsShell(fs.getConf());
+ assertEquals("Failed to chmod " + baseDir, 0, fsShell.run(new String[] {"-chmod", "-R", "777", baseDir.toString()}));
+
log.info("Exporting table to {}", exportDir);
log.info("Importing table from {}", importDir);
[4/7] accumulo git commit: ACCUMULO-3822 chmod 777 the import and
export directory
Posted by el...@apache.org.
ACCUMULO-3822 chmod 777 the import and export directory
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/88940000
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/88940000
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/88940000
Branch: refs/heads/1.7
Commit: 88940000f50636eca6ff45d740027806584d6119
Parents: 11c1600
Author: Josh Elser <el...@apache.org>
Authored: Sat May 16 21:11:38 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Sun May 17 10:15:10 2015 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/test/ImportExportIT.java | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/88940000/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java b/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
index 1472d9f..f30a970 100644
--- a/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
@@ -16,6 +16,9 @@
*/
package org.apache.accumulo.test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
@@ -37,6 +40,7 @@ import org.apache.accumulo.harness.AccumuloClusterIT;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileUtil;
+import org.apache.hadoop.fs.FsShell;
import org.apache.hadoop.fs.Path;
import org.junit.Assert;
import org.junit.Test;
@@ -85,15 +89,23 @@ public class ImportExportIT extends AccumuloClusterIT {
// Must exist on the filesystem the cluster is running.
FileSystem fs = cluster.getFileSystem();
Path tmp = cluster.getTemporaryPath();
+ log.info("Using FileSystem: " + fs);
Path baseDir = new Path(tmp, getClass().getName());
- fs.mkdirs(baseDir);
+ if (fs.exists(baseDir)) {
+ log.info("{} exists on filesystem, deleting", baseDir);
+ assertTrue("Failed to deleted " + baseDir, fs.delete(baseDir, true));
+ }
+ log.info("Creating {}", baseDir);
+ assertTrue("Failed to create " + baseDir, fs.mkdirs(baseDir));
Path exportDir = new Path(baseDir, "export");
Path importDir = new Path(baseDir, "import");
for (Path p : new Path[] {exportDir, importDir}) {
- fs.delete(p, true);
- fs.mkdirs(p);
+ assertTrue("Failed to create " + baseDir, fs.mkdirs(p));
}
+ FsShell fsShell = new FsShell(fs.getConf());
+ assertEquals("Failed to chmod " + baseDir, 0, fsShell.run(new String[] {"-chmod", "-R", "777", baseDir.toString()}));
+
log.info("Exporting table to {}", exportDir);
log.info("Importing table from {}", importDir);
[7/7] accumulo git commit: Merge branch '1.7'
Posted by el...@apache.org.
Merge branch '1.7'
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/61f92790
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/61f92790
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/61f92790
Branch: refs/heads/master
Commit: 61f927901a230128831c5401c4a3bc552e400f45
Parents: f98ddc2 4eda9ec
Author: Josh Elser <el...@apache.org>
Authored: Sun May 17 10:37:27 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Sun May 17 10:37:27 2015 -0400
----------------------------------------------------------------------
.../standalone/StandaloneAccumuloCluster.java | 21 ++++++++++++++------
.../standalone/StandaloneClusterControl.java | 17 ++++++++--------
.../StandaloneClusterControlTest.java | 6 +++---
.../accumulo/harness/AccumuloClusterIT.java | 3 ++-
.../StandaloneAccumuloClusterConfiguration.java | 11 +++++++---
.../apache/accumulo/test/ImportExportIT.java | 18 ++++++++++++++---
.../accumulo/test/functional/CleanTmpIT.java | 12 +++++------
7 files changed, 57 insertions(+), 31 deletions(-)
----------------------------------------------------------------------