@Override public void run() { try { executor.shutdown(); executor.awaitTermination(WAIT_TIME, TimeUnit.SECONDS); executor = null; } catch(InterruptedException ie) { /* ignore */ } timelineClient.stop(); } });
@Override public void run() { try { executor.shutdown(); executor.awaitTermination(WAIT_TIME, TimeUnit.SECONDS); executor = null; } catch(InterruptedException ie) { /* ignore */ } timelineClient.stop(); } });
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(); } }
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(); } } }
@Override public void run() { timelineClient.stop(); executor.shutdownNow(); executor = null; } }, PigImplConstants.SHUTDOWN_HOOK_ATS_CLIENT_PRIORITY);
@Override public void run() { try { executor.shutdown(); executor.awaitTermination(WAIT_TIME, TimeUnit.SECONDS); executor = null; } catch(InterruptedException ie) { /* ignore */ } timelineClient.stop(); } });
@Override public void close() { if (timelineClient != null && timelineClient.isInState(Service.STATE.STARTED)) { timelineClient.stop(); } }
@Override public void close() { if (timelineClient != null && timelineClient.isInState(Service.STATE.STARTED)) { timelineClient.stop(); } }
@Override protected void serviceStop() throws Exception { if (this.rmClient != null) { RPC.stopProxy(this.rmClient); } if (historyServiceEnabled) { historyClient.stop(); } if (timelineClient != null) { timelineClient.stop(); } super.serviceStop(); }
@Override protected void serviceStop() throws Exception { if (this.rmClient != null) { RPC.stopProxy(this.rmClient); } if (historyServiceEnabled) { historyClient.stop(); } if (timelineServiceEnabled) { timelineClient.stop(); } super.serviceStop(); }
@Override protected void serviceStop() throws Exception { if (this.rmClient != null) { RPC.stopProxy(this.rmClient); } if (historyServiceEnabled) { historyClient.stop(); } if (timelineClient != null) { timelineClient.stop(); } super.serviceStop(); }
private void initializeTimelineClient() { if (this.conf == null) { throw new TezUncheckedException("ATSACLManager not configured"); } if (timelineClient != null) { this.timelineClient.stop(); this.timelineClient = null; } if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) { this.timelineClient = TimelineClient.createTimelineClient(); this.timelineClient.init(this.conf); this.timelineClient.start(); } else { this.timelineClient = null; if (conf.get(TezConfiguration.TEZ_HISTORY_LOGGING_SERVICE_CLASS, "") .equals(atsHistoryLoggingServiceClassName)) { LOG.warn(atsHistoryLoggingServiceClassName + " is disabled due to Timeline Service being disabled, " + YarnConfiguration.TIMELINE_SERVICE_ENABLED + " set to false"); } } try { this.user = UserGroupInformation.getCurrentUser().getShortUserName(); } catch (IOException e) { throw new TezUncheckedException("Unable to get Current User UGI", e); } }
@Override protected void serviceStop() throws Exception { if (this.rmClient != null) { RPC.stopProxy(this.rmClient); } if (historyServiceEnabled) { historyClient.stop(); } if (timelineServiceEnabled) { timelineClient.stop(); } super.serviceStop(); }
@SuppressWarnings("unchecked") @Override public long renew(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); return client.renewDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } }
@SuppressWarnings("unchecked") @Override public void cancel(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); client.cancelDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } } }
@SuppressWarnings("unchecked") @Override public void cancel(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); client.cancelDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } } }
@SuppressWarnings("unchecked") @Override public long renew(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); return client.renewDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } }
@SuppressWarnings("unchecked") @Override public long renew(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); return client.renewDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } }
@SuppressWarnings("unchecked") @Override public void cancel(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); client.cancelDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } } }