nwangtw commented on a change in pull request #3178: Soften padding constraint
URL: https://github.com/apache/incubator-heron/pull/3178#discussion_r251642620
##########
File path:
heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java
##########
@@ -281,12 +294,24 @@ private ByteAmount
getContainerRamPadding(List<TopologyAPI.Config.KeyValue> topo
}
// Validate instance resources specified so far don't violate
container-level constraint
- if (!containerResHint.equals(notSpecified)
- && usedRes.greaterThan(containerResHint.minus(containerResPadding)))
{
+ if (!containerResHint.equals(notSpecified) &&
usedRes.greaterThan(containerResHint)) {
throw new PackingException(String.format("Invalid packing plan
generated. "
- + "Total instance %s in a container (%s) have exceeded "
+ + "Total instance %s (%s) in container#%d have exceeded "
+ "the container-level constraint of %s.",
- resourceType, usedRes.toString(), containerResHint));
+ resourceType, usedRes.toString(), containerId,
containerResHint.toString()));
+ }
+
+ // Soft padding constraint validation: warn if padding amount cannot be
accommodated
+ boolean paddingThrottling = false;
+ if (!containerResHint.equals(notSpecified)
Review comment:
this block can be refactored and combined with the "if
(!containerResHint.equals(notSpecified) &&
usedRes.greaterThan(containerResHint))" above.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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