accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [6/6] git commit: Merge branch '1.6'
Date Mon, 27 Oct 2014 23:52:54 GMT
Merge branch '1.6'

Conflicts:
	test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
	test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4d6176b3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4d6176b3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4d6176b3

Branch: refs/heads/master
Commit: 4d6176b39b7a5fff4489b9caaeca1ab85eb2730c
Parents: 65cc3d3 41fc5fb
Author: Josh Elser <elserj@apache.org>
Authored: Mon Oct 27 19:52:38 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Mon Oct 27 19:52:38 2014 -0400

----------------------------------------------------------------------
 .../test/randomwalk/multitable/CopyTable.java   | 37 +++++++++++++-------
 .../test/randomwalk/multitable/CreateTable.java | 19 ++++++++--
 2 files changed, 41 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d6176b3/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
----------------------------------------------------------------------
diff --cc test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
index 36f497c,1aa8384..24f83e1
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
@@@ -22,54 -23,64 +23,66 @@@ import java.util.TreeSet
  
  import org.apache.accumulo.core.client.impl.Tables;
  import org.apache.accumulo.core.util.CachedConfiguration;
 +import org.apache.accumulo.test.randomwalk.Environment;
  import org.apache.accumulo.test.randomwalk.State;
  import org.apache.accumulo.test.randomwalk.Test;
+ import org.apache.hadoop.io.Text;
  import org.apache.hadoop.util.ToolRunner;
  
  public class CopyTable extends Test {
-   
+ 
+   private final TreeSet<Text> splits;
+ 
+   public CopyTable() {
+     splits = new TreeSet<Text>();
+     for (int i = 1; i < 10; i++) {
+       splits.add(new Text(Integer.toString(i)));
+     }
+   }
+ 
    @Override
 -  public void visit(State state, Properties props) throws Exception {
 +  public void visit(State state, Environment env, Properties props) throws Exception {
-     
+ 
      @SuppressWarnings("unchecked")
      ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
      if (tables.isEmpty())
        return;
-     
+ 
      Random rand = new Random();
      String srcTableName = tables.remove(rand.nextInt(tables.size()));
-     
+ 
      int nextId = ((Integer) state.get("nextId")).intValue();
      String dstTableName = String.format("%s_%d", state.getString("tableNamePrefix"), nextId);
-     
+ 
      String[] args = new String[8];
      args[0] = "-libjars";
 -    args[1] = state.getMapReduceJars();
 -    args[2] = state.getProperty("USERNAME");
 -    args[3] = state.getProperty("PASSWORD");
 +    args[1] = getMapReduceJars();
 +    args[2] = env.getUserName();
 +    args[3] = env.getPassword();
      args[4] = srcTableName;
 -    args[5] = state.getInstance().getInstanceName();
 -    args[6] = state.getProperty("ZOOKEEPERS");
 +    args[5] = env.getInstance().getInstanceName();
 +    args[6] = env.getConfigProperty("ZOOKEEPERS");
      args[7] = dstTableName;
-     
+ 
      log.debug("copying " + srcTableName + " to " + dstTableName);
-     
+ 
 -    state.getConnector().tableOperations().create(dstTableName);
 -    state.getConnector().tableOperations().addSplits(dstTableName, splits);
 +    env.getConnector().tableOperations().create(dstTableName);
-     
++
++    env.getConnector().tableOperations().addSplits(dstTableName, splits);
+ 
      if (ToolRunner.run(CachedConfiguration.getInstance(), new CopyTool(), args) != 0) {
        log.error("Failed to run map/red verify");
        return;
      }
-     
+ 
 -    String tableId = Tables.getNameToIdMap(state.getInstance()).get(dstTableName);
 +    String tableId = Tables.getNameToIdMap(env.getInstance()).get(dstTableName);
      log.debug("copied " + srcTableName + " to " + dstTableName + " (id - " + tableId + "
)");
-     
+ 
      tables.add(dstTableName);
-     
+ 
 -    state.getConnector().tableOperations().delete(srcTableName);
 +    env.getConnector().tableOperations().delete(srcTableName);
      log.debug("dropped " + srcTableName);
-     
+ 
      nextId++;
      state.set("nextId", Integer.valueOf(nextId));
    }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d6176b3/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
----------------------------------------------------------------------
diff --cc test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
index 3875a0b,3bcd0eb..272c3ea
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
@@@ -22,21 -23,32 +23,33 @@@ import java.util.TreeSet
  import org.apache.accumulo.core.client.Connector;
  import org.apache.accumulo.core.client.TableExistsException;
  import org.apache.accumulo.core.client.impl.Tables;
 +import org.apache.accumulo.test.randomwalk.Environment;
  import org.apache.accumulo.test.randomwalk.State;
  import org.apache.accumulo.test.randomwalk.Test;
+ import org.apache.hadoop.io.Text;
  
  public class CreateTable extends Test {
-   
+ 
+   private final TreeSet<Text> splits;
+ 
+   public CreateTable() {
+     splits = new TreeSet<Text>();
+     for (int i = 1; i < 10; i++) {
+       splits.add(new Text(Integer.toString(i)));
+     }
+   }
+ 
    @Override
 -  public void visit(State state, Properties props) throws Exception {
 -    Connector conn = state.getConnector();
 +  public void visit(State state, Environment env, Properties props) throws Exception {
 +    Connector conn = env.getConnector();
-     
+ 
      int nextId = ((Integer) state.get("nextId")).intValue();
      String tableName = String.format("%s_%d", state.getString("tableNamePrefix"), nextId);
      try {
        conn.tableOperations().create(tableName);
+       // Add some splits to make the server's life easier
+       conn.tableOperations().addSplits(tableName, splits);
 -      String tableId = Tables.getNameToIdMap(state.getInstance()).get(tableName);
 +      String tableId = Tables.getNameToIdMap(env.getInstance()).get(tableName);
        log.debug("created " + tableName + " (id:" + tableId + ")");
        @SuppressWarnings("unchecked")
        ArrayList<String> tables = (ArrayList<String>) state.get("tableList");


Mime
View raw message