Package org.infinispan.query.affinity
Class ShardAllocationManagerImpl
- java.lang.Object
-
- org.infinispan.query.affinity.ShardAllocationManagerImpl
-
- All Implemented Interfaces:
ShardAllocatorManager
public final class ShardAllocationManagerImpl extends Object implements ShardAllocatorManager
- Since:
- 9.0
- See Also:
ShardAllocatorManager
-
-
Constructor Summary
Constructors Constructor Description ShardAllocationManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AddressgetOwner(String shardId)StringgetShardFromKey(Object key)StringgetShardFromSegment(int segment)Set<String>getShards()Set<String>getShardsForModification(Address address)voidinitialize(int numberOfShards, int numSegments)Initializes theShardAllocatorManagerwith the configured number of segments and shards.voidinject(Cache<?,?> cache, DistributionManager distributionManager)booleanisOwnershipChanged(TopologyChangedEvent<?,?> tce, String indeName)voidonTopologyChange(TopologyChangedEvent<?,?> tce)
-
-
-
Method Detail
-
inject
public void inject(Cache<?,?> cache, DistributionManager distributionManager)
-
getShardFromSegment
public String getShardFromSegment(int segment)
- Specified by:
getShardFromSegmentin interfaceShardAllocatorManager- Returns:
- the shard name for a certain segment.
-
getOwner
public Address getOwner(String shardId)
- Specified by:
getOwnerin interfaceShardAllocatorManager- Returns:
- Owner of an index shard.
-
getShardFromKey
public String getShardFromKey(Object key)
- Specified by:
getShardFromKeyin interfaceShardAllocatorManager
-
initialize
public void initialize(int numberOfShards, int numSegments)Description copied from interface:ShardAllocatorManagerInitializes theShardAllocatorManagerwith the configured number of segments and shards.- Specified by:
initializein interfaceShardAllocatorManager
-
getShards
public Set<String> getShards()
- Specified by:
getShardsin interfaceShardAllocatorManager- Returns:
- the list of all shards available.
-
getShardsForModification
public Set<String> getShardsForModification(Address address)
- Specified by:
getShardsForModificationin interfaceShardAllocatorManager- Returns:
- the list of shards used to do modifications to the index for a given address.
-
isOwnershipChanged
public boolean isOwnershipChanged(TopologyChangedEvent<?,?> tce, String indeName)
- Specified by:
isOwnershipChangedin interfaceShardAllocatorManager- Returns:
- Owner of an index shard given a certain
ConsistentHash.
-
onTopologyChange
public void onTopologyChange(TopologyChangedEvent<?,?> tce)
-
-