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 classPartitionGroup.Builder<C extends PartitionGroupConfig<C>>Partition group builder.static interfacePartitionGroup.Type<C extends PartitionGroupConfig<C>>Partition group type. -
Method Summary
Modifier and Type Method Description PartitiongetPartition(PartitionId partitionId)Returns a partition by ID.default PartitiongetPartition(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.Stringname()Returns the partition group name.ProxyProtocolnewProtocol()Returns a new primitive protocol.PrimitiveProtocol.Typeprotocol()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.Typetype()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
nullif 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
-