From 3c9d0b4deafa967a261842d52317a19b43613cd6 Mon Sep 17 00:00:00 2001 From: gautier Date: Mon, 21 Jun 2021 17:10:09 +0200 Subject: [PATCH] [HOPS-1638] fix quota daily cost --- .../hops/yarn/server/resourcemanager/quota/QuotaService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/io/hops/yarn/server/resourcemanager/quota/QuotaService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/io/hops/yarn/server/resourcemanager/quota/QuotaService.java index 5f717d6782..a31d9416a3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/io/hops/yarn/server/resourcemanager/quota/QuotaService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/io/hops/yarn/server/resourcemanager/quota/QuotaService.java @@ -313,7 +313,7 @@ private void computeAndApplyChargeInt(ContainerId containerId, Map float charge = computeCharge(resourcesMap, usedMillis); chargeProjectQuota(projectQuota, projectName, user, containerId, charge); //** ProjectDailyCost charging** - chargeProjectDailyCost(projectDailyCost, projectName, user, curentDay, charge, appId); + projectDailyCost = chargeProjectDailyCost(projectDailyCost, projectName, user, curentDay, charge, appId); if (projectQuota != null) { pqDA.add(projectQuota); } @@ -352,7 +352,7 @@ private void chargeProjectQuota(ProjectQuota projectQuota, String projectName, S } } - private void chargeProjectDailyCost(ProjectDailyCost projectDailyCost, String projectName, String user, long day, + private ProjectDailyCost chargeProjectDailyCost(ProjectDailyCost projectDailyCost, String projectName, String user, long day, float charge, ApplicationId appId) { LOG.debug("Quota: project " + projectName + " user " + user + " has used " + charge + " credits, on day: " + day); @@ -362,6 +362,7 @@ private void chargeProjectDailyCost(ProjectDailyCost projectDailyCost, String pr } projectDailyCost.incrementCharge(charge, appId.toString()); + return projectDailyCost; } /**