Package io.atomix.primitive.partition
Interface PartitionGroup
- All Superinterfaces:
io.atomix.utils.config.Configured<PartitionGroupConfig>
- All Known Subinterfaces:
ManagedPartitionGroup
public interface PartitionGroup extends io.atomix.utils.config.Configured<PartitionGroupConfig>
Primitive partition group.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PartitionGroup.Builder<C extends PartitionGroupConfig<C>>
Partition group builder.static interface
PartitionGroup.Type<C extends PartitionGroupConfig<C>>
Partition group type. -
Method Summary
Modifier and Type Method Description Partition
getPartition(PartitionId partitionId)
Returns a partition by ID.default Partition
getPartition(String key)
Returns the partition for the given key.List<PartitionId>
getPartitionIds()
Returns a sorted list of partition IDs.Collection<Partition>
getPartitions()
Returns a collection of all partitions.String
name()
Returns the partition group name.ProxyProtocol
newProtocol()
Returns a new primitive protocol.PrimitiveProtocol.Type
protocol()
Returns the primitive protocol type supported by the partition group.default CompletableFuture<Void>
snapshot()
Takes snapshots of all partitions.default CompletableFuture<Void>
snapshot(PartitionId partitionId)
Takes a snapshot of the partition.PartitionGroup.Type
type()
Returns the partition group type.
-
Method Details
-
name
String name()Returns the partition group name.- Returns:
- the partition group name
-
type
PartitionGroup.Type type()Returns the partition group type.- Returns:
- the partition group type
-
protocol
PrimitiveProtocol.Type protocol()Returns the primitive protocol type supported by the partition group.- Returns:
- the primitive protocol type supported by the partition group
-
newProtocol
ProxyProtocol newProtocol()Returns a new primitive protocol.- Returns:
- a new primitive protocol
-
getPartition
Returns a partition by ID.- Parameters:
partitionId
- the partition identifier- Returns:
- the partition or
null
if no partition with the given identifier exists - Throws:
NullPointerException
- if the partition identifier isnull
-
getPartition
Returns the partition for the given key.- Parameters:
key
- the key for which to return the partition- Returns:
- the partition for the given key
-
getPartitions
Collection<Partition> getPartitions()Returns a collection of all partitions.- Returns:
- a collection of all partitions
-
getPartitionIds
List<PartitionId> getPartitionIds()Returns a sorted list of partition IDs.- Returns:
- a sorted list of partition IDs
-
snapshot
Takes a snapshot of the partition.- Parameters:
partitionId
- the partition identifier- Returns:
- a future to be completed once the snapshot is complete
-
snapshot
Takes snapshots of all partitions.- Returns:
- a future to be completed once snapshots have been taken
-