Package org.zalando.fahrschein
Interface PartitionManager
- All Known Implementing Classes:
SimplePartitionManager
public interface PartitionManager
-
Method Summary
Modifier and TypeMethodDescriptionlockPartitions(String eventName, List<Partition> partitions, String lockedBy) Locks partitions for one event.voidunlockPartitions(Lock lock) Unlocks previously locked partitions.
-
Method Details
-
lockPartitions
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 eventpartitions- The partitions to locklockedBy- Name of one node of the consuming application- Returns:
- A
Lockinstance containing the list of locked partitions if locking succeeded,Optional.empty()otherwise
-
unlockPartitions
Unlocks previously locked partitions.- Parameters:
lock- The lock object returned fromlockPartitions(String, List, String)
-