Package cn.boboweike.carrot.storage
Interface PartitionedStorageProvider
-
- All Known Implementing Classes:
AbstractPartitionedStorageProvider,InMemoryPartitionedStorageProvider,MongoDBPartitionedStorageProvider,ThreadSafePartitionedStorageProvider
public interface PartitionedStorageProvider
-
-
Field Summary
Fields Modifier and Type Field Description static intBATCH_SIZEstatic intDEFAULT_NUM_OF_PARTITIONSstatic StringPARTITION_HINT_KEYstatic StringPARTITION_PREFIX
-
Method Summary
-
-
-
Field Detail
-
BATCH_SIZE
static final int BATCH_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_NUM_OF_PARTITIONS
static final int DEFAULT_NUM_OF_PARTITIONS
- See Also:
- Constant Field Values
-
PARTITION_PREFIX
static final String PARTITION_PREFIX
- See Also:
- Constant Field Values
-
PARTITION_HINT_KEY
static final String PARTITION_HINT_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
String getName()
-
getTotalNumOfPartitions
int getTotalNumOfPartitions()
-
extendLockByPartition
boolean extendLockByPartition(Integer partition, int durationInSeconds, String lockedBy)
-
unlockByPartition
boolean unlockByPartition(Integer partition)
-
setTaskMapper
void setTaskMapper(TaskMapper taskMapper)
-
setPartitioner
void setPartitioner(Partitioner partitioner)
-
setUpStorageProvider
void setUpStorageProvider(StorageProviderUtils.DatabaseOptions databaseOptions)
This method allows to reinitialize the StorageProvider. It can be used if you are using Flyway or Liquibase to setup your database manually. By default, this method is automatically called on construction of the StorageProvider- Parameters:
databaseOptions- defines whether to set up the StorageProvider or validate whether the StorageProvider is set up correctly.
-
addTaskStorageOnChangeListener
void addTaskStorageOnChangeListener(StorageProviderChangeListener listener)
-
removeTaskStorageOnChangeListener
void removeTaskStorageOnChangeListener(StorageProviderChangeListener listener)
-
announceBackgroundTaskServer
void announceBackgroundTaskServer(BackgroundTaskServerStatus serverStatus)
-
signalBackgroundTaskServerAlive
boolean signalBackgroundTaskServerAlive(BackgroundTaskServerStatus serverStatus)
-
signalBackgroundTaskServerStopped
void signalBackgroundTaskServerStopped(BackgroundTaskServerStatus serverStatus)
-
getBackgroundTaskServers
List<BackgroundTaskServerStatus> getBackgroundTaskServers()
-
getLongestRunningBackgroundTaskServerId
UUID getLongestRunningBackgroundTaskServerId()
-
removeTimedOutBackgroundTaskServers
int removeTimedOutBackgroundTaskServers(Instant heartbeatOlderThan)
-
saveMetadata
void saveMetadata(CarrotMetadata metadata)
-
getMetadata
List<CarrotMetadata> getMetadata(String name)
-
getMetadata
CarrotMetadata getMetadata(String name, String owner)
-
deleteMetadata
void deleteMetadata(String name)
-
getTasksByPartition
List<Task> getTasksByPartition(StateName state, Instant updatedBefore, PageRequest pageRequest, Integer partition)
-
getScheduledTasksByPartition
List<Task> getScheduledTasksByPartition(Instant scheduledBefore, PageRequest pageRequest, Integer partition)
-
getTasksByPartition
List<Task> getTasksByPartition(StateName state, PageRequest pageRequest, Integer partition)
-
getTaskPageByPartition
Page<Task> getTaskPageByPartition(StateName state, PageRequest pageRequest, Integer partition)
-
deleteTasksPermanentlyByPartition
int deleteTasksPermanentlyByPartition(StateName state, Instant updatedBefore, Integer partition)
-
existsByPartition
boolean existsByPartition(TaskDetails taskDetails, Integer partition, StateName... states)
-
recurringTaskExistsByPartition
boolean recurringTaskExistsByPartition(String recurringTaskId, Integer partition, StateName... states)
-
saveRecurringTask
RecurringTask saveRecurringTask(RecurringTask recurringTask)
-
getRecurringTasksByPartition
List<RecurringTask> getRecurringTasksByPartition(Integer partition)
-
getRecurringTasks
List<RecurringTask> getRecurringTasks()
-
countRecurringTasksByPartition
long countRecurringTasksByPartition(Integer partition)
-
deleteRecurringTask
int deleteRecurringTask(String id)
-
getTaskStatsData
TaskStatsData getTaskStatsData()
-
publishTotalAmountOfSucceededTasks
void publishTotalAmountOfSucceededTasks(int amount)
-
close
void close()
-
-