Class DatabasePartitionSet
java.lang.Object
com.arpnetworking.clusteraggregator.partitioning.DatabasePartitionSet
- All Implemented Interfaces:
PartitionSet
A partition set that is backed by an eBean database.
- Author:
- Brandon Arp (brandon dot arp at inscopemetrics dot com)
-
Constructor Summary
ConstructorDescriptionDatabasePartitionSet
(Database database, PartitionSet partitionSet) Public constructor. -
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.
-
Constructor Details
-
DatabasePartitionSet
Public constructor.- Parameters:
database
- The database to use to back the datapartitionSet
- The partition set model backing this instance
-
-
Method Details
-
getExistingPartition
Description copied from interface:PartitionSet
Will return an existing partition mapping, or Optional.absent if one does not exist.- Specified by:
getExistingPartition
in interfacePartitionSet
- Parameters:
key
- the key to be partitioned- Returns:
- a partition number
-
getOrCreatePartition
Description copied from interface:PartitionSet
Will return the partition mapping, creating one if possible. Will return Optional.absent() if a partition is unable to be created for the key.- Specified by:
getOrCreatePartition
in interfacePartitionSet
- Parameters:
key
- the key to be partitioned- Returns:
- optionally, a partition number
-