Skip to content

Commit

Permalink
HBASE-18679 Add a null check around the result of getCounters() in ITBLL
Browse files Browse the repository at this point in the history
  • Loading branch information
joshelser committed Aug 25, 2017
1 parent 439191e commit 2773510
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,11 @@ public int run(int numMappers, long numNodes, Path tmpOutput,
public boolean verify() {
try {
Counters counters = job.getCounters();
if (counters == null) {
LOG.info("Counters object was null, Generator verification cannot be performed."
+ " This is commonly a result of insufficient YARN configuration.");
return false;
}

if (counters.findCounter(Counts.TERMINATING).getValue() > 0 ||
counters.findCounter(Counts.UNDEFINED).getValue() > 0 ||
Expand Down Expand Up @@ -1315,7 +1320,8 @@ public int run(Path outputDir, int numReducers) throws Exception {
if (success) {
Counters counters = job.getCounters();
if (null == counters) {
LOG.warn("Counters were null, cannot verify Job completion");
LOG.warn("Counters were null, cannot verify Job completion."
+ " This is commonly a result of insufficient YARN configuration.");
// We don't have access to the counters to know if we have "bad" counts
return 0;
}
Expand All @@ -1337,6 +1343,11 @@ public boolean verify(long expectedReferenced) throws Exception {
}

Counters counters = job.getCounters();
if (counters == null) {
LOG.info("Counters object was null, write verification cannot be performed."
+ " This is commonly a result of insufficient YARN configuration.");
return false;
}

// Run through each check, even if we fail one early
boolean success = verifyExpectedValues(expectedReferenced, counters);
Expand Down

0 comments on commit 2773510

Please sign in to comment.