|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.security.visibility.VisibilityLabelsCache
@InterfaceAudience.Private public class VisibilityLabelsCache
Maintains the cache for visibility labels and also uses the zookeeper to update the labels in the system. The cache updation happens based on the data change event that happens on the zookeeper znode for labels table
| Method Summary | |
|---|---|
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> |
getGroupAuths(String[] groups)
|
Set<Integer> |
getGroupAuthsAsOrdinals(String[] groups)
Returns the list of ordinals of labels associated with the groups |
String |
getLabel(int ordinal)
Returns the string associated with the ordinal. |
int |
getLabelOrdinal(String label)
|
int |
getLabelsCount()
|
List<String> |
getUserAuths(String user)
|
Set<Integer> |
getUserAuthsAsOrdinals(String user)
Returns the list of ordinals of labels associated with the user |
void |
refreshLabelsCache(byte[] data)
|
void |
refreshUserAuthsCache(byte[] data)
|
void |
writeToZookeeper(byte[] data,
boolean labelsOrUserAuths)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static VisibilityLabelsCache createAndGet(ZooKeeperWatcher watcher,
org.apache.hadoop.conf.Configuration conf)
throws IOException
watcher - conf -
IOExceptionpublic 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
IOExceptionpublic int getLabelOrdinal(String label)
getLabelOrdinal in interface VisibilityLabelOrdinalProviderlabel - Not null label string
public String getLabel(int ordinal)
VisibilityLabelOrdinalProvider
getLabel in interface VisibilityLabelOrdinalProviderordinal - The ordinal of label which we are looking for.
null when no label exist in
the system with given ordinalpublic int getLabelsCount()
public List<String> getUserAuths(String user)
public List<String> getGroupAuths(String[] groups)
public Set<Integer> getUserAuthsAsOrdinals(String user)
user - Not null value.
public Set<Integer> getGroupAuthsAsOrdinals(String[] groups)
groups -
public void writeToZookeeper(byte[] data,
boolean labelsOrUserAuths)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||