reswqa commented on code in PR #23179:
URL: https://github.com/apache/flink/pull/23179#discussion_r1290831536
##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/netty/TieredStorageResultSubpartitionViewTest.java:
##########
@@ -115,18 +113,18 @@ void testNotifyRequiredSegmentId() {
@Test
void testReleaseAllResources() throws IOException {
tieredStorageResultSubpartitionView.releaseAllResources();
- assertThat(nettyPayloadQueues.get(0)).hasSize(0);
- assertThat(nettyPayloadQueues.get(1)).hasSize(0);
+ assertThat(nettyPayloadQueues.get(0).getBacklog()).isEqualTo(0);
+ assertThat(nettyPayloadQueues.get(1).getBacklog()).isEqualTo(0);
Review Comment:
```suggestion
assertThat(nettyPayloadQueues.get(1).getBacklog()).isZero;
```
##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/netty/TieredStorageResultSubpartitionView.java:
##########
@@ -94,14 +93,14 @@ public BufferAndBacklog getNextBuffer() throws IOException {
@Override
public AvailabilityWithBacklog getAvailabilityAndBacklog(int
numCreditsAvailable) {
if (findCurrentNettyPayloadQueue()) {
- Queue<NettyPayload> currentQueue =
+ NettyPayloadQueue currentQueue =
nettyPayloadQueues.get(queueIndexContainsCurrentSegment);
boolean availability = numCreditsAvailable > 0;
if (numCreditsAvailable <= 0
&& getNettyPayloadNextDataType(currentQueue) ==
Buffer.DataType.EVENT_BUFFER) {
Review Comment:
What should we do with error, it also does not have backlog.
##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/netty/NettyPayloadQueue.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.io.network.partition.hybrid.tiered.netty;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
+/**
+ * The {@link NettyPayloadQueue} is the queue to contain different types of
{@link NettyPayload} and
+ * calculate the backlog number.
+ */
+public class NettyPayloadQueue {
Review Comment:
Basically, this should impl `Queue`.
##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/netty/TieredStorageResultSubpartitionViewTest.java:
##########
@@ -115,18 +113,18 @@ void testNotifyRequiredSegmentId() {
@Test
void testReleaseAllResources() throws IOException {
tieredStorageResultSubpartitionView.releaseAllResources();
- assertThat(nettyPayloadQueues.get(0)).hasSize(0);
- assertThat(nettyPayloadQueues.get(1)).hasSize(0);
+ assertThat(nettyPayloadQueues.get(0).getBacklog()).isEqualTo(0);
Review Comment:
```suggestion
assertThat(nettyPayloadQueues.get(0).getBacklog()).isZero();
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]