hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject svn commit: r1515206 - in /hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase: ./ chaos/actions/ chaos/monkies/ mapreduce/ mttr/ test/
Date Sun, 18 Aug 2013 20:29:38 GMT
Author: eclark
Date: Sun Aug 18 20:29:37 2013
New Revision: 1515206

URL: http://svn.apache.org/r1515206
Log:
HBASE-9253 clean up IT test code.

Modified:
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestsDriver.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java
Sun Aug 18 20:29:37 2013
@@ -165,7 +165,7 @@ public class IntegrationTestLazyCfLoadin
       scf.setFilterIfMissing(true);
       return scf;
     }
-  };
+  }
 
   @Before
   public void setUp() throws Exception {

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java
Sun Aug 18 20:29:37 2013
@@ -85,7 +85,7 @@ public class IntegrationTestManyRegions 
       LOG.info(String.format("Deleting existing table %s.", TABLE_NAME));
       if (admin.isTableEnabled(TABLE_NAME)) admin.disableTable(TABLE_NAME);
       admin.deleteTable(TABLE_NAME);
-      LOG.info(String.format("Existing table %s deleted."));
+      LOG.info(String.format("Existing table %s deleted.", TABLE_NAME));
     }
     LOG.info("Cluster ready");
   }

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestsDriver.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestsDriver.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestsDriver.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestsDriver.java
Sun Aug 18 20:29:37 2013
@@ -102,8 +102,8 @@ public class IntegrationTestsDriver exte
     IntegrationTestingUtility.setUseDistributedCluster(conf);
     Class<?>[] classes = findIntegrationTestClasses();
     LOG.info("Found " + classes.length + " integration tests to run:");
-    for (int i = 0; i < classes.length; i++) {
-      LOG.info("  " + classes[i]);
+    for (Class<?> aClass : classes) {
+      LOG.info("  " + aClass);
     }
     JUnitCore junit = new JUnitCore();
     junit.addListener(new TextListener(System.out));

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
Sun Aug 18 20:29:37 2013
@@ -56,7 +56,7 @@ public class Action {
     initialServers = regionServers.toArray(new ServerName[regionServers.size()]);
   }
 
-  public void perform() throws Exception { };
+  public void perform() throws Exception { }
 
   /** Returns current region servers */
   protected ServerName[] getCurrentServers() throws IOException {

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java
Sun Aug 18 20:29:37 2013
@@ -31,13 +31,11 @@ import org.apache.hadoop.hbase.util.Byte
  * Action the adds a column family to a table.
  */
 public class AddColumnAction extends Action {
-  private final Random random;
   private final byte[] tableName;
   private HBaseAdmin admin;
 
   public AddColumnAction(String tableName) {
     this.tableName = Bytes.toBytes(tableName);
-    this.random = new Random();
   }
 
   @Override

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
Sun Aug 18 20:29:37 2013
@@ -24,8 +24,8 @@ import org.apache.hadoop.hbase.client.HB
 import org.apache.hadoop.hbase.util.Bytes;
 
 /**
-* Created by eclark on 8/12/13.
-*/
+ * Action that queues a table compaction.
+ */
 public class CompactTableAction extends Action {
   private final byte[] tableNameBytes;
   private final int majorRatio;

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
Sun Aug 18 20:29:37 2013
@@ -58,7 +58,8 @@ public class RemoveColumnAction extends 
     }
 
     int index = random.nextInt(columnDescriptors.length);
-    while(protectedColumns.contains(columnDescriptors[index].getNameAsString())) {
+    while(protectedColumns != null &&
+          protectedColumns.contains(columnDescriptors[index].getNameAsString())) {
       index = random.nextInt(columnDescriptors.length);
     }
 

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java
Sun Aug 18 20:29:37 2013
@@ -22,8 +22,8 @@ import org.apache.hadoop.hbase.ServerNam
 import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey;
 
 /**
-* Created by eclark on 8/12/13.
-*/
+ * Action that restarts a random HRegionServer
+ */
 public class RestartRandomRsAction extends RestartActionBaseAction {
   public RestartRandomRsAction(long sleepTime) {
     super(sleepTime);

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
Sun Aug 18 20:29:37 2013
@@ -20,6 +20,27 @@ package org.apache.hadoop.hbase.chaos.mo
 
 import org.apache.hadoop.hbase.Stoppable;
 
+/**
+ * A utility to injects faults in a running cluster.
+ * <p>
+ * ChaosMonkey defines Action's and Policy's. Actions are sequences of events, like
+ *  - Select a random server to kill
+ *  - Sleep for 5 sec
+ *  - Start the server on the same host
+ * Actions can also be complex events, like rolling restart of all of the servers.
+ * <p>
+ * Policies on the other hand are responsible for executing the actions based on a strategy.
+ * The default policy is to execute a random action every minute based on predefined action
+ * weights. ChaosMonkey executes predefined named policies until it is stopped. More than
one
+ * policy can be active at any time.
+ * <p>
+ * Chaos monkey can be run from the command line, or can be invoked from integration tests.
+ * See {@link org.apache.hadoop.hbase.IntegrationTestIngest} or other integration tests that
use
+ * chaos monkey for code examples.
+ * <p>
+ * ChaosMonkey class is indeed inspired by the Netflix's same-named tool:
+ * http://techblog.netflix.com/2012/07/chaos-monkey-released-into-wild.html
+ */
 public abstract class ChaosMonkey implements Stoppable {
   public abstract void start() throws Exception;
 

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
Sun Aug 18 20:29:37 2013
@@ -30,25 +30,7 @@ import org.apache.hadoop.hbase.chaos.pol
 import org.apache.hadoop.hbase.util.Pair;
 
 /**
- * A utility to injects faults in a running cluster.
- * <p>
- * ChaosMonkey defines Action's and Policy's. Actions are sequences of events, like
- *  - Select a random server to kill
- *  - Sleep for 5 sec
- *  - Start the server on the same host
- * Actions can also be complex events, like rolling restart of all of the servers.
- * <p>
- * Policies on the other hand are responsible for executing the actions based on a strategy.
- * The default policy is to execute a random action every minute based on predefined action
- * weights. ChaosMonkey executes predefined named policies until it is stopped. More than
one
- * policy can be active at any time.
- * <p>
- * Chaos monkey can be run from the command line, or can be invoked from integration tests.
- * See {@link org.apache.hadoop.hbase.IntegrationTestIngest} or other integration tests that
use
- * chaos monkey for code examples.
- * <p>
- * ChaosMonkey class is indeed inspired by the Netflix's same-named tool:
- * http://techblog.netflix.com/2012/07/chaos-monkey-released-into-wild.html
+ * Chaos monkey that given multiple policies will run actions against the cluster.
  */
 public class PolicyBasedChaosMonkey extends ChaosMonkey {
 

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
Sun Aug 18 20:29:37 2013
@@ -329,10 +329,6 @@ public class IntegrationTestBulkLoad ext
 
     private Long order;
 
-    public LinkKey() {
-
-    }
-
     public LinkKey(long chainId, long order) {
       this.chainId = chainId;
       this.order = order;
@@ -373,9 +369,6 @@ public class IntegrationTestBulkLoad ext
       return rk;
     }
 
-    public LinkChain() {
-    }
-
     public LinkChain(Long rk, Long next) {
       this.rk = rk;
       this.next = next;
@@ -416,8 +409,7 @@ public class IntegrationTestBulkLoad ext
                             LinkChain linkChain,
                             int numPartitions) {
       int hash = linkKey.getChainId().hashCode();
-      int partition = hash % numPartitions;
-      return partition;
+      return hash % numPartitions;
     }
   }
 

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
Sun Aug 18 20:29:37 2013
@@ -339,7 +339,9 @@ public class IntegrationTestImportTsv im
       fout.write(Bytes.toBytes("testRunFromOutputCommitter\n"));
       LOG.debug(format("Wrote test data to file: %s", inputPath));
     } finally {
-      fout.close();
+      if (fout != null) {
+        fout.close();
+      }
     }
 
     // create a parent job that ships the HBase dependencies. This is

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java
Sun Aug 18 20:29:37 2013
@@ -445,7 +445,7 @@ public class IntegrationTestMTTR {
 
       rs = table.getScanner(s);
       Result result = rs.next();
-      return rs != null && result != null && result.size() > 0;
+      return result != null && result.size() > 0;
       } finally {
         if (rs != null) {
           rs.close();
@@ -510,7 +510,6 @@ public class IntegrationTestMTTR {
     @Override
     public Boolean call() throws Exception {
       int colsPerKey = 10;
-      int recordSize = 500;
       int numServers = util.getHBaseClusterInterface().getInitialClusterStatus().getServersSize();
       int numKeys = numServers * 5000;
       int writeThreads = 10;
@@ -521,7 +520,7 @@ public class IntegrationTestMTTR {
       do {
         int ret = loadTool.run(new String[]{
             "-tn", loadTableName.getNameAsString(),
-            "-write", String.format("%d:%d:%d", colsPerKey, recordSize, writeThreads),
+            "-write", String.format("%d:%d:%d", colsPerKey, 500, writeThreads),
             "-num_keys", String.valueOf(numKeys),
             "-skip_init"
         });

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java
Sun Aug 18 20:29:37 2013
@@ -28,6 +28,7 @@ import java.util.Random;
 import java.util.Set;
 import java.util.UUID;
 
+import com.google.common.collect.Sets;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.GnuParser;
 import org.apache.commons.cli.HelpFormatter;
@@ -204,10 +205,6 @@ public class IntegrationTestBigLinkedLis
 
     private static final Log LOG = LogFactory.getLog(Generator.class);
 
-    public static enum Counts {
-      UNREFERENCED, UNDEFINED, REFERENCED, CORRUPT
-    }
-
     static class GeneratorInputFormat extends InputFormat<BytesWritable,NullWritable>
{
       static class GeneratorInputSplit extends InputSplit implements Writable {
         @Override
@@ -322,7 +319,6 @@ public class IntegrationTestBigLinkedLis
      */
     static class GeneratorMapper
       extends Mapper<BytesWritable, NullWritable, NullWritable, NullWritable> {
-      Random rand = new Random();
 
       byte[][] first = null;
       byte[][] prev = null;
@@ -350,11 +346,11 @@ public class IntegrationTestBigLinkedLis
         if (this.numNodes < this.wrap) {
           this.wrap = this.numNodes;
         }
-      };
+      }
 
       protected void cleanup(Context context) throws IOException ,InterruptedException {
         table.close();
-      };
+      }
 
       @Override
       protected void map(BytesWritable key, NullWritable value, Context output) throws IOException
{
@@ -593,7 +589,9 @@ public class IntegrationTestBigLinkedLis
           context.getCounter(Counts.UNREFERENCED).increment(1);
         } else {
           if (refs.size() > 1) {
-            context.write(new Text(keyString), new Text(refsSb.toString()));
+            if (refsSb != null) {
+              context.write(new Text(keyString), new Text(refsSb.toString()));
+            }
             context.getCounter(Counts.EXTRAREFERENCES).increment(refs.size() - 1);
           }
           // node is defined and referenced
@@ -1067,18 +1065,18 @@ public class IntegrationTestBigLinkedLis
 
   @Override
   protected Set<String> getColumnFamilies() {
-    return null;
+    return Sets.newHashSet(Bytes.toString(FAMILY_NAME));
   }
 
   private static void setJobConf(Job job, int numMappers, long numNodes,
-      Integer width, Integer wrapMuplitplier) {
+      Integer width, Integer wrapMultiplier) {
     job.getConfiguration().setInt(GENERATOR_NUM_MAPPERS_KEY, numMappers);
     job.getConfiguration().setLong(GENERATOR_NUM_ROWS_PER_MAP_KEY, numNodes);
     if (width != null) {
-      job.getConfiguration().setInt(GENERATOR_WIDTH_KEY, width.intValue());
+      job.getConfiguration().setInt(GENERATOR_WIDTH_KEY, width);
     }
-    if (wrapMuplitplier != null) {
-      job.getConfiguration().setInt(GENERATOR_WRAP_KEY, wrapMuplitplier.intValue());
+    if (wrapMultiplier != null) {
+      job.getConfiguration().setInt(GENERATOR_WRAP_KEY, wrapMultiplier);
     }
   }
 

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java?rev=1515206&r1=1515205&r2=1515206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
Sun Aug 18 20:29:37 2013
@@ -24,7 +24,6 @@ import java.util.UUID;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import org.apache.commons.cli.CommandLine;
 import org.apache.hadoop.conf.Configuration;
@@ -114,7 +113,7 @@ public class IntegrationTestLoadAndVerif
   private enum Counters {
     ROWS_WRITTEN,
     REFERENCES_WRITTEN,
-    REFERENCES_CHECKED;
+    REFERENCES_CHECKED
   }
 
   @Before
@@ -122,9 +121,11 @@ public class IntegrationTestLoadAndVerif
     util = getTestingUtil(getConf());
     util.initializeCluster(3);
     this.setConf(util.getConfiguration());
-    getConf().setLong(NUM_TO_WRITE_KEY, NUM_TO_WRITE_DEFAULT / 100);
-    getConf().setInt(NUM_MAP_TASKS_KEY, NUM_MAP_TASKS_DEFAULT / 100);
-    getConf().setInt(NUM_REDUCE_TASKS_KEY, NUM_REDUCE_TASKS_DEFAULT / 10);
+    if (!util.isDistributedCluster()) {
+      getConf().setLong(NUM_TO_WRITE_KEY, NUM_TO_WRITE_DEFAULT / 100);
+      getConf().setInt(NUM_MAP_TASKS_KEY, NUM_MAP_TASKS_DEFAULT / 100);
+      getConf().setInt(NUM_REDUCE_TASKS_KEY, NUM_REDUCE_TASKS_DEFAULT / 10);
+    }
   }
 
   /**
@@ -360,8 +361,7 @@ public class IntegrationTestLoadAndVerif
     htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
 
     HBaseAdmin admin = getTestingUtil(getConf()).getHBaseAdmin();
-    int numPreCreate = 40;
-    admin.createTable(htd, Bytes.toBytes(0L), Bytes.toBytes(-1L), numPreCreate);
+    admin.createTable(htd, Bytes.toBytes(0L), Bytes.toBytes(-1L), 40);
 
     doLoad(getConf(), htd);
     doVerify(getConf(), htd);



Mime
View raw message