fe/src/main/java/com/cloudera/impala/authorization/AuthorizationConfig.java
/*
   * Validates the authorization configuration and throws an AuthorizationException
   * if any problems are found. If authorization is disabled, config checks are skipped.
   */
Validates the authorization configuration and throws an AuthorizationException
if any problems are found. If authorization is disabled, config checks are skipped.
Validates the authorization configuration and throws an AuthorizationException if any problems are found . If authorization is disabled config checks are skipped .
public void validateConfig() throws IllegalArgumentException {
    if (!isEnabled()) {
      return;
    }
    if (serverName_ == null || serverName_.isEmpty()) {
      throw new IllegalArgumentException("Authorization is enabled but the server name" +
          " is null or empty. Set the server name using the impalad --server_name flag."
          );
    }
    if (policyFile_ == null || policyFile_.isEmpty()) {
      throw new IllegalArgumentException("Authorization is enabled but the policy file" +
          " path was null or empty. Set the policy file using the " +
          "--authorization_policy_file impalad flag.");
    }
    if (policyProviderClassName_ == null || policyProviderClassName_.isEmpty()) {
      throw new IllegalArgumentException("Authorization is enabled but the " +
          "authorization policy provider class name is null or empty. Set the class " +
          "name using the --authorization_policy_provider_class impalad flag.");
    }
    Class<?> providerClass = null;
    try {
      providerClass = Class.forName(policyProviderClassName_, false,
          this.getClass().getClassLoader());
    } catch (ClassNotFoundException e) {
      throw new IllegalArgumentException(String.format("The authorization policy " +
          "provider class '%s' was not found.", policyProviderClassName_), e);
    }
    Preconditions.checkNotNull(providerClass);
    if (!ResourceAuthorizationProvider.class.isAssignableFrom(providerClass)) {
      throw new IllegalArgumentException(String.format("The authorization policy " +
          "provider class '%s' must be a subclass of '%s'.",
          policyProviderClassName_,
          ResourceAuthorizationProvider.class.getName()));
    }
  }
public void validateConfig ( ) throws IllegalArgumentException { if ( ! isEnabled ( ) ) { return ; } if ( serverName_ == null || serverName_ . isEmpty ( ) ) { throw new IllegalArgumentException ( "Authorization is enabled but the server name" + " is null or empty. Set the server name using the impalad --server_name flag." ) ; } if ( policyFile_ == null || policyFile_ . isEmpty ( ) ) { throw new IllegalArgumentException ( "Authorization is enabled but the policy file" + " path was null or empty. Set the policy file using the " + "--authorization_policy_file impalad flag." ) ; } if ( policyProviderClassName_ == null || policyProviderClassName_ . isEmpty ( ) ) { throw new IllegalArgumentException ( "Authorization is enabled but the " + "authorization policy provider class name is null or empty. Set the class " + "name using the --authorization_policy_provider_class impalad flag." ) ; } Class < ? > providerClass = null ; try { providerClass = Class . forName ( policyProviderClassName_ , false , this . getClass ( ) . getClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException ( String . format ( "The authorization policy " + "provider class '%s' was not found." , policyProviderClassName_ ) , e ) ; } Preconditions . checkNotNull ( providerClass ) ; if ( ! ResourceAuthorizationProvider . class . isAssignableFrom ( providerClass ) ) { throw new IllegalArgumentException ( String . format ( "The authorization policy " + "provider class '%s' must be a subclass of '%s'." , policyProviderClassName_ , ResourceAuthorizationProvider . class . getName ( ) ) ) ; } }
Validates the authorization configuration and throws an AuthorizationException
 if any problems are found.
Validates the authorization configuration and throws an AuthorizationException if any problems are found .
// If authorization is not enabled, config checks are skipped. // Get the Class object without performing any initialization.