Search in sources :

Example 6 with UnauthenticatedException

use of alluxio.exception.status.UnauthenticatedException in project alluxio by Alluxio.

the class AuthenticatedChannelClientDriver method waitUntilChannelAuthenticated.

private void waitUntilChannelAuthenticated(long timeoutMs) throws AlluxioStatusException {
    try {
        // Wait until authentication status changes.
        mChannelAuthenticatedFuture.get(timeoutMs, TimeUnit.MILLISECONDS);
        mChannelAuthenticated = true;
    } catch (InterruptedException ie) {
        Thread.currentThread().interrupt();
        throw AlluxioStatusException.fromThrowable(ie);
    } catch (ExecutionException e) {
        AlluxioStatusException statExc = AlluxioStatusException.fromThrowable(e.getCause());
        // Unimplemented is returned if server doesn't provide authentication service.
        if (statExc.getStatusCode() == Status.Code.UNIMPLEMENTED) {
            throw new UnauthenticatedException("Authentication is disabled on target server.");
        }
        throw statExc;
    } catch (TimeoutException e) {
        throw new UnavailableException(e);
    }
}
Also used : UnauthenticatedException(alluxio.exception.status.UnauthenticatedException) UnavailableException(alluxio.exception.status.UnavailableException) AlluxioStatusException(alluxio.exception.status.AlluxioStatusException) ExecutionException(java.util.concurrent.ExecutionException) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

UnauthenticatedException (alluxio.exception.status.UnauthenticatedException)6 UnavailableException (alluxio.exception.status.UnavailableException)3 AlluxioStatusException (alluxio.exception.status.AlluxioStatusException)2 GrpcChannel (alluxio.grpc.GrpcChannel)2 UUID (java.util.UUID)2 ServiceNotFoundException (alluxio.exception.ServiceNotFoundException)1 FailedPreconditionException (alluxio.exception.status.FailedPreconditionException)1 NotFoundException (alluxio.exception.status.NotFoundException)1 GetConfigurationPResponse (alluxio.grpc.GetConfigurationPResponse)1 GrpcConnection (alluxio.grpc.GrpcConnection)1 GrpcServer (alluxio.grpc.GrpcServer)1 MetaMasterConfigurationServiceGrpc (alluxio.grpc.MetaMasterConfigurationServiceGrpc)1 RetryPolicy (alluxio.retry.RetryPolicy)1 User (alluxio.security.User)1 AppLoginModule (alluxio.security.login.AppLoginModule)1 LoginModuleConfiguration (alluxio.security.login.LoginModuleConfiguration)1 UserState (alluxio.security.user.UserState)1 IOException (java.io.IOException)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1