wonook commented on a change in pull request #279: [NEMO-420] OffHeapMemory 
configuration only supports a single type of executor
URL: https://github.com/apache/incubator-nemo/pull/279#discussion_r366946672
 
 

 ##########
 File path: 
runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ContainerManager.java
 ##########
 @@ -149,18 +149,39 @@ public void onContainerAllocated(final String executorId,
     }
 
     final ResourceSpecification resourceSpecification = 
selectResourceSpecForContainer();
+    final List<Configuration> configurationsToMerge = new ArrayList<>();
+
     evaluatorIdToResourceSpec.put(allocatedContainer.getId(), 
resourceSpecification);
 
     LOG.info("Container type (" + resourceSpecification.getContainerType()
       + ") allocated, will be used for [" + executorId + "]");
     pendingContextIdToResourceSpec.put(executorId, resourceSpecification);
 
+    configurationsToMerge.add(executorConfiguration);
+
+    // ExecutorMemory handling
+    configurationsToMerge.add(Tang.Factory.getTang().newConfigurationBuilder()
+        .bindNamedParameter(JobConf.ExecutorMemoryMb.class, 
String.valueOf(resourceSpecification.getMemory()))
+        .build()
+    );
+
+    // MaxOffheapRatio handling
+    resourceSpecification.getMaxOffheapRatio().ifPresent(value -> {
+      
configurationsToMerge.add(Tang.Factory.getTang().newConfigurationBuilder()
+        .bindNamedParameter(JobConf.MaxOffheapRatio.class, 
String.valueOf(resourceSpecification.getMaxOffheapRatio()))
 
 Review comment:
   I think `resourceSpecification.getMaxOffheapRatio()` should become `value`, 
as that is the actual value of the parameter.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to