flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm <...@git.apache.org>
Subject [GitHub] flink pull request #2669: [FLINK-4871] [mini cluster] Add memory calculation...
Date Fri, 21 Oct 2016 16:16:10 GMT
Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2669#discussion_r84509754
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniClusterConfiguration.java
---
    @@ -96,11 +101,20 @@ public void setCommonRpcBindAddress(String bindAddress) {
     		this.commonBindAddress = bindAddress;
     	}
     
    +	public void setManagedMemoryPerTaskManager(long managedMemoryPerTaskManager) {
    +		checkArgument(managedMemoryPerTaskManager > 0, "must have more than 0 MB of memory
for the TaskManager.");
    +		this.managedMemoryPerTaskManager = managedMemoryPerTaskManager;
    +	}
    +
     	// ------------------------------------------------------------------------
     	//  getters
     	// ------------------------------------------------------------------------
     
     	public Configuration getConfiguration() {
    +		// update the memory in case that we've changed the number of components (TM, RM, JM)
    +		long memory = calculateManagedMemoryPerTaskManager();
    --- End diff --
    
    Getters should usually not perform any calculation. How about changing the method name
to `updateConfiguration()`? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message