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).An
OverseerTaskProcessor.OverseerMessageHandlerSelector
determines whichOverseerMessageHandler
handles specific messages in the queue.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
OverseerTaskProcessor.OverseerMessageHandlerSelector
An interface to determine whichOverseerMessageHandler
handles a given message.protected class
OverseerTaskProcessor.Runner
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_BLOCKED_TASKS
static int
MAX_PARALLEL_TASKS
Maximum number of overseer collection operations which can be executed concurrentlyprotected OverseerTaskProcessor.OverseerMessageHandlerSelector
selector
ExecutorService
tpe
-
Constructor Summary
Constructors Constructor Description OverseerTaskProcessor(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String myId, Stats stats, OverseerTaskProcessor.OverseerMessageHandlerSelector selector, OverseerNodePrioritizer prioritizer, OverseerTaskQueue workQueue, DistributedMap runningMap, DistributedMap completedMap, DistributedMap failureMap, SolrMetricsContext solrMetricsContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.solr.cloud.Overseer.LeaderStatus
amILeader()
void
close()
static String
getLeaderId(org.apache.solr.common.cloud.SolrZkClient zkClient)
static String
getLeaderNode(org.apache.solr.common.cloud.SolrZkClient zkClient)
static List<String>
getSortedElectionNodes(org.apache.solr.common.cloud.SolrZkClient zk, String path)
static List<String>
getSortedOverseerNodeNames(org.apache.solr.common.cloud.SolrZkClient zk)
boolean
isClosed()
void
run()
-
-
-
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(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String myId, Stats stats, OverseerTaskProcessor.OverseerMessageHandlerSelector selector, OverseerNodePrioritizer prioritizer, OverseerTaskQueue workQueue, DistributedMap runningMap, DistributedMap completedMap, DistributedMap failureMap, SolrMetricsContext solrMetricsContext)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getSortedOverseerNodeNames
public static List<String> getSortedOverseerNodeNames(org.apache.solr.common.cloud.SolrZkClient zk) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
getSortedElectionNodes
public static List<String> getSortedElectionNodes(org.apache.solr.common.cloud.SolrZkClient zk, String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
getLeaderNode
public static String getLeaderNode(org.apache.solr.common.cloud.SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
getLeaderId
public static String getLeaderId(org.apache.solr.common.cloud.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()
-
-