Map<String, Object> callWithExecutable(final ExecutableFlow exflow, final Executor executor, final String action) throws ExecutorManagerException { return callWithExecutionId(executor.getHost(), executor.getPort(), action, exflow.getExecutionId(), null, (Pair<String, String>[]) null); }
@Override public void start() throws ExecutorManagerException { initialize(); this.updaterThread.start(); this.cleanerThread.start(); this.queueProcessor.start(); }
@Override public void resetForRetry() { super.resetForRetry(); this.setStatus(Status.RUNNING); }
Map<String, Object> callWithReference(final ExecutionReference ref, final String action, final Pair<String, String>... params) throws ExecutorManagerException { final Executor executor = ref.getExecutor().get(); return callWithExecutionId(executor.getHost(), executor.getPort(), action, ref.getExecId(), null, params); }
@Override public void doAction() throws Exception { final ExecutableFlow exFlow = executorManagerAdapter.getExecutableFlow(this.execId); logger.info("ready to kill execution " + this.execId); if (!Status.isStatusFinished(exFlow.getStatus())) { logger.info("Killing execution " + this.execId); executorManagerAdapter.cancelFlow(exFlow, Constants.AZKABAN_SLA_CHECKER_USERNAME); } }
public String getPrintableId(final String delimiter) { if (this.getParentFlow() == null || this.getParentFlow() instanceof ExecutableFlow) { return getId(); } return getParentFlow().getPrintableId(delimiter) + delimiter + getId(); }
private ExecutableFlow createExecutionAndAssign(final Status status, final Executor executor) throws Exception { final ExecutableFlow flow = createExecution(status); this.assignExecutor.assignExecutor(executor.getId(), flow.getExecutionId()); return flow; }
public List<ExecutorLogEvent> getExecutorEvents(final Executor executor, final int num, final int offset) throws ExecutorManagerException { try { return this.dbOperator.query(ExecutorLogsResultHandler.SELECT_EXECUTOR_EVENTS_ORDER, new ExecutorLogsResultHandler(), executor.getId(), num, offset); } catch (final SQLException e) { throw new ExecutorManagerException( "Failed to fetch events for executor id : " + executor.getId(), e); } }
List<ExecutableFlow> fetchFlowHistory(final int projectId, final String flowId, final int skip, final int num, final Status status) throws ExecutorManagerException { try { return this.dbOperator.query(FetchExecutableFlows.FETCH_EXECUTABLE_FLOW_BY_STATUS, new FetchExecutableFlows(), projectId, flowId, status.getNumVal(), skip, num); } catch (final SQLException e) { throw new ExecutorManagerException("Error fetching active flows", e); } }
/** * {@inheritDoc} * * @see azkaban.executor.ExecutorManagerAdapter#fetchExecutor(int) */ @Override public Executor fetchExecutor(final int executorId) throws ExecutorManagerException { for (final Executor executor : this.activeExecutors.getAll()) { if (executor.getId() == executorId) { return executor; } } return this.executorLoader.fetchExecutor(executorId); }
@Before public void setup() { this.executionFlowDao = new ExecutionFlowDao(dbOperator); this.executorDao = new ExecutorDao(dbOperator); this.assignExecutor = new AssignExecutorDao(dbOperator, this.executorDao); this.fetchActiveFlowDao = new FetchActiveFlowDao(dbOperator); this.executionJobDao = new ExecutionJobDao(dbOperator); this.loader = new JdbcProjectImpl(props, dbOperator); }
@Override public List<ExecutableFlow> fetchFlowHistory(final String projContain, final String flowContains, final String userNameContains, final int status, final long startTime, final long endTime, final int skip, final int num) throws ExecutorManagerException { return this.executionFlowDao.fetchFlowHistory(projContain, flowContains, userNameContains, status, startTime, endTime, skip, num); }
@Override public List<ExecutableFlow> getExecutableFlows(final int projectId, final String flowId, final int from, final int length, final Status status) throws ExecutorManagerException { return this.executorLoader.fetchFlowHistory(projectId, flowId, from, length, status); }
@SuppressWarnings("unused") public void shutdown() { this.shutdown = true; this.interrupt(); }
/** * {@inheritDoc} * * @see azkaban.executor.ExecutorManagerAdapter#setupExecutors() */ @Override public void setupExecutors() throws ExecutorManagerException { checkMultiExecutorMode(); this.activeExecutors.setupExecutors(); }
@Override public List<ExecutableJobInfo> fetchJobInfoAttempts(final int execId, final String jobId) throws ExecutorManagerException { return this.executionJobDao.fetchJobInfoAttempts(execId, jobId); }
/** * Returns state of QueueProcessor False, no flow is being dispatched True , flows are being * dispatched as expected */ public boolean isQueueProcessorThreadActive() { return this.queueProcessor.isActive(); }
private RunningExecutionsUpdaterThread getRunningExecutionsUpdaterThread() { return new RunningExecutionsUpdaterThread(new RunningExecutionsUpdater( this.updaterStage, this.alertHolder, this.commonMetrics, this.apiGateway, this.runningExecutions, this.executionFinalizer, this.execLoader), this.runningExecutions); }
Map<String, Object> callWithReferenceByUser(final ExecutionReference ref, final String action, final String user, final Pair<String, String>... params) throws ExecutorManagerException { final Executor executor = ref.getExecutor().get(); return callWithExecutionId(executor.getHost(), executor.getPort(), action, ref.getExecId(), user, params); }