@InterfaceAudience.Private public class VisibilityUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.hadoop.hbase.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<org.apache.hadoop.hbase.Tag> |
createVisibilityExpTags(String visExpression,
boolean withSerializationFormat,
boolean checkAuths,
Set<Integer> auths,
VisibilityLabelOrdinalProvider ordinalProvider) |
static org.apache.hadoop.hbase.filter.Filter |
createVisibilityLabelFilter(Region region,
org.apache.hadoop.hbase.security.visibility.Authorizations authorizations) |
static Byte |
extractAndPartitionTags(org.apache.hadoop.hbase.Cell cell,
List<org.apache.hadoop.hbase.Tag> visTags,
List<org.apache.hadoop.hbase.Tag> nonVisTags)
Extracts and partitions the visibility tags and nonVisibility Tags
|
static Byte |
extractVisibilityTags(org.apache.hadoop.hbase.Cell cell,
List<org.apache.hadoop.hbase.Tag> tags)
Extract the visibility tags of the given Cell into the given List
|
static org.apache.hadoop.hbase.security.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(org.apache.hadoop.hbase.Cell cell) |
static List<org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.VisibilityLabel> |
readLabelsFromZKData(byte[] data)
Reads back from the zookeeper.
|
static org.apache.hadoop.hbase.protobuf.generated.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 org.apache.hadoop.hbase.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<org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.VisibilityLabel> readLabelsFromZKData(byte[] data) throws org.apache.hadoop.hbase.exceptions.DeserializationException
data - org.apache.hadoop.hbase.exceptions.DeserializationExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUserAuthorizations readUserAuthsFromZKData(byte[] data)
throws org.apache.hadoop.hbase.exceptions.DeserializationException
data - org.apache.hadoop.hbase.exceptions.DeserializationExceptionpublic 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(org.apache.hadoop.hbase.Cell cell, List<org.apache.hadoop.hbase.Tag> tags)
cell - - the celltags - - the array that will be populated if visibility tags are presentpublic static Byte extractAndPartitionTags(org.apache.hadoop.hbase.Cell cell, List<org.apache.hadoop.hbase.Tag> visTags, List<org.apache.hadoop.hbase.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(org.apache.hadoop.hbase.Cell cell)
public static org.apache.hadoop.hbase.filter.Filter createVisibilityLabelFilter(Region region, org.apache.hadoop.hbase.security.visibility.Authorizations authorizations) throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.security.User getActiveUser()
throws IOException
IOException - When there is IOE in getting the system user (During non-RPC handling).public static List<org.apache.hadoop.hbase.Tag> createVisibilityExpTags(String visExpression, boolean withSerializationFormat, boolean checkAuths, Set<Integer> auths, VisibilityLabelOrdinalProvider ordinalProvider) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.