@InterfaceAudience.Private public class DefaultVisibilityLabelServiceImpl extends java.lang.Object implements VisibilityLabelService
| Constructor and Description |
|---|
DefaultVisibilityLabelServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
OperationStatus[] |
addLabels(java.util.List<byte[]> labels)
Adds the set of labels into the system.
|
protected void |
addSystemLabel(Region region,
java.util.Map<java.lang.String,java.lang.Integer> labels,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> userAuths) |
OperationStatus[] |
clearAuths(byte[] user,
java.util.List<byte[]> authLabels)
Removes given labels from user's globally authorized list of labels.
|
java.util.List<Tag> |
createVisibilityExpTags(java.lang.String visExpression,
boolean withSerializationFormat,
boolean checkAuths)
Creates tags corresponding to given visibility expression.
|
byte[] |
encodeVisibilityForReplication(java.util.List<Tag> tags,
java.lang.Byte serializationFormat)
Provides a way to modify the visibility tags of type
TagType
.VISIBILITY_TAG_TYPE, that are part of the cell created from the WALEdits
that are prepared for replication while calling
ReplicationEndpoint
.replicate(). |
protected Pair<java.util.Map<java.lang.String,java.lang.Integer>,java.util.Map<java.lang.String,java.util.List<java.lang.Integer>>> |
extractLabelsAndAuths(java.util.List<java.util.List<Cell>> labelDetails) |
java.util.List<java.lang.String> |
getAuths(byte[] user,
boolean systemCall)
Deprecated.
|
Configuration |
getConf() |
protected java.util.List<java.util.List<Cell>> |
getExistingLabelsWithAuths() |
java.util.List<java.lang.String> |
getGroupAuths(java.lang.String[] groups,
boolean systemCall)
Retrieve the visibility labels for the groups.
|
java.util.List<java.lang.String> |
getUserAuths(byte[] user,
boolean systemCall)
Retrieve the visibility labels for the user.
|
VisibilityExpEvaluator |
getVisibilityExpEvaluator(Authorizations authorizations)
Creates VisibilityExpEvaluator corresponding to given Authorizations.
|
boolean |
havingSystemAuth(byte[] user)
Deprecated.
|
boolean |
havingSystemAuth(User user)
System checks for user auth during admin operations.
|
void |
init(RegionCoprocessorEnvironment e)
System calls this after opening of regions.
|
protected boolean |
isReadFromSystemAuthUser() |
java.util.List<java.lang.String> |
listLabels(java.lang.String regex)
Retrieve the list of visibility labels defined in the system.
|
boolean |
matchVisibility(java.util.List<Tag> putVisTags,
java.lang.Byte putTagsFormat,
java.util.List<Tag> deleteVisTags,
java.lang.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,
java.util.List<byte[]> authLabels)
Sets given labels globally authorized for the user.
|
void |
setConf(Configuration conf) |
protected void |
updateZk(boolean labelAddition) |
public void setConf(Configuration conf)
public Configuration getConf()
public void init(RegionCoprocessorEnvironment e) throws java.io.IOException
VisibilityLabelServiceinit in interface VisibilityLabelServicee - the region coprocessor envjava.io.IOExceptionprotected java.util.List<java.util.List<Cell>> getExistingLabelsWithAuths() throws java.io.IOException
java.io.IOExceptionprotected Pair<java.util.Map<java.lang.String,java.lang.Integer>,java.util.Map<java.lang.String,java.util.List<java.lang.Integer>>> extractLabelsAndAuths(java.util.List<java.util.List<Cell>> labelDetails)
protected void addSystemLabel(Region region, java.util.Map<java.lang.String,java.lang.Integer> labels, java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> userAuths) throws java.io.IOException
java.io.IOExceptionpublic OperationStatus[] addLabels(java.util.List<byte[]> labels) throws java.io.IOException
VisibilityLabelServiceaddLabels in interface VisibilityLabelServicelabels - Labels to add to the system.java.io.IOExceptionpublic OperationStatus[] setAuths(byte[] user, java.util.List<byte[]> authLabels) throws java.io.IOException
VisibilityLabelServicesetAuths in interface VisibilityLabelServiceuser - The authorizing userauthLabels - Labels which are getting authorized for the userjava.io.IOExceptionpublic OperationStatus[] clearAuths(byte[] user, java.util.List<byte[]> authLabels) throws java.io.IOException
VisibilityLabelServiceclearAuths in interface VisibilityLabelServiceuser - The user whose authorization to be removedauthLabels - Labels which are getting removed from authorization setjava.io.IOException@Deprecated
public java.util.List<java.lang.String> getAuths(byte[] user,
boolean systemCall)
throws java.io.IOException
VisibilityLabelServicegetAuths in interface VisibilityLabelServiceuser - Name of the user whose authorization to be retrievedsystemCall - Whether a system or user originated call.java.io.IOExceptionpublic java.util.List<java.lang.String> getUserAuths(byte[] user,
boolean systemCall)
throws java.io.IOException
VisibilityLabelServicegetUserAuths in interface VisibilityLabelServiceuser - Name of the user whose authorization to be retrievedsystemCall - Whether a system or user originated call.java.io.IOExceptionpublic java.util.List<java.lang.String> getGroupAuths(java.lang.String[] groups,
boolean systemCall)
throws java.io.IOException
VisibilityLabelServicegetGroupAuths in interface VisibilityLabelServicegroups - Name of the groups whose authorization to be retrievedsystemCall - Whether a system or user originated call.java.io.IOExceptionpublic java.util.List<java.lang.String> listLabels(java.lang.String regex)
throws java.io.IOException
VisibilityLabelServicelistLabels in interface VisibilityLabelServiceregex - The regular expression to filter which labels are returned.java.io.IOExceptionpublic java.util.List<Tag> createVisibilityExpTags(java.lang.String visExpression, boolean withSerializationFormat, boolean checkAuths) throws java.io.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.java.io.IOExceptionprotected void updateZk(boolean labelAddition)
throws java.io.IOException
java.io.IOExceptionpublic VisibilityExpEvaluator getVisibilityExpEvaluator(Authorizations authorizations) throws java.io.IOException
VisibilityLabelServicegetVisibilityExpEvaluator in interface VisibilityLabelServiceauthorizations - Authorizations for the read requestjava.io.IOExceptionprotected boolean isReadFromSystemAuthUser()
throws java.io.IOException
java.io.IOException@Deprecated
public boolean havingSystemAuth(byte[] user)
throws java.io.IOException
VisibilityLabelServicehavingSystemAuth in interface VisibilityLabelServiceuser - User for whom system auth check to be done.java.io.IOExceptionpublic boolean havingSystemAuth(User user) throws java.io.IOException
VisibilityLabelServicehavingSystemAuth in interface VisibilityLabelServiceuser - User for whom system auth check to be done.java.io.IOExceptionpublic boolean matchVisibility(java.util.List<Tag> putVisTags, java.lang.Byte putTagsFormat, java.util.List<Tag> deleteVisTags, java.lang.Byte deleteTagsFormat) throws java.io.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 ordinalsjava.io.IOExceptionVisibilityConstants.SORTED_ORDINAL_SERIALIZATION_FORMATpublic byte[] encodeVisibilityForReplication(java.util.List<Tag> tags, java.lang.Byte serializationFormat) throws java.io.IOException
VisibilityLabelServiceTagType
.VISIBILITY_TAG_TYPE, that are part of the cell created from the WALEdits
that are prepared for replication while calling
ReplicationEndpoint
.replicate().
VisibilityReplicationEndpoint
calls this API to provide an opportunity to modify the visibility tags
before replicating.encodeVisibilityForReplication in interface VisibilityLabelServicetags - the visibility tags associated with the cellserializationFormat - the serialization format associated with the tagjava.io.IOException