AHeise commented on a change in pull request #12575:
URL: https://github.com/apache/flink/pull/12575#discussion_r440772079
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/CheckpointBarrierAligner.java
##########
@@ -46,14 +49,8 @@
private static final Logger LOG =
LoggerFactory.getLogger(CheckpointBarrierAligner.class);
- /** Used to get InputGate by channel index. */
- private final InputGate[] channelIndexToInputGate;
-
- /** Used to get channel index offset by InputGate. */
- private final Map<InputGate, Integer> inputGateToChannelIndexOffset;
-
/** Flags that indicate whether a channel is currently
blocked/buffered. */
- private final boolean[] blockedChannels;
+ private final Map<InputChannelInfo, Boolean> blockedChannels;
Review comment:
Never mind, I misread the code. It's only used while calling
`LinkedHashSet` -> `super(HashSet)`.
Anyways, the current way is used to avoid dynamic reallocations. I can also
write a small wrapper Set implementation (similar to `EnumSet`) if it's too
hard to read right now.
Performance-wise there is no gain on a `HashSet#containsKey` on an empty set
to a `HashMap#get` on a filled set with same capacity. However, I'd we avoid
object creations and deletions if we just update the nodes on write access.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]