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

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

                Author: ASF GitHub Bot
            Created on: 31/Aug/22 21:16
            Start Date: 31/Aug/22 21:16
    Worklog Time Spent: 10m 
      Work Description: ZihanLi58 commented on code in PR #3545:
URL: https://github.com/apache/gobblin/pull/3545#discussion_r960033115


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/MysqlUserQuotaManager.java:
##########
@@ -0,0 +1,259 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.service.modules.orchestration;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Collection;
+
+import org.apache.commons.dbcp.BasicDataSource;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.inject.Inject;
+import com.typesafe.config.Config;
+
+import javax.inject.Singleton;
+import javax.sql.DataSource;
+import lombok.extern.slf4j.Slf4j;
+
+import org.apache.gobblin.configuration.ConfigurationKeys;
+import org.apache.gobblin.metastore.MysqlStateStore;
+import org.apache.gobblin.service.modules.flowgraph.Dag;
+import org.apache.gobblin.service.modules.spec.JobExecutionPlan;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+/**
+ * An implementation of {@link UserQuotaManager} that stores quota usage in 
mysql.
+ */
+@Slf4j
+@Singleton
+public class MysqlUserQuotaManager extends AbstractUserQuotaManager {
+  private final MysqlQuotaStore mysqlStore;
+
+  @Inject
+  public MysqlUserQuotaManager(Config config) throws IOException {
+    super(config);
+    this.mysqlStore = createQuotaStore(config);
+  }
+
+  // This implementation does not need to update quota usage when the service 
restarts or it's leadership status changes
+  public void init(Collection<Dag<JobExecutionPlan>> dags) {

Review Comment:
   Confused here: we only have one dag state store for all hosts, when dag 
manager A goes done, dag manager B should be able to pick up the work left by 
dag manager A from dag state store. 





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

    Worklog Id:     (was: 805369)
    Time Spent: 2h 40m  (was: 2.5h)

> add a mysql based user quota manager
> ------------------------------------
>
>                 Key: GOBBLIN-1691
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1691
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> mysql based user quota manager can share the usage data with other instances 
> of Gobblin Service



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to