org.apache.solr.cloud

## Class OverseerCollectionMessageHandler

- java.lang.Object
- - org.apache.solr.cloud.OverseerCollectionMessageHandler

- All Implemented Interfaces:
    Closeable, AutoCloseable, OverseerMessageHandler

      public class OverseerCollectionMessageHandler
      extends Object
      implements OverseerMessageHandler, Closeable

  A `OverseerMessageHandler` that handles Collections API related overseer messages.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.solr.cloud.OverseerMessageHandler

      `OverseerMessageHandler.Lock`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COLL_CONF`
    `static String` | `COLL_PROP_PREFIX`
    `static Map<String,Object>` | `COLL_PROPS`
    `static String` | `CREATE_NODE_SET`
    `static String` | `CREATE_NODE_SET_EMPTY`
    `static String` | `CREATE_NODE_SET_SHUFFLE`
    `static String` | `NUM_SLICES`
    `static String` | `ONLY_ACTIVE_NODES`
    `static String` | `ONLY_IF_DOWN`
    `static String` | `REQUESTID`
    `static String` | `ROUTER`
    `static String` | `SHARD_UNIQUE`
    `static String` | `SHARDS_PROP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OverseerCollectionMessageHandler(ZkStateReader zkStateReader, String myId, ShardHandlerFactory shardHandlerFactory, String adminPath, Overseer.Stats stats, Overseer overseer, OverseerNodePrioritizer overseerPrioritizer)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `protected void` | `crossCheckReplicaStateWithLiveNodes(List<String> liveNodes, NamedList<Object> collectionProps)` Walks the tree of collection status to verify that any replicas not reporting a "down" status is on a live node, if any replicas reporting their status as "active" but the node is not live is marked as "down"; used by CLUSTERSTATUS.
    `String` | `getName()`
    `String` | `getTaskKey(ZkNodeProps message)`
    `String` | `getTimerName(String operation)`
    `OverseerMessageHandler.Lock` | `lockTask(ZkNodeProps message, OverseerTaskProcessor.TaskBatch taskBatch)` Try to provide an exclusive lock for this particular task return null if locking is not possible.
    `SolrResponse` | `processMessage(ZkNodeProps message, String operation)`
    `static void` | `sendShardRequest(String nodeName, ModifiableSolrParams params, ShardHandler shardHandler, String asyncId, Map<String,String> requestMap, String adminPath, ZkStateReader zkStateReader)`

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

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

- - ### Field Detail

    - #### NUM_SLICES

          public static final String NUM_SLICES

      See Also:
        Constant Field Values

    - #### CREATE_NODE_SET_SHUFFLE

          public static final String CREATE_NODE_SET_SHUFFLE

      See Also:
        Constant Field Values

    - #### CREATE_NODE_SET_EMPTY

          public static final String CREATE_NODE_SET_EMPTY

      See Also:
        Constant Field Values

    - #### CREATE_NODE_SET

          public static final String CREATE_NODE_SET

      See Also:
        Constant Field Values

    - #### ROUTER

          public static final String ROUTER

      See Also:
        Constant Field Values

    - #### SHARDS_PROP

          public static final String SHARDS_PROP

      See Also:
        Constant Field Values

    - #### REQUESTID

          public static final String REQUESTID

      See Also:
        Constant Field Values

    - #### COLL_CONF

          public static final String COLL_CONF

      See Also:
        Constant Field Values

    - #### COLL_PROP_PREFIX

          public static final String COLL_PROP_PREFIX

      See Also:
        Constant Field Values

    - #### ONLY_IF_DOWN

          public static final String ONLY_IF_DOWN

      See Also:
        Constant Field Values

    - #### SHARD_UNIQUE

          public static final String SHARD_UNIQUE

      See Also:
        Constant Field Values

    - #### ONLY_ACTIVE_NODES

          public static final String ONLY_ACTIVE_NODES

      See Also:
        Constant Field Values

    - #### COLL_PROPS

          public static final Map<String,Object> COLL_PROPS

  - ### Constructor Detail

    - #### OverseerCollectionMessageHandler

          public OverseerCollectionMessageHandler(ZkStateReader zkStateReader,
                                                  String myId,
                                                  ShardHandlerFactory shardHandlerFactory,
                                                  String adminPath,
                                                  Overseer.Stats stats,
                                                  Overseer overseer,
                                                  OverseerNodePrioritizer overseerPrioritizer)

  - ### Method Detail

    - #### processMessage

          public SolrResponse processMessage(ZkNodeProps message,
                                             String operation)

      Specified by:
        `processMessage` in interface `OverseerMessageHandler`
      Parameters:
        `message` - the message to process
        `operation` - the operation to process
      Returns:
        response

    - #### crossCheckReplicaStateWithLiveNodes

          protected void crossCheckReplicaStateWithLiveNodes(List<String> liveNodes,
                                                             NamedList<Object> collectionProps)

      Walks the tree of collection status to verify that any replicas not reporting a "down" status is on a live node, if any replicas reporting their status as "active" but the node is not live is marked as "down"; used by CLUSTERSTATUS.
      Parameters:
        `liveNodes` - List of currently live node names.
        `collectionProps` - Map of collection status information pulled directly from ZooKeeper.

    - #### sendShardRequest

          public static void sendShardRequest(String nodeName,
                                              ModifiableSolrParams params,
                                              ShardHandler shardHandler,
                                              String asyncId,
                                              Map<String,String> requestMap,
                                              String adminPath,
                                              ZkStateReader zkStateReader)

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `OverseerMessageHandler`
      Returns:
        the name of the OverseerMessageHandler

    - #### getTimerName

          public String getTimerName(String operation)

      Specified by:
        `getTimerName` in interface `OverseerMessageHandler`
      Parameters:
        `operation` - the operation to be timed
      Returns:
        the name of the timer to use for the operation

    - #### getTaskKey

          public String getTaskKey(ZkNodeProps message)

      Specified by:
        `getTaskKey` in interface `OverseerMessageHandler`
      Parameters:
        `message` - the message being processed
      Returns:
        the taskKey for the message for handling task exclusivity

    - #### lockTask

          public OverseerMessageHandler.Lock lockTask(ZkNodeProps message,
                                                      OverseerTaskProcessor.TaskBatch taskBatch)

      Description copied from interface: `OverseerMessageHandler`
      Try to provide an exclusive lock for this particular task return null if locking is not possible. If locking is not necessary
      Specified by:
        `lockTask` in interface `OverseerMessageHandler`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.