final Agent agent = agents[index];
i = 0;
do {
try {
transceiver = null;
final AvroSourceProtocol c = connect(agent.getHost(), agent.getPort());
final Status status = (batch == null) ? c.append(avroEvent) : c.appendBatch(batch);
if (!status.equals(Status.OK)) {
if (i == retries - 1) {
final String warnMsg = "RPC communication failed to " + getName() + " at " +
agent.getHost() + ":" + agent.getPort();
LOGGER.warn(warnMsg);