public class LogStreamProcessor extends Object implements StreamProcessor
Modifier and Type | Field and Description |
---|---|
protected LogManager |
manager |
protected List<ComputationPool> |
pools |
protected Settings |
settings |
protected Topology |
topology |
Constructor and Description |
---|
LogStreamProcessor(LogManager manager) |
Modifier and Type | Method and Description |
---|---|
boolean |
drainAndStop(Duration timeout)
Stop computations when input streams are empty.
|
protected List<List<LogPartition>> |
getDefaultAssignments(ComputationMetadataMapping meta) |
long |
getLowWatermark()
Return the low watermark for all the computations of the topology.
|
long |
getLowWatermark(String computationName)
Return the low watermark for the computation.
|
StreamProcessor |
init(Topology topology,
Settings settings)
Initialize streams, but don't run the computations
|
protected List<ComputationPool> |
initPools() |
protected void |
initStreams() |
boolean |
isDone(long timestamp)
Returns true if all messages with a lower timestamp has been processed by the topology.
|
void |
shutdown()
Shutdown immediately.
|
void |
start()
Run the initialized computations.
|
boolean |
stop(Duration timeout)
Try to stop computations gracefully after processing a record or a timer within the timeout duration.
|
boolean |
waitForAssignments(Duration timeout)
Wait for the computations to have assigned partitions ready to process records.
|
protected final LogManager manager
protected List<ComputationPool> pools
public LogStreamProcessor(LogManager manager)
public StreamProcessor init(Topology topology, Settings settings)
StreamProcessor
init
in interface StreamProcessor
public void start()
StreamProcessor
start
in interface StreamProcessor
public boolean waitForAssignments(Duration timeout) throws InterruptedException
StreamProcessor
true
if all computations have assigned partitions during the timeout delay.waitForAssignments
in interface StreamProcessor
InterruptedException
public boolean stop(Duration timeout)
StreamProcessor
stop
in interface StreamProcessor
public boolean drainAndStop(Duration timeout)
StreamProcessor
true
if computations are stopped during the timeout delay.drainAndStop
in interface StreamProcessor
public void shutdown()
StreamProcessor
shutdown
in interface StreamProcessor
public long getLowWatermark()
StreamProcessor
getLowWatermark
in interface StreamProcessor
public long getLowWatermark(String computationName)
StreamProcessor
getLowWatermark
in interface StreamProcessor
public boolean isDone(long timestamp)
StreamProcessor
isDone
in interface StreamProcessor
protected List<ComputationPool> initPools()
protected List<List<LogPartition>> getDefaultAssignments(ComputationMetadataMapping meta)
protected void initStreams()
Copyright © 2018 Nuxeo. All rights reserved.