Details
Description
Related to HBASE-8367 there is no programmatic way to determine if the hbase.bulkload.retries.number value has been hit. Callers of doBulkLoad have no way to determine other than log examination whether the bulk load was actually successful.
Here is the relevant code sections:
LoadIncrementalHFiles.java
public void doBulkLoad ... { try { ... if (maxRetries != 0 && count >= maxRetries) { LOG.error("Retry attempted " + count + " times without completing, bailing out"); return; } ... } finally { ... pool.shutdown(); if (queue != null && !queue.isEmpty()) { StringBuilder err = new StringBuilder(); err.append("-------------------------------------------------\n"); err.append("Bulk load aborted with some files not yet loaded:\n"); err.append("-------------------------------------------------\n"); for (LoadQueueItem q : queue) { err.append(" ").append(q.hfilePath).append('\n'); } LOG.error(err); } } if (queue != null && !queue.isEmpty()) { throw new RuntimeException("Bulk load aborted with some files not yet loaded." + "Please check log for more details."); }
One possible solution is to move the throw new RuntimeException clause at the end into the finally block. The exception is currently never thrown for max retries due to the return in the initial if statement.