Package nz.org.riskscape.engine.sched
Class Page
java.lang.Object
nz.org.riskscape.engine.sched.Page
The Scheduler
works with Pages, which is simply a block of Tuples. The goal is to
reduce thread-contention - each thread can work independently with its own Page of Tuples, and we
only have to worry about locking when adding/getting a new Page.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Page
public Page(int pageSize)
-
-
Method Details
-
getTupleCount
public int getTupleCount()- Returns:
- the number of Tuples currently in this page
-
isFull
public boolean isFull()- Returns:
- true if no more Tuples can be added to this page
-
add
public void add(nz.org.riskscape.engine.Tuple tuple) Adds (i.e. writes) a new tuple to the page.
-
toString
-
getReadOnlyCopy
Returns a copy of the Page that can only be read from, not updated. Note that multiple different processes can read from the same Page at the same time.
-
getMaxSize
public int getMaxSize()The maximum number of Tuples that can fit in this page
-