Class DatabaseCleanupTask
- java.lang.Object
-
- com.netflix.genie.web.tasks.GenieTask
-
- com.netflix.genie.web.tasks.leader.LeaderTask
-
- com.netflix.genie.web.tasks.leader.DatabaseCleanupTask
-
- All Implemented Interfaces:
java.lang.Runnable
public class DatabaseCleanupTask extends LeaderTask
ALeaderTask
which will clean up the database of old records if desired.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description DatabaseCleanupTask(@NotNull DatabaseCleanupProperties cleanupProperties, @NotNull org.springframework.core.env.Environment environment, @NotNull DataServices dataServices, @NotNull io.micrometer.core.instrument.MeterRegistry registry)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
Any cleanup that needs to be performed when this task is stopped due to leadership being revoked.GenieTaskScheduleType
getScheduleType()
Get the type of scheduling mechanism which should be used to schedule this task.org.springframework.scheduling.Trigger
getTrigger()
Get the Trigger which this task should be scheduled with.void
run()
Clean out database based on date.-
Methods inherited from class com.netflix.genie.web.tasks.GenieTask
getFixedDelay, getFixedRate
-
-
-
-
Constructor Detail
-
DatabaseCleanupTask
public DatabaseCleanupTask(@NotNull @NotNull DatabaseCleanupProperties cleanupProperties, @NotNull @NotNull org.springframework.core.env.Environment environment, @NotNull @NotNull DataServices dataServices, @NotNull @NotNull io.micrometer.core.instrument.MeterRegistry registry)
Constructor.- Parameters:
cleanupProperties
- The properties to use to configure this taskenvironment
- The application environment to pull properties fromdataServices
- TheDataServices
encapsulation instance to useregistry
- The metrics registry
-
-
Method Detail
-
getScheduleType
public GenieTaskScheduleType getScheduleType()
Get the type of scheduling mechanism which should be used to schedule this task.- Specified by:
getScheduleType
in classGenieTask
- Returns:
- The schedule type
-
getTrigger
public org.springframework.scheduling.Trigger getTrigger()
Get the Trigger which this task should be scheduled with.- Overrides:
getTrigger
in classGenieTask
- Returns:
- The trigger
-
run
public void run()
Clean out database based on date.
-
cleanup
public void cleanup()
Any cleanup that needs to be performed when this task is stopped due to leadership being revoked.- Overrides:
cleanup
in classLeaderTask
-
-