forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-13013][network] Request partitions during InputGate#setup
Before partitions were being requested on first polling/getting next buffer which was causing a couple of issues: - it was a little bit confusing - after first requestPartitions call, this was causing unnecessary synchronisation overhead - this was preventing data notifications to come through and isAvailable() future was always not completed before the first attempt to read the data from the input gate This commit moves requesting partitions to InputGate#setup solving those issues.
- Loading branch information
Showing
19 changed files
with
252 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/NoOpBufferPool.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* 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:https://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. | ||
*/ | ||
|
||
// We have it in this package because we could not mock the methods otherwise | ||
|
||
package org.apache.flink.runtime.io.network.buffer; | ||
|
||
import org.apache.flink.core.memory.MemorySegment; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* No-op implementation of {@link BufferPool}. | ||
*/ | ||
public class NoOpBufferPool implements BufferPool { | ||
|
||
@Override | ||
public void lazyDestroy() { | ||
} | ||
|
||
@Override | ||
public Buffer requestBuffer() throws IOException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public Buffer requestBufferBlocking() throws IOException, InterruptedException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public BufferBuilder requestBufferBuilderBlocking() throws IOException, InterruptedException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public boolean addBufferListener(BufferListener listener) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public boolean isDestroyed() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public int getNumberOfRequiredMemorySegments() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public int getMaxNumberOfMemorySegments() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public int getNumBuffers() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void setNumBuffers(int numBuffers) throws IOException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public int getNumberOfAvailableMemorySegments() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public int bestEffortGetNumOfUsedBuffers() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void recycle(MemorySegment memorySegment) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.