@Override public Void apply(JobExecutionStateListener input) { input.onMetadataChange(state, key, oldValue, newValue); return null; }
@Override public Void apply(JobExecutionStateListener input) { input.onStageTransition(this.state, this.previousStage, this.newStage); return null; } }
@Override public Void apply(JobExecutionStateListener input) { input.onStatusChange(this.state, this.previousStatus, this.newStatus); return null; } }
public void setStage(String newStage) { this.changeLock.lock(); try { String oldStage = this.stage; this.stage = newStage; if (this.listener.isPresent()) { this.listener.get().onStageTransition(this, oldStage, this.stage); } } finally { this.changeLock.unlock(); } }
private void doRunningStateChange(RunningState newState) { RunningState oldState = null; JobExecutionStateListener stateListener = null; this.changeLock.lock(); try { // verify transition if (null == this.runningState) { Preconditions.checkState(RunningState.PENDING == newState); } else { Preconditions.checkState(EXPECTED_PRE_TRANSITION_STATES.get(newState).contains(this.runningState), "unexpected state transition " + this.runningState + " --> " + newState); } oldState = this.runningState; this.runningState = newState; if (this.listener.isPresent()) { stateListener = this.listener.get(); } this.runningStateChanged.signalAll(); } finally { this.changeLock.unlock(); } if (null != stateListener) { stateListener.onStatusChange(this, oldState, newState); } }
public void setMedatata(String key, Object value) { this.changeLock.lock(); try { Object oldValue = this.executionMetadata.get(key); this.executionMetadata.put(key, value); if (this.listener.isPresent()) { this.listener.get().onMetadataChange(this, key, oldValue, value); } } finally { this.changeLock.unlock(); } }