/** * Run the RowCounter map reduce job and verify the row count. * * @param args the command line arguments to be used for rowcounter job. * @param expectedCount the expected row count (result of map reduce job). * @throws Exception */ private void runRowCount(String[] args, int expectedCount) throws Exception { GenericOptionsParser opts = new GenericOptionsParser(TEST_UTIL.getConfiguration(), args); Configuration conf = opts.getConfiguration(); args = opts.getRemainingArgs(); Job job = RowCounter.createSubmittableJob(conf, args); job.waitForCompletion(true); assertTrue(job.isSuccessful()); Counter counter = job.getCounters().findCounter(RowCounterMapper.Counters.ROWS); assertEquals(expectedCount, counter.getValue()); }
/** * Run the RowCounter map reduce job and verify the row count. * * @param args the command line arguments to be used for rowcounter job. * @param expectedCount the expected row count (result of map reduce job). * @throws Exception */ private void runRowCount(String[] args, int expectedCount) throws Exception { GenericOptionsParser opts = new GenericOptionsParser( TEST_UTIL.getConfiguration(), args); Configuration conf = opts.getConfiguration(); args = opts.getRemainingArgs(); Job job = RowCounter.createSubmittableJob(conf, args); job.waitForCompletion(true); assertTrue(job.isSuccessful()); Counter counter = job.getCounters().findCounter( RowCounterMapper.Counters.ROWS); assertEquals(expectedCount, counter.getValue()); }