use of alluxio.exception.status.CancelledException in project alluxio by Alluxio.
the class PollingMasterInquireClient method getAddress.
@Nullable
private InetSocketAddress getAddress() {
// Iterate over the masters and try to connect to each of their RPC ports.
List<InetSocketAddress> addresses;
if (mConfiguration.getBoolean(PropertyKey.USER_RPC_SHUFFLE_MASTERS_ENABLED)) {
addresses = Lists.newArrayList(mConnectDetails.getAddresses());
Collections.shuffle(addresses);
} else {
addresses = mConnectDetails.getAddresses();
}
for (InetSocketAddress address : addresses) {
try {
LOG.debug("Checking whether {} is listening for RPCs", address);
pingMetaService(address);
LOG.debug("Successfully connected to {}", address);
return address;
} catch (UnavailableException e) {
LOG.debug("Failed to connect to {}", address);
continue;
} catch (DeadlineExceededException e) {
LOG.debug("Timeout while connecting to {}", address);
continue;
} catch (CancelledException e) {
LOG.debug("Cancelled while connecting to {}", address);
continue;
} catch (AlluxioStatusException e) {
LOG.error("Error while connecting to {}. {}", address, e);
// Breaking the loop on non filtered error.
break;
}
}
return null;
}
Aggregations