org.hibernate.search.store.impl
Class IdHashShardingStrategy

java.lang.Object
  extended by org.hibernate.search.store.impl.IdHashShardingStrategy
All Implemented Interfaces:
IndexShardingStrategy

public class IdHashShardingStrategy
extends Object
implements IndexShardingStrategy

This implementation use idInString as the hashKey.

Author:
Emmanuel Bernard

Constructor Summary
IdHashShardingStrategy()
           
 
Method Summary
 IndexManager getIndexManagerForAddition(Class<?> entity, Serializable id, String idInString, org.apache.lucene.document.Document document)
          return the IndexManager where the given entity will be indexed
 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() fullTextFilters can be empty if no filter is applied
 void initialize(Properties properties, IndexManager[] providers)
          provides access to sharding properties (under the suffix sharding_strategy) and provide access to all the IndexManager for a given index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdHashShardingStrategy

public IdHashShardingStrategy()
Method Detail

initialize

public void initialize(Properties properties,
                       IndexManager[] providers)
Description copied from interface: IndexShardingStrategy
provides access to sharding properties (under the suffix sharding_strategy) and provide access to all the IndexManager for a given index

Specified by:
initialize in interface IndexShardingStrategy

getIndexManagersForAllShards

public IndexManager[] getIndexManagersForAllShards()
Description copied from interface: IndexShardingStrategy
Ask for all shards (eg to query or optimize)

Specified by:
getIndexManagersForAllShards in interface IndexShardingStrategy

getIndexManagerForAddition

public IndexManager getIndexManagerForAddition(Class<?> entity,
                                               Serializable id,
                                               String idInString,
                                               org.apache.lucene.document.Document document)
Description copied from interface: IndexShardingStrategy
return the IndexManager where the given entity will be indexed

Specified by:
getIndexManagerForAddition in interface IndexShardingStrategy

getIndexManagersForDeletion

public IndexManager[] getIndexManagersForDeletion(Class<?> entity,
                                                  Serializable id,
                                                  String idInString)
Description copied from interface: IndexShardingStrategy
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. If null, all the IndexManagers containing entity types should be returned

Specified by:
getIndexManagersForDeletion in interface IndexShardingStrategy
Parameters:
entity - the type of the deleted entity
id - the id in object form
idInString - the id as transformed by the used TwoWayStringBridge

getIndexManagersForQuery

public IndexManager[] getIndexManagersForQuery(FullTextFilterImplementor[] fullTextFilters)
Description copied from interface: IndexShardingStrategy
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() fullTextFilters can be empty if no filter is applied

Specified by:
getIndexManagersForQuery in interface IndexShardingStrategy


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved