accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1433949 - in /accumulo/trunk: examples/instamo/src/main/java/org/apache/accumulo/instamo/ examples/instamo/src/test/java/org/apache/accumulo/instamo/ test/src/main/java/org/apache/accumulo/test/ test/src/test/java/org/apache/accumulo/test/
Date Wed, 16 Jan 2013 14:32:39 GMT
Author: kturner
Date: Wed Jan 16 14:32:38 2013
New Revision: 1433949

URL: http://svn.apache.org/viewvc?rev=1433949&view=rev
Log:
ACCUMULO-880 added simpler constructor to MiniAccumuloCluster for default use case.  Renamed
MacConfig

Added:
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloConfig.java
      - copied, changed from r1433104, accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MacConfig.java
Removed:
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MacConfig.java
Modified:
    accumulo/trunk/examples/instamo/src/main/java/org/apache/accumulo/instamo/MapReduceExample.java
    accumulo/trunk/examples/instamo/src/test/java/org/apache/accumulo/instamo/ExampleAccumuloUnitTest.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java

Modified: accumulo/trunk/examples/instamo/src/main/java/org/apache/accumulo/instamo/MapReduceExample.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/examples/instamo/src/main/java/org/apache/accumulo/instamo/MapReduceExample.java?rev=1433949&r1=1433948&r2=1433949&view=diff
==============================================================================
--- accumulo/trunk/examples/instamo/src/main/java/org/apache/accumulo/instamo/MapReduceExample.java
(original)
+++ accumulo/trunk/examples/instamo/src/main/java/org/apache/accumulo/instamo/MapReduceExample.java
Wed Jan 16 14:32:38 2013
@@ -21,7 +21,6 @@ import java.util.UUID;
 
 import org.apache.accumulo.server.test.continuous.ContinuousIngest;
 import org.apache.accumulo.server.test.continuous.ContinuousVerify;
-import org.apache.accumulo.test.MacConfig;
 import org.apache.accumulo.test.MiniAccumuloCluster;
 import org.apache.commons.io.FileUtils;
 
@@ -52,7 +51,7 @@ public class MapReduceExample {
     File tmpDir = new File(FileUtils.getTempDirectory(), "macc-" + UUID.randomUUID().toString());
     
     try {
-      MiniAccumuloCluster la = new MiniAccumuloCluster(new MacConfig(tmpDir, "pass1234"));
+      MiniAccumuloCluster la = new MiniAccumuloCluster(tmpDir, "pass1234");
       la.start();
       
       System.out.println("\n   ---- Running Mapred Against Accumulo\n");

Modified: accumulo/trunk/examples/instamo/src/test/java/org/apache/accumulo/instamo/ExampleAccumuloUnitTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/examples/instamo/src/test/java/org/apache/accumulo/instamo/ExampleAccumuloUnitTest.java?rev=1433949&r1=1433948&r2=1433949&view=diff
==============================================================================
--- accumulo/trunk/examples/instamo/src/test/java/org/apache/accumulo/instamo/ExampleAccumuloUnitTest.java
(original)
+++ accumulo/trunk/examples/instamo/src/test/java/org/apache/accumulo/instamo/ExampleAccumuloUnitTest.java
Wed Jan 16 14:32:38 2013
@@ -17,7 +17,6 @@ package org.apache.accumulo.instamo;
  */
 
 
-import org.apache.accumulo.test.MacConfig;
 import org.apache.accumulo.test.MiniAccumuloCluster;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -39,7 +38,7 @@ public class ExampleAccumuloUnitTest {
 
     folder.create();
     
-    accumulo = new MiniAccumuloCluster(new MacConfig(folder.getRoot(), "superSecret"));
+    accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
     
     accumulo.start();
     

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java?rev=1433949&r1=1433948&r2=1433949&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java Wed
Jan 16 14:32:38 2013
@@ -118,7 +118,7 @@ public class MiniAccumuloCluster {
   
   private List<LogWriter> logWriters = new ArrayList<MiniAccumuloCluster.LogWriter>();
 
-  private MacConfig config;
+  private MiniAccumuloConfig config;
   private Process[] tabletServerProcesses;
 
   private int getRandomFreePort() {
@@ -188,7 +188,7 @@ public class MiniAccumuloCluster {
     if (!siteConfig.containsKey(key))
       fileWriter.append("<property><name>" + key + "</name><value>"
+ value + "</value></property>\n");
   }
-
+  
   /**
    * 
    * @param dir
@@ -196,13 +196,19 @@ public class MiniAccumuloCluster {
    *          and Junit provide methods for creating temporary directories.
    * @param rootPassword
    *          Initial root password for instance.
-   * @param siteConfig
-   *          Any system properties that needs to be set before Accumulo processes are started.
These are properties that would normally be placed in
-   *          accumulo-site.xml
+   * @throws IOException
+   */
+  public MiniAccumuloCluster(File dir, String rootPassword) throws IOException {
+    this(new MiniAccumuloConfig(dir, rootPassword));
+  }
+
+  /**
+   * @param config
+   *          initial configuration
    * @throws IOException
    */
 
-  public MiniAccumuloCluster(MacConfig config) throws IOException {
+  public MiniAccumuloCluster(MiniAccumuloConfig config) throws IOException {
 
     if (config.getDir().exists() && !config.getDir().isDirectory())
       throw new IllegalArgumentException("Must pass in directory, " + config.getDir() + "
is a file");

Copied: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloConfig.java
(from r1433104, accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MacConfig.java)
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloConfig.java?p2=accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloConfig.java&p1=accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MacConfig.java&r1=1433104&r2=1433949&rev=1433949&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MacConfig.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloConfig.java Wed
Jan 16 14:32:38 2013
@@ -24,7 +24,7 @@ import java.util.Map;
  * Holds configuration for {@link MiniAccumuloCluster}. Required configurations must be passed
to constructor and all other configurations are optional.
  */
 
-public class MacConfig {
+public class MiniAccumuloConfig {
   
   private File dir = null;
   private String rootPassword = null;
@@ -33,12 +33,13 @@ public class MacConfig {
   
   /**
    * @param dir
-   *          A local directory where mini accumulo cluster will store all of its data. This
directory should be empty or non-existant.
+   *          An empty or nonexistant temp directoy that Accumulo and Zookeeper can store
data in. Creating the directory is left to the user. Java 7, Guava,
+   *          and Junit provide methods for creating temporary directories.
    * @param rootPassword
    *          The initial password for the Accumulo root user
    */
 
-  public MacConfig(File dir, String rootPassword) {
+  public MiniAccumuloConfig(File dir, String rootPassword) {
     this.dir = dir;
     this.rootPassword = rootPassword;
   }
@@ -63,7 +64,7 @@ public class MacConfig {
    * @return
    */
   
-  public MacConfig setNumTservers(int numTservers) {
+  public MiniAccumuloConfig setNumTservers(int numTservers) {
     if (numTservers < 1)
       throw new IllegalArgumentException("Must have at least one tablet server");
     this.numTservers = numTservers;
@@ -83,7 +84,7 @@ public class MacConfig {
    * @return
    */
   
-  public MacConfig setSiteConfig(Map<String,String> siteConfig) {
+  public MiniAccumuloConfig setSiteConfig(Map<String,String> siteConfig) {
     this.siteConfig = siteConfig;
     return this;
   }

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java?rev=1433949&r1=1433948&r2=1433949&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
(original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
Wed Jan 16 14:32:38 2013
@@ -59,7 +59,7 @@ public class MiniAccumuloClusterTest {
     
     Logger.getLogger("org.apache.zookeeper").setLevel(Level.WARN);
 
-    accumulo = new MiniAccumuloCluster(new MacConfig(folder.getRoot(), "superSecret").setNumTservers(2));
+    accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
     
     accumulo.start();
     



Mime
View raw message