[ 
https://issues.apache.org/jira/browse/FLINK-9028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16406276#comment-16406276
 ] 

ASF GitHub Bot commented on FLINK-9028:
---------------------------------------

Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5726#discussion_r175753301
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/ContaineredTaskManagerParameters.java
 ---
    @@ -112,35 +113,11 @@ public String toString() {
        public static ContaineredTaskManagerParameters create(
                Configuration config, long containerMemoryMB, int numSlots)
        {
    -           // (1) compute how much memory we subtract from the total 
memory, to get the Java memory
    -
    -           final float memoryCutoffRatio = config.getFloat(
    -                   ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO);
    -
    -           final int minCutoff = config.getInteger(
    -                   ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN);
    -
    -           if (memoryCutoffRatio >= 1 || memoryCutoffRatio <= 0) {
    -                   throw new IllegalArgumentException("The configuration 
value '"
    -                           + 
ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO.key() + "' must be 
between 0 and 1. Value given="
    -                           + memoryCutoffRatio);
    -           }
    -
    -           if (minCutoff >= containerMemoryMB) {
    -                   throw new IllegalArgumentException("The configuration 
value '"
    -                           + 
ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN.key() + "'='" + minCutoff
    -                           + "' is larger than the total container memory 
" + containerMemoryMB);
    -           }
    -
    -           long cutoff = (long) (containerMemoryMB * memoryCutoffRatio);
    -           if (cutoff < minCutoff) {
    -                   cutoff = minCutoff;
    -           }
    -
    -           final long javaMemorySizeMB = containerMemoryMB - cutoff;
    +           // (1) try to compute how much memory used by container
    +           final long cutoffMB = 
ResourceManagerRuntimeServices.calculateCutoffMB(config, containerMemoryMB);
    --- End diff --
    
    I would keep this method in the `ContaineredTaskManagerParameters` class.


> flip6 should check config before starting cluster
> -------------------------------------------------
>
>                 Key: FLINK-9028
>                 URL: https://issues.apache.org/jira/browse/FLINK-9028
>             Project: Flink
>          Issue Type: Bug
>          Components: Distributed Coordination
>    Affects Versions: 1.5.0
>            Reporter: Sihua Zhou
>            Assignee: Sihua Zhou
>            Priority: Major
>             Fix For: 1.5.0
>
>
> In flip6, we should perform parameters checking before starting cluster.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to