Package org.infinispan.query.affinity
Interface ShardAllocatorManager
-
- All Known Implementing Classes:
ShardAllocationManagerImpl
public interface ShardAllocatorManager
ShardAllocatorManager is responsible for the mapping between index shards and Infinispan segments for all indexes in a cache.- Since:
- 9.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Address
getOwner(String shardId)
String
getShardFromKey(Object key)
String
getShardFromSegment(int segment)
Set<String>
getShards()
Set<String>
getShardsForModification(Address address)
void
initialize(int numberOfShards, int numSegments)
Initializes theShardAllocatorManager
with the configured number of segments and shards.boolean
isOwnershipChanged(TopologyChangedEvent<?,?> tce, String shardId)
-
-
-
Method Detail
-
getShardFromSegment
String getShardFromSegment(int segment)
- Returns:
- the shard name for a certain segment.
-
getShardsForModification
Set<String> getShardsForModification(Address address)
- Returns:
- the list of shards used to do modifications to the index for a given address.
-
isOwnershipChanged
boolean isOwnershipChanged(TopologyChangedEvent<?,?> tce, String shardId)
- Returns:
- Owner of an index shard given a certain
ConsistentHash
.
-
initialize
void initialize(int numberOfShards, int numSegments)
Initializes theShardAllocatorManager
with the configured number of segments and shards.
-
-