Package org.infinispan.query.affinity
Class ShardAllocationManagerImpl
- java.lang.Object
-
- org.infinispan.query.affinity.ShardAllocationManagerImpl
-
- All Implemented Interfaces:
ShardAllocatorManager
public final class ShardAllocationManagerImpl extends java.lang.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(java.lang.String shardId)java.lang.StringgetShardFromKey(java.lang.Object key)java.lang.StringgetShardFromSegment(int segment)java.util.Set<java.lang.String>getShards()java.util.Set<java.lang.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, java.lang.String indeName)voidonTopologyChange(TopologyChangedEvent<?,?> tce)
-
-
-
Method Detail
-
inject
public void inject(Cache<?,?> cache, DistributionManager distributionManager)
-
getShardFromSegment
public java.lang.String getShardFromSegment(int segment)
- Specified by:
getShardFromSegmentin interfaceShardAllocatorManager- Returns:
- the shard name for a certain segment.
-
getOwner
public Address getOwner(java.lang.String shardId)
- Specified by:
getOwnerin interfaceShardAllocatorManager- Returns:
- Owner of an index shard.
-
getShardFromKey
public java.lang.String getShardFromKey(java.lang.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 java.util.Set<java.lang.String> getShards()
- Specified by:
getShardsin interfaceShardAllocatorManager- Returns:
- the list of all shards available.
-
getShardsForModification
public java.util.Set<java.lang.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, java.lang.String indeName)
- Specified by:
isOwnershipChangedin interfaceShardAllocatorManager- Returns:
- Owner of an index shard given a certain
ConsistentHash.
-
onTopologyChange
public void onTopologyChange(TopologyChangedEvent<?,?> tce)
-
-