Skip to content

Commit

Permalink
FlintStreamingJobCleanerTask Implementation (#2574)
Browse files Browse the repository at this point in the history
Signed-off-by: Vamsi Manohar <[email protected]>
(cherry picked from commit 284a0be)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Mar 20, 2024
1 parent c205b6d commit 40ad03f
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,18 @@ public void beforeStop() {
}
});
}
initializeStreamingJobHouseKeeperCron();

if (flintStreamingJobHouseKeeperCron == null) {
initializeStreamingJobHouseKeeperCron();
clusterService.addLifecycleListener(
new LifecycleListener() {

Check warning on line 140 in spark/src/main/java/org/opensearch/sql/spark/cluster/ClusterManagerEventListener.java

View check run for this annotation

Codecov / codecov/patch

spark/src/main/java/org/opensearch/sql/spark/cluster/ClusterManagerEventListener.java#L138-L140

Added lines #L138 - L140 were not covered by tests
@Override
public void beforeStop() {
cancel(flintStreamingJobHouseKeeperCron);
flintStreamingJobHouseKeeperCron = null;
}

Check warning on line 145 in spark/src/main/java/org/opensearch/sql/spark/cluster/ClusterManagerEventListener.java

View check run for this annotation

Codecov / codecov/patch

spark/src/main/java/org/opensearch/sql/spark/cluster/ClusterManagerEventListener.java#L143-L145

Added lines #L143 - L145 were not covered by tests
});
}
}

private void initializeStreamingJobHouseKeeperCron() {
Expand Down

0 comments on commit 40ad03f

Please sign in to comment.