本文整理汇总了Java中org.apache.hadoop.mapreduce.JobACL.getAclName方法的典型用法代码示例。如果您正苦于以下问题:Java JobACL.getAclName方法的具体用法?Java JobACL.getAclName怎么用?Java JobACL.getAclName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.mapreduce.JobACL
的用法示例。
在下文中一共展示了JobACL.getAclName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constructJobACLs
import org.apache.hadoop.mapreduce.JobACL; //导入方法依赖的package包/类
/**
* Construct the jobACLs from the configuration so that they can be kept in
* the memory. If authorization is disabled on the JT, nothing is constructed
* and an empty map is returned.
*
* @return JobACL to AccessControlList map.
*/
public Map<JobACL, AccessControlList> constructJobACLs(Configuration conf) {
Map<JobACL, AccessControlList> acls =
new HashMap<JobACL, AccessControlList>();
// Don't construct anything if authorization is disabled.
if (!areACLsEnabled()) {
return acls;
}
for (JobACL aclName : JobACL.values()) {
String aclConfigName = aclName.getAclName();
String aclConfigured = conf.get(aclConfigName);
if (aclConfigured == null) {
// If ACLs are not configured at all, we grant no access to anyone. So
// jobOwner and cluster administrator _only_ can do 'stuff'
aclConfigured = " ";
}
acls.put(aclName, new AccessControlList(aclConfigured));
}
return acls;
}
示例2: getJobAcls
import org.apache.hadoop.mapreduce.JobACL; //导入方法依赖的package包/类
/** Get the acls configured for the job **/
public Map<JobACL, AccessControlList> getJobAcls() {
Map<JobACL, AccessControlList> jobAcls =
new HashMap<JobACL, AccessControlList>();
for (JobACL jobACL : JobACL.values()) {
Utf8 jobACLsUtf8 = new Utf8(jobACL.getAclName());
if (datum.acls.containsKey(jobACLsUtf8)) {
jobAcls.put(jobACL, new AccessControlList(datum.acls.get(
jobACLsUtf8).toString()));
}
}
return jobAcls;
}
示例3: getJobAcls
import org.apache.hadoop.mapreduce.JobACL; //导入方法依赖的package包/类
/** Get the acls configured for the job **/
public Map<JobACL, AccessControlList> getJobAcls() {
Map<JobACL, AccessControlList> jobAcls =
new HashMap<JobACL, AccessControlList>();
for (JobACL jobACL : JobACL.values()) {
Utf8 jobACLsUtf8 = new Utf8(jobACL.getAclName());
if (datum.getAcls().containsKey(jobACLsUtf8)) {
jobAcls.put(jobACL, new AccessControlList(datum.getAcls().get(
jobACLsUtf8).toString()));
}
}
return jobAcls;
}