You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2019/08/02 07:44:07 UTC
[flink] 10/15: [hotfix][tests] fix codestyle issues in
NettyShuffleEnvironmentBuilder
This is an automated email from the ASF dual-hosted git repository.
chesnay pushed a commit to branch release-1.9
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 95d6d41c710ffbfcc200e3193b840fddf515cb79
Author: Andrey Zagrebin <az...@gmail.com>
AuthorDate: Mon Jul 29 17:48:28 2019 +0300
[hotfix][tests] fix codestyle issues in NettyShuffleEnvironmentBuilder
---
.../io/network/NettyShuffleEnvironmentBuilder.java | 49 +++++-----------------
1 file changed, 11 insertions(+), 38 deletions(-)
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/NettyShuffleEnvironmentBuilder.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/NettyShuffleEnvironmentBuilder.java
index 96b6330..4f0ecf3 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/NettyShuffleEnvironmentBuilder.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/NettyShuffleEnvironmentBuilder.java
@@ -33,38 +33,30 @@ import java.time.Duration;
*/
public class NettyShuffleEnvironmentBuilder {
- public static final int DEFAULT_NUM_NETWORK_BUFFERS = 1024;
+ private static final int DEFAULT_NETWORK_BUFFER_SIZE = 32 << 10;
+ private static final int DEFAULT_NUM_NETWORK_BUFFERS = 1024;
- private static final String[] DEFAULT_TEMP_DIRS = new String[] {EnvironmentInformation.getTemporaryFileDirectory()};
+ private static final String[] DEFAULT_TEMP_DIRS = {EnvironmentInformation.getTemporaryFileDirectory()};
+ private static final Duration DEFAULT_REQUEST_SEGMENTS_TIMEOUT = Duration.ofMillis(30000L);
private int numNetworkBuffers = DEFAULT_NUM_NETWORK_BUFFERS;
- private int networkBufferSize = 32 * 1024;
+ private int partitionRequestInitialBackoff;
- private int partitionRequestInitialBackoff = 0;
-
- private int partitionRequestMaxBackoff = 0;
+ private int partitionRequestMaxBackoff;
private int networkBuffersPerChannel = 2;
private int floatingNetworkBuffersPerGate = 8;
- private Duration requestSegmentsTimeout = Duration.ofMillis(30000L);
-
private boolean isCreditBased = true;
- private boolean isNetworkDetailedMetrics = false;
-
private ResourceID taskManagerLocation = ResourceID.generate();
private NettyConfig nettyConfig;
- private TaskEventDispatcher taskEventDispatcher = new TaskEventDispatcher();
-
private MetricGroup metricGroup = UnregisteredMetricGroups.createUnregisteredTaskManagerMetricGroup();
- private String[] tempDirs = DEFAULT_TEMP_DIRS;
-
public NettyShuffleEnvironmentBuilder setTaskManagerLocation(ResourceID taskManagerLocation) {
this.taskManagerLocation = taskManagerLocation;
return this;
@@ -75,11 +67,6 @@ public class NettyShuffleEnvironmentBuilder {
return this;
}
- public NettyShuffleEnvironmentBuilder setNetworkBufferSize(int networkBufferSize) {
- this.networkBufferSize = networkBufferSize;
- return this;
- }
-
public NettyShuffleEnvironmentBuilder setPartitionRequestInitialBackoff(int partitionRequestInitialBackoff) {
this.partitionRequestInitialBackoff = partitionRequestInitialBackoff;
return this;
@@ -100,10 +87,6 @@ public class NettyShuffleEnvironmentBuilder {
return this;
}
- public void setRequestSegmentsTimeout(Duration requestSegmentsTimeout) {
- this.requestSegmentsTimeout = requestSegmentsTimeout;
- }
-
public NettyShuffleEnvironmentBuilder setIsCreditBased(boolean isCreditBased) {
this.isCreditBased = isCreditBased;
return this;
@@ -114,39 +97,29 @@ public class NettyShuffleEnvironmentBuilder {
return this;
}
- public NettyShuffleEnvironmentBuilder setTaskEventDispatcher(TaskEventDispatcher taskEventDispatcher) {
- this.taskEventDispatcher = taskEventDispatcher;
- return this;
- }
-
public NettyShuffleEnvironmentBuilder setMetricGroup(MetricGroup metricGroup) {
this.metricGroup = metricGroup;
return this;
}
- public NettyShuffleEnvironmentBuilder setTempDirs(String[] tempDirs) {
- this.tempDirs = tempDirs;
- return this;
- }
-
public NettyShuffleEnvironment build() {
return NettyShuffleServiceFactory.createNettyShuffleEnvironment(
new NettyShuffleEnvironmentConfiguration(
numNetworkBuffers,
- networkBufferSize,
+ DEFAULT_NETWORK_BUFFER_SIZE,
partitionRequestInitialBackoff,
partitionRequestMaxBackoff,
networkBuffersPerChannel,
floatingNetworkBuffersPerGate,
- requestSegmentsTimeout,
+ DEFAULT_REQUEST_SEGMENTS_TIMEOUT,
isCreditBased,
- isNetworkDetailedMetrics,
+ false,
nettyConfig,
- tempDirs,
+ DEFAULT_TEMP_DIRS,
BoundedBlockingSubpartitionType.AUTO,
false),
taskManagerLocation,
- taskEventDispatcher,
+ new TaskEventDispatcher(),
metricGroup);
}
}