accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/5] git commit: ACCUMULO-3276 More logging about what the client is doing for shard and multitable.
Date Thu, 30 Oct 2014 03:25:21 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 10cc4c491 -> 1aa4784a9
  refs/heads/master 4d7cdc161 -> c662e0a15


ACCUMULO-3276 More logging about what the client is doing for shard and multitable.


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

Branch: refs/heads/1.6
Commit: 54d09bb16a16217701ce92a40f00f3a241d16975
Parents: 10cc4c4
Author: Josh Elser <elserj@apache.org>
Authored: Wed Oct 29 14:17:56 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Oct 29 14:17:56 2014 -0400

----------------------------------------------------------------------
 .../test/randomwalk/multitable/CreateTable.java |  5 +-
 .../test/randomwalk/shard/ShardFixture.java     | 62 ++++++++++++--------
 2 files changed, 42 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/54d09bb1/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
----------------------------------------------------------------------
diff --git 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
index 3bcd0eb..408b7df 100644
--- 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
@@ -46,10 +46,11 @@ public class CreateTable extends Test {
     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);
       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/54d09bb1/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
----------------------------------------------------------------------
diff --git 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
index ccf4f35..aa2422b 100644
--- 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
@@ -31,69 +31,83 @@ import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 
 public class ShardFixture extends Fixture {
-  
+
   static SortedSet<Text> genSplits(long max, int numTablets, String format) {
-    
+
     int numSplits = numTablets - 1;
     long distance = max / numTablets;
     long split = distance;
-    
+
     TreeSet<Text> splits = new TreeSet<Text>();
-    
+
     for (int i = 0; i < numSplits; i++) {
       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();
     String name = (String) state.get("indexTableName") + suffix;
     int numPartitions = (Integer) state.get("numPartitions");
     boolean enableCache = (Boolean) state.get("cacheIndex");
     conn.tableOperations().create(name);
-    conn.tableOperations().addSplits(name, genSplits(numPartitions, rand.nextInt(numPartitions)
+ 1, "%06x"));
+
+    String tableId = conn.tableOperations().tableIdMap().get(name);
+    log.info("Created index table " + name + "(id:" + tableId + ")");
     
+    SortedSet<Text> splits = genSplits(numPartitions, rand.nextInt(numPartitions) +
1, "%06x");
+    conn.tableOperations().addSplits(name, splits);
+
+    log.info("Added " + splits.size() + " splits to " + name);
+
     if (enableCache) {
       conn.tableOperations().setProperty(name, Property.TABLE_INDEXCACHE_ENABLED.getKey(),
"true");
       conn.tableOperations().setProperty(name, Property.TABLE_BLOCKCACHE_ENABLED.getKey(),
"true");
-      
+
       log.info("Enabled caching for table " + name);
     }
   }
-  
+
   @Override
   public void setUp(State state) throws Exception {
     String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
     String pid = state.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();
-    
+
     createIndexTable(this.log, state, "", 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 {
     // We have resources we need to clean up
@@ -104,17 +118,19 @@ public class ShardFixture extends Fixture {
       } catch (MutationsRejectedException e) {
         log.error("Ignoring mutations that weren't flushed", e);
       }
-      
+
       // Reset the MTBW on the state to null
       state.resetMultiTableBatchWriter();
     }
-    
+
     Connector conn = state.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