[
https://issues.apache.org/jira/browse/GOBBLIN-1457?focusedWorklogId=636645&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-636645
]
ASF GitHub Bot logged work on GOBBLIN-1457:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 10/Aug/21 21:35
Start Date: 10/Aug/21 21:35
Worklog Time Spent: 10m
Work Description: jack-moseley commented on a change in pull request
#3327:
URL: https://github.com/apache/gobblin/pull/3327#discussion_r686338290
##########
File path:
gobblin-service/src/main/java/org/apache/gobblin/service/modules/db/ServiceDatabaseProviderImpl.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.db;
+
+import java.time.Duration;
+import java.util.Objects;
+
+import org.apache.commons.dbcp2.BasicDataSource;
+
+import com.typesafe.config.Config;
+
+import javax.inject.Inject;
+import javax.sql.DataSource;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import org.apache.gobblin.password.PasswordManager;
+import org.apache.gobblin.service.ServiceConfigKeys;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+public class ServiceDatabaseProviderImpl implements ServiceDatabaseProvider {
+
+ private final Configuration configuration;
+ private BasicDataSource dataSource;
+
+ @Inject
+ public ServiceDatabaseProviderImpl(Configuration configuration) {
+ this.configuration = configuration;
+ }
+
+ public DataSource getDatasource() {
+ ensureDataSource();
+ return dataSource;
+ }
+
+ private synchronized void ensureDataSource() {
Review comment:
Just noting, for other GaaS tables we separate them by using a config
prefix like `gobblin.service.mysqlDagStateStore.state.store.db.table`. And we
do also use `state.store.db.` prefixed configs even for the `MySqlSpecStore`,
which is not an implementation of a state store. But yeah that's not really the
best pattern, so I think it's fine to have this one separate. If anything maybe
we should change the spec store to use this datasource instead at some point.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 636645)
Time Spent: 4.5h (was: 4h 20m)
> Automatic troubleshooter
> ------------------------
>
> Key: GOBBLIN-1457
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1457
> Project: Apache Gobblin
> Issue Type: Improvement
> Components: gobblin-core
> Reporter: Alexander Prokofiev
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 4.5h
> Remaining Estimate: 0h
>
> Automatic troubleshooter will collect issues from job logs and health checks.
> Then it will show users the root cause of the problems with action items on
> how to resolve them.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)