@InterfaceAudience.Private public class VisibilityUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Tag |
SORTED_ORDINAL_SERIALIZATION_FORMAT_TAG |
static String |
SYSTEM_LABEL |
static String |
VISIBILITY_LABEL_GENERATOR_CLASS |
Constructor and Description |
---|
VisibilityUtils() |
Modifier and Type | Method and Description |
---|---|
static List<Tag> |
createVisibilityExpTags(String visExpression,
boolean withSerializationFormat,
boolean checkAuths,
Set<Integer> auths,
VisibilityLabelOrdinalProvider ordinalProvider) |
static Filter |
createVisibilityLabelFilter(Region region,
Authorizations authorizations) |
static Byte |
extractAndPartitionTags(Cell cell,
List<Tag> visTags,
List<Tag> nonVisTags)
Extracts and partitions the visibility tags and nonVisibility Tags
|
static Byte |
extractVisibilityTags(Cell cell,
List<Tag> tags)
Extract the visibility tags of the given Cell into the given List
|
static User |
getActiveUser() |
static byte[] |
getDataToWriteToZooKeeper(Map<String,Integer> existingLabels)
Creates the labels data to be written to zookeeper.
|
static List<ScanLabelGenerator> |
getScanLabelGenerators(org.apache.hadoop.conf.Configuration conf) |
static byte[] |
getUserAuthsDataToWriteToZooKeeper(Map<String,List<Integer>> userAuths)
Creates the user auth data to be written to zookeeper.
|
static boolean |
isVisibilityTagsPresent(Cell cell) |
static List<VisibilityLabelsProtos.VisibilityLabel> |
readLabelsFromZKData(byte[] data)
Reads back from the zookeeper.
|
static VisibilityLabelsProtos.MultiUserAuthorizations |
readUserAuthsFromZKData(byte[] data)
Reads back User auth data written to zookeeper.
|
public static final String VISIBILITY_LABEL_GENERATOR_CLASS
public static final String SYSTEM_LABEL
public static final Tag SORTED_ORDINAL_SERIALIZATION_FORMAT_TAG
public static byte[] getDataToWriteToZooKeeper(Map<String,Integer> existingLabels)
existingLabels
- public static byte[] getUserAuthsDataToWriteToZooKeeper(Map<String,List<Integer>> userAuths)
userAuths
- public static List<VisibilityLabelsProtos.VisibilityLabel> readLabelsFromZKData(byte[] data) throws DeserializationException
data
- DeserializationException
public static VisibilityLabelsProtos.MultiUserAuthorizations readUserAuthsFromZKData(byte[] data) throws DeserializationException
data
- DeserializationException
public static List<ScanLabelGenerator> getScanLabelGenerators(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration to useIllegalArgumentException
- when any of the specified ScanLabelGenerator class can not be loaded.public static Byte extractVisibilityTags(Cell cell, List<Tag> tags)
cell
- - the celltags
- - the array that will be populated if visibility tags are presentpublic static Byte extractAndPartitionTags(Cell cell, List<Tag> visTags, List<Tag> nonVisTags)
cell
- - the cell for which we would extract and partition the
visibility and non visibility tagsvisTags
- - all the visibilty tags of type TagType.VISIBILITY_TAG_TYPE would
be added to this listnonVisTags
- - all the non visibility tags would be added to this listpublic static boolean isVisibilityTagsPresent(Cell cell)
public static Filter createVisibilityLabelFilter(Region region, Authorizations authorizations) throws IOException
IOException
public static User getActiveUser() throws IOException
IOException
- When there is IOE in getting the system user (During non-RPC handling).public static List<Tag> createVisibilityExpTags(String visExpression, boolean withSerializationFormat, boolean checkAuths, Set<Integer> auths, VisibilityLabelOrdinalProvider ordinalProvider) throws IOException
IOException
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.