Tabnine Logo
RolePrincipalGrant.isGrantOption
Code IndexAdd Tabnine to your IDE (free)

How to use
isGrantOption
method
in
org.apache.hadoop.hive.metastore.api.RolePrincipalGrant

Best Java code snippets using org.apache.hadoop.hive.metastore.api.RolePrincipalGrant.isGrantOption (Showing top 13 results out of 315)

origin: apache/hive

static String writeRoleGrantsInfo(List<RolePrincipalGrant> roleGrants, boolean testMode) {
 if (roleGrants == null || roleGrants.isEmpty()) {
  return "";
 }
 StringBuilder builder = new StringBuilder();
 //sort the list to get sorted (deterministic) output (for ease of testing)
 Collections.sort(roleGrants);
 for (RolePrincipalGrant roleGrant : roleGrants) {
  appendNonNull(builder, roleGrant.getRoleName(), true);
  appendNonNull(builder, roleGrant.isGrantOption());
  appendNonNull(builder, testMode ? -1 : roleGrant.getGrantTime() * 1000L);
  appendNonNull(builder, roleGrant.getGrantorName());
 }
 return builder.toString();
}
origin: apache/drill

static String writeRoleGrantsInfo(List<RolePrincipalGrant> roleGrants, boolean testMode) {
 if (roleGrants == null || roleGrants.isEmpty()) {
  return "";
 }
 StringBuilder builder = new StringBuilder();
 //sort the list to get sorted (deterministic) output (for ease of testing)
 Collections.sort(roleGrants);
 for (RolePrincipalGrant roleGrant : roleGrants) {
  appendNonNull(builder, roleGrant.getRoleName(), true);
  appendNonNull(builder, roleGrant.isGrantOption());
  appendNonNull(builder, testMode ? -1 : roleGrant.getGrantTime() * 1000L);
  appendNonNull(builder, roleGrant.getGrantorName());
 }
 return builder.toString();
}
origin: apache/hive

public Object getFieldValue(_Fields field) {
 switch (field) {
 case ROLE_NAME:
  return getRoleName();
 case PRINCIPAL_NAME:
  return getPrincipalName();
 case PRINCIPAL_TYPE:
  return getPrincipalType();
 case GRANT_OPTION:
  return isGrantOption();
 case GRANT_TIME:
  return getGrantTime();
 case GRANTOR_NAME:
  return getGrantorName();
 case GRANTOR_PRINCIPAL_TYPE:
  return getGrantorPrincipalType();
 }
 throw new IllegalStateException();
}
origin: apache/hive

public HiveRoleGrant(RolePrincipalGrant thriftRoleGrant) {
 this.roleName = thriftRoleGrant.getRoleName();
 this.principalName = thriftRoleGrant.getPrincipalName();
 this.principalType = thriftRoleGrant.getPrincipalType().name();
 this.grantOption = thriftRoleGrant.isGrantOption();
 this.grantTime = thriftRoleGrant.getGrantTime();
 this.grantor = thriftRoleGrant.getGrantorName();
 this.grantorType = thriftRoleGrant.getGrantorPrincipalType() == null ? null :
  thriftRoleGrant.getGrantorPrincipalType().name();
}
origin: apache/drill

public HiveRoleGrant(RolePrincipalGrant thriftRoleGrant) {
 this.roleName = thriftRoleGrant.getRoleName();
 this.principalName = thriftRoleGrant.getPrincipalName();
 this.principalType = thriftRoleGrant.getPrincipalType().name();
 this.grantOption = thriftRoleGrant.isGrantOption();
 this.grantTime = thriftRoleGrant.getGrantTime();
 this.grantor = thriftRoleGrant.getGrantorName();
 this.grantorType = thriftRoleGrant.getGrantorPrincipalType() == null ? null :
  thriftRoleGrant.getGrantorPrincipalType().name();
}
origin: prestosql/presto

@Override
public void grantRole(String role, String granteeName, PrincipalType granteeType, String grantorName, PrincipalType grantorType, boolean grantOption)
    throws TException
{
  List<RolePrincipalGrant> grants = listRoleGrants(granteeName, granteeType);
  for (RolePrincipalGrant grant : grants) {
    if (grant.getRoleName().equals(role)) {
      if (grant.isGrantOption() == grantOption) {
        return;
      }
      if (!grant.isGrantOption() && grantOption) {
        revokeRole(role, granteeName, granteeType, false);
        break;
      }
    }
  }
  createGrant(role, granteeName, granteeType, grantorName, grantorType, grantOption);
}
origin: prestosql/presto

@Override
public void revokeRole(String role, String granteeName, PrincipalType granteeType, boolean grantOption)
    throws TException
{
  List<RolePrincipalGrant> grants = listRoleGrants(granteeName, granteeType);
  RolePrincipalGrant currentGrant = null;
  for (RolePrincipalGrant grant : grants) {
    if (grant.getRoleName().equals(role)) {
      currentGrant = grant;
      break;
    }
  }
  if (currentGrant == null) {
    return;
  }
  if (!currentGrant.isGrantOption() && grantOption) {
    return;
  }
  removeGrant(role, granteeName, granteeType, grantOption);
}
origin: com.facebook.presto.hive/hive-apache

static String writeRoleGrantsInfo(List<RolePrincipalGrant> roleGrants, boolean testMode) {
 if (roleGrants == null || roleGrants.isEmpty()) {
  return "";
 }
 StringBuilder builder = new StringBuilder();
 //sort the list to get sorted (deterministic) output (for ease of testing)
 Collections.sort(roleGrants);
 for (RolePrincipalGrant roleGrant : roleGrants) {
  appendNonNull(builder, roleGrant.getRoleName(), true);
  appendNonNull(builder, roleGrant.isGrantOption());
  appendNonNull(builder, testMode ? -1 : roleGrant.getGrantTime() * 1000L);
  appendNonNull(builder, roleGrant.getGrantorName());
 }
 return builder.toString();
}
origin: com.facebook.presto.hive/hive-apache

public Object getFieldValue(_Fields field) {
 switch (field) {
 case ROLE_NAME:
  return getRoleName();
 case PRINCIPAL_NAME:
  return getPrincipalName();
 case PRINCIPAL_TYPE:
  return getPrincipalType();
 case GRANT_OPTION:
  return Boolean.valueOf(isGrantOption());
 case GRANT_TIME:
  return Integer.valueOf(getGrantTime());
 case GRANTOR_NAME:
  return getGrantorName();
 case GRANTOR_PRINCIPAL_TYPE:
  return getGrantorPrincipalType();
 }
 throw new IllegalStateException();
}
origin: org.spark-project.hive/hive-metastore

public Object getFieldValue(_Fields field) {
 switch (field) {
 case ROLE_NAME:
  return getRoleName();
 case PRINCIPAL_NAME:
  return getPrincipalName();
 case PRINCIPAL_TYPE:
  return getPrincipalType();
 case GRANT_OPTION:
  return Boolean.valueOf(isGrantOption());
 case GRANT_TIME:
  return Integer.valueOf(getGrantTime());
 case GRANTOR_NAME:
  return getGrantorName();
 case GRANTOR_PRINCIPAL_TYPE:
  return getGrantorPrincipalType();
 }
 throw new IllegalStateException();
}
origin: org.apache.hive/hive-standalone-metastore

public Object getFieldValue(_Fields field) {
 switch (field) {
 case ROLE_NAME:
  return getRoleName();
 case PRINCIPAL_NAME:
  return getPrincipalName();
 case PRINCIPAL_TYPE:
  return getPrincipalType();
 case GRANT_OPTION:
  return isGrantOption();
 case GRANT_TIME:
  return getGrantTime();
 case GRANTOR_NAME:
  return getGrantorName();
 case GRANTOR_PRINCIPAL_TYPE:
  return getGrantorPrincipalType();
 }
 throw new IllegalStateException();
}
origin: prestosql/presto

public static RoleGrant fromRolePrincipalGrant(RolePrincipalGrant grant)
{
  return new RoleGrant(
      new PrestoPrincipal(fromMetastoreApiPrincipalType(grant.getPrincipalType()), grant.getPrincipalName()),
      grant.getRoleName(),
      grant.isGrantOption());
}
origin: com.facebook.presto.hive/hive-apache

public HiveRoleGrant(RolePrincipalGrant thriftRoleGrant) {
 this.roleName = thriftRoleGrant.getRoleName();
 this.principalName = thriftRoleGrant.getPrincipalName();
 this.principalType = thriftRoleGrant.getPrincipalType().name();
 this.grantOption = thriftRoleGrant.isGrantOption();
 this.grantTime = thriftRoleGrant.getGrantTime();
 this.grantor = thriftRoleGrant.getGrantorName();
 this.grantorType = thriftRoleGrant.getGrantorPrincipalType() == null ? null :
  thriftRoleGrant.getGrantorPrincipalType().name();
}
org.apache.hadoop.hive.metastore.apiRolePrincipalGrantisGrantOption

Popular methods of RolePrincipalGrant

  • getPrincipalName
  • getPrincipalType
  • getRoleName
  • getGrantTime
  • getGrantorName
  • getGrantorPrincipalType
  • <init>
    Performs a deep copy on other.
  • equals
  • isSetGrantOption
    Returns true if field grantOption is set (has been assigned a value) and false otherwise
  • isSetGrantTime
    Returns true if field grantTime is set (has been assigned a value) and false otherwise
  • isSetGrantorName
    Returns true if field grantorName is set (has been assigned a value) and false otherwise
  • isSetGrantorPrincipalType
    Returns true if field grantorPrincipalType is set (has been assigned a value) and false otherwise
  • isSetGrantorName,
  • isSetGrantorPrincipalType,
  • isSetPrincipalName,
  • isSetPrincipalType,
  • isSetRoleName,
  • read,
  • setGrantOption,
  • setGrantOptionIsSet,
  • setGrantTime

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • getApplicationContext (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • JComboBox (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now