@Override public synchronized void close() throws IOException { changeCurrentProgress(currentTaskSize); parent.onJobMonitorClosed(jobId); }
/** * Performs as {@link #setUp(ExecutionMonitor, ExecutionContext)} that does nothing. * @param context current context * @since 0.4.0 */ protected final void voidSetUp(ExecutionContext context) { YSLOG.info("I51001", context.getBatchId(), context.getFlowId(), context.getExecutionId(), context.getPhase(), getHandlerId()); }
/** * Returns the class loader which loaded this service class. * @return the class loader * @deprecated use {@link #getContext()} instead */ @Deprecated public ClassLoader getClassLoader() { return getContext().getClassLoader(); }
/** * Creates a new context with system variables as context parameters. * @param classLoader current class loader * @return the created context object * @throws IllegalArgumentException if some parameters were {@code null} */ public static ProfileContext system(ClassLoader classLoader) { return new ProfileContext(classLoader, new VariableResolver(System.getenv())); }
private static Set<String> consumeBlockerIds(NavigableMap<String, String> flowMap, String flowId) { String blockersString = extract(flowMap, getPrefix(flowId), KEY_BLOCKERS); Set<String> blockerIds = parseTokens(blockersString); return blockerIds; }
@Override public String getResourceId(ExecutionContext context) throws InterruptedException, IOException { return handler.getResourceId(context, null); } }
@Override public void execute( ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException { handler.cleanUp(monitor, context); }
@Override public void execute( ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException { handler.execute(monitor, context, script); }
@Override public void execute( ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException { handler.setUp(monitor, context); }
/** * Returns the tracking ID of this job. * @param context current execution context * @return the tracking ID * @since 0.5.0 */ public String getTrackingId(ExecutionContext context) { return computeTrackingId(context); }
@Override public String getId() { return script.getId(); }
@Override public synchronized void progressed(double size) throws IOException { double nextProgress = currentProgress + size; changeCurrentProgress(nextProgress); }
/** * Returns an output stream for jobs. * The default implementation returns the {@link #getOutput() this.getOutput()}. * @param jobId target job ID * @return the target stream * @throws IOException if failed to obtain output */ protected OutputStream getJobOutput(String jobId) throws IOException { return getOutput(); }
private ExecutionContext newContext(String batchId, String flowId, String executionId, ExecutionPhase phase) { return new ExecutionContext( batchId, flowId, executionId, phase, batchArguments, environmentVaritables, extensions); }
private static String getPrefix(String flowId, ExecutionPhase phase, String nodeId) { assert flowId != null; assert phase != null; assert nodeId != null; return getPrefix(flowId, phase) + nodeId + '.'; }
@Override public void checkCancelled() throws InterruptedException { parent.checkCancelled(); }
/** * Performs as {@link #cleanUp(ExecutionMonitor, ExecutionContext)} that does nothing. * @param context current context * @since 0.4.0 */ protected final void voidCleanUp(ExecutionContext context) { YSLOG.info("I51002", context.getBatchId(), context.getFlowId(), context.getExecutionId(), context.getPhase(), getHandlerId()); } }
@Override public String getResourceId(ExecutionContext context) throws InterruptedException, IOException { return handler.getResourceId(context, script); } }