Class HashShardingStrategy
java.lang.Object
org.hibernate.search.backend.lucene.index.impl.HashShardingStrategy
- All Implemented Interfaces:
ShardingStrategy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes the sharding strategy.toShardIdentifier(String documentId, String routingKey) Returns the shard identifier corresponding to the given document ID and routing key.toShardIdentifiers(Set<String> routingKeys) Returns all the shard identifiers that can be assigned to the given routing keys byShardingStrategy.toShardIdentifier(String, String).
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
HashShardingStrategy
public HashShardingStrategy()
-
-
Method Details
-
initialize
Description copied from interface:ShardingStrategyInitializes the sharding strategy.- Specified by:
initializein interfaceShardingStrategy- Parameters:
context- The initialization context, giving access to configuration and environment. The sharding strategy is expected to callShardingStrategyInitializationContext.shardIdentifiers(Set).
-
toShardIdentifier
Description copied from interface:ShardingStrategyReturns the shard identifier corresponding to the given document ID and routing key.Called in particular when indexing documents.
- Specified by:
toShardIdentifierin interfaceShardingStrategy- Parameters:
documentId- A document identifier. Nevernull.routingKey- A routing key. Nevernull.- Returns:
- A shard identifiers corresponding to the given document ID and routing key. Never
null.
-
toShardIdentifiers
Description copied from interface:ShardingStrategyReturns all the shard identifiers that can be assigned to the given routing keys byShardingStrategy.toShardIdentifier(String, String).Called in particular when searching.
- Specified by:
toShardIdentifiersin interfaceShardingStrategy- Parameters:
routingKeys- A set of routing keys. Nevernull, never empty.- Returns:
- All the shard identifiers that can be assigned to the given routing keys.
-