@InterfaceAudience.Private public class VisibilityLabelsCache extends Object implements VisibilityLabelOrdinalProvider
Modifier and Type | Method and Description |
---|---|
static VisibilityLabelsCache |
createAndGet(ZooKeeperWatcher watcher,
org.apache.hadoop.conf.Configuration conf)
Creates the singleton instance, if not yet present, and returns the same.
|
static VisibilityLabelsCache |
get() |
List<String> |
getAuths(String user) |
Set<Integer> |
getAuthsAsOrdinals(String user)
Returns the list of ordinals of authentications associated with the user
|
String |
getLabel(int ordinal) |
int |
getLabelOrdinal(String label) |
int |
getLabelsCount() |
void |
refreshLabelsCache(byte[] data) |
void |
refreshUserAuthsCache(byte[] data) |
void |
writeToZookeeper(byte[] data,
boolean labelsOrUserAuths) |
public static VisibilityLabelsCache createAndGet(ZooKeeperWatcher watcher, org.apache.hadoop.conf.Configuration conf) throws IOException
watcher
- conf
- IOException
public static VisibilityLabelsCache get()
IllegalStateException
- when this is called before calling
createAndGet(ZooKeeperWatcher, Configuration)
public void refreshLabelsCache(byte[] data) throws IOException
IOException
public void refreshUserAuthsCache(byte[] data) throws IOException
IOException
public int getLabelOrdinal(String label)
getLabelOrdinal
in interface VisibilityLabelOrdinalProvider
label
- Not null label stringpublic String getLabel(int ordinal)
ordinal
- The ordinal of label which we are looking for.null
when no label exist in
the system with given ordinalpublic int getLabelsCount()
public Set<Integer> getAuthsAsOrdinals(String user)
user
- Not null value.public void writeToZookeeper(byte[] data, boolean labelsOrUserAuths)
Copyright © 2014 The Apache Software Foundation. All rights reserved.