Interface PartitionSet
- All Known Implementing Classes:
DatabasePartitionSet
,InMemoryPartitionSet
public interface PartitionSet
Represents a set of partitions and a way to register and retrieve the mappings.
- Author:
- Brandon Arp (brandon dot arp at inscopemetrics dot com)
-
Method Summary
Modifier and TypeMethodDescriptionWill return an existing partition mapping, or Optional.absent if one does not exist.Will return the partition mapping, creating one if possible.
-
Method Details
-
getExistingPartition
Will return an existing partition mapping, or Optional.absent if one does not exist.- Parameters:
key
- the key to be partitioned- Returns:
- a partition number
-
getOrCreatePartition
Will return the partition mapping, creating one if possible. Will return Optional.absent() if a partition is unable to be created for the key.- Parameters:
key
- the key to be partitioned- Returns:
- optionally, a partition number
-