Package org.apache.hadoop.hive.metastore.api

Examples of org.apache.hadoop.hive.metastore.api.Role


  public Role getRole(String roleName) throws NoSuchObjectException {
    MRole mRole = this.getMRole(roleName);
    if (mRole == null) {
      throw new NoSuchObjectException(roleName + " role can not be found.");
    }
    Role ret = new Role(mRole.getRoleName(), mRole.getCreateTime(), mRole
        .getOwnerName());
    return ret;
  }
View Full Code Here


          RESERVED_ROLE_NAMES);
    }
    try {
      String grantorName = adminGrantor == null ? null : adminGrantor.getName();
      metastoreClientFactory.getHiveMetastoreClient().create_role(
        new Role(roleName, 0, grantorName));
    } catch (TException e) {
      throw SQLAuthorizationUtils.getPluginException("Error create role", e);
    }
  }
View Full Code Here

  }

  public void createRole(String roleName, String ownerName)
      throws HiveException {
    try {
      getMSC().create_role(new Role(roleName, -1, ownerName));
    } catch (Exception e) {
      throw new HiveException(e);
    }
  }
View Full Code Here

      Boolean ret = null;
      try {
        ret = executeWithRetry(new Command<Boolean>() {
          @Override
          public Boolean run(RawStore ms) throws Exception {
            Role role = ms.getRole(roleName);
            return ms.grantRole(role, userName, principalType, grantor, grantorType, grantOption);
          }
        });
      } catch (MetaException e) {
        throw e;
View Full Code Here

            List<Role> result = new ArrayList<Role>();
            List<MRoleMap> roleMap = ms.listRoles(principalName, principalType);
            if (roleMap!=null) {
              for (MRoleMap role : roleMap) {
                MRole r = role.getRole();
                result.add(new Role(r.getRoleName(), r
                    .getCreateTime(), r.getOwnerName()));
              }
            }
            return result;
          }
View Full Code Here

      Boolean ret = null;
      try {
        ret = executeWithRetry(new Command<Boolean>() {
          @Override
          public Boolean run(RawStore ms) throws Exception {
            Role mRole = ms.getRole(roleName);
            return ms.revokeRole(mRole, userName, principalType);
          }
        });
      } catch (MetaException e) {
        throw e;
View Full Code Here

  }

  public void createRole(String roleName, String ownerName)
      throws HiveException {
    try {
      getMSC().create_role(new Role(roleName, -1, ownerName));
    } catch (Exception e) {
      throw new HiveException(e);
    }
  }
View Full Code Here

          RESERVED_ROLE_NAMES);
    }
    try {
      String grantorName = adminGrantor == null ? null : adminGrantor.getName();
      metastoreClientFactory.getHiveMetastoreClient().create_role(
        new Role(roleName, 0, grantorName));
    } catch (TException e) {
      throw new HiveAuthzPluginException("Error create role : " + e.getMessage(), e);
    }
  }
View Full Code Here

  }

  public void createRole(String roleName, String ownerName)
      throws HiveException {
    try {
      getMSC().create_role(new Role(roleName, -1, ownerName));
    } catch (Exception e) {
      throw new HiveException(e);
    }
  }
View Full Code Here

      if (!users.hasNext()) {
        LOG.info("No user is added in admin role, since config value "+ userStr +
          " is in incorrect format. We accept comma seprated list of users.");
        return;
      }
      Role adminRole;
      RawStore ms = getMS();
      try {
        adminRole = ms.getRole(ADMIN);
      } catch (NoSuchObjectException e) {
        LOG.error("Failed to retrieve just added admin role",e);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.metastore.api.Role

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.