[ 
https://issues.apache.org/jira/browse/GOBBLIN-1073?focusedWorklogId=401698&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-401698
 ]

ASF GitHub Bot logged work on GOBBLIN-1073:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Mar/20 19:17
            Start Date: 11/Mar/20 19:17
    Worklog Time Spent: 10m 
      Work Description: sv2000 commented on pull request #2913: [GOBBLIN-1073] 
Add proxy user and requester quota to GaaS
URL: https://github.com/apache/incubator-gobblin/pull/2913#discussion_r391204406
 
 

 ##########
 File path: 
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java
 ##########
 @@ -785,6 +852,35 @@ private void submitJob(DagNode<JobExecutionPlan> dagNode) 
{
       }
     }
 
+    /**
+     * Decrement the quota by one for the proxy user and requesters 
corresponding to the provided {@link DagNode}.
+     */
+    private void releaseQuota(DagNode<JobExecutionPlan> dagNode) {
+      String proxyUser = 
ConfigUtils.getString(dagNode.getValue().getJobSpec().getConfig(), 
AzkabanProjectConfig.USER_TO_PROXY, null);
+      String specExecutorUri = 
dagNode.getValue().getSpecExecutor().getUri().toString();
+
+      if (proxyUser != null) {
+        String proxyUserKey = proxyUser + "," + specExecutorUri;
+        if (proxyUserToJobCount.containsKey(proxyUserKey) && 
proxyUserToJobCount.get(proxyUserKey) > 0) {
+          proxyUserToJobCount.put(proxyUserKey, 
proxyUserToJobCount.get(proxyUserKey) - 1);
+        }
+      }
+
+      String serializedRequesters = 
ConfigUtils.getString(dagNode.getValue().getJobSpec().getConfig(), 
RequesterService.REQUESTER_LIST, null);
+      if (serializedRequesters != null) {
+        try {
+          for (ServiceRequester requester : 
RequesterService.deserialize(serializedRequesters)) {
+            String requesterKey = requester.toString() + "," + specExecutorUri;
 
 Review comment:
   Move this to a separate method getRequesterKey()?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 401698)
    Time Spent: 1h 10m  (was: 1h)

> Add proxy user and requester quota to GaaS
> ------------------------------------------
>
>                 Key: GOBBLIN-1073
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1073
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Jack Moseley
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to