@Internal public final class StreamTaskNetworkInput<T> extends Object implements StreamTaskInput<T>
StreamTaskInput
that wraps an input from network taken from CheckpointedInputGate
.
This internally uses a StatusWatermarkValve
to keep track of Watermark
and
StreamStatus
events, and forwards them to event subscribers once the
StatusWatermarkValve
determines the Watermark
from all inputs has advanced, or
that a StreamStatus
needs to be propagated downstream to denote a status change.
Forwarding elements, watermarks, or status status elements must be protected by synchronizing
on the given lock object. This ensures that we don't call methods on a
StreamInputProcessor
concurrently with the timer callback or other things.
PushingAsyncDataInput.DataOutput<T>
AvailabilityProvider.AvailabilityHelper
UNSPECIFIED
AVAILABLE
Constructor and Description |
---|
StreamTaskNetworkInput(CheckpointedInputGate checkpointedInputGate,
TypeSerializer<?> inputSerializer,
IOManager ioManager,
StatusWatermarkValve statusWatermarkValve,
int inputIndex) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
InputStatus |
emitNext(PushingAsyncDataInput.DataOutput<T> output)
Pushes the next element to the output from current data input, and returns
the input status to indicate whether there are more available data in
current input.
|
CompletableFuture<?> |
getAvailableFuture() |
int |
getInputIndex()
Returns the input index of this input.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isApproximatelyAvailable, isAvailable
public StreamTaskNetworkInput(CheckpointedInputGate checkpointedInputGate, TypeSerializer<?> inputSerializer, IOManager ioManager, StatusWatermarkValve statusWatermarkValve, int inputIndex)
public InputStatus emitNext(PushingAsyncDataInput.DataOutput<T> output) throws Exception
PushingAsyncDataInput
This method should be non blocking.
emitNext
in interface PushingAsyncDataInput<T>
Exception
public int getInputIndex()
StreamTaskInput
getInputIndex
in interface StreamTaskInput<T>
public CompletableFuture<?> getAvailableFuture()
getAvailableFuture
in interface AvailabilityProvider
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.