HBASE-14728 TestRowCounter is broken in master (Abhishek Singh Chouhan) -- REAPPLY
This commit is contained in:
parent
950050e9d6
commit
6c5da91b18
|
@ -38,6 +38,8 @@ import org.apache.hadoop.hbase.client.Put;
|
||||||
import org.apache.hadoop.hbase.client.Table;
|
import org.apache.hadoop.hbase.client.Table;
|
||||||
import org.apache.hadoop.hbase.util.Bytes;
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
import org.apache.hadoop.hbase.util.LauncherSecurityManager;
|
import org.apache.hadoop.hbase.util.LauncherSecurityManager;
|
||||||
|
import org.apache.hadoop.mapreduce.Counter;
|
||||||
|
import org.apache.hadoop.mapreduce.Job;
|
||||||
import org.apache.hadoop.util.ToolRunner;
|
import org.apache.hadoop.util.ToolRunner;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
@ -203,9 +205,11 @@ public class TestRowCounter {
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private void runRowCount(String[] args, int expectedCount) throws Exception {
|
private void runRowCount(String[] args, int expectedCount) throws Exception {
|
||||||
final RowCounter counter = new RowCounter();
|
Job job = RowCounter.createSubmittableJob(TEST_UTIL.getConfiguration(), args);
|
||||||
assertEquals("job failed either due to failure or miscount (see log output).", 0,
|
job.waitForCompletion(true);
|
||||||
ToolRunner.run(TEST_UTIL.getConfiguration(), counter, args));
|
assertTrue(job.isSuccessful());
|
||||||
|
Counter counter = job.getCounters().findCounter(RowCounter.RowCounterMapper.Counters.ROWS);
|
||||||
|
assertEquals(expectedCount, counter.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue