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 2014/03/20 17:19:49 UTC
git commit: ACCUMULO-2061 Co-locate volumes with the MAC dir
Repository: accumulo
Updated Branches:
refs/heads/ACCUMULO-2061 8b8d565b7 -> 3487f8a80
ACCUMULO-2061 Co-locate volumes with the MAC dir
Losing the volumes on test failure sucks because you can't validate
if we misplaced a file on the wrong volume in the first place.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/3487f8a8
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/3487f8a8
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/3487f8a8
Branch: refs/heads/ACCUMULO-2061
Commit: 3487f8a80810a73fb742382a6ecab609cb518b0b
Parents: 8b8d565
Author: Josh Elser <el...@apache.org>
Authored: Thu Mar 20 12:18:42 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Thu Mar 20 12:18:42 2014 -0400
----------------------------------------------------------------------
.../java/org/apache/accumulo/test/VolumeIT.java | 26 ++++++--------------
1 file changed, 7 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/3487f8a8/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
index 0a7ef3f..c0e41c1 100644
--- a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
@@ -22,7 +22,6 @@ import static org.junit.Assert.assertTrue;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
-import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
@@ -65,7 +64,6 @@ import org.apache.accumulo.server.ServerConstants;
import org.apache.accumulo.server.init.Initialize;
import org.apache.accumulo.server.util.Admin;
import org.apache.accumulo.test.functional.ConfigurableMacIT;
-import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
@@ -73,38 +71,28 @@ import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.RawLocalFileSystem;
import org.apache.hadoop.io.Text;
import org.apache.zookeeper.ZooKeeper;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.BeforeClass;
import org.junit.Test;
public class VolumeIT extends ConfigurableMacIT {
private static final Text EMPTY = new Text();
private static final Value EMPTY_VALUE = new Value(new byte[] {});
- public static File volDirBase;
- public static Path v1;
- public static Path v2;
+ private File volDirBase;
+ private Path v1, v2;
- @BeforeClass
- public static void createVolumeDirs() throws IOException {
- volDirBase = createSharedTestDir(VolumeIT.class.getName() + "-volumes");
+ @SuppressWarnings("deprecation")
+ @Override
+ public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
+ File baseDir = cfg.getDir();
+ volDirBase = new File(baseDir, "volumes");
File v1f = new File(volDirBase, "v1");
File v2f = new File(volDirBase, "v2");
v1f.mkdir();
v2f.mkdir();
v1 = new Path("file://" + v1f.getAbsolutePath());
v2 = new Path("file://" + v2f.getAbsolutePath());
- }
- @After
- public void clearDirs() throws IOException {
- FileUtils.deleteQuietly(new File(v1.getParent().toUri()));
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
// Run MAC on two locations in the local file system
URI v1Uri = v1.toUri();
cfg.setProperty(Property.INSTANCE_DFS_DIR, v1Uri.getPath());