Java Code Examples for org.apache.hadoop.mapreduce.JobACL#values()

The following examples show how to use org.apache.hadoop.mapreduce.JobACL#values() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobACLsManager.java    From hadoop with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: JobACLsManager.java    From big-c with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 3
Source File: JobSubmittedEvent.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/** 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;
}
 
Example 4
Source File: JobSubmittedEvent.java    From big-c with Apache License 2.0 5 votes vote down vote up
/** 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;
}