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
AOverseerMessageHandler
that handles Collections API related overseer messages.A lot of the content that was in this class got moved to
CollectionHandlingUtils
andCollApiCmds
.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
Constructors Constructor Description OverseerCollectionMessageHandler(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String myId, HttpShardHandlerFactory shardHandlerFactory, String adminPath, Stats stats, Overseer overseer, OverseerNodePrioritizer overseerPrioritizer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
String
getName()
String
getTaskKey(org.apache.solr.common.cloud.ZkNodeProps message)
String
getTimerName(String operation)
boolean
isClosed()
OverseerMessageHandler.Lock
lockTask(org.apache.solr.common.cloud.ZkNodeProps message, long batchSessionId)
Grabs an exclusive lock for this particular task.OverseerSolrResponse
processMessage(org.apache.solr.common.cloud.ZkNodeProps message, String operation)
-
-
-
Constructor Detail
-
OverseerCollectionMessageHandler
public OverseerCollectionMessageHandler(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String myId, HttpShardHandlerFactory shardHandlerFactory, String adminPath, Stats stats, Overseer overseer, OverseerNodePrioritizer overseerPrioritizer)
-
-
Method Detail
-
processMessage
public OverseerSolrResponse processMessage(org.apache.solr.common.cloud.ZkNodeProps message, String operation)
- Specified by:
processMessage
in interfaceOverseerMessageHandler
- Parameters:
message
- the message to processoperation
- the operation to process- Returns:
- response
-
getName
public String getName()
- Specified by:
getName
in interfaceOverseerMessageHandler
- Returns:
- the name of the OverseerMessageHandler
-
getTimerName
public String getTimerName(String operation)
- Specified by:
getTimerName
in interfaceOverseerMessageHandler
- Parameters:
operation
- the operation to be timed- Returns:
- the name of the timer to use for the operation
-
getTaskKey
public String getTaskKey(org.apache.solr.common.cloud.ZkNodeProps message)
- Specified by:
getTaskKey
in 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:
lockTask
in interfaceOverseerMessageHandler
- Returns:
null
if 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
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfaceorg.apache.solr.common.SolrCloseable
-
-