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

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


        ex = e;
        rethrowException(e);
      } finally {
        endFunction("get_principals_in_role", ex == null, ex);
      }
      return new GetPrincipalsInRoleResponse(getRolePrincipalGrants(roleMaps));
    }
View Full Code Here


        ex = e;
        rethrowException(e);
      } finally {
        endFunction("get_principals_in_role", ex == null, ex);
      }
      return new GetPrincipalsInRoleResponse(getRolePrincipalGrants(roleMaps));
    }
View Full Code Here

    if (!isUserAdmin()) {
      throw new HiveAccessControlException("Current user : " + currentUserName+ " is not"
        + " allowed get principals in a role. " + ADMIN_ONLY_MSG);
    }
    try {
      GetPrincipalsInRoleResponse princGrantInfo =
          metastoreClientFactory.getHiveMetastoreClient().get_principals_in_role(new GetPrincipalsInRoleRequest(roleName));

      List<HiveRoleGrant> hiveRoleGrants = new ArrayList<HiveRoleGrant>();
      for(RolePrincipalGrant thriftRoleGrant :  princGrantInfo.getPrincipalGrants()){
        hiveRoleGrants.add(new HiveRoleGrant(thriftRoleGrant));
      }
      return hiveRoleGrants;
    } catch (Exception e) {
      throw new HiveAuthzPluginException("Error getting principals for all roles", e);
View Full Code Here

        ex = e;
        rethrowException(e);
      } finally {
        endFunction("get_principals_in_role", ex == null, ex);
      }
      return new GetPrincipalsInRoleResponse(getRolePrincipalGrants(roleMaps));
    }
View Full Code Here


  public static List<HiveRoleGrant> getHiveRoleGrants(IMetaStoreClient client, String roleName)
      throws Exception {
    GetPrincipalsInRoleRequest request = new GetPrincipalsInRoleRequest(roleName);
    GetPrincipalsInRoleResponse princGrantInfo = client.get_principals_in_role(request);

    List<HiveRoleGrant> hiveRoleGrants = new ArrayList<HiveRoleGrant>();
    for(RolePrincipalGrant thriftRoleGrant :  princGrantInfo.getPrincipalGrants()){
      hiveRoleGrants.add(new HiveRoleGrant(thriftRoleGrant));
    }
    return hiveRoleGrants;
  }
View Full Code Here

    if (!isUserAdmin()) {
      throw new HiveAccessControlException("Current user : " + currentUserName+ " is not"
        + " allowed get principals in a role. " + ADMIN_ONLY_MSG);
    }
    try {
      GetPrincipalsInRoleResponse princGrantInfo =
          metastoreClientFactory.getHiveMetastoreClient().get_principals_in_role(new GetPrincipalsInRoleRequest(roleName));

      List<HiveRoleGrant> hiveRoleGrants = new ArrayList<HiveRoleGrant>();
      for(RolePrincipalGrant thriftRoleGrant :  princGrantInfo.getPrincipalGrants()){
        hiveRoleGrants.add(new HiveRoleGrant(thriftRoleGrant));
      }
      return hiveRoleGrants;
    } catch (Exception e) {
      throw new HiveAuthzPluginException("Error getting principals for all roles", e);
View Full Code Here

        ex = e;
        rethrowException(e);
      } finally {
        endFunction("get_principals_in_role", ex == null, ex);
      }
      return new GetPrincipalsInRoleResponse(getRolePrincipalGrants(roleMaps));
    }
View Full Code Here

        ex = e;
        rethrowException(e);
      } finally {
        endFunction("get_principals_in_role", ex == null, ex);
      }
      return new GetPrincipalsInRoleResponse(getRolePrincipalGrants(roleMaps));
    }
View Full Code Here

TOP

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

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.