Object[] results = new Object[actions.size()];
ServerName server = addr.getServerName();
Map<ServerName, MultiAction<Row>> actionsByServer =
Collections.singletonMap(server, actions);
try {
AsyncRequestFuture arf =
ap.submitMultiActions(null, retainedActions, 0L, null, results, true, null,
null, actionsByServer, null);
arf.waitUntilDone();
if (arf.hasError()) {
// We just log and ignore the exception here since failed Puts will be resubmit again.
LOG.debug("Caught some exceptions when flushing puts to region server "
+ addr.getHostnamePort(), arf.getErrors());
}
} finally {
for (int i = 0; i < results.length; i++) {
if (results[i] instanceof Result) {
failedCount--;