water.util
Class TimelineSnapshot

java.lang.Object
  extended by water.util.TimelineSnapshot
All Implemented Interfaces:
java.lang.Iterable<TimelineSnapshot.Event>, java.util.Iterator<TimelineSnapshot.Event>

public final class TimelineSnapshot
extends java.lang.Object
implements java.lang.Iterable<TimelineSnapshot.Event>, java.util.Iterator<TimelineSnapshot.Event>

Wrapper around timeline snapshot. Implements iterator interface (events are ordered according to send/receive dependencies across the nodes and trivial time dependencies inside node)


Nested Class Summary
 class TimelineSnapshot.Event
           
 
Field Summary
 java.util.HashMap<TimelineSnapshot.Event,java.util.ArrayList<TimelineSnapshot.Event>> _sends
           
 
Constructor Summary
TimelineSnapshot(H2O cloud, long[][] snapshot)
           
 
Method Summary
 TimelineSnapshot.Event getDependency(TimelineSnapshot.Event e)
           
 boolean hasNext()
          Just check if there is any non null non-issued event.
 java.util.Iterator<TimelineSnapshot.Event> iterator()
           
 TimelineSnapshot.Event next()
          Get the next event of the timeline according to the ordering.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sends

public final java.util.HashMap<TimelineSnapshot.Event,java.util.ArrayList<TimelineSnapshot.Event>> _sends
Constructor Detail

TimelineSnapshot

public TimelineSnapshot(H2O cloud,
                        long[][] snapshot)
Method Detail

iterator

public java.util.Iterator<TimelineSnapshot.Event> iterator()
Specified by:
iterator in interface java.lang.Iterable<TimelineSnapshot.Event>

hasNext

public boolean hasNext()
Just check if there is any non null non-issued event.

Specified by:
hasNext in interface java.util.Iterator<TimelineSnapshot.Event>

getDependency

public TimelineSnapshot.Event getDependency(TimelineSnapshot.Event e)

next

public TimelineSnapshot.Event next()
Get the next event of the timeline according to the ordering. Ordering is performed in this method. Basically there are n ordered stream of events with possible dependenencies caused by send/rcv relation. Sends are always eligible to be scheduled. Receives are eligible only if their matching send was already issued. In situation when current events of all streams are blocked (should not happen!) the oldest one is unblocked and issued. Out of all eligible events, the smallest one (according to Event.compareTo) is picked.

Specified by:
next in interface java.util.Iterator<TimelineSnapshot.Event>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<TimelineSnapshot.Event>