@InterfaceAudience.Public @InterfaceStability.Stable public class AuthUtil extends Object
ChoreService choreService = null;
// Presumes HBase configuration files are on the classpath
final Configuration conf = HBaseConfiguration.create();
final ScheduledChore authChore = AuthUtil.getAuthChore(conf);
if (authChore != null) {
choreService = new ChoreService("MY_APPLICATION");
choreService.scheduleChore(authChore);
}
try {
// do application work
} finally {
if (choreService != null) {
choreService.shutdown();
}
}
See the "Running Canary in a Kerberos-enabled Cluster" section of the HBase Reference Guide for
an example of configuring a user of this Auth Chore to run on a secure cluster.Modifier and Type | Method and Description |
---|---|
static ScheduledChore |
getAuthChore(org.apache.hadoop.conf.Configuration conf)
Checks if security is enabled and if so, launches chore for refreshing kerberos ticket.
|
static String |
getGroupName(String aclKey)
Returns the actual name for a group principal (stripped of the
group prefix).
|
static boolean |
isGroupPrincipal(String name)
Returns whether or not the given name should be interpreted as a group
principal.
|
static String |
toGroupEntry(String name)
Returns the group entry with the group prefix for a group principal.
|
public static ScheduledChore getAuthChore(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- the hbase service configurationIOException
@InterfaceAudience.Private public static boolean isGroupPrincipal(String name)
@InterfaceAudience.Private public static String getGroupName(String aclKey)
@InterfaceAudience.Private public static String toGroupEntry(String name)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.