Package org.hibernate.search.store
Class IdHashShardingStrategy
java.lang.Object
org.hibernate.search.store.IdHashShardingStrategy
- All Implemented Interfaces:
IndexShardingStrategy
This implementation use idInString as the hashKey.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDirectoryProviderForAddition(Class<?> entity, Serializable id, String idInString, Document document) return the DirectoryProvider where the given entity will be indexedDirectoryProvider<?>[]Ask for all shards (eg to query or optimize)DirectoryProvider<?>[]getDirectoryProvidersForDeletion(Class<?> entity, Serializable id, String idInString) return the DirectoryProvider(s) where the given entity is stored and where the deletion operation needs to be applied id and idInString can be null.DirectoryProvider<?>[]getDirectoryProvidersForQuery(FullTextFilterImplementor[] fullTextFilters) return the set of DirectoryProvider(s) where the entities matching the filters are stored this optional optimization allows queries to hit a subset of all shards, which may be useful for some datasets if this optimization is not needed, return getDirectoryProvidersForAllShards() fullTextFilters can be empty if no filter is appliedvoidinitialize(Properties properties, DirectoryProvider<?>[] providers) provides access to sharding properties (under the suffix sharding_strategy) and provide access to all the DirectoryProviders for a given index
-
Constructor Details
-
IdHashShardingStrategy
public IdHashShardingStrategy()
-
-
Method Details
-
initialize
Description copied from interface:IndexShardingStrategyprovides access to sharding properties (under the suffix sharding_strategy) and provide access to all the DirectoryProviders for a given index- Specified by:
initializein interfaceIndexShardingStrategy
-
getDirectoryProvidersForAllShards
Description copied from interface:IndexShardingStrategyAsk for all shards (eg to query or optimize)- Specified by:
getDirectoryProvidersForAllShardsin interfaceIndexShardingStrategy
-
getDirectoryProviderForAddition
public DirectoryProvider<?> getDirectoryProviderForAddition(Class<?> entity, Serializable id, String idInString, Document document) Description copied from interface:IndexShardingStrategyreturn the DirectoryProvider where the given entity will be indexed- Specified by:
getDirectoryProviderForAdditionin interfaceIndexShardingStrategy
-
getDirectoryProvidersForDeletion
public DirectoryProvider<?>[] getDirectoryProvidersForDeletion(Class<?> entity, Serializable id, String idInString) Description copied from interface:IndexShardingStrategyreturn the DirectoryProvider(s) where the given entity is stored and where the deletion operation needs to be applied id and idInString can be null. If null, all the directory providers containing entity types should be returned- Specified by:
getDirectoryProvidersForDeletionin interfaceIndexShardingStrategy
-
getDirectoryProvidersForQuery
public DirectoryProvider<?>[] getDirectoryProvidersForQuery(FullTextFilterImplementor[] fullTextFilters) Description copied from interface:IndexShardingStrategyreturn the set of DirectoryProvider(s) where the entities matching the filters are stored this optional optimization allows queries to hit a subset of all shards, which may be useful for some datasets if this optimization is not needed, return getDirectoryProvidersForAllShards() fullTextFilters can be empty if no filter is applied- Specified by:
getDirectoryProvidersForQueryin interfaceIndexShardingStrategy
-