public class IdHashShardingStrategy extends Object implements IndexShardingStrategy
| Constructor and Description |
|---|
IdHashShardingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
IndexManager |
getIndexManagerForAddition(Class<?> entity,
Serializable id,
String idInString,
org.apache.lucene.document.Document document) |
IndexManager[] |
getIndexManagersForAllShards()
Ask for all shards (eg to query or optimize)
|
IndexManager[] |
getIndexManagersForDeletion(Class<?> entity,
Serializable id,
String idInString)
return the IndexManager(s) where the given entity is stored and where the deletion operation needs to be applied
id and idInString could be null.
|
IndexManager[] |
getIndexManagersForQuery(FullTextFilterImplementor[] fullTextFilters)
return the set of IndexManager(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 getIndexManagersForAllShards()
|
void |
initialize(Properties properties,
IndexManager[] indexManagers)
provides access to sharding properties (under the suffix sharding_strategy)
and provide access to all the IndexManager for a given index
|
public void initialize(Properties properties, IndexManager[] indexManagers)
IndexShardingStrategyinitialize in interface IndexShardingStrategyproperties - configuration propertiesindexManagers - array of IndexManagerpublic IndexManager[] getIndexManagersForAllShards()
IndexShardingStrategygetIndexManagersForAllShards in interface IndexShardingStrategyIndexManager for all shardspublic IndexManager getIndexManagerForAddition(Class<?> entity, Serializable id, String idInString, org.apache.lucene.document.Document document)
getIndexManagerForAddition in interface IndexShardingStrategyentity - the type of the entityid - the id in object formidInString - the id as transformed by the used TwoWayStringBridgedocument - the document to indexpublic IndexManager[] getIndexManagersForDeletion(Class<?> entity, Serializable id, String idInString)
IndexShardingStrategygetIndexManagersForDeletion in interface IndexShardingStrategyentity - the type of the deleted entityid - the id in object formidInString - the id as transformed by the used TwoWayStringBridgeIndexManager(s) where the given entity is storedpublic IndexManager[] getIndexManagersForQuery(FullTextFilterImplementor[] fullTextFilters)
IndexShardingStrategygetIndexManagersForQuery in interface IndexShardingStrategyfullTextFilters - can be empty if no filter is appliedIndexManager(s) where the entities matching the filters are storedCopyright © 2006–2017 Hibernate. All rights reserved.