@InterfaceAudience.Private public class DefaultVisibilityLabelServiceImpl extends Object implements VisibilityLabelService
| Constructor and Description |
|---|
DefaultVisibilityLabelServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
OperationStatus[] |
addLabels(List<byte[]> labels)
Adds the set of labels into the system.
|
protected void |
addSystemLabel(HRegion region,
Map<String,Integer> labels,
Map<String,List<Integer>> userAuths) |
OperationStatus[] |
clearAuths(byte[] user,
List<byte[]> authLabels)
Removes given labels from user's globally authorized list of labels.
|
List<Tag> |
createVisibilityExpTags(String visExpression,
boolean withSerializationFormat,
boolean checkAuths)
Creates tags corresponding to given visibility expression.
|
protected Pair<Map<String,Integer>,Map<String,List<Integer>>> |
extractLabelsAndAuths(List<List<Cell>> labelDetails) |
List<String> |
getAuths(byte[] user,
boolean systemCall) |
org.apache.hadoop.conf.Configuration |
getConf() |
protected List<List<Cell>> |
getExistingLabelsWithAuths() |
protected List<String> |
getSystemAndSuperUsers() |
VisibilityExpEvaluator |
getVisibilityExpEvaluator(Authorizations authorizations)
Creates VisibilityExpEvaluator corresponding to given Authorizations.
|
boolean |
havingSystemAuth(byte[] user)
System checks for user auth during admin operations.
|
void |
init(RegionCoprocessorEnvironment e)
System calls this after opening of regions.
|
protected boolean |
isReadFromSuperUser() |
boolean |
matchVisibility(List<Tag> putVisTags,
Byte putTagsFormat,
List<Tag> deleteVisTags,
Byte deleteTagsFormat)
System uses this for deciding whether a Cell can be deleted by matching visibility expression
in Delete mutation and the cell in consideration.
|
OperationStatus[] |
setAuths(byte[] user,
List<byte[]> authLabels)
Sets given labels globally authorized for the user.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
protected void |
updateZk(boolean labelAddition) |
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurablepublic void init(RegionCoprocessorEnvironment e) throws IOException
VisibilityLabelServiceinit in interface VisibilityLabelServicee - the region coprocessor envIOExceptionprotected List<List<Cell>> getExistingLabelsWithAuths() throws IOException
IOExceptionprotected Pair<Map<String,Integer>,Map<String,List<Integer>>> extractLabelsAndAuths(List<List<Cell>> labelDetails)
protected void addSystemLabel(HRegion region, Map<String,Integer> labels, Map<String,List<Integer>> userAuths) throws IOException
IOExceptionprotected List<String> getSystemAndSuperUsers() throws IOException
IOExceptionpublic OperationStatus[] addLabels(List<byte[]> labels) throws IOException
VisibilityLabelServiceaddLabels in interface VisibilityLabelServicelabels - Labels to add to the system.IOExceptionpublic OperationStatus[] setAuths(byte[] user, List<byte[]> authLabels) throws IOException
VisibilityLabelServicesetAuths in interface VisibilityLabelServiceuser - The authorizing userauthLabels - Labels which are getting authorized for the userIOExceptionpublic OperationStatus[] clearAuths(byte[] user, List<byte[]> authLabels) throws IOException
VisibilityLabelServiceclearAuths in interface VisibilityLabelServiceuser - The user whose authorization to be removedauthLabels - Labels which are getting removed from authorization setIOExceptionpublic List<String> getAuths(byte[] user, boolean systemCall) throws IOException
getAuths in interface VisibilityLabelServiceuser - Name of the user whose authorization to be retrievedsystemCall - Whether a system or user originated call.IOExceptionpublic List<Tag> createVisibilityExpTags(String visExpression, boolean withSerializationFormat, boolean checkAuths) throws IOException
VisibilityLabelServicecreateVisibilityExpTags in interface VisibilityLabelServicevisExpression - The Expression for which corresponding Tags to be created.withSerializationFormat - specifies whether a tag, denoting the serialization version
of the tags, to be added in the list. When this is true make sure to add the
serialization format Tag also. The format tag value should be byte type.checkAuths - denotes whether to check individual labels in visExpression against user's
global auth label.IOExceptionprotected void updateZk(boolean labelAddition)
throws IOException
IOExceptionpublic VisibilityExpEvaluator getVisibilityExpEvaluator(Authorizations authorizations) throws IOException
VisibilityLabelServicegetVisibilityExpEvaluator in interface VisibilityLabelServiceauthorizations - Authorizations for the read requestIOExceptionprotected boolean isReadFromSuperUser()
throws IOException
IOExceptionpublic boolean havingSystemAuth(byte[] user)
throws IOException
VisibilityLabelServicehavingSystemAuth in interface VisibilityLabelServiceuser - User for whom system auth check to be done.IOExceptionpublic boolean matchVisibility(List<Tag> putVisTags, Byte putTagsFormat, List<Tag> deleteVisTags, Byte deleteTagsFormat) throws IOException
VisibilityLabelServicematchVisibility in interface VisibilityLabelServiceputVisTags - The visibility tags present in the Put mutationputTagsFormat - The serialization format for the Put visibility tags. A null value for
this format means the tags are written with unsorted label ordinalsdeleteVisTags - - The visibility tags in the delete mutation (the specified Cell Visibility)deleteTagsFormat - The serialization format for the Delete visibility tags. A null value for
this format means the tags are written with unsorted label ordinalsIOExceptionVisibilityConstants.SORTED_ORDINAL_SERIALIZATION_FORMATCopyright © 2014 The Apache Software Foundation. All rights reserved.