@InterfaceAudience.Private public class TablePermission extends Permission
null
, it implies
full table access.Permission.Action
Modifier and Type | Field and Description |
---|---|
private byte[] |
family |
private static org.apache.commons.logging.Log |
LOG |
private String |
namespace |
private byte[] |
qualifier |
private TableName |
table |
ACTION_BY_CODE, actions, VERSION
Constructor and Description |
---|
TablePermission()
Nullary constructor for Writable, do not use
|
TablePermission(String namespace,
byte[] actionCodes)
Creates a new permission for the given namespace,
allowing the actions matching the provided byte codes to be performed.
|
TablePermission(String namespace,
Permission.Action... assigned)
Create a new permission for the given namespace,
allowing the given actions.
|
TablePermission(String namespace,
TableName table,
byte[] family,
byte[] qualifier,
byte[] actionCodes)
Creates a new permission for the given namespace or table, family and column qualifier,
allowing the actions matching the provided byte codes to be performed.
|
TablePermission(String namespace,
TableName table,
byte[] family,
byte[] qualifier,
Permission.Action... assigned)
Creates a new permission for the given namespace or table, restricted to the given
column family and qualifier, allowing the assigned actions to be performed.
|
TablePermission(TableName table,
byte[] family,
byte[] qualifier,
byte[] actionCodes)
Creates a new permission for the given table, family and column qualifier,
allowing the actions matching the provided byte codes to be performed.
|
TablePermission(TableName table,
byte[] family,
byte[] qualifier,
Permission.Action... assigned)
Creates a new permission for the given table, restricted to the given
column family and qualifier, allowing the assigned actions to be performed.
|
TablePermission(TableName table,
byte[] family,
Permission.Action... assigned)
Create a new permission for the given table and (optionally) column family,
allowing the given actions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
byte[] |
getFamily() |
String |
getNamespace() |
byte[] |
getQualifier() |
TableName |
getTableName() |
boolean |
hasFamily() |
int |
hashCode() |
boolean |
hasNamespace() |
boolean |
hasQualifier() |
boolean |
hasTable() |
boolean |
implies(String namespace,
Permission.Action action)
Checks that a given table operation is authorized by this permission
instance.
|
boolean |
implies(TableName table,
byte[] family,
byte[] qualifier,
Permission.Action action)
Checks that a given table operation is authorized by this permission
instance.
|
boolean |
implies(TableName table,
KeyValue kv,
Permission.Action action)
Checks if this permission grants access to perform the given action on
the given table and key value.
|
boolean |
matchesFamily(TableName table,
byte[] family,
Permission.Action action)
Returns
true if this permission matches the given column
family at least. |
boolean |
matchesFamilyQualifier(TableName table,
byte[] family,
byte[] qualifier,
Permission.Action action)
Returns if the given permission matches the given qualifier.
|
void |
readFields(DataInput in) |
String |
toString() |
void |
write(DataOutput out) |
getActions, getVersion, implies
private static final org.apache.commons.logging.Log LOG
private TableName table
private byte[] family
private byte[] qualifier
private String namespace
public TablePermission()
public TablePermission(TableName table, byte[] family, Permission.Action... assigned)
table
- the tablefamily
- the family, can be null if a global permission on the tableassigned
- the list of allowed actionspublic TablePermission(TableName table, byte[] family, byte[] qualifier, Permission.Action... assigned)
table
- the tablefamily
- the family, can be null if a global permission on the tableassigned
- the list of allowed actionspublic TablePermission(TableName table, byte[] family, byte[] qualifier, byte[] actionCodes)
table
- the tablefamily
- the family, can be null if a global permission on the tableactionCodes
- the list of allowed action codespublic TablePermission(String namespace, TableName table, byte[] family, byte[] qualifier, Permission.Action... assigned)
namespace
- table
- the tablefamily
- the family, can be null if a global permission on the tableassigned
- the list of allowed actionspublic TablePermission(String namespace, TableName table, byte[] family, byte[] qualifier, byte[] actionCodes)
namespace
- table
- the tablefamily
- the family, can be null if a global permission on the tableactionCodes
- the list of allowed action codespublic TablePermission(String namespace, byte[] actionCodes)
namespace
- actionCodes
- the list of allowed action codespublic TablePermission(String namespace, Permission.Action... assigned)
namespace
- assigned
- the list of allowed actionspublic boolean hasTable()
public TableName getTableName()
public boolean hasFamily()
public byte[] getFamily()
public boolean hasQualifier()
public byte[] getQualifier()
public boolean hasNamespace()
public String getNamespace()
public boolean implies(String namespace, Permission.Action action)
namespace
- the namespace where the operation is being performedaction
- the action being requestedtrue
if the action within the given scope is allowed
by this permission, false
public boolean implies(TableName table, byte[] family, byte[] qualifier, Permission.Action action)
table
- the table where the operation is being performedfamily
- the column family to which the operation is restricted,
if null
implies "all"qualifier
- the column qualifier to which the action is restricted,
if null
implies "all"action
- the action being requestedtrue
if the action within the given scope is allowed
by this permission, false
public boolean implies(TableName table, KeyValue kv, Permission.Action action)
table
- the table on which the operation is being performedkv
- the KeyValue on which the operation is being requestedaction
- the action requestedtrue
if the action is allowed over the given scope
by this permission, otherwise false
public boolean matchesFamily(TableName table, byte[] family, Permission.Action action)
true
if this permission matches the given column
family at least. This only indicates a partial match against the table
and column family, however, and does not guarantee that implies() for the
column same family would return true
. In the case of a
column-qualifier specific permission, for example, implies() would still
return false.public boolean matchesFamilyQualifier(TableName table, byte[] family, byte[] qualifier, Permission.Action action)
table
- the table name to matchfamily
- the column family to matchqualifier
- the qualifier name to matchaction
- the action requestedtrue
if the table, family and qualifier match,
otherwise false
public boolean equals(Object obj)
equals
in class Permission
public int hashCode()
hashCode
in class Permission
public String toString()
toString
in class Permission
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class Permission
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class Permission
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.