File tree Expand file tree Collapse file tree
api/src/main/java/marquez/jobs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626public class DbRetentionJob extends AbstractScheduledService implements Managed {
2727 private static final Duration NO_DELAY = Duration .ofMinutes (0 );
2828
29+ /* The retention policy frequency. */
30+ private final int frequencyMins ;
31+
2932 /* The number of rows deleted per batch. */
3033 private final int numberOfRowsPerBatch ;
3134
@@ -42,10 +45,11 @@ public class DbRetentionJob extends AbstractScheduledService implements Managed
4245 */
4346 public DbRetentionJob (
4447 @ NonNull final Jdbi jdbi , @ NonNull final DbRetentionConfig dbRetentionConfig ) {
48+ this .frequencyMins = dbRetentionConfig .getFrequencyMins ();
4549 this .numberOfRowsPerBatch = dbRetentionConfig .getNumberOfRowsPerBatch ();
4650 this .retentionDays = dbRetentionConfig .getRetentionDays ();
4751
48- // Open connection .
52+ // Connection to database retention policy will be applied .
4953 this .jdbi = jdbi ;
5054
5155 // Define fixed schedule with no delay.
@@ -61,8 +65,12 @@ protected Scheduler scheduler() {
6165
6266 @ Override
6367 public void start () throws Exception {
64- log .info ("Starting db retention job..." );
6568 startAsync ().awaitRunning ();
69+ log .info (
70+ "Started db retention job with retention policy of '{}' days, "
71+ + "scheduled to be applied every '{}' mins." ,
72+ retentionDays ,
73+ frequencyMins );
6674 }
6775
6876 @ Override
You can’t perform that action at this time.
0 commit comments