Skip to content

Commit a5e8bb4

Browse files
zhijiangWzentol
authored andcommitted
[hotfix][network] Remove unused IOMode from NetworkEnvironmentConfiguration
1 parent 600be00 commit a5e8bb4

File tree

5 files changed

+4
-70
lines changed

5 files changed

+4
-70
lines changed

flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ public final class ConfigConstants {
284284
public static final String TASK_MANAGER_MEMORY_SEGMENT_SIZE_KEY = "taskmanager.memory.segment-size";
285285

286286
/**
287-
* The implementation to use for spillable/spilled intermediate results, which have both
288-
* synchronous and asynchronous implementations: "sync" or "async".
287+
* @deprecated Not used anymore
289288
*/
289+
@Deprecated
290290
public static final String TASK_MANAGER_NETWORK_DEFAULT_IO_MODE = "taskmanager.network.defaultIOMode";
291291

292292
/**
@@ -1435,9 +1435,9 @@ public final class ConfigConstants {
14351435
public static final int DEFAULT_TASK_MANAGER_MEMORY_SEGMENT_SIZE = 32768;
14361436

14371437
/**
1438-
* The implementation to use for spillable/spilled intermediate results, which have both
1439-
* synchronous and asynchronous implementations: "sync" or "async".
1438+
* @deprecated Not used anymore
14401439
*/
1440+
@Deprecated
14411441
public static final String DEFAULT_TASK_MANAGER_NETWORK_DEFAULT_IO_MODE = "sync";
14421442

14431443
/**

flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManager.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,6 @@
3636
* The facade for the provided I/O manager services.
3737
*/
3838
public abstract class IOManager {
39-
40-
public enum IOMode {
41-
42-
SYNC(true), ASYNC(false);
43-
44-
private final boolean isSynchronous;
45-
46-
IOMode(boolean isSynchronous) {
47-
this.isSynchronous = isSynchronous;
48-
}
49-
50-
public boolean isSynchronous() {
51-
return isSynchronous;
52-
}
53-
}
54-
5539
/** Logging */
5640
protected static final Logger LOG = LoggerFactory.getLogger(IOManager.class);
5741

flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServicesConfiguration.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.flink.api.common.time.Time;
2222
import org.apache.flink.configuration.CheckpointingOptions;
23-
import org.apache.flink.configuration.ConfigConstants;
2423
import org.apache.flink.configuration.Configuration;
2524
import org.apache.flink.configuration.ConfigurationUtils;
2625
import org.apache.flink.configuration.IllegalConfigurationException;
@@ -29,7 +28,6 @@
2928
import org.apache.flink.configuration.TaskManagerOptions;
3029
import org.apache.flink.core.memory.MemoryType;
3130
import org.apache.flink.runtime.akka.AkkaUtils;
32-
import org.apache.flink.runtime.io.disk.iomanager.IOManager;
3331
import org.apache.flink.runtime.io.network.netty.NettyConfig;
3432
import org.apache.flink.runtime.memory.MemoryManager;
3533
import org.apache.flink.runtime.registration.RetryingRegistrationConfiguration;
@@ -379,18 +377,6 @@ private static NetworkEnvironmentConfiguration parseNetworkEnvironmentConfigurat
379377
nettyConfig = null;
380378
}
381379

382-
// Default spill I/O mode for intermediate results
383-
final String syncOrAsync = configuration.getString(
384-
ConfigConstants.TASK_MANAGER_NETWORK_DEFAULT_IO_MODE,
385-
ConfigConstants.DEFAULT_TASK_MANAGER_NETWORK_DEFAULT_IO_MODE);
386-
387-
final IOManager.IOMode ioMode;
388-
if (syncOrAsync.equals("async")) {
389-
ioMode = IOManager.IOMode.ASYNC;
390-
} else {
391-
ioMode = IOManager.IOMode.SYNC;
392-
}
393-
394380
int initialRequestBackoff = configuration.getInteger(
395381
TaskManagerOptions.NETWORK_REQUEST_BACKOFF_INITIAL);
396382
int maxRequestBackoff = configuration.getInteger(
@@ -406,7 +392,6 @@ private static NetworkEnvironmentConfiguration parseNetworkEnvironmentConfigurat
406392
networkBufMin,
407393
networkBufMax,
408394
pageSize,
409-
ioMode,
410395
initialRequestBackoff,
411396
maxRequestBackoff,
412397
buffersPerChannel,

flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package org.apache.flink.runtime.taskmanager;
2020

21-
import org.apache.flink.runtime.io.disk.iomanager.IOManager.IOMode;
2221
import org.apache.flink.runtime.io.network.netty.NettyConfig;
2322

2423
import javax.annotation.Nullable;
@@ -36,8 +35,6 @@ public class NetworkEnvironmentConfiguration {
3635

3736
private final int networkBufferSize;
3837

39-
private final IOMode ioMode;
40-
4138
private final int partitionRequestInitialBackoff;
4239

4340
private final int partitionRequestMaxBackoff;
@@ -48,34 +45,11 @@ public class NetworkEnvironmentConfiguration {
4845

4946
private final NettyConfig nettyConfig;
5047

51-
/**
52-
* Constructor for a setup with purely local communication (no netty).
53-
*/
5448
public NetworkEnvironmentConfiguration(
5549
float networkBufFraction,
5650
long networkBufMin,
5751
long networkBufMax,
5852
int networkBufferSize,
59-
IOMode ioMode,
60-
int partitionRequestInitialBackoff,
61-
int partitionRequestMaxBackoff,
62-
int networkBuffersPerChannel,
63-
int floatingNetworkBuffersPerGate) {
64-
65-
this(networkBufFraction, networkBufMin, networkBufMax, networkBufferSize,
66-
ioMode,
67-
partitionRequestInitialBackoff, partitionRequestMaxBackoff,
68-
networkBuffersPerChannel, floatingNetworkBuffersPerGate,
69-
null);
70-
71-
}
72-
73-
public NetworkEnvironmentConfiguration(
74-
float networkBufFraction,
75-
long networkBufMin,
76-
long networkBufMax,
77-
int networkBufferSize,
78-
IOMode ioMode,
7953
int partitionRequestInitialBackoff,
8054
int partitionRequestMaxBackoff,
8155
int networkBuffersPerChannel,
@@ -86,7 +60,6 @@ public NetworkEnvironmentConfiguration(
8660
this.networkBufMin = networkBufMin;
8761
this.networkBufMax = networkBufMax;
8862
this.networkBufferSize = networkBufferSize;
89-
this.ioMode = ioMode;
9063
this.partitionRequestInitialBackoff = partitionRequestInitialBackoff;
9164
this.partitionRequestMaxBackoff = partitionRequestMaxBackoff;
9265
this.networkBuffersPerChannel = networkBuffersPerChannel;
@@ -112,10 +85,6 @@ public int networkBufferSize() {
11285
return networkBufferSize;
11386
}
11487

115-
public IOMode ioMode() {
116-
return ioMode;
117-
}
118-
11988
public int partitionRequestInitialBackoff() {
12089
return partitionRequestInitialBackoff;
12190
}
@@ -142,7 +111,6 @@ public NettyConfig nettyConfig() {
142111
public int hashCode() {
143112
int result = 1;
144113
result = 31 * result + networkBufferSize;
145-
result = 31 * result + ioMode.hashCode();
146114
result = 31 * result + partitionRequestInitialBackoff;
147115
result = 31 * result + partitionRequestMaxBackoff;
148116
result = 31 * result + networkBuffersPerChannel;
@@ -170,7 +138,6 @@ else if (obj == null || getClass() != obj.getClass()) {
170138
this.partitionRequestMaxBackoff == that.partitionRequestMaxBackoff &&
171139
this.networkBuffersPerChannel == that.networkBuffersPerChannel &&
172140
this.floatingNetworkBuffersPerGate == that.floatingNetworkBuffersPerGate &&
173-
this.ioMode == that.ioMode &&
174141
(nettyConfig != null ? nettyConfig.equals(that.nettyConfig) : that.nettyConfig == null);
175142
}
176143
}
@@ -182,7 +149,6 @@ public String toString() {
182149
", networkBufMin=" + networkBufMin +
183150
", networkBufMax=" + networkBufMax +
184151
", networkBufferSize=" + networkBufferSize +
185-
", ioMode=" + ioMode +
186152
", partitionRequestInitialBackoff=" + partitionRequestInitialBackoff +
187153
", partitionRequestMaxBackoff=" + partitionRequestMaxBackoff +
188154
", networkBuffersPerChannel=" + networkBuffersPerChannel +

flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/NetworkBufferCalculationTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ private static TaskManagerServicesConfiguration getTmConfig(
9191
networkBufMin,
9292
networkBufMax,
9393
checkedDownCast(MemorySize.parse(TaskManagerOptions.MEMORY_SEGMENT_SIZE.defaultValue()).getBytes()),
94-
null,
9594
TaskManagerOptions.NETWORK_REQUEST_BACKOFF_INITIAL.defaultValue(),
9695
TaskManagerOptions.NETWORK_REQUEST_BACKOFF_MAX.defaultValue(),
9796
TaskManagerOptions.NETWORK_BUFFERS_PER_CHANNEL.defaultValue(),

0 commit comments

Comments
 (0)