hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1530064 - /hbase/branches/0.96/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
Date Mon, 07 Oct 2013 21:11:22 GMT
Author: sershe
Date: Mon Oct  7 21:11:21 2013
New Revision: 1530064

URL: http://svn.apache.org/r1530064
Log:
HBASE-9714 add scan logging to IntegrationTestLoadAndVerify

Modified:
    hbase/branches/0.96/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java

Modified: hbase/branches/0.96/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java?rev=1530064&r1=1530063&r2=1530064&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
(original)
+++ hbase/branches/0.96/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
Mon Oct  7 21:11:21 2013
@@ -47,10 +47,12 @@ import org.apache.hadoop.hbase.client.HT
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.client.ScannerCallable;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.mapreduce.NMapInputFormat;
 import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil;
 import org.apache.hadoop.hbase.mapreduce.TableMapper;
+import org.apache.hadoop.hbase.mapreduce.TableRecordReaderImpl;
 import org.apache.hadoop.hbase.util.AbstractHBaseTool;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.BytesWritable;
@@ -316,6 +318,7 @@ public class IntegrationTestLoadAndVerif
     job.setMapperClass(LoadMapper.class);
     job.setInputFormatClass(NMapInputFormat.class);
     job.setNumReduceTasks(0);
+    setJobScannerConf(job);
     FileOutputFormat.setOutputPath(job, outputDir);
 
     TableMapReduceUtil.addDependencyJars(job);
@@ -331,6 +334,7 @@ public class IntegrationTestLoadAndVerif
     Job job = new Job(conf);
     job.setJarByClass(this.getClass());
     job.setJobName(TEST_NAME + " Verification for " + htd.getTableName());
+    setJobScannerConf(job);
 
     Scan scan = new Scan();
 
@@ -350,6 +354,13 @@ public class IntegrationTestLoadAndVerif
     assertEquals(0, numOutputRecords);
   }
 
+  private static void setJobScannerConf(Job job) {
+    // Make sure scanners log something useful to make debugging possible.
+    job.getConfiguration().setBoolean(ScannerCallable.LOG_SCANNER_ACTIVITY, true);
+    long lpr = job.getConfiguration().getLong(NUM_TO_WRITE_KEY, NUM_TO_WRITE_DEFAULT) / 100;
+    job.getConfiguration().setInt(TableRecordReaderImpl.LOG_PER_ROW_COUNT, (int)lpr);
+  }
+
   public Path getTestDir(String testName, String subdir) throws IOException {
     //HBaseTestingUtility.getDataTestDirOnTestFs() has not been backported.
     FileSystem fs = FileSystem.get(getConf());



Mime
View raw message