org.hibernate.search.indexes.impl

## Class IndexShardingStrategyIndexManagerSelector

- java.lang.Object
- - org.hibernate.search.indexes.impl.IndexShardingStrategyIndexManagerSelector

- All Implemented Interfaces:
    IndexManagerSelector

      public class IndexShardingStrategyIndexManagerSelector
      extends Object
      implements IndexManagerSelector

  Author:
    Yoann Rodiere

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexShardingStrategyIndexManagerSelector(IndexShardingStrategy shardingStrategy, IndexManager[] allIndexManagers)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<IndexManager>` | `all()` Ask for all shards (eg to optimize)
    `Set<IndexManager>` | `forExisting(IndexedTypeIdentifier typeId, Serializable id, String idInString)`
    `Set<IndexManager>` | `forFilters(FullTextFilterImplementor[] fullTextFilters)`
    `IndexManager` | `forNew(IndexedTypeIdentifier typeId, Serializable id, String idInString, Document document)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IndexShardingStrategyIndexManagerSelector

          public IndexShardingStrategyIndexManagerSelector(IndexShardingStrategy shardingStrategy,
                                                           IndexManager[] allIndexManagers)

  - ### Method Detail

    - #### all

          public Set<IndexManager> all()

      Description copied from interface: `IndexManagerSelector`
      Ask for all shards (eg to optimize)
      Specified by:
        `all` in interface `IndexManagerSelector`
      Returns:
        all the `IndexManager` for all shards

    - #### forNew

          public IndexManager forNew(IndexedTypeIdentifier typeId,
                                     Serializable id,
                                     String idInString,
                                     Document document)

      Specified by:
        `forNew` in interface `IndexManagerSelector`
      Parameters:
        `typeId` - the type of the entity
        `id` - the id in object form
        `idInString` - the id as transformed by the used TwoWayStringBridge
        `document` - the document to index
      Returns:
        the IndexManager where the given entity will be indexed

    - #### forExisting

          public Set<IndexManager> forExisting(IndexedTypeIdentifier typeId,
                                               Serializable id,
                                               String idInString)

      Specified by:
        `forExisting` in interface `IndexManagerSelector`
      Parameters:
        `typeId` - the type of the existing entity
        `id` - the id in object form
        `idInString` - the id as transformed by the used TwoWayStringBridge
      Returns:
        If id and idInString are non-null, the `IndexManager`(s) where the given entity is stored. If they are null, all the `IndexManager`(s) where an entity of the given type is stored.

    - #### forFilters

          public Set<IndexManager> forFilters(FullTextFilterImplementor[] fullTextFilters)

      Specified by:
        `forFilters` in interface `IndexManagerSelector`
      Parameters:
        `fullTextFilters` - the filters applied to the query; must be empty if no filter is applied
      Returns:
        the set of `IndexManager`(s) where the entities matching the filters are stored

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved