accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1459533 - in /accumulo/trunk: ./ assemble/ core/ core/src/main/java/org/apache/accumulo/core/util/ core/src/main/java/org/apache/accumulo/core/util/shell/ core/src/main/java/org/apache/accumulo/core/util/shell/commands/ core/src/test/java/...
Date Thu, 21 Mar 2013 21:24:32 GMT
Author: ecn
Date: Thu Mar 21 21:24:31 2013
New Revision: 1459533

URL: http://svn.apache.org/r1459533
Log:
ACCUMULO-581 run a lot more shell commands using miniaccumulo cluster

Added:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteShellIterCommand.java
      - copied unchanged from r1459531, accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteShellIterCommand.java
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/shell/
      - copied from r1459531, accumulo/branches/1.5/test/src/test/java/org/apache/accumulo/test/shell/
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/shell/ShellServerTest.java
      - copied unchanged from r1459531, accumulo/branches/1.5/test/src/test/java/org/apache/accumulo/test/shell/ShellServerTest.java
Removed:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteShellterCommand.java
Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HistoryCommand.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/TraceCommand.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/ShellTest.java
    accumulo/trunk/examples/   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java 
 (props changed)
    accumulo/trunk/pom.xml
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/src/   (props changed)
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
    accumulo/trunk/test/pom.xml
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1459531

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/assemble:r1459531

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1459531

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
Thu Mar 21 21:24:31 2013
@@ -23,6 +23,8 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
 
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
@@ -140,7 +142,7 @@ public class LocalityGroupUtil {
   }
   
   public static String encodeColumnFamilies(Set<Text> colFams) {
-    HashSet<String> ecfs = new HashSet<String>();
+    SortedSet<String> ecfs = new TreeSet<String>();
     
     StringBuilder sb = new StringBuilder();
     

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java Thu
Mar 21 21:24:31 2013
@@ -112,9 +112,22 @@ public class TableDiskUsage {
     return externalUsage;
   }
   
+  public interface Printer {
+    void print(String line);
+  }
+  
   public static void printDiskUsage(AccumuloConfiguration acuConf, Collection<String>
tables, FileSystem fs, Connector conn) throws TableNotFoundException,
-      IOException {
-    
+  IOException {
+    printDiskUsage(acuConf, tables, fs, conn, new Printer() {
+      @Override
+      public void print(String line) {
+        System.out.println(line);
+      }
+    });
+  }
+  public static void printDiskUsage(AccumuloConfiguration acuConf, Collection<String>
tables, FileSystem fs, Connector conn, Printer printer) throws TableNotFoundException,
+  IOException {
+  
     TableDiskUsage tdu = new TableDiskUsage();
     
     HashSet<String> tableIds = new HashSet<String>();
@@ -204,7 +217,7 @@ public class TableDiskUsage {
     }
     
     for (Entry<TreeSet<String>,Long> entry : usage.entrySet())
-      System.out.printf("%,24d %s%n", entry.getValue(), entry.getKey());
+      printer.print(String.format("%,24d %s", entry.getValue(), entry.getKey()));
     
   }
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java Thu Mar
21 21:24:31 2013
@@ -84,7 +84,7 @@ import org.apache.accumulo.core.util.she
 import org.apache.accumulo.core.util.shell.commands.DeleteManyCommand;
 import org.apache.accumulo.core.util.shell.commands.DeleteRowsCommand;
 import org.apache.accumulo.core.util.shell.commands.DeleteScanIterCommand;
-import org.apache.accumulo.core.util.shell.commands.DeleteShellterCommand;
+import org.apache.accumulo.core.util.shell.commands.DeleteShellIterCommand;
 import org.apache.accumulo.core.util.shell.commands.DeleteTableCommand;
 import org.apache.accumulo.core.util.shell.commands.DeleteUserCommand;
 import org.apache.accumulo.core.util.shell.commands.DropTableCommand;
@@ -348,7 +348,7 @@ public class Shell extends ShellOptions 
     Command[] exitCommands = {new ByeCommand(), new ExitCommand(), new QuitCommand()};
     Command[] helpCommands = {new AboutCommand(), new HelpCommand(), new InfoCommand(), new
QuestionCommand()};
     Command[] iteratorCommands = {new DeleteIterCommand(), new DeleteScanIterCommand(), new
ListIterCommand(), new SetIterCommand(), new SetScanIterCommand(),
-        new SetShellIterCommand(), new ListShellIterCommand(), new DeleteShellterCommand()};
+        new SetShellIterCommand(), new ListShellIterCommand(), new DeleteShellIterCommand()};
     Command[] otherCommands = {new HiddenCommand()};
     Command[] permissionsCommands = {new GrantCommand(), new RevokeCommand(), new SystemPermissionsCommand(),
new TablePermissionsCommand(),
         new UserPermissionsCommand()};
@@ -432,7 +432,10 @@ public class Shell extends ShellOptions 
     if (isVerbose())
       printInfo();
     
-    String configDir = System.getenv("HOME") + "/.accumulo";
+    String home = System.getProperty("HOME");
+    if (home == null)
+      home = System.getenv("HOME");
+    String configDir = home + "/.accumulo";
     String historyPath = configDir + "/shell_history.txt";
     File accumuloDir = new File(configDir);
     if (!accumuloDir.exists() && !accumuloDir.mkdirs())
@@ -972,6 +975,10 @@ public class Shell extends ShellOptions 
     this.exit = exit;
   }
   
+  public boolean getExit() {
+    return this.exit;
+  }
+  
   public boolean isVerbose() {
     return verbose;
   }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java
Thu Mar 21 21:24:31 2013
@@ -16,15 +16,30 @@
  */
 package org.apache.accumulo.core.util.shell.commands;
 
+import java.io.IOException;
+
+import jline.ConsoleReader;
+
 import org.apache.accumulo.core.util.shell.Shell;
 import org.apache.accumulo.core.util.shell.Shell.Command;
 import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
+import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.Printer;
 import org.apache.commons.cli.CommandLine;
 
 public class ClasspathCommand extends Command {
   @Override
   public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
{
-    AccumuloVFSClassLoader.printClassPath();
+    final ConsoleReader reader = shellState.getReader();
+    AccumuloVFSClassLoader.printClassPath(new Printer() {
+      @Override
+      public void print(String s) {
+        try {
+          reader.printString(s + "\n");
+        } catch (IOException ex) {
+          throw new RuntimeException(ex);
+        }
+      }
+    });
     return 0;
   }
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
Thu Mar 21 21:24:31 2013
@@ -25,6 +25,7 @@ import org.apache.accumulo.core.client.T
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.ConfigurationCopy;
 import org.apache.accumulo.core.util.TableDiskUsage;
+import org.apache.accumulo.core.util.TableDiskUsage.Printer;
 import org.apache.accumulo.core.util.shell.Shell;
 import org.apache.accumulo.core.util.shell.Shell.Command;
 import org.apache.commons.cli.CommandLine;
@@ -37,7 +38,7 @@ public class DUCommand extends Command {
   
   private Option optTablePattern;
   
-  public int execute(final String fullCommand, final CommandLine cl, Shell shellState) throws
IOException, TableNotFoundException {
+  public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws IOException, TableNotFoundException {
     
     final SortedSet<String> tablesToFlush = new TreeSet<String>(Arrays.asList(cl.getArgs()));
     if (cl.hasOption(optTablePattern.getOpt())) {
@@ -49,7 +50,17 @@ public class DUCommand extends Command {
     }
     try {
       final AccumuloConfiguration acuConf = new ConfigurationCopy(shellState.getConnector().instanceOperations().getSystemConfiguration());
-      TableDiskUsage.printDiskUsage(acuConf, tablesToFlush, FileSystem.get(new Configuration()),
shellState.getConnector());
+      TableDiskUsage.printDiskUsage(acuConf, tablesToFlush, FileSystem.get(new Configuration()),
shellState.getConnector(), new Printer() {
+        @Override
+        public void print(String line) {
+          try {
+            shellState.getReader().printString(line + "\n");
+          } catch (IOException ex) {
+            throw new RuntimeException(ex);
+          }
+        }
+        
+      });
     } catch (Exception ex) {
       throw new RuntimeException(ex);
     }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HistoryCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HistoryCommand.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HistoryCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HistoryCommand.java
Thu Mar 21 21:24:31 2013
@@ -36,7 +36,10 @@ public class HistoryCommand extends Comm
   @Override
   public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws Exception {
     
-    final String histDir = System.getenv("HOME") + "/.accumulo";
+    String home = System.getProperty("HOME");
+    if (home == null)
+      home = System.getenv("HOME");
+    final String histDir = home + "/.accumulo";
     int counter = 0;
     
     if (cl.hasOption(clearHist.getOpt())) {
@@ -60,8 +63,7 @@ public class HistoryCommand extends Comm
         try {
           Line = in.readLine();
           while (Line != null) {
-            shellState.getReader().printString(counter + " " + Line);
-            shellState.getReader().printNewline();
+            shellState.getReader().printString(counter + " " + Line + "\n");
             counter++;
             Line = in.readLine();
           }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java
Thu Mar 21 21:24:31 2013
@@ -28,12 +28,13 @@ import org.apache.commons.cli.Options;
 import org.apache.hadoop.io.Text;
 
 public class MergeCommand extends Command {
-  private Option verboseOpt, forceOpt, sizeOpt;
+  private Option verboseOpt, forceOpt, sizeOpt, allOpt;
   
   @Override
   public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws Exception {
     boolean verbose = shellState.isVerbose();
     boolean force = false;
+    boolean all = false;
     long size = -1;
     final String tableName = OptUtil.getTableOpt(cl, shellState);
     final Text startRow = OptUtil.getStartRow(cl);
@@ -44,10 +45,13 @@ public class MergeCommand extends Comman
     if (cl.hasOption(forceOpt.getOpt())) {
       force = true;
     }
+    if (cl.hasOption(allOpt.getOpt())) {
+      force = true;
+    }
     if (cl.hasOption(sizeOpt.getOpt())) {
       size = AccumuloConfiguration.getMemoryInBytes(cl.getOptionValue(sizeOpt.getOpt()));
     }
-    if (startRow == null && endRow == null && size < 0) {
+    if (startRow == null && endRow == null && size < 0 && all)
{
       shellState.getReader().flushConsole();
       String line = shellState.getReader().readLine("Merge the entire table { " + tableName
+ " } into one tablet (yes|no)? ");
       if (line == null)
@@ -92,6 +96,7 @@ public class MergeCommand extends Comman
     verboseOpt = new Option("v", "verbose", false, "verbose output during merge");
     sizeOpt = new Option("s", "size", true, "merge tablets to the given size over the entire
table");
     forceOpt = new Option("f", "force", false, "merge small tablets to large tablets, even
if it goes over the given size");
+    allOpt = new Option("", "all", false, "allow an entire table to be merged into one tablet
without prompting the user for confirmation");
     Option startRowOpt = OptUtil.startRowOpt();
     startRowOpt.setDescription("begin row (NOT inclusive)");
     o.addOption(startRowOpt);
@@ -100,6 +105,7 @@ public class MergeCommand extends Comman
     o.addOption(verboseOpt);
     o.addOption(sizeOpt);
     o.addOption(forceOpt);
+    o.addOption(allOpt);
     return o;
   }
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/TraceCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/TraceCommand.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/TraceCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/TraceCommand.java
Thu Mar 21 21:24:31 2013
@@ -42,7 +42,7 @@ public class TraceCommand extends DebugC
         if (Trace.isTracing()) {
           final long trace = Trace.currentTrace().traceId();
           Trace.off();
-          for (int i = 0; i < 10; i++) {
+          for (int i = 0; i < 30; i++) {
             try {
               final Map<String,String> properties = shellState.getConnector().instanceOperations().getSystemConfiguration();
               final String table = properties.get(Property.TRACE_TABLE.getKey());

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/ShellTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/ShellTest.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/ShellTest.java (original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/ShellTest.java Thu
Mar 21 21:24:31 2013
@@ -32,7 +32,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class ShellTest {
-  static class TestOutputStream extends OutputStream {
+  public static class TestOutputStream extends OutputStream {
     StringBuilder sb = new StringBuilder();
     
     @Override
@@ -164,4 +164,5 @@ public class ShellTest {
     Shell.log.debug("Starting user test --------------------------");
     //exec("createuser root", false, "user exists");
   }
+  
 }

Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/examples:r1459531

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1459531

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1459531

Modified: accumulo/trunk/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/pom.xml?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/pom.xml (original)
+++ accumulo/trunk/pom.xml Thu Mar 21 21:24:31 2013
@@ -223,7 +223,7 @@
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <redirectTestOutputToFile>true</redirectTestOutputToFile>
+          <redirectTestOutputToFile>false</redirectTestOutputToFile>
         </configuration>
       </plugin>
     </plugins>
@@ -548,6 +548,12 @@
             <version>${hadoop.version}</version>
             <scope>provided</scope>
           </dependency>
+          <dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>hadoop-tools</artifactId>
+            <version>${hadoop.version}</version>
+            <scope>test</scope>
+          </dependency>
         </dependencies>
       </dependencyManagement>
     </profile>
@@ -576,6 +582,12 @@
             <scope>provided</scope>
           </dependency>
           <dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>hadoop-distcp</artifactId>
+            <version>${hadoop.version}</version>
+            <scope>test</scope>
+          </dependency>
+          <dependency>
             <groupId>org.apache.avro</groupId>
             <artifactId>avro</artifactId>
             <version>${avro.version}</version>

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1459531

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/src:r1459531

Modified: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
(original)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
Thu Mar 21 21:24:31 2013
@@ -261,8 +261,19 @@ public class AccumuloVFSClassLoader {
 
     return localLoader.getClassLoader();
   }
+  public interface Printer {
+    void print(String s);
+  }
   
   public static void printClassPath() {
+    printClassPath(new Printer() {
+      @Override
+      public void print(String s) { 
+        System.out.println(s);
+      }
+    });
+  }
+  public static void printClassPath(Printer out) {
     try {
       ClassLoader cl = getClassLoader();
       ArrayList<ClassLoader> classloaders = new ArrayList<ClassLoader>();
@@ -278,27 +289,26 @@ public class AccumuloVFSClassLoader {
       
       for (ClassLoader classLoader : classloaders) {
         if (level > 0)
-          System.out.println();
-        System.out.print("Level " + level + " ");
+          out.print("");
         level++;
         
         if (classLoader instanceof URLClassLoader) {
           // If VFS class loader enabled, but no contexts defined.
           URLClassLoader ucl = (URLClassLoader) classLoader;
-          System.out.println("URL classpath items are:");
+          out.print("Level " + level + " URL classpath items are:");
 
             for (URL u : ucl.getURLs()) {
-              System.out.println("\t" + u.toExternalForm());
+              out.print("\t" + u.toExternalForm());
             }
 
         } else if (classLoader instanceof VFSClassLoader) {
-          System.out.println("VFS classpaths items are:");
+          out.print("Level " + level + " VFS classpaths items are:");
           VFSClassLoader vcl = (VFSClassLoader) classLoader;
           for (FileObject f : vcl.getFileObjects()) {
-            System.out.println("\t" + f.getURL().toExternalForm());
+            out.print("\t" + f.getURL().toExternalForm());
           }
         } else {
-          System.out.println("Unknown classloader configuration " + classLoader.getClass());
+          out.print("Unknown classloader configuration " + classLoader.getClass());
         }
       }
       

Modified: accumulo/trunk/test/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/pom.xml?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/test/pom.xml (original)
+++ accumulo/trunk/test/pom.xml Thu Mar 21 21:24:31 2013
@@ -111,6 +111,10 @@
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-math</artifactId>
     </dependency>
+    <dependency>
+    	<groupId>org.apache.hadoop</groupId>
+    	<artifactId>hadoop-tools</artifactId>
+    </dependency>
   </dependencies>
 
 </project>

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=1459533&r1=1459532&r2=1459533&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 Thu
Mar 21 21:24:31 2013
@@ -148,7 +148,7 @@ public class MiniAccumuloCluster {
     throw new RuntimeException("Unable to find port");
   }
   
-  private Process exec(Class<? extends Object> clazz, String... args) throws IOException
{
+  public Process exec(Class<? extends Object> clazz, String... args) throws IOException
{
     String javaHome = System.getProperty("java.home");
     String javaBin = javaHome + File.separator + "bin" + File.separator + "java";
     String classpath = System.getProperty("java.class.path");
@@ -263,6 +263,8 @@ public class MiniAccumuloCluster {
     appendProp(fileWriter, Property.TSERV_MAXMEM, "50M", siteConfig);
     appendProp(fileWriter, Property.TSERV_WALOG_MAX_SIZE, "100M", siteConfig);
     appendProp(fileWriter, Property.TSERV_NATIVEMAP_ENABLED, "false", siteConfig);
+    appendProp(fileWriter, Property.TRACE_LOGIN_PROPERTIES  + ".password", config.getRootPassword(),
siteConfig);
+    appendProp(fileWriter, Property.TRACE_PORT, "" + getRandomFreePort(), siteConfig);
     // since there is a small amount of memory, check more frequently for majc... setting
may not be needed in 1.5
     appendProp(fileWriter, Property.TSERV_MAJC_DELAY, "3", siteConfig);
     String cp = System.getenv("ACCUMULO_HOME")+"/lib/.*.jar,"+

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
Thu Mar 21 21:24:31 2013
@@ -100,6 +100,7 @@ public class BulkPlusOne extends BulkTes
     fs.delete(dir, true);
     FileStatus[] failures = fs.listStatus(fail);
     if (failures != null && failures.length > 0) {
+      state.set("bulkImportSuccess", "false");
       throw new Exception(failures.length + " failure files found importing files from "
+ dir);
     }
     fs.delete(fail, true);

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
Thu Mar 21 21:24:31 2013
@@ -59,6 +59,7 @@ public class Setup extends Test {
     }
     state.set("rand", rand);
     state.set("fs", FileSystem.get(CachedConfiguration.getInstance()));
+    state.set("bulkImportSuccess", "true");
     BulkPlusOne.counter.set(0l);
     
     ThreadPoolExecutor e = new SimpleThreadPool(MAX_POOL_SIZE, "bulkImportPool");

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
Thu Mar 21 21:24:31 2013
@@ -50,6 +50,10 @@ public class Verify extends Test {
       lastSize = size;
       threadPool.awaitTermination(10, TimeUnit.SECONDS);
     }
+    if (!"true".equals(state.get("bulkImportSuccess"))) {
+      log.info("Not verifying bulk import test due to import failures");
+      return;
+    }
     
     String user = state.getConnector().whoami();
     Authorizations auths = state.getConnector().securityOperations().getUserAuthorizations(user);

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java?rev=1459533&r1=1459532&r2=1459533&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
Thu Mar 21 21:24:31 2013
@@ -24,6 +24,7 @@ import java.util.UUID;
 
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.TableOfflineException;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.test.randomwalk.State;
@@ -37,7 +38,7 @@ public class Write extends Test {
     
     @SuppressWarnings("unchecked")
     ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
-    
+
     if (tables.isEmpty()) {
       log.debug("No tables to ingest into");
       return;
@@ -49,6 +50,9 @@ public class Write extends Test {
     BatchWriter bw = null;
     try {
       bw = state.getMultiTableBatchWriter().getBatchWriter(tableName);
+    } catch (TableOfflineException e) {
+      log.error("Table " + tableName + " is offline!");
+      return;
     } catch (TableNotFoundException e) {
       log.error("Table " + tableName + " not found!");
       return;



Mime
View raw message