BatchScheduler( String batchId, BatchScript batchScript, ExecutionLock lock, ExecutorService executor) { assert batchId != null; assert batchScript != null; assert lock != null; assert executor != null; this.batchId = batchId; this.flows = new LinkedList<FlowScript>(batchScript.getAllFlows()); this.lock = lock; this.executor = executor; this.running = new HashMap<String, FlowScriptTask>(); this.blocking = new HashSet<String>(); for (FlowScript flow : flows) { blocking.add(flow.getId()); } this.doneQueue = new LinkedBlockingQueue<FlowScriptTask>(); }