Future<?> scheduleWithDynamicInterval(Task task, boolean can_block);
protected synchronized void startInfoWriter() { if(info_writer == null || info_writer.isDone()) info_writer=timer.scheduleWithDynamicInterval(new InfoWriter(info_writer_max_writes_after_view, info_writer_sleep_time)); }
protected synchronized void startInfoSender() { if(info_sender_future == null || info_sender_future.isDone()) info_sender_future=timer.scheduleWithDynamicInterval(info_sender, getTransport() instanceof TCP); }
protected synchronized void startViewConsistencyChecker() { if(view_consistency_checker == null || view_consistency_checker.isDone()) view_consistency_checker=timer.scheduleWithDynamicInterval(new ViewConsistencyChecker()); }
protected void startStableTask() { stable_task_lock.lock(); try { if(stable_task_future == null || stable_task_future.isDone()) { StableTask stable_task=new StableTask(); stable_task_future=timer.scheduleWithDynamicInterval(stable_task, getTransport() instanceof TCP); log.trace("%s: stable task started", local_addr); } } finally { stable_task_lock.unlock(); } }
/** * Add a task for execution at adjustable intervals * @param t the task to execute */ public ScheduledFuture<?> scheduleWithDynamicInterval(Task t) { return scheduleWithDynamicInterval(t, true); }
public void doSchedule(TimeScheduler timer) { future=timer.scheduleWithDynamicInterval(this); }
Future<?> scheduleWithDynamicInterval(Task task, boolean can_block);
protected synchronized void startInfoSender() { if(info_sender_future == null || info_sender_future.isDone()) info_sender_future=timer.scheduleWithDynamicInterval(info_sender, getTransport() instanceof TCP); }
void startCoordAnnouncerTask() { if(announcer_task_future == null || announcer_task_future.isDone()) { announcements.add(local_addr); announcer_task=new CoordinatorAnnouncer(); announcer_task_future=timer.scheduleWithDynamicInterval(announcer_task); if(log.isDebugEnabled()) log.debug("coordinator announcement task started, announcements=" + announcements); } }
protected synchronized void startViewConsistencyChecker() { if(view_consistency_checker == null || view_consistency_checker.isDone()) view_consistency_checker=timer.scheduleWithDynamicInterval(new ViewConsistencyChecker()); }
protected synchronized void startInfoWriter() { if(info_writer == null || info_writer.isDone()) info_writer=timer.scheduleWithDynamicInterval(new InfoWriter(info_writer_max_writes_after_view, info_writer_sleep_time)); }
private void startStableTask() { stable_task_lock.lock(); try { if(stable_task_future == null || stable_task_future.isDone()) { StableTask stable_task=new StableTask(); stable_task_future=timer.scheduleWithDynamicInterval(stable_task, true); if(log.isTraceEnabled()) log.trace("stable task started"); } } finally { stable_task_lock.unlock(); } }
/** Starts with view_task_lock held, no need to acquire it again */ void startViewSender() { try { view_task_lock.lock(); if(view_send_task_future == null || view_send_task_future.isDone()) { ViewSendTask view_send_task=new ViewSendTask(); view_send_task_future=timer.scheduleWithDynamicInterval(view_send_task, true); // fixed-rate scheduling if(log.isTraceEnabled()) log.trace("view send task started"); } } finally { view_task_lock.unlock(); } }
/** * Adds a new message to the hash table. * @param seqno The sequence number associated with the message * @param msg The message (should be a copy!) * @param receivers The set of addresses to which the message was sent * and from which consequently an ACK is expected */ public void add(long seqno, Message msg, Vector receivers) { if(waiting) return; if(receivers.isEmpty()) return; synchronized(msgs) { if(msgs.get(new Long(seqno)) != null) return; Entry e=new Entry(seqno, msg, receivers, retransmit_intervals); Future future=timer.scheduleWithDynamicInterval(e); e.setFuture(future); msgs.put(new Long(seqno), e); } }
protected void startStableTask() { stable_task_lock.lock(); try { if(stable_task_future == null || stable_task_future.isDone()) { StableTask stable_task=new StableTask(); stable_task_future=timer.scheduleWithDynamicInterval(stable_task, getTransport() instanceof TCP); log.trace("%s: stable task started", local_addr); } } finally { stable_task_lock.unlock(); } }