Class SqLiteStorageProvider
java.lang.Object
org.jobrunr.storage.AbstractStorageProvider
org.jobrunr.storage.sql.common.DefaultSqlStorageProvider
org.jobrunr.storage.sql.sqlite.SqLiteStorageProvider
- All Implemented Interfaces:
AutoCloseable, SqlStorageProvider, StorageProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface StorageProvider
StorageProvider.StorageProviderInfo -
Field Summary
Fields inherited from class DefaultSqlStorageProvider
dataSource, dialect, tablePrefixModifier and TypeFieldDescriptionprotected final DataSourceprotected final Dialectprotected final StringFields inherited from interface StorageProvider
BATCH_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionSqLiteStorageProvider(DataSource dataSource) SqLiteStorageProvider(DataSource dataSource, String tablePrefix) SqLiteStorageProvider(DataSource dataSource, String tablePrefix, StorageProviderUtils.DatabaseOptions databaseOptions) SqLiteStorageProvider(DataSource dataSource, String tablePrefix, StorageProviderUtils.DatabaseOptions databaseOptions, RateLimiter changeListenerNotificationRateLimit) SqLiteStorageProvider(DataSource dataSource, StorageProviderUtils.DatabaseOptions databaseOptions) -
Method Summary
Methods inherited from class DefaultSqlStorageProvider
announceBackgroundJobServer, backgroundJobServerTable, countJobs, deleteJobsPermanently, deleteMetadata, deleteMetadata, deletePermanently, deleteRecurringJob, getBackgroundJobServers, getCarbonAwareJobList, getDatabaseCreator, getDistinctJobSignatures, getJobById, getJobList, getJobList, getJobStats, getJobsToProcess, getLongestRunningBackgroundJobServerId, getMetadata, getMetadata, getRecurringJobLatestScheduledInstant, getRecurringJobs, getScheduledJobs, jobStatsView, jobTable, metadataTable, publishTotalAmountOfSucceededJobs, recurringJobsUpdated, recurringJobTable, removeTimedOutBackgroundJobServers, save, save, saveMetadata, saveRecurringJob, setJobMapper, setUpStorageProvider, signalBackgroundJobServerAlive, signalBackgroundJobServerStoppedModifier and TypeMethodDescriptionvoidannounceBackgroundJobServer(BackgroundJobServerStatus serverStatus) protected BackgroundJobServerTablebackgroundJobServerTable(Connection connection) longCounts all the jobs matching the givenStateName.intdeleteJobsPermanently(StateName state, Instant updatedBefore) voiddeleteMetadata(String name) voiddeleteMetadata(String name, String owner) intDeletes theJobwith the given id and returns the amount of deleted jobs (either 0 or 1).intDeletes theRecurringJobwith the given id.getCarbonAwareJobList(Instant deadlineBefore, AmountRequest amountRequest) Returns all carbon aware jobs with a deadline before the givenInstant.protected DatabaseCreatorgetDistinctJobSignatures(StateName... states) getJobById(UUID id) Returns theJobwith the given id or throws aJobNotFoundExceptionif the job does not existgetJobList(StateName state, Instant updatedBefore, AmountRequest amountRequest) getJobList(StateName state, AmountRequest amountRequest) Returns all the jobs matching the givenStateNameandAmountRequest.Returns the statistics of the jobs (amount enqueued, amount scheduled, ...) Important: in most cases, this results in a intensive query.getJobsToProcess(BackgroundJobServer backgroundJobServer, AmountRequest amountRequest) getMetadata(String name) getMetadata(String name, String owner) getRecurringJobLatestScheduledInstant(String recurringJobId, StateName... states) Returns the scheduled instant of the lastJob, in one of the given states, created by theRecurringJobwith the given recurringJobId.Returns a listRecurringJobs.getScheduledJobs(Instant scheduledBefore, AmountRequest amountRequest) protected JobStatsViewjobStatsView(Connection connection) protected JobTablejobTable(Connection connection) protected MetadataTablemetadataTable(Connection connection) voidpublishTotalAmountOfSucceededJobs(int amount) booleanrecurringJobsUpdated(Long recurringJobsUpdatedHash) protected RecurringJobTablerecurringJobTable(Connection connection) intremoveTimedOutBackgroundJobServers(Instant heartbeatOlderThan) Save theJoband increases the version if saving succeeded.voidsaveMetadata(JobRunrMetadata metadata) saveRecurringJob(RecurringJob recurringJob) Saves aRecurringJobto the database.voidsetJobMapper(JobMapper jobMapper) voidsetUpStorageProvider(StorageProviderUtils.DatabaseOptions databaseOptions) This method allows to reinitialize the StorageProvider.booleansignalBackgroundJobServerAlive(BackgroundJobServerStatus serverStatus) voidsignalBackgroundJobServerStopped(BackgroundJobServerStatus serverStatus) Methods inherited from class AbstractStorageProvider
addJobStorageOnChangeListener, close, getStorageProviderInfo, notifyJobStatsOnChangeListeners, notifyJobStatsOnChangeListenersIf, notifyMetadataChangeListeners, notifyMetadataChangeListenersIf, notifyMetadataChangeListenersOnCurrentThread, removeJobStorageOnChangeListener, validatePollInterval, validateRecurringJobIntervalModifier and TypeMethodDescriptionvoidAllows to listen for changes related tojobs.voidclose()protected voidprotected voidnotifyJobStatsOnChangeListenersIf(boolean mustNotify) protected voidprotected voidnotifyMetadataChangeListenersIf(boolean mustNotify) protected voidvoidRemove the given listener that listens for changes toJobsfinal voidvalidatePollInterval(Duration pollInterval) final voidvalidateRecurringJobInterval(Duration durationBetweenRecurringJobInstances) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StorageProvider
getJobById, getJobs, getScheduledJobsModifier and TypeMethodDescriptiondefault JobgetJobById(JobId jobId) Returns theJobwith the given id or throws aJobNotFoundExceptionif the job does not existgetJobs(StateName state, PageRequest pageRequest) getScheduledJobs(Instant scheduledBefore, PageRequest pageRequest)
-
Constructor Details
-
SqLiteStorageProvider
-
SqLiteStorageProvider
-
SqLiteStorageProvider
public SqLiteStorageProvider(DataSource dataSource, StorageProviderUtils.DatabaseOptions databaseOptions) -
SqLiteStorageProvider
public SqLiteStorageProvider(DataSource dataSource, String tablePrefix, StorageProviderUtils.DatabaseOptions databaseOptions) -
SqLiteStorageProvider
public SqLiteStorageProvider(DataSource dataSource, String tablePrefix, StorageProviderUtils.DatabaseOptions databaseOptions, RateLimiter changeListenerNotificationRateLimit)
-