Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.catalog.Role Class Reference
Inheritance diagram for com.cloudera.impala.catalog.Role:
Collaboration diagram for com.cloudera.impala.catalog.Role:

Public Member Functions

 Role (String roleName, Set< String > grantGroups)
 
boolean addPrivilege (RolePrivilege privilege)
 
List< RolePrivilegegetPrivileges ()
 
Set< String > getPrivilegeNames ()
 
RolePrivilege getPrivilege (String privilegeName)
 
RolePrivilege removePrivilege (String privilegeName)
 
synchronized void addGrantGroup (String groupName)
 
synchronized void removeGrantGroup (String groupName)
 
TRole toThrift ()
 
Set< String > getGrantGroups ()
 
TCatalogObjectType getCatalogObjectType ()
 
String getName ()
 
int getId ()
 
synchronized long getCatalogVersion ()
 
synchronized void setCatalogVersion (long newVersion)
 
boolean isLoaded ()
 

Static Public Member Functions

static Role fromThrift (TRole thriftRole)
 

Private Member Functions

 Role (TRole role)
 

Private Attributes

final TRole role_
 
long catalogVersion_ = Catalog.INITIAL_CATALOG_VERSION
 
final CatalogObjectCache
< RolePrivilege
rolePrivileges_
 

Static Private Attributes

static AtomicInteger roleId_ = new AtomicInteger(0)
 

Detailed Description

Represents a role in an authorization policy. This class is thread safe.

Definition at line 30 of file Role.java.

Constructor & Destructor Documentation

com.cloudera.impala.catalog.Role.Role ( String  roleName,
Set< String >  grantGroups 
)
inline
com.cloudera.impala.catalog.Role.Role ( TRole  role)
inlineprivate

Definition at line 46 of file Role.java.

References com.cloudera.impala.catalog.Role.role_.

Member Function Documentation

synchronized void com.cloudera.impala.catalog.Role.addGrantGroup ( String  groupName)
inline

Adds a new grant group to this role.

Definition at line 93 of file Role.java.

References com.cloudera.impala.catalog.Role.role_.

boolean com.cloudera.impala.catalog.Role.addPrivilege ( RolePrivilege  privilege)
inline

Adds a privilege to the role. Returns true if the privilege was added successfully or false if there was a newer version of the privilege already added to the role.

Definition at line 54 of file Role.java.

static Role com.cloudera.impala.catalog.Role.fromThrift ( TRole  thriftRole)
inlinestatic

Creates a Role from a TRole thrift struct.

Definition at line 117 of file Role.java.

References com.cloudera.impala.catalog.Role.Role().

TCatalogObjectType com.cloudera.impala.catalog.Role.getCatalogObjectType ( )
inline

Implements com.cloudera.impala.catalog.CatalogObject.

Definition at line 129 of file Role.java.

synchronized long com.cloudera.impala.catalog.Role.getCatalogVersion ( )
inline
Set<String> com.cloudera.impala.catalog.Role.getGrantGroups ( )
inline

Gets the set of group names that have been granted this role or an empty Set if no groups have been granted the role.

Definition at line 125 of file Role.java.

Referenced by com.cloudera.impala.catalog.AuthorizationPolicy.addRole(), com.cloudera.impala.catalog.AuthorizationPolicy.removeRole(), and com.cloudera.impala.util.SentryProxy.PolicyReader.run().

int com.cloudera.impala.catalog.Role.getId ( )
inline
String com.cloudera.impala.catalog.Role.getName ( )
inline
RolePrivilege com.cloudera.impala.catalog.Role.getPrivilege ( String  privilegeName)
inline

Gets a privilege with the given name from this role. If no privilege exists with this name null is returned.

Definition at line 78 of file Role.java.

Set<String> com.cloudera.impala.catalog.Role.getPrivilegeNames ( )
inline

Returns all privilege names for this role, or an empty set of no privileges are granted to the role.

Definition at line 70 of file Role.java.

List<RolePrivilege> com.cloudera.impala.catalog.Role.getPrivileges ( )
inline

Returns all privileges for this role. If no privileges have been added to the role an empty list will be returned.

Definition at line 62 of file Role.java.

Referenced by com.cloudera.impala.catalog.AuthorizationPolicy.addRole(), and com.cloudera.impala.catalog.Catalog.getTCatalogObject().

boolean com.cloudera.impala.catalog.Role.isLoaded ( )
inline

Implements com.cloudera.impala.catalog.CatalogObject.

Definition at line 140 of file Role.java.

synchronized void com.cloudera.impala.catalog.Role.removeGrantGroup ( String  groupName)
inline

Removes a grant group from this role.

Definition at line 101 of file Role.java.

RolePrivilege com.cloudera.impala.catalog.Role.removePrivilege ( String  privilegeName)
inline

Removes a privilege with the given name from the role. Returns the removed privilege or null if no privilege exists with this name.

Definition at line 86 of file Role.java.

synchronized void com.cloudera.impala.catalog.Role.setCatalogVersion ( long  newVersion)
inline
TRole com.cloudera.impala.catalog.Role.toThrift ( )
inline

Returns the Thrift representation of the role.

Definition at line 110 of file Role.java.

References com.cloudera.impala.catalog.Role.role_.

Member Data Documentation

long com.cloudera.impala.catalog.Role.catalogVersion_ = Catalog.INITIAL_CATALOG_VERSION
private
final TRole com.cloudera.impala.catalog.Role.role_
private
AtomicInteger com.cloudera.impala.catalog.Role.roleId_ = new AtomicInteger(0)
staticprivate

Definition at line 33 of file Role.java.

final CatalogObjectCache<RolePrivilege> com.cloudera.impala.catalog.Role.rolePrivileges_
private
Initial value:
=
new CatalogObjectCache<RolePrivilege>()

Definition at line 36 of file Role.java.


The documentation for this class was generated from the following file: