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

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

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

    https://github.com/apache/flink/pull/5448#discussion_r197736638
  
    --- Diff: 
flink-clients/src/main/java/org/apache/flink/client/deployment/ClusterSpecification.java
 ---
    @@ -67,8 +68,8 @@ public String toString() {
        public static ClusterSpecification fromConfiguration(Configuration 
configuration) {
                int slots = 
configuration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS, 1);
     
    -           int jobManagerMemoryMb = 
configuration.getInteger(JobManagerOptions.JOB_MANAGER_HEAP_MEMORY);
    -           int taskManagerMemoryMb = 
configuration.getInteger(TaskManagerOptions.TASK_MANAGER_HEAP_MEMORY);
    +           int jobManagerMemoryMb = (int) 
MemorySize.parse(configuration.getString(JobManagerOptions.JOB_MANAGER_HEAP_MEMORY)).getMebiBytes();
    --- End diff --
    
    hi @dawidwys this belongs suggestion 2, "change the return value of 
getMebiBytes() to int or have a getMebiBytesAsInt() method that uses a 
MathUtils.checkedDownCast() to avoid unnoticed overflow errors, as Stephan 
commented"
    
    "have a getMebiBytesAsInt()" is another choice, if I picked the first 
choice and change the `(int) to  MathUtils.checkedDownCast()` . Is there 
necessary to provide the `getMebiBytesAsInt()` method?


> Configure Memory Sizes with units
> ---------------------------------
>
>                 Key: FLINK-6469
>                 URL: https://issues.apache.org/jira/browse/FLINK-6469
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Stephan Ewen
>            Assignee: vinoyang
>            Priority: Major
>              Labels: pull-request-available
>
> Currently, memory sizes are configured by pure numbers, the interpretation is 
> different from configuration parameter to parameter.
> For example, heap sizes are configured in megabytes, network buffer memory is 
> configured in bytes, alignment thresholds are configured in bytes.
> I propose to configure all memory parameters the same way, with units similar 
> to time. The JVM itself configured heap size similarly: {{Xmx5g}} or 
> {{Xmx2000m}}.
> {code}
> 10000  -> bytes
> 10 kb
> 64 mb
> 1 gb
> ...
> {code}



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

Reply via email to