bamboo.sim
Class EventQueue
java.lang.Object
bamboo.sim.EventQueue
public class EventQueue
- extends Object
A really simple, and hopefully really fast, simulator core. The user
can add nodes with a specified lifetime, register and cancel timer
events, and nothing more. Timers that would go off after a node has
been removed are ignored at registration time. Also, a cleanup function
may be provided when adding a node; it will be called before the node is
removed. Time is in microseconds.
- Version:
- $Id: EventQueue.java,v 1.8 2004/04/17 22:44:58 srhea Exp $
- Author:
- Sean C. Rhea
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static org.apache.log4j.Logger logger
nodes_by_node_id
protected Map nodes_by_node_id
cancelled_timers
protected Set cancelled_timers
event_queue
protected PriorityQueue event_queue
now_us
protected long now_us
current_node_id
protected ostore.util.NodeId current_node_id
failure_cb
protected EventQueue.Callback failure_cb
EventQueue
public EventQueue()
add_node
public void add_node(ostore.util.NodeId node_id,
long life_time_us,
EventQueue.Callback cleanup_cb,
Object user_data)
register_timer
public Object register_timer(long time_us,
EventQueue.Callback cb,
Object user_data)
register_timer
public Object register_timer(ostore.util.NodeId node_id,
long time_us,
EventQueue.Callback cb,
Object user_data)
cancel_timer
public void cancel_timer(Object token)
run
public void run()
failure_time_us
public long failure_time_us(ostore.util.NodeId node_id)
now_us
public long now_us()
current_node_id
public ostore.util.NodeId current_node_id()
set_current_node_id
public void set_current_node_id(ostore.util.NodeId n)