nwangtw commented on a change in pull request #3187: Consolidate Packing
URL: https://github.com/apache/incubator-heron/pull/3187#discussion_r255194967
##########
File path:
heron/packing/src/java/org/apache/heron/packing/utils/PackingUtils.java
##########
@@ -104,6 +72,17 @@ public static double increaseBy(double value, int
paddingPercentage) {
return value + (paddingPercentage * value) / 100;
}
+ public static Resource finalizePadding(
+ Resource containerResource, Resource padding, int paddingPercentage) {
+ double cpuPadding = Math.max(padding.getCpu(),
+ containerResource.getCpu() * paddingPercentage / 100);
+ ByteAmount ramPadding =
ByteAmount.fromBytes(Math.max(padding.getRam().asBytes(),
+ containerResource.getRam().asBytes() * paddingPercentage / 100));
+ ByteAmount diskPadding =
ByteAmount.fromBytes(Math.max(padding.getDisk().asBytes(),
+ containerResource.getDisk().asBytes() * paddingPercentage / 100));
+ return new Resource(cpuPadding, ramPadding, diskPadding);
Review comment:
suggest to add a blank line above the return
----------------------------------------------------------------
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