@Override @Transactional public void joinFinishedSplits() { try { joinFinishedSplits(BULK_SIZE); } catch (Exception ex) { logger.error("SplitJoinJob failed", ex); } }
Long executionId = findExecutionId(executions, splitId); logger.error("Couldn't find suspended execution for split " + splitId + " execution id: " + executionId); joinAndSendToQueue(suspendedExecutionsWithOneBranch);
@Override @Transactional public int joinFinishedSplits(int bulkSize) { // 1. Find all suspended executions that have all their branches ended PageRequest pageRequest = new PageRequest(0, bulkSize); List<SuspendedExecution> suspendedExecutions = suspendedExecutionsRepository.findFinishedSuspendedExecutions(pageRequest); return joinAndSendToQueue(suspendedExecutions); }
private int joinAndSendToQueue(List<SuspendedExecution> suspendedExecutions) { List<ExecutionMessage> messages = new ArrayList<>(); if (logger.isDebugEnabled()) logger.debug("Joining finished branches, found " + suspendedExecutions.size() + " suspended executions with all branches finished"); // nothing to do here if (suspendedExecutions.isEmpty()) return 0; for (SuspendedExecution se : suspendedExecutions) { Execution exec = joinSplit(se); messages.add(executionToStartExecutionMessage.convert(exec)); } // 3. send the suspended execution back to the queue queueDispatcherService.dispatch(messages); // 4. delete the suspended execution from the suspended table suspendedExecutionsRepository.delete(suspendedExecutions); return suspendedExecutions.size(); }
Long executionId = findExecutionId(executions, splitId); logger.error("Couldn't find suspended execution for split " + splitId + " execution id: " + executionId); joinAndSendToQueue(suspendedExecutionsWithOneBranch);
@Override @Transactional public int joinFinishedSplits(int bulkSize) { // 1. Find all suspended executions that have all their branches ended PageRequest pageRequest = new PageRequest(0, bulkSize); List<SuspendedExecution> suspendedExecutions = suspendedExecutionsRepository.findFinishedSuspendedExecutions(pageRequest); return joinAndSendToQueue(suspendedExecutions); }
private int joinAndSendToQueue(List<SuspendedExecution> suspendedExecutions) { List<ExecutionMessage> messages = new ArrayList<>(); if (logger.isDebugEnabled()) logger.debug("Joining finished branches, found " + suspendedExecutions.size() + " suspended executions with all branches finished"); // nothing to do here if (suspendedExecutions.isEmpty()) return 0; for (SuspendedExecution se : suspendedExecutions) { Execution exec = joinSplit(se); messages.add(executionToStartExecutionMessage.convert(exec)); } // 3. send the suspended execution back to the queue queueDispatcherService.dispatch(messages); // 4. delete the suspended execution from the suspended table suspendedExecutionsRepository.delete(suspendedExecutions); return suspendedExecutions.size(); }
@Override @Transactional public void joinFinishedSplits() { try { joinFinishedSplits(BULK_SIZE); } catch (Exception ex) { logger.error("SplitJoinJob failed", ex); } }