public class ComputationRunner extends Object implements Runnable, RebalanceListener
Modifier and Type | Field and Description |
---|---|
protected CountDownLatch |
assignmentLatch |
protected Computation |
computation |
protected ComputationContextImpl |
context |
protected long |
counter |
protected boolean |
drain |
protected long |
inCheckpointRecords |
protected long |
inRecords |
protected long |
lastReadTime |
protected long |
lastTimerExecution |
protected LogManager |
logManager |
protected WatermarkMonotonicInterval |
lowWatermark |
protected ComputationMetadataMapping |
metadata |
protected long |
outRecords |
static Duration |
READ_TIMEOUT |
protected static long |
STARVING_TIMEOUT_MS |
protected boolean |
stop |
protected Supplier<Computation> |
supplier |
protected LogTailer<Record> |
tailer |
protected String |
threadName |
Constructor and Description |
---|
ComputationRunner(Supplier<Computation> supplier,
ComputationMetadataMapping metadata,
List<LogPartition> defaultAssignment,
LogManager logManager) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkpoint() |
protected void |
checkpointIfNecessary() |
protected void |
checkRecordFlags(Record record) |
protected void |
checkSourceLowWatermark() |
protected void |
closeTailer() |
protected boolean |
continueLoop() |
void |
drain() |
Watermark |
getLowWatermark() |
protected Duration |
getTimeoutDuration() |
void |
onPartitionsAssigned(Collection<LogPartition> partitions) |
void |
onPartitionsRevoked(Collection<LogPartition> partitions) |
protected void |
processLoop() |
protected void |
processRecord() |
protected void |
processTimer() |
void |
run() |
protected void |
saveOffsets() |
protected void |
saveState() |
protected void |
saveTimers() |
protected void |
sendRecords() |
protected void |
setThreadName(String message) |
void |
stop() |
boolean |
waitForAssignments(Duration timeout) |
public static final Duration READ_TIMEOUT
protected static final long STARVING_TIMEOUT_MS
protected final LogManager logManager
protected final ComputationMetadataMapping metadata
protected final Supplier<Computation> supplier
protected final CountDownLatch assignmentLatch
protected final WatermarkMonotonicInterval lowWatermark
protected ComputationContextImpl context
protected volatile boolean stop
protected volatile boolean drain
protected Computation computation
protected long counter
protected long inRecords
protected long inCheckpointRecords
protected long outRecords
protected long lastReadTime
protected long lastTimerExecution
protected String threadName
public ComputationRunner(Supplier<Computation> supplier, ComputationMetadataMapping metadata, List<LogPartition> defaultAssignment, LogManager logManager)
public void stop()
public void drain()
public boolean waitForAssignments(Duration timeout) throws InterruptedException
InterruptedException
protected void closeTailer()
protected void processLoop() throws InterruptedException
InterruptedException
protected boolean continueLoop()
protected void processTimer()
protected void processRecord() throws InterruptedException
InterruptedException
protected Duration getTimeoutDuration()
protected void checkSourceLowWatermark()
protected void checkRecordFlags(Record record)
protected void checkpointIfNecessary()
protected void checkpoint()
protected void saveTimers()
protected void saveState()
protected void saveOffsets()
protected void sendRecords()
public Watermark getLowWatermark()
protected void setThreadName(String message)
public void onPartitionsRevoked(Collection<LogPartition> partitions)
onPartitionsRevoked
in interface RebalanceListener
public void onPartitionsAssigned(Collection<LogPartition> partitions)
onPartitionsAssigned
in interface RebalanceListener
Copyright © 2018 Nuxeo. All rights reserved.