Interface PartitionManager

All Known Implementing Classes:
SimplePartitionManager

public interface PartitionManager
  • Method Details

    • lockPartitions

      Optional<Lock> lockPartitions(String eventName, List<Partition> partitions, String lockedBy)
      Locks partitions for one event. When running consumers on multiple nodes they should try to lock partitions so that events are only processed by one consumer.
      Parameters:
      eventName - Name of the event
      partitions - The partitions to lock
      lockedBy - Name of one node of the consuming application
      Returns:
      A Lock instance containing the list of locked partitions if locking succeeded, Optional.empty() otherwise
    • unlockPartitions

      void unlockPartitions(Lock lock)
      Unlocks previously locked partitions.
      Parameters:
      lock - The lock object returned from lockPartitions(String, List, String)