This is an automated email from the ASF dual-hosted git repository. pnowojski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
commit 130e7970b5aefc064498f0d67811260face2e5e5 Author: Zhijiang <wangzhijiang...@aliyun.com> AuthorDate: Tue Jul 9 18:32:35 2019 +0800 [hotfix][network] Move private NoOpResultSubpartitionView class out of PartitionRequestQueueTest NoOpResultSubpartitionView is defined as a private class in PartitionRequestQueueTest. It could be used widely in other places future, so it is reasonable to refactor it as a separate public class. --- .../partition/NoOpResultSubpartitionView.java | 64 ++++++++++++++++++++++ .../network/netty/PartitionRequestQueueTest.java | 40 +------------- 2 files changed, 65 insertions(+), 39 deletions(-) diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/NoOpResultSubpartitionView.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/NoOpResultSubpartitionView.java new file mode 100644 index 0000000..f3ba1e3 --- /dev/null +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/NoOpResultSubpartitionView.java @@ -0,0 +1,64 @@ +/* + * 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; + +import javax.annotation.Nullable; + +/** + * A dummy implementation of the {@link ResultSubpartitionView}. + */ +public class NoOpResultSubpartitionView implements ResultSubpartitionView { + + @Nullable + public ResultSubpartition.BufferAndBacklog getNextBuffer() { + return null; + } + + @Override + public void notifyDataAvailable() { + } + + @Override + public void releaseAllResources() { + } + + @Override + public void notifySubpartitionConsumed() { + } + + @Override + public boolean isReleased() { + return true; + } + + @Override + public Throwable getFailureCause() { + return null; + } + + @Override + public boolean nextBufferIsEvent() { + return false; + } + + @Override + public boolean isAvailable() { + return false; + } +} diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java index 2deaa9b..a9e8662 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java @@ -20,6 +20,7 @@ package org.apache.flink.runtime.io.network.netty; import org.apache.flink.runtime.execution.CancelTaskException; import org.apache.flink.runtime.io.network.NetworkSequenceViewReader; +import org.apache.flink.runtime.io.network.partition.NoOpResultSubpartitionView; import org.apache.flink.runtime.io.network.partition.ResultPartitionID; import org.apache.flink.runtime.io.network.partition.ResultPartitionProvider; import org.apache.flink.runtime.io.network.partition.ResultSubpartition.BufferAndBacklog; @@ -369,43 +370,4 @@ public class PartitionRequestQueueTest { return channelBlockingBuffer; } - - private static class NoOpResultSubpartitionView implements ResultSubpartitionView { - @Nullable - public BufferAndBacklog getNextBuffer() { - return null; - } - - @Override - public void notifyDataAvailable() { - } - - @Override - public void releaseAllResources() { - } - - @Override - public void notifySubpartitionConsumed() { - } - - @Override - public boolean isReleased() { - return true; - } - - @Override - public Throwable getFailureCause() { - return null; - } - - @Override - public boolean nextBufferIsEvent() { - return false; - } - - @Override - public boolean isAvailable() { - return false; - } - } }