Search in sources :

Example 1 with ACLConfigurationParser

use of org.apache.tez.common.security.ACLConfigurationParser in project tez by apache.

the class ATSHistoryACLPolicyManager method createTimelineDomain.

private void createTimelineDomain(String domainId, Configuration tezConf, DAGAccessControls dagAccessControls) throws IOException, HistoryACLPolicyException {
    TimelineDomain timelineDomain = new TimelineDomain();
    timelineDomain.setId(domainId);
    ACLConfigurationParser parser = new ACLConfigurationParser(tezConf, false);
    timelineDomain.setReaders(getMergedViewACLs(parser, dagAccessControls));
    timelineDomain.setWriters(user);
    try {
        if (timelineClient != null) {
            timelineClient.putDomain(timelineDomain);
        }
    } catch (Exception e) {
        LOG.warn("Could not post timeline domain", e);
        throw new HistoryACLPolicyException("Fail to create ACL-related domain in Timeline", e);
    }
}
Also used : TimelineDomain(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain) HistoryACLPolicyException(org.apache.tez.common.security.HistoryACLPolicyException) ACLConfigurationParser(org.apache.tez.common.security.ACLConfigurationParser) IOException(java.io.IOException) HistoryACLPolicyException(org.apache.tez.common.security.HistoryACLPolicyException) TezUncheckedException(org.apache.tez.dag.api.TezUncheckedException)

Example 2 with ACLConfigurationParser

use of org.apache.tez.common.security.ACLConfigurationParser in project tez by apache.

the class ATSV15HistoryACLPolicyManager method createTimelineDomain.

private void createTimelineDomain(ApplicationId applicationId, String domainId, Configuration tezConf, DAGAccessControls dagAccessControls) throws IOException, HistoryACLPolicyException {
    TimelineDomain timelineDomain = new TimelineDomain();
    timelineDomain.setId(domainId);
    ACLConfigurationParser parser = new ACLConfigurationParser(tezConf, false);
    timelineDomain.setReaders(getMergedViewACLs(parser, dagAccessControls));
    timelineDomain.setWriters(user);
    // Use dummy app attempt id
    ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(applicationId, 1);
    try {
        if (timelineClient != null) {
            timelineClient.putDomain(appAttemptId, timelineDomain);
        }
    } catch (Exception e) {
        LOG.warn("Could not post timeline domain", e);
        throw new HistoryACLPolicyException("Fail to create ACL-related domain in Timeline", e);
    }
}
Also used : TimelineDomain(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain) ApplicationAttemptId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId) HistoryACLPolicyException(org.apache.tez.common.security.HistoryACLPolicyException) ACLConfigurationParser(org.apache.tez.common.security.ACLConfigurationParser) IOException(java.io.IOException) HistoryACLPolicyException(org.apache.tez.common.security.HistoryACLPolicyException) TezUncheckedException(org.apache.tez.dag.api.TezUncheckedException)

Aggregations

IOException (java.io.IOException)2 TimelineDomain (org.apache.hadoop.yarn.api.records.timeline.TimelineDomain)2 ACLConfigurationParser (org.apache.tez.common.security.ACLConfigurationParser)2 HistoryACLPolicyException (org.apache.tez.common.security.HistoryACLPolicyException)2 TezUncheckedException (org.apache.tez.dag.api.TezUncheckedException)2 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)1