Interface PartitionMap<T extends AsyncCloseable>
- Type Parameters:
T
- The value object which represents the partition.
- All Superinterfaces:
AsyncCloseable
,ListenableAsyncCloseable
- All Known Implementing Classes:
PowerSetPartitionMap
PartitionAttributes
that are fully specified and returns the corresponding
partitions those PartitionAttributes
belong to.-
Method Summary
Modifier and TypeMethodDescriptionadd
(PartitionAttributes partition) Deprecated.Add a newPartitionAttributes
that is absolutely specified.get
(PartitionAttributes wildCardAttributes) Deprecated.Get the partition value corresponding to thePartitionAttributes
parameter.remove
(PartitionAttributes partition) Deprecated.Remove aPartitionAttributes
that was previously added viaadd(PartitionAttributes)
.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosing
-
Method Details
-
add
Deprecated.Add a newPartitionAttributes
that is absolutely specified. This may create new partitions.The terminology "absolutely"/"fully" here is meant to clarify that
partition
contains all the attributes to uniquely identify a single host. This is typically called when notification is received fromServiceDiscoverer
and that address is translated to the correspondingPartitionAttributes
.This method is not guaranteed to provide any thread safety or visibility with respect to calls to this method or
remove(PartitionAttributes)
. If these methods are called from multiple threads you may need to provide external synchronization.- Parameters:
partition
- A fully specifiedPartitionAttributes
.- Returns:
- The partitions that
partition
belongs to. These may (or may not) be new partitions.
-
remove
Deprecated.Remove aPartitionAttributes
that was previously added viaadd(PartitionAttributes)
.New partitions typically are not created as a result of this method call.
This method is not guaranteed to provide any thread safety or visibility with respect to calls to this method or
add(PartitionAttributes)
. If these methods are called from multiple threads you may need to provide external synchronization.- Parameters:
partition
- A fully specifiedPartitionAttributes
.- Returns:
- The partitions that
partition
belongs to.
-
get
Deprecated.Get the partition value corresponding to thePartitionAttributes
parameter.This may be called from any thread.
- Parameters:
wildCardAttributes
- APartitionAttributes
which identifies the partition. Note that this may not be fully specified, and this is where the "wild card" terminology comes from.- Returns:
- the partition value corresponding to the
PartitionAttributes
parameter.
-
ClientGroup
as an alternative or reach out to the maintainers describing the use-case.