Class AmazonDocumentDBStorageProvider
java.lang.Object
org.jobrunr.storage.AbstractStorageProvider
org.jobrunr.storage.nosql.mongo.MongoDBStorageProvider
org.jobrunr.storage.nosql.documentdb.AmazonDocumentDBStorageProvider
- All Implemented Interfaces:
AutoCloseable, NoSqlStorageProvider, StorageProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface StorageProvider
StorageProvider.StorageProviderInfo -
Field Summary
Fields inherited from class MongoDBStorageProvider
DEFAULT_DB_NAMEFields inherited from interface StorageProvider
BATCH_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionAmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient) AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, String dbName) AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix) AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix, StorageProviderUtils.DatabaseOptions databaseOptions) AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix, StorageProviderUtils.DatabaseOptions databaseOptions, RateLimiter changeListenerNotificationRateLimit) AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, String dbName, StorageProviderUtils.DatabaseOptions databaseOptions) AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, StorageProviderUtils.DatabaseOptions databaseOptions, RateLimiter changeListenerNotificationRateLimit) AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, RateLimiter changeListenerNotificationRateLimit) AmazonDocumentDBStorageProvider(String hostName, int port) -
Method Summary
Modifier and TypeMethodDescriptionamazonDocumentDBStorageProviderWithDefaultSetting(String hostName, int port, com.mongodb.MongoCredential credential) amazonDocumentDBStorageProviderWithDefaultSetting(String hostName, int port, com.mongodb.MongoCredential credential, String dbName) protected voidrunMigrations(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix) protected voidvalidateTables(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix) Methods inherited from class MongoDBStorageProvider
announceBackgroundJobServer, countJobs, deleteJobsPermanently, deleteMetadata, deleteMetadata, deletePermanently, deleteRecurringJob, explainAggregation, explainQuery, getBackgroundJobServers, getCarbonAwareJobList, getDistinctJobSignatures, getJobById, getJobList, getJobList, getJobStats, getLongestRunningBackgroundJobServerId, getMetadata, getMetadata, getRecurringJobLatestScheduledInstant, getRecurringJobs, getScheduledJobs, publishTotalAmountOfSucceededJobs, recurringJobsUpdated, removeTimedOutBackgroundJobServers, save, save, saveMetadata, saveRecurringJob, setJobMapper, setUpStorageProvider, signalBackgroundJobServerAlive, signalBackgroundJobServerStopped, toMongoIdModifier and TypeMethodDescriptionvoidannounceBackgroundJobServer(BackgroundJobServerStatus serverStatus) 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.protected voidexplainAggregation(List<org.bson.conversions.Bson> query, String collectionName) used to perform query analysis for performance tuningprotected voidexplainQuery(org.bson.conversions.Bson query) used to perform query analysis for performance tuninggetCarbonAwareJobList(Instant deadlineBefore, AmountRequest amountRequest) Returns all carbon aware jobs with a deadline before the givenInstant.getDistinctJobSignatures(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.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) voidpublishTotalAmountOfSucceededJobs(int amount) booleanrecurringJobsUpdated(Long recurringJobsUpdatedHash) 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) static StringMethods 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, getJobsToProcess, getScheduledJobsModifier and TypeMethodDescriptiondefault JobgetJobById(JobId jobId) Returns theJobwith the given id or throws aJobNotFoundExceptionif the job does not existgetJobs(StateName state, PageRequest pageRequest) getJobsToProcess(BackgroundJobServer backgroundJobServer, AmountRequest amountRequest) getScheduledJobs(Instant scheduledBefore, PageRequest pageRequest)
-
Constructor Details
-
AmazonDocumentDBStorageProvider
-
AmazonDocumentDBStorageProvider
public AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient) -
AmazonDocumentDBStorageProvider
-
AmazonDocumentDBStorageProvider
public AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, String dbName, StorageProviderUtils.DatabaseOptions databaseOptions) -
AmazonDocumentDBStorageProvider
-
AmazonDocumentDBStorageProvider
public AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix, StorageProviderUtils.DatabaseOptions databaseOptions) -
AmazonDocumentDBStorageProvider
public AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, RateLimiter changeListenerNotificationRateLimit) -
AmazonDocumentDBStorageProvider
public AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, StorageProviderUtils.DatabaseOptions databaseOptions, RateLimiter changeListenerNotificationRateLimit) -
AmazonDocumentDBStorageProvider
public AmazonDocumentDBStorageProvider(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix, StorageProviderUtils.DatabaseOptions databaseOptions, RateLimiter changeListenerNotificationRateLimit)
-
-
Method Details
-
runMigrations
protected void runMigrations(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix) - Overrides:
runMigrationsin classMongoDBStorageProvider
-
validateTables
protected void validateTables(com.mongodb.client.MongoClient mongoClient, String dbName, String collectionPrefix) - Overrides:
validateTablesin classMongoDBStorageProvider
-
amazonDocumentDBStorageProviderWithDefaultSetting
public static AmazonDocumentDBStorageProvider amazonDocumentDBStorageProviderWithDefaultSetting(String hostName, int port, com.mongodb.MongoCredential credential) -
amazonDocumentDBStorageProviderWithDefaultSetting
public static AmazonDocumentDBStorageProvider amazonDocumentDBStorageProviderWithDefaultSetting(String hostName, int port, com.mongodb.MongoCredential credential, String dbName)
-