private void createTimelineDomain(String domainId, String readers, String writers) throws Exception { TimelineDomain timelineDomain = new TimelineDomain(); timelineDomain.setId(domainId); timelineDomain.setReaders(readers); timelineDomain.setWriters(writers); timelineClient.putDomain(timelineDomain); LOG.info("ATS domain created:" + domainId + "(" + readers + "," + writers + ")"); }
private void createTimelineDomain(String domainId, String readers, String writers) throws Exception { TimelineDomain timelineDomain = new TimelineDomain(); timelineDomain.setId(domainId); timelineDomain.setReaders(readers); timelineDomain.setWriters(writers); timelineClient.putDomain(timelineDomain); LOG.info("ATS domain created:" + domainId + "(" + readers + "," + writers + ")"); }
private void prepareTimelineDomain() { TimelineClient timelineClient = null; if (jstormClientContext.conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) { timelineClient = TimelineClient.createTimelineClient(); timelineClient.init(jstormClientContext.conf); timelineClient.start(); } else { LOG.warn("Cannot put the domain " + jstormClientContext.domainId + " because the timeline service is not enabled"); return; } try { TimelineDomain domain = new TimelineDomain(); domain.setId(jstormClientContext.domainId); domain.setReaders( jstormClientContext.viewACLs != null && jstormClientContext.viewACLs.length() > 0 ? jstormClientContext.viewACLs : JOYConstants.BLANK); domain.setWriters( jstormClientContext.modifyACLs != null && jstormClientContext.modifyACLs.length() > 0 ? jstormClientContext.modifyACLs : JOYConstants.BLANK); timelineClient.putDomain(domain); LOG.info("Put the timeline domain: " + TimelineUtils.dumpTimelineRecordtoJSON(domain)); } catch (Exception e) { LOG.error("Error when putting the timeline domain", e); } finally { timelineClient.stop(); } }
private void prepareTimelineDomain() { TimelineClient timelineClient = null; if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) { timelineClient = TimelineClient.createTimelineClient(); timelineClient.init(conf); timelineClient.start(); } else { LOG.warn("Cannot put the domain " + domainId + " because the timeline service is not enabled"); return; } try { TimelineDomain domain = new TimelineDomain(); domain.setId(domainId); domain.setReaders( viewACLs != null && viewACLs.length() > 0 ? viewACLs : " "); domain.setWriters( modifyACLs != null && modifyACLs.length() > 0 ? modifyACLs : " "); timelineClient.putDomain(domain); LOG.info("Put the timeline domain: " + TimelineUtils.dumpTimelineRecordtoJSON(domain)); } catch (Exception e) { LOG.error("Error when putting the timeline domain", e); } finally { timelineClient.stop(); } } }
for (TimelineDomain domain : domains.getDomains()) { try { client.putDomain(domain); } catch (Exception e) { LOG.error("Error when putting domain " + domain.getId(), e);
private void prepareTimelineDomain() { TimelineClient timelineClient = null; if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) { timelineClient = TimelineClient.createTimelineClient(); timelineClient.init(conf); timelineClient.start(); } else { LOG.warn("Cannot put the domain " + domainId + " because the timeline service is not enabled"); return; } try { //TODO: we need to check and combine the existing timeline domain ACLs, //but let's do it once we have client java library to query domains. TimelineDomain domain = new TimelineDomain(); domain.setId(domainId); domain.setReaders( viewACLs != null && viewACLs.length() > 0 ? viewACLs : " "); domain.setWriters( modifyACLs != null && modifyACLs.length() > 0 ? modifyACLs : " "); timelineClient.putDomain(domain); LOG.info("Put the timeline domain: " + TimelineUtils.dumpTimelineRecordtoJSON(domain)); } catch (Exception e) { LOG.error("Error when putting the timeline domain", e); } finally { timelineClient.stop(); } }
for (TimelineDomain domain : domains.getDomains()) { try { client.putDomain(domain); } catch (Exception e) { LOG.error("Error when putting domain " + domain.getId(), e);
for (TimelineDomain domain : domains.getDomains()) { try { client.putDomain(domain); } catch (Exception e) { LOG.error("Error when putting domain " + domain.getId(), e);
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); } }
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); } }