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 Details

    • getExistingPartition

      Optional<Integer> getExistingPartition(String key)
      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

      Optional<Integer> getOrCreatePartition(String key)
      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