Class InMemoryPartitionedStorageProvider

    • Constructor Detail

      • InMemoryPartitionedStorageProvider

        public InMemoryPartitionedStorageProvider()
      • InMemoryPartitionedStorageProvider

        protected InMemoryPartitionedStorageProvider​(RateLimiter rateLimiter)
    • Method Detail

      • getTotalNumOfPartitions

        public int getTotalNumOfPartitions()
      • lockByPartition

        public boolean lockByPartition​(Integer partition,
                                       int durationInSeconds,
                                       String lockedBy)
      • extendLockByPartition

        public boolean extendLockByPartition​(Integer partition,
                                             int durationInSeconds,
                                             String lockedBy)
      • unlockByPartition

        public boolean unlockByPartition​(Integer partition)
      • setTaskMapper

        public void setTaskMapper​(TaskMapper taskMapper)
      • setPartitioner

        public void setPartitioner​(Partitioner partitioner)
      • setUpStorageProvider

        public void setUpStorageProvider​(StorageProviderUtils.DatabaseOptions databaseOptions)
        Description copied from interface: PartitionedStorageProvider
        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.
      • getLongestRunningBackgroundTaskServerId

        public UUID getLongestRunningBackgroundTaskServerId()
      • removeTimedOutBackgroundTaskServers

        public int removeTimedOutBackgroundTaskServers​(Instant heartbeatOlderThan)
      • saveMetadata

        public void saveMetadata​(CarrotMetadata metadata)
      • deleteMetadata

        public void deleteMetadata​(String name)
      • save

        public Task save​(Task task)
      • saveByPartition

        public Task saveByPartition​(Task task,
                                    Integer partition)
      • deletePermanentlyByPartition

        public int deletePermanentlyByPartition​(UUID id,
                                                Integer partition)
      • getTaskById

        public Task getTaskById​(UUID id)
      • deleteTasksPermanentlyByPartition

        public int deleteTasksPermanentlyByPartition​(StateName state,
                                                     Instant updatedBefore,
                                                     Integer partition)
      • getDistinctTaskSignatures

        public Set<String> getDistinctTaskSignatures​(StateName... states)
      • recurringTaskExistsByPartition

        public boolean recurringTaskExistsByPartition​(String recurringTaskId,
                                                      Integer partition,
                                                      StateName... states)
      • countRecurringTasksByPartition

        public long countRecurringTasksByPartition​(Integer partition)
      • deleteRecurringTask

        public int deleteRecurringTask​(String id)
      • publishTotalAmountOfSucceededTasks

        public void publishTotalAmountOfSucceededTasks​(int amount)