Package org.apache.hadoop.hive.ql.metadata

Examples of org.apache.hadoop.hive.ql.metadata.AuthorizationException


    for (String hiveUDF : Splitter.on(",").omitEmptyStrings().trimResults().split(whiteList)) {
      if (queryUDF.equalsIgnoreCase(hiveUDF)) {
        return; // found the given UDF in whitelist
      }
    }
    throw new AuthorizationException("The UDF " + queryUDF + " is not found in the list of allowed UDFs");
  }
View Full Code Here


    case DFS_DIR:
    case LOCAL_DIR:
      try {
        objectHierarchy.add(parseURI(entity.toString()));
      } catch (Exception e) {
        throw new AuthorizationException("Failed to get File URI", e);
      }
      break;
    default:
      throw new UnsupportedOperationException("Unsupported entity type " +
          entity.getType().name());
View Full Code Here

        if (PathUtils.impliesURI(localScratchURI, localRequestURI)) {
          return true;
        }
      }
    } catch (Exception e) {
      throw new AuthorizationException("Failed to extract uri details", e);
    }
    return false;
  }
View Full Code Here

            .trim();
        SentryOnFailureHookContext hookContext = new SentryOnFailureHookContextImpl(
            queryPlan.getQueryString(), new HashSet<ReadEntity>(),
            new HashSet<WriteEntity>(), stmtOperation,
            null, null, null, null, subject.getName(), ipAddress,
            new AuthorizationException(e), conf);
        HiveAuthzBindingHook.runFailureHook(hookContext, csHooks);
        throw e; // rethrow the exception for logging
      }
    } catch(Throwable throwable) {
      setException(throwable);
View Full Code Here

    protected FsAction getFsAction(Privilege priv, Path path) {

        switch (priv.getPriv()) {
        case ALL:
            throw new AuthorizationException("no matching Action for Privilege.All");
        case ALTER_DATA:
            return FsAction.WRITE;
        case ALTER_METADATA:
            return FsAction.WRITE;
        case CREATE:
            return FsAction.WRITE;
        case DROP:
            return FsAction.WRITE;
        case INDEX:
            return FsAction.WRITE;
        case LOCK:
            return FsAction.WRITE;
        case SELECT:
            return FsAction.READ;
        case SHOW_DATABASE:
            return FsAction.READ;
        case UNKNOWN:
        default:
            throw new AuthorizationException("Unknown privilege");
        }
    }
View Full Code Here

            }

            checkPermissions(getConf(), path, actions);

        } catch (AccessControlException ex) {
            throw new AuthorizationException(ex);
        } catch (LoginException ex) {
            throw new AuthorizationException(ex);
        } catch (IOException ex) {
            throw new HiveException(ex);
        }
    }
View Full Code Here

    hiveObject = hiveObject + "}";

    if (inputCheck != null) {
      int input = this.firstFalseIndex(inputCheck);
      if (input >= 0) {
        throw new AuthorizationException("No privilege '"
            + inputRequiredPriv[input].toString() + "' found for inputs "
            + hiveObject);
      }
    }

    if (outputCheck != null) {
      int output = this.firstFalseIndex(outputCheck);
      if (output >= 0) {
        throw new AuthorizationException("No privilege '"
            + outputRequiredPriv[output].toString() + "' found for outputs "
            + hiveObject);
      }
    }
  }
View Full Code Here

  }
 
  protected FsAction getFsAction(Privilege priv, Path path) {
   
    switch (priv.getPriv()) {
    case ALL            : throw new AuthorizationException("no matching Action for Privilege.All");
    case ALTER_DATA     : return FsAction.WRITE;  
    case ALTER_METADATA : return FsAction.WRITE; 
    case CREATE         : return FsAction.WRITE;
    case DROP           : return FsAction.WRITE;
    case INDEX          : return FsAction.WRITE;
    case LOCK           : return FsAction.WRITE;
    case SELECT         : return FsAction.READ;
    case SHOW_DATABASE  : return FsAction.READ;
    case UNKNOWN        :
    default             : throw new AuthorizationException("Unknown privilege");
    }
  }
View Full Code Here

      }
     
      checkPermissions(getConf(), path, actions);
     
    } catch (AccessControlException ex) {
      throw new AuthorizationException(ex);
    } catch (LoginException ex) {
      throw new AuthorizationException(ex);
    } catch (IOException ex) {
      throw new HiveException(ex);
    }
  }
View Full Code Here

      return FsAction.READ;
    case SHOW_DATABASE:
      return FsAction.READ;
    case UNKNOWN:
    default:
      throw new AuthorizationException("Unknown privilege");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.metadata.AuthorizationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.