Search in sources :

Example 6 with CancelledException

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;
}
Also used : InetSocketAddress(java.net.InetSocketAddress) CancelledException(alluxio.exception.status.CancelledException) UnavailableException(alluxio.exception.status.UnavailableException) DeadlineExceededException(alluxio.exception.status.DeadlineExceededException) AlluxioStatusException(alluxio.exception.status.AlluxioStatusException) Nullable(javax.annotation.Nullable)

Aggregations

CancelledException (alluxio.exception.status.CancelledException)6 DeadlineExceededException (alluxio.exception.status.DeadlineExceededException)3 IOException (java.io.IOException)2 TimeoutException (java.util.concurrent.TimeoutException)2 AlluxioException (alluxio.exception.AlluxioException)1 AlluxioStatusException (alluxio.exception.status.AlluxioStatusException)1 UnavailableException (alluxio.exception.status.UnavailableException)1 LockResource (alluxio.resource.LockResource)1 InetSocketAddress (java.net.InetSocketAddress)1 ExecutionException (java.util.concurrent.ExecutionException)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1 Nullable (javax.annotation.Nullable)1