@InterfaceAudience.Private public class VisibilityUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
COMMA |
private static ExpressionExpander |
EXP_EXPANDER |
private static ExpressionParser |
EXP_PARSER |
private static org.slf4j.Logger |
LOG |
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 |
---|---|
private static void |
checkAuths(Set<Integer> auths,
int labelOrdinal,
String identifier,
boolean checkAuths) |
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.
|
private static void |
getLabelOrdinals(ExpressionNode node,
List<Integer> labelOrdinals,
Set<Integer> auths,
boolean checkAuths,
VisibilityLabelOrdinalProvider ordinalProvider) |
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<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.
|
private static void |
writeLabelOrdinalsToStream(List<Integer> labelOrdinals,
DataOutputStream dos)
This will sort the passed labels in ascending oder and then will write one after the other to
the passed stream.
|
private static final org.slf4j.Logger LOG
public static final String VISIBILITY_LABEL_GENERATOR_CLASS
public static final String SYSTEM_LABEL
public static final Tag SORTED_ORDINAL_SERIALIZATION_FORMAT_TAG
private static final String COMMA
private static final ExpressionParser EXP_PARSER
private static final ExpressionExpander EXP_EXPANDER
public VisibilityUtils()
public static byte[] getDataToWriteToZooKeeper(Map<String,Integer> existingLabels)
public static byte[] getUserAuthsDataToWriteToZooKeeper(Map<String,List<Integer>> userAuths)
public static List<org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.VisibilityLabel> readLabelsFromZKData(byte[] data) throws DeserializationException
DeserializationException
public static org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUserAuthorizations readUserAuthsFromZKData(byte[] data) throws DeserializationException
DeserializationException
public static List<ScanLabelGenerator> getScanLabelGenerators(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration to usepublic 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 tags n * - 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
private static void getLabelOrdinals(ExpressionNode node, List<Integer> labelOrdinals, Set<Integer> auths, boolean checkAuths, VisibilityLabelOrdinalProvider ordinalProvider) throws IOException, InvalidLabelException
IOException
InvalidLabelException
private static void writeLabelOrdinalsToStream(List<Integer> labelOrdinals, DataOutputStream dos) throws IOException
IOException
private static void checkAuths(Set<Integer> auths, int labelOrdinal, String identifier, boolean checkAuths) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.