accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [5/5] git commit: Merge branch '1.6'
Date Thu, 30 Oct 2014 03:25:25 GMT
Merge branch '1.6'

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


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

Branch: refs/heads/master
Commit: c662e0a15d02b4fd146bde67aaecb1597a8a4a14
Parents: 4d7cdc1 1aa4784
Author: Josh Elser <elserj@apache.org>
Authored: Wed Oct 29 23:15:45 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Oct 29 23:15:45 2014 -0400

----------------------------------------------------------------------
 .../core/client/impl/TableOperationsImpl.java   |  8 +++
 .../test/randomwalk/multitable/CreateTable.java |  3 +
 .../test/randomwalk/shard/ShardFixture.java     | 62 ++++++++++++--------
 3 files changed, 50 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/c662e0a1/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/c662e0a1/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 272c3ea,408b7df..27ab09c
--- 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
@@@ -47,10 -46,11 +47,13 @@@ public class CreateTable extends Test 
      String tableName = String.format("%s_%d", state.getString("tableNamePrefix"), nextId);
      try {
        conn.tableOperations().create(tableName);
 -      String tableId = Tables.getNameToIdMap(state.getInstance()).get(tableName);
 +      // Add some splits to make the server's life easier
 +      conn.tableOperations().addSplits(tableName, splits);
 +      String tableId = Tables.getNameToIdMap(env.getInstance()).get(tableName);
        log.debug("created " + tableName + " (id:" + tableId + ")");
+       // Add some splits to make the server's life easier
+       conn.tableOperations().addSplits(tableName, splits);
+       log.debug("created " + splits.size() + " splits on " + tableName);
        @SuppressWarnings("unchecked")
        ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
        tables.add(tableName);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/c662e0a1/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
----------------------------------------------------------------------
diff --cc test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
index 99529e2,aa2422b..36e9d5e
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
@@@ -45,12 -44,12 +45,12 @@@ public class ShardFixture extends Fixtu
        splits.add(new Text(String.format(format, split)));
        split += distance;
      }
-     
+ 
      return splits;
    }
-   
+ 
 -  static void createIndexTable(Logger log, State state, String suffix, Random rand) throws
Exception {
 -    Connector conn = state.getConnector();
 +  static void createIndexTable(Logger log, State state, Environment env, String suffix,
Random rand) throws Exception {
 +    Connector conn = env.getConnector();
      String name = (String) state.get("indexTableName") + suffix;
      int numPartitions = (Integer) state.get("numPartitions");
      boolean enableCache = (Boolean) state.get("cacheIndex");
@@@ -64,58 -70,67 +71,67 @@@
        log.info("Enabled caching for table " + name);
      }
    }
-   
+ 
    @Override
 -  public void setUp(State state) throws Exception {
 +  public void setUp(State state, Environment env) throws Exception {
      String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
 -    String pid = state.getPid();
 +    String pid = env.getPid();
-     
+ 
      Random rand = new Random();
-     
+ 
      int numPartitions = rand.nextInt(90) + 10;
-     
+ 
      state.set("indexTableName", String.format("ST_index_%s_%s_%d", hostname, pid, System.currentTimeMillis()));
      state.set("docTableName", String.format("ST_docs_%s_%s_%d", hostname, pid, System.currentTimeMillis()));
      state.set("numPartitions", Integer.valueOf(numPartitions));
      state.set("cacheIndex", rand.nextDouble() < .5);
      state.set("rand", rand);
      state.set("nextDocID", Long.valueOf(0));
-     
+ 
 -    Connector conn = state.getConnector();
 +    Connector conn = env.getConnector();
-     
+ 
 -    createIndexTable(this.log, state, "", rand);
 +    createIndexTable(this.log, state, env, "", rand);
-     
+ 
      String docTableName = (String) state.get("docTableName");
      conn.tableOperations().create(docTableName);
-     conn.tableOperations().addSplits(docTableName, genSplits(0xff, rand.nextInt(32) + 1,
"%02x"));
-     
+ 
+     String tableId = conn.tableOperations().tableIdMap().get(docTableName);
+     log.info("Created doc table " + docTableName + " (id:" + tableId + ")");
+ 
+     SortedSet<Text> splits = genSplits(0xff, rand.nextInt(32) + 1, "%02x");
+     conn.tableOperations().addSplits(docTableName, splits);
+ 
+     log.info("Added " + splits.size() + " splits to " + docTableName);
+ 
      if (rand.nextDouble() < .5) {
        conn.tableOperations().setProperty((String) state.get("docTableName"), Property.TABLE_BLOOM_ENABLED.getKey(),
"true");
        log.info("Enabled bloom filters for table " + (String) state.get("docTableName"));
      }
    }
-   
+ 
    @Override
 -  public void tearDown(State state) throws Exception {
 +  public void tearDown(State state, Environment env) throws Exception {
      // We have resources we need to clean up
 -    if (state.isMultiTableBatchWriterInitialized()) {
 -      MultiTableBatchWriter mtbw = state.getMultiTableBatchWriter();
 +    if (env.isMultiTableBatchWriterInitialized()) {
 +      MultiTableBatchWriter mtbw = env.getMultiTableBatchWriter();
        try {
          mtbw.close();
        } catch (MutationsRejectedException e) {
          log.error("Ignoring mutations that weren't flushed", e);
        }
-       
+ 
        // Reset the MTBW on the state to null
 -      state.resetMultiTableBatchWriter();
 +      env.resetMultiTableBatchWriter();
      }
-     
+ 
 -    Connector conn = state.getConnector();
 +    Connector conn = env.getConnector();
-     
+ 
+     log.info("Deleting index and doc tables");
+ 
      conn.tableOperations().delete((String) state.get("indexTableName"));
      conn.tableOperations().delete((String) state.get("docTableName"));
-     
+ 
      log.debug("Exiting shard test");
    }
-   
+ 
  }


Mime
View raw message