private void executeInMemoryChore(ProcedureInMemoryChore<TEnvironment> chore) { if (!chore.isWaiting()) { return; } // The ProcedureInMemoryChore is a special case, and it acts as a chore. // instead of bringing the Chore class in, we reuse this timeout thread for // this special case. try { chore.periodicExecute(executor.getEnvironment()); } catch (Throwable e) { LOG.error("Ignoring {} exception: {}", chore, e.getMessage(), e); } }
/** * Add a chore procedure to the executor * @param chore the chore to add */ public void addChore(ProcedureInMemoryChore<TEnvironment> chore) { chore.setState(ProcedureState.WAITING_TIMEOUT); timeoutExecutor.add(chore); }
protected ProcedureInMemoryChore(final int timeoutMsec) { setTimeout(timeoutMsec); }
private void executeInMemoryChore(ProcedureInMemoryChore<TEnvironment> chore) { if (!chore.isWaiting()) { return; } // The ProcedureInMemoryChore is a special case, and it acts as a chore. // instead of bringing the Chore class in, we reuse this timeout thread for // this special case. try { chore.periodicExecute(executor.getEnvironment()); } catch (Throwable e) { LOG.error("Ignoring {} exception: {}", chore, e.getMessage(), e); } }
/** * Remove a chore procedure from the executor * @param chore the chore to remove * @return whether the chore is removed, or it will be removed later */ public boolean removeChore(ProcedureInMemoryChore<TEnvironment> chore) { chore.setState(ProcedureState.SUCCESS); return timeoutExecutor.remove(chore); }
protected ProcedureInMemoryChore(final int timeoutMsec) { setTimeout(timeoutMsec); }
private void executeInMemoryChore(ProcedureInMemoryChore chore) { if (!chore.isWaiting()) { return; } // The ProcedureInMemoryChore is a special case, and it acts as a chore. // instead of bringing the Chore class in, we reuse this timeout thread for // this special case. try { chore.periodicExecute(executor.getEnvironment()); } catch (Throwable e) { LOG.error("Ignoring {} exception: {}", chore, e.getMessage(), e); } }
/** * Add a chore procedure to the executor * @param chore the chore to add */ public void addChore(ProcedureInMemoryChore<TEnvironment> chore) { chore.setState(ProcedureState.WAITING_TIMEOUT); timeoutExecutor.add(chore); }
protected ProcedureInMemoryChore(final int timeoutMsec) { setTimeout(timeoutMsec); }
/** * Add a chore procedure to the executor * @param chore the chore to add */ public void addChore(final ProcedureInMemoryChore chore) { chore.setState(ProcedureState.WAITING_TIMEOUT); timeoutExecutor.add(chore); }
/** * Remove a chore procedure from the executor * @param chore the chore to remove * @return whether the chore is removed, or it will be removed later */ public boolean removeChore(final ProcedureInMemoryChore chore) { chore.setState(ProcedureState.SUCCESS); return timeoutExecutor.remove(chore); }
/** * Remove a chore procedure from the executor * @param chore the chore to remove * @return whether the chore is removed, or it will be removed later */ public boolean removeChore(ProcedureInMemoryChore<TEnvironment> chore) { chore.setState(ProcedureState.SUCCESS); return timeoutExecutor.remove(chore); }