public class ContiguousOutputChunker extends Object implements Output
This cycle marker wraps another tracking structure in order to allow for flexible buffering methods. The extents are buffer segments which can be managed atomically. They are chained here in two chains: The marking chain and the tracking chain. When the atomic marking head is non-null, then marking is possible, but marking calls block otherwise. The same is true for the tracking head element.
The nowMarking and nowTracking conditions are meant to be locked and awaited by marking and tracking calls respectively. Conversely, they are expected to be signaled by tracking and marking calls.
This implementation needs to be adapted to handle early exit of either marker or tracker threads with no deadlock.
| Constructor and Description |
|---|
ContiguousOutputChunker(Activity activity) |
ContiguousOutputChunker(long min,
long nextRangeMin,
int extentSize,
int maxExtents) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtentReader(Output reader) |
void |
close() |
boolean |
onCycleResult(long completedCycle,
int result)
Mark the result of the numbered cycle with an integer value.
|
void |
onCycleResultSegment(CycleResultsSegment segment) |
void |
removeExtentReader(Output reader) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitonCycleResultpublic ContiguousOutputChunker(long min,
long nextRangeMin,
int extentSize,
int maxExtents)
public ContiguousOutputChunker(Activity activity)
public void onCycleResultSegment(CycleResultsSegment segment)
onCycleResultSegment in interface Outputpublic boolean onCycleResult(long completedCycle,
int result)
OutputonCycleResult in interface OutputcompletedCycle - The cycle number being marked.result - the result ordinalpublic void close()
throws Exception
close in interface Outputclose in interface AutoCloseableExceptionpublic void addExtentReader(Output reader)
public void removeExtentReader(Output reader)
Copyright © 2017. All rights reserved.