Skip to content

Commit df98c32

Browse files
[Bug- #1473 ][chunjun-clients] fix Logic error in confProp parameter processing.(#1477)
[Bug- #1473 ][chunjun-clients] fix Logic error in confProp parameter processing
1 parent 0db36b8 commit df98c32

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

chunjun-clients/src/main/java/com/dtstack/chunjun/client/yarn/YarnPerJobClusterClientHelper.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.apache.flink.client.program.ClusterClientProvider;
3030
import org.apache.flink.configuration.Configuration;
3131
import org.apache.flink.configuration.JobManagerOptions;
32+
import org.apache.flink.configuration.MemorySize;
3233
import org.apache.flink.configuration.TaskManagerOptions;
3334
import org.apache.flink.runtime.jobgraph.JobGraph;
3435
import org.apache.flink.runtime.jobgraph.SavepointRestoreSettings;
@@ -182,20 +183,21 @@ private ClusterSpecification createClusterSpecification(JobDeployer jobDeployer)
182183
jobManagerMemoryMb =
183184
Math.max(
184185
MIN_JM_MEMORY,
185-
ValueUtil.getInt(
186-
conProp.getProperty(
187-
JobManagerOptions.TOTAL_PROCESS_MEMORY.key())));
188-
jobManagerMemoryMb = jobManagerMemoryMb >> 20;
186+
MemorySize.parse(
187+
conProp.getProperty(
188+
JobManagerOptions.TOTAL_PROCESS_MEMORY
189+
.key()))
190+
.getMebiBytes());
189191
}
190192
if (conProp.containsKey(TaskManagerOptions.TOTAL_PROCESS_MEMORY.key())) {
191193
taskManagerMemoryMb =
192194
Math.max(
193195
MIN_TM_MEMORY,
194-
ValueUtil.getInt(
195-
conProp.getProperty(
196-
TaskManagerOptions.TOTAL_PROCESS_MEMORY.key())));
197-
198-
taskManagerMemoryMb = taskManagerMemoryMb >> 20;
196+
MemorySize.parse(
197+
conProp.getProperty(
198+
TaskManagerOptions.TOTAL_PROCESS_MEMORY
199+
.key()))
200+
.getMebiBytes());
199201
}
200202
if (conProp.containsKey(NUM_TASK_SLOTS.key())) {
201203
slotsPerTaskManager = ValueUtil.getInt(conProp.get(NUM_TASK_SLOTS.key()));

0 commit comments

Comments
 (0)