Class OverseerCollectionMessageHandler
java.lang.Object
org.apache.solr.cloud.api.collections.OverseerCollectionMessageHandler
- All Implemented Interfaces:
Closeable,AutoCloseable,OverseerMessageHandler,org.apache.solr.common.SolrCloseable
public class OverseerCollectionMessageHandler
extends Object
implements OverseerMessageHandler, org.apache.solr.common.SolrCloseable
A
OverseerMessageHandler that handles Collections API related overseer messages.
A lot of the content that was in this class got moved to CollectionHandlingUtils and
CollApiCmds.
The equivalent of this class for distributed Collection API command execution is DistributedCollectionConfigSetCommandRunner.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.solr.cloud.OverseerMessageHandler
OverseerMessageHandler.Lock -
Constructor Summary
ConstructorsConstructorDescriptionOverseerCollectionMessageHandler(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String myId, HttpShardHandlerFactory shardHandlerFactory, String adminPath, Stats stats, Overseer overseer, OverseerNodePrioritizer overseerPrioritizer) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getName()getTaskKey(org.apache.solr.common.cloud.ZkNodeProps message) getTimerName(String operation) booleanisClosed()lockTask(org.apache.solr.common.cloud.ZkNodeProps message, long batchSessionId) Grabs an exclusive lock for this particular task.processMessage(org.apache.solr.common.cloud.ZkNodeProps message, String operation)
-
Constructor Details
-
OverseerCollectionMessageHandler
public OverseerCollectionMessageHandler(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String myId, HttpShardHandlerFactory shardHandlerFactory, String adminPath, Stats stats, Overseer overseer, OverseerNodePrioritizer overseerPrioritizer)
-
-
Method Details
-
processMessage
public OverseerSolrResponse processMessage(org.apache.solr.common.cloud.ZkNodeProps message, String operation) - Specified by:
processMessagein interfaceOverseerMessageHandler- Parameters:
message- the message to processoperation- the operation to process- Returns:
- response
-
getName
- Specified by:
getNamein interfaceOverseerMessageHandler- Returns:
- the name of the OverseerMessageHandler
-
getTimerName
- Specified by:
getTimerNamein interfaceOverseerMessageHandler- Parameters:
operation- the operation to be timed- Returns:
- the name of the timer to use for the operation
-
getTaskKey
- Specified by:
getTaskKeyin interfaceOverseerMessageHandler- Parameters:
message- the message being processed- Returns:
- the taskKey for the message for handling task exclusivity
-
lockTask
public OverseerMessageHandler.Lock lockTask(org.apache.solr.common.cloud.ZkNodeProps message, long batchSessionId) Grabs an exclusive lock for this particular task.- Specified by:
lockTaskin interfaceOverseerMessageHandler- Returns:
nullif locking is not possible. When locking is not possible, it will remain impossible for the passed value ofbatchSessionId. This is to guarantee tasks are executed in queue order (and a later task is not run earlier than its turn just because it happens that a lock got released).
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceorg.apache.solr.common.SolrCloseable
-