@Override public void ack(Object messageId) { //remove from processStartTime, if size == 0, then update lastUpdateTime Long startTime = (Long)messageId; if (LOG.isDebugEnabled()) { LOG.debug("succeed startTime {}", startTime); } this.processStartTime.remove(startTime); if (this.processStartTime.size() == 0) { while (true) { try { LOG.info("all have finished, update lastUpdateTime to {}", this.lastUpdateTime + MAX_SAFE_TIME); AggregationTimeManager.instance().updateLastFinishTime(this.lastUpdateTime + MAX_SAFE_TIME); break; } catch (Exception e) { Utils.sleep(3); } } } }
@Override public void nextTuple() { LOG.info("start to fetch job list"); try { List<AppInfo> apps = rmResourceFetcher.getResource(Constants.ResourceType.RUNNING_MR_JOB); if (apps == null) { apps = new ArrayList<>(); } handleApps(apps, true); long fetchTime = Calendar.getInstance().getTimeInMillis(); if (fetchTime - this.lastFinishAppTime > 60000L) { apps = rmResourceFetcher.getResource(Constants.ResourceType.COMPLETE_MR_JOB, Long.toString(this.lastFinishAppTime)); if (apps == null) { apps = new ArrayList<>(); } handleApps(apps, false); this.lastFinishAppTime = fetchTime; this.runningJobManager.updateLastFinishTime(partitionId, fetchTime); } } catch (Exception e) { LOG.warn("exception found {}", e); } finally { //need to be configured Utils.sleep(60); } }
@Override public void nextTuple() { Utils.sleep(5); if (LOG.isDebugEnabled()) { LOG.debug("start to run");
LOG.error("An fetal exception is caught: {}", e.getMessage(), e); } finally { Utils.sleep(endpointConfig.fetchRunningJobInterval);