private void recordFailure(final Table table, final Put put, final long keyBase, final long start,
    IOException e) {
    failedKeySet.add(keyBase);
    String exceptionInfo;
    if (e instanceof RetriesExhaustedWithDetailsException) {
      RetriesExhaustedWithDetailsException aggEx = (RetriesExhaustedWithDetailsException) e;
      exceptionInfo = aggEx.getExhaustiveDescription();
    } else {
      StringWriter stackWriter = new StringWriter();
      PrintWriter pw = new PrintWriter(stackWriter);
      e.printStackTrace(pw);
      pw.flush();
      exceptionInfo = StringUtils.stringifyException(e);
    }
    LOG.error("Failed to insert: " + keyBase + " after "
      + (EnvironmentEdgeManager.currentTime() - start) + "ms; region information: "
      + getRegionDebugInfoSafe(table, put.getRow()) + "; errors: " + exceptionInfo);
  }
MultiThreadedWriter that helps in testing ACL
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/util/MultiThreadedWriterWithACL.java