T
- Type of the elements in the Stream being rescaled@Internal public class RescalePartitioner<T> extends StreamPartitioner<T>
StreamingJobGraphGenerator
instantiates a DistributionPattern.POINTWISE
distribution pattern when encountering RescalePartitioner
.
The subset of downstream operations to which the upstream operation sends elements depends on the degree of parallelism of both the upstream and downstream operation. For example, if the upstream operation has parallelism 2 and the downstream operation has parallelism 4, then one upstream operation would distribute elements to two downstream operations while the other upstream operation would distribute to the other two downstream operations. If, on the other hand, the downstream operation has parallelism 2 while the upstream operation has parallelism 4 then two upstream operations will distribute to one downstream operation while the other two upstream operations will distribute to the other downstream operations.
In cases where the different parallelisms are not multiples of each other one or several downstream operations will have a differing number of inputs from upstream operations.
numberOfChannels
Constructor and Description |
---|
RescalePartitioner() |
Modifier and Type | Method and Description |
---|---|
StreamPartitioner<T> |
copy() |
SubtaskStateMapper |
getDownstreamSubtaskStateMapper()
Defines the behavior of this partitioner, when downstream rescaled during recovery of
in-flight data.
|
SubtaskStateMapper |
getUpstreamSubtaskStateMapper()
Defines the behavior of this partitioner, when upstream rescaled during recovery of in-flight
data.
|
boolean |
isPointwise() |
int |
selectChannel(SerializationDelegate<StreamRecord<T>> record)
Returns the logical channel index, to which the given record should be written.
|
String |
toString() |
equals, hashCode, isBroadcast, setup
public int selectChannel(SerializationDelegate<StreamRecord<T>> record)
ChannelSelector
UnsupportedOperationException
).record
- the record to determine the output channels for.public SubtaskStateMapper getDownstreamSubtaskStateMapper()
StreamPartitioner
getDownstreamSubtaskStateMapper
in class StreamPartitioner<T>
public SubtaskStateMapper getUpstreamSubtaskStateMapper()
StreamPartitioner
getUpstreamSubtaskStateMapper
in class StreamPartitioner<T>
public StreamPartitioner<T> copy()
copy
in class StreamPartitioner<T>
public boolean isPointwise()
isPointwise
in class StreamPartitioner<T>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.