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

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

                Author: ASF GitHub Bot
            Created on: 31/Oct/23 19:18
            Start Date: 31/Oct/23 19:18
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3812:
URL: https://github.com/apache/gobblin/pull/3812#discussion_r1378063750


##########
gobblin-runtime/src/main/java/org/apache/gobblin/util/DBStatementExecutor.java:
##########
@@ -22,24 +22,28 @@
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
+import java.util.ArrayList;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import javax.sql.DataSource;
 import org.slf4j.Logger;
 
 
 /**
- * MySQL based implementations of stores require common functionality that can 
be stored in a utility class. The
- * functionality includes executing prepared statements on a data source 
object and executing SQL queries at fixed
- * intervals. The instantiater of the class should provide the data source 
used within this utility.
+ * Many database stores require common functionality that can be stored in a 
utility class. The functionality
+ * includes executing prepared statements on a data source object and SQL 
queries at fixed intervals.
+ * The caller of the class MUST maintain ownership of the {@link DataSource} 
and close this instance when the
+ * {@link DataSource} is about to be closed well. Both are to be done only 
once this instance will no longer be used.
  */
-public class MySQLStoreUtils {
+public class DBStatementExecutor {

Review Comment:
   might be nice to implement `Closeable` or `AutoCloseable`... what do you 
think?





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

    Worklog Id:     (was: 888134)
    Time Spent: 3h  (was: 2h 50m)

> Create MySQL util class for re-usable methods & enable MysqlDagActionStore 
> retention
> ------------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1942
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1942
>             Project: Apache Gobblin
>          Issue Type: Bug
>          Components: gobblin-service
>            Reporter: Urmi Mustafi
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> Defines a new class {{MySQLStoreUtils}} used for common functionality between 
> MySQL based implementations of stores. It includes a new method to run a SQL 
> command in a {{ScheduledThreadPoolExecutor}} using {{interval T}} which is 
> used for retention on the {{MysqlDagActionStore}} and 
> {{{}MysqlMultiActiveLeaseArbiter{}}}.  



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

Reply via email to