Package 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). AnOverseerTaskProcessor.OverseerMessageHandlerSelectordetermines whichOverseerMessageHandlerhandles specific messages in the queue.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceOverseerTaskProcessor.OverseerMessageHandlerSelectorAn interface to determine whichOverseerMessageHandlerhandles a given message.protected classOverseerTaskProcessor.RunnerclassOverseerTaskProcessor.TaskBatch
-
Field Summary
Fields Modifier and Type Field Description static intMAX_BLOCKED_TASKSstatic intMAX_PARALLEL_TASKSMaximum number of overseer collection operations which can be executed concurrentlyprotected OverseerTaskProcessor.OverseerMessageHandlerSelectorselectorExecutorServicetpe
-
Constructor Summary
Constructors Constructor Description OverseerTaskProcessor(ZkStateReader zkStateReader, String myId, 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 Description protected org.apache.solr.cloud.Overseer.LeaderStatusamILeader()voidclose()static StringgetLeaderId(SolrZkClient zkClient)static StringgetLeaderNode(SolrZkClient zkClient)static List<String>getSortedElectionNodes(SolrZkClient zk, String path)static List<String>getSortedOverseerNodeNames(SolrZkClient zk)booleanisClosed()voidrun()
-
-
-
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, Stats stats, OverseerTaskProcessor.OverseerMessageHandlerSelector selector, OverseerNodePrioritizer prioritizer, OverseerTaskQueue workQueue, DistributedMap runningMap, DistributedMap completedMap, DistributedMap failureMap)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getSortedOverseerNodeNames
public static List<String> getSortedOverseerNodeNames(SolrZkClient zk) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
getSortedElectionNodes
public static List<String> getSortedElectionNodes(SolrZkClient zk, String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
getLeaderNode
public static String getLeaderNode(SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
getLeaderId
public static String getLeaderId(SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
amILeader
protected org.apache.solr.cloud.Overseer.LeaderStatus amILeader()
-
isClosed
public boolean isClosed()
-
-