@Override public void consumeExecuteQueue() { // Consume control queue first, and then async consume execute queue controlQueue.consumeBatchWhenAvailable(this); exeQueue.consumeBatch(this); } }
private void executeEvent() { try { exeQueue.consumeBatch(this); } catch (Exception e) { if (!taskStatus.isShutdown()) { LOG.error("unknown exception:", e); } } }
public void consumeExecuteQueue() { //Asynchronous release the queue, but still is single thread controlQueue.consumeBatch(this); exeQueue.consumeBatchWhenAvailable(this); }
protected void consumeBatch(EventHandler<Object> handler) { boolean isConsumeEvent = false; if (controlQueue.population() > 0) { controlQueue.consumeBatch(handler); isConsumeEvent = true; } if (exeQueue.population() > 0) { exeQueue.consumeBatch(handler); isConsumeEvent = true; } if (!isConsumeEvent) JStormUtils.sleepMs(1); } }
@Override public void run() { if (!isFinishInit) { initWrapper(); } while (!taskStatus.isShutdown()) { try { //Asynchronous release the queue, but still is single thread controlQueue.consumeBatch(this); exeQueue.consumeBatchWhenAvailable(this); /* processControlEvent();*/ } catch (Throwable e) { if (!taskStatus.isShutdown()) { LOG.error(idStr + " bolt exeutor error", e); } } } }
controlQueue.consumeBatch(this); if (System.currentTimeMillis() - now > delayRun * 1000) { executorStatus.setStatus(TaskStatus.RUN); controlQueue.consumeBatch(this);
private void executeEvent() { try { exeQueue.consumeBatch(this); } catch (Exception e) { if (taskStatus.isShutdown() == false) { LOG.error("Actor occur unknow exception ", e); } } }
controlQueue.consumeBatch(this); if (System.currentTimeMillis() - now > delayRun * 1000){ executorStatus.setStatus(TaskStatus.RUN); controlQueue.consumeBatch(this);