T
- the type of the elements which this pipe should transfer.public class BoundedSynchedPipe<T> extends AbstractSynchedPipe<T> implements IMonitorablePipe
cachedTargetStage
Constructor and Description |
---|
BoundedSynchedPipe(OutputPort<? extends T> sourcePort,
InputPort<T> targetPort,
int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
add(Object element)
Adds an element to the pipe.
|
boolean |
addNonBlocking(Object element)
Adds an element to the pipe.
|
int |
capacity() |
long |
getNumPullsSinceAppStart() |
long |
getNumPushesSinceAppStart() |
int |
getNumWaits() |
long |
getPullThroughput() |
long |
getPushThroughput() |
boolean |
isEmpty()
Checks whether the pipe is empty or not.
|
Object |
removeLast()
Retrieves and removes the last element from the pipe.
|
int |
size() |
close, getSignal, isClosed, reportNewElement, sendSignal, waitForStartSignal
getCachedTargetStage, getScheduler, getSourcePort, getTargetPort, hasMore, setScheduler, toString
public BoundedSynchedPipe(OutputPort<? extends T> sourcePort, InputPort<T> targetPort, int capacity)
public void add(Object element)
IPipe
IPipe.addNonBlocking(Object)
).
If it cannot guarantee element delivery in some special situation, it then must throw an exception.public boolean addNonBlocking(Object element)
IPipe
addNonBlocking
in interface IPipe<T>
element
- Element which will be addedtrue
if the element could be added, false otherwisepublic Object removeLast()
IPipe
removeLast
in interface IPipe<T>
null
if the pipe is currently empty.public boolean isEmpty()
IPipe
public int size()
size
in interface IMonitorablePipe
size
in interface IPipe<T>
public int getNumWaits()
getNumWaits
in interface IMonitorablePipe
public long getPushThroughput()
getPushThroughput
in interface IMonitorablePipe
public long getPullThroughput()
getPullThroughput
in interface IMonitorablePipe
public long getNumPushesSinceAppStart()
getNumPushesSinceAppStart
in interface IMonitorablePipe
public long getNumPullsSinceAppStart()
getNumPullsSinceAppStart
in interface IMonitorablePipe
public int capacity()
capacity
in interface IMonitorablePipe
capacity
in interface IPipe<T>
Copyright © 2015–2020. All rights reserved.