accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1460663 - in /accumulo/trunk: ./ assemble/ core/ examples/ fate/src/main/java/org/apache/accumulo/fate/ fate/src/main/java/org/apache/accumulo/fate/zookeeper/ server/ src/ test/ test/src/test/java/org/apache/accumulo/test/
Date Mon, 25 Mar 2013 13:52:44 GMT
Author: ecn
Date: Mon Mar 25 13:52:43 2013
New Revision: 1460663

URL: http://svn.apache.org/r1460663
Log:
ACCUMULO-581 make ShellServerTest portable to hadoop2.0

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    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/server/   (props changed)
    accumulo/trunk/src/   (props changed)
    accumulo/trunk/test/pom.xml
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java

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

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

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

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

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:r1460660

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:r1460660

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

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

Modified: accumulo/trunk/test/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/pom.xml?rev=1460663&r1=1460662&r2=1460663&view=diff
==============================================================================
--- accumulo/trunk/test/pom.xml (original)
+++ accumulo/trunk/test/pom.xml Mon Mar 25 13:52:43 2013
@@ -73,6 +73,10 @@
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-core</artifactId>
         </dependency>
+        <dependency>
+          <groupId>org.apache.hadoop</groupId>
+          <artifactId>hadoop-tools</artifactId>
+        </dependency>
       </dependencies>
     </profile>
     <!-- profile for building against Hadoop 2.0.x
@@ -90,6 +94,10 @@
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-client</artifactId>
         </dependency>
+        <dependency>
+          <groupId>org.apache.hadoop</groupId>
+          <artifactId>hadoop-distcp</artifactId>
+        </dependency>
       </dependencies>
     </profile>
   </profiles>
@@ -111,10 +119,6 @@
       <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/test/java/org/apache/accumulo/test/ShellServerTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java?rev=1460663&r1=1460662&r2=1460663&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java Mon Mar
25 13:52:43 2013
@@ -12,6 +12,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
 import java.util.Map.Entry;
 
 import jline.ConsoleReader;
@@ -146,7 +147,7 @@ public class ShellServerTest {
     exec("offline t", true);
     String export = folder.newFolder().toString();
     exec("exporttable -t t " + export, true);
-    DistCp cp = new DistCp(new Configuration());
+    DistCp cp = newDistCp();
     String import_ = folder.newFolder().toString();
     cp.run(new String[] {"-f", export + "/distcp.txt", import_});
     exec("importtable t2 " + import_, true);
@@ -158,6 +159,25 @@ public class ShellServerTest {
     exec("deletetable -f t2", true);
   }
   
+  private DistCp newDistCp() {
+    try {
+      @SuppressWarnings("unchecked")
+      Constructor<DistCp>[] constructors = (Constructor<DistCp>[]) DistCp.class.getConstructors();
+      for (Constructor<DistCp> constructor : constructors) {
+        Class<?>[] parameterTypes = constructor.getParameterTypes();
+        if (parameterTypes.length > 1 && parameterTypes[0].equals(Configuration.class))
+          if (parameterTypes.length == 1) {
+            return constructor.newInstance(new Configuration());
+          } else if (parameterTypes.length == 2) {
+            return constructor.newInstance(new Configuration(), null);
+          }
+      }
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
+    throw new RuntimeException("Unexpected constructors for DistCp");
+  }
+
   @Test(timeout = 30000)
   public void setscaniterDeletescaniter() throws Exception {
     // setscaniter, deletescaniter



Mime
View raw message