org.apache.solr.cloud

## Class OverseerTaskProcessor

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

- All Implemented Interfaces:
    Closeable, AutoCloseable, Runnable
  Direct Known Subclasses:
    OverseerCollectionConfigSetProcessor

      public class OverseerTaskProcessor
      extends Object
      implements Runnable, Closeable

  A generic processor run in the Overseer, used for handling items added to a distributed work queue. Has support for handling exclusive tasks (i.e. tasks that should not run in parallel with each other). An `OverseerTaskProcessor.OverseerMessageHandlerSelector` determines which `OverseerMessageHandler` handles specific messages in the queue.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `OverseerTaskProcessor.OverseerMessageHandlerSelector` An interface to determine which `OverseerMessageHandler` handles a given message.
    `protected class` | `OverseerTaskProcessor.Runner`
    `class` | `OverseerTaskProcessor.TaskBatch`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `MAX_BLOCKED_TASKS`
    `static int` | `MAX_PARALLEL_TASKS` Maximum number of overseer collection operations which can be executed concurrently
    `protected OverseerTaskProcessor.OverseerMessageHandlerSelector` | `selector`
    `ExecutorService` | `tpe`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OverseerTaskProcessor(ZkStateReader zkStateReader, String myId, Overseer.Stats stats, OverseerTaskProcessor.OverseerMessageHandlerSelector selector, OverseerNodePrioritizer prioritizer, OverseerTaskQueue workQueue, DistributedMap runningMap, DistributedMap completedMap, DistributedMap failureMap)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.apache.solr.cloud.Overseer.LeaderStatus` | `amILeader()`
    `void` | `close()`
    `static String` | `getLeaderId(SolrZkClient zkClient)`
    `static String` | `getLeaderNode(SolrZkClient zkClient)`
    `static List<String>` | `getSortedElectionNodes(SolrZkClient zk, String path)`
    `static List<String>` | `getSortedOverseerNodeNames(SolrZkClient zk)`
    `boolean` | `isClosed()`
    `void` | `run()`

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

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

- - ### Field Detail

    - #### MAX_PARALLEL_TASKS

          public static final int MAX_PARALLEL_TASKS

      Maximum number of overseer collection operations which can be executed concurrently
      See Also:
        Constant Field Values

    - #### MAX_BLOCKED_TASKS

          public static final int MAX_BLOCKED_TASKS

      See Also:
        Constant Field Values

    - #### tpe

          public ExecutorService tpe

    - #### selector

          protected OverseerTaskProcessor.OverseerMessageHandlerSelector selector

  - ### Constructor Detail

    - #### OverseerTaskProcessor

          public OverseerTaskProcessor(ZkStateReader zkStateReader,
                                       String myId,
                                       Overseer.Stats stats,
                                       OverseerTaskProcessor.OverseerMessageHandlerSelector selector,
                                       OverseerNodePrioritizer prioritizer,
                                       OverseerTaskQueue workQueue,
                                       DistributedMap runningMap,
                                       DistributedMap completedMap,
                                       DistributedMap failureMap)

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`

    - #### close

          public void close()

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

    - #### getSortedOverseerNodeNames

          public static List<String> getSortedOverseerNodeNames(SolrZkClient zk)
                                                         throws org.apache.zookeeper.KeeperException,
                                                                InterruptedException

      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### getSortedElectionNodes

          public static List<String> getSortedElectionNodes(SolrZkClient zk,
                                                            String path)
                                                     throws org.apache.zookeeper.KeeperException,
                                                            InterruptedException

      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### getLeaderNode

          public static String getLeaderNode(SolrZkClient zkClient)
                                      throws org.apache.zookeeper.KeeperException,
                                             InterruptedException

      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### getLeaderId

          public static String getLeaderId(SolrZkClient zkClient)
                                    throws org.apache.zookeeper.KeeperException,
                                           InterruptedException

      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### amILeader

          protected org.apache.solr.cloud.Overseer.LeaderStatus amILeader()

    - #### isClosed

          public boolean isClosed()

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