Class DistributedCollectionConfigSetCommandRunner
java.lang.Object
org.apache.solr.cloud.api.collections.DistributedCollectionConfigSetCommandRunner
Class for execution Collection API and Config Set API commands in a distributed way, without
going through Overseer and
OverseerCollectionMessageHandler or OverseerConfigSetMessageHandler.
This class is only called when the Overseer is disabled, which implies cluster state updates are distributed as well.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDistributedCollectionConfigSetCommandRunner(CoreContainer coreContainer, org.apache.solr.common.cloud.SolrZkClient zkClient) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleandeleteSingleAsyncId(String asyncId) org.apache.solr.common.util.Pair<org.apache.solr.client.solrj.response.RequestStatusState, OverseerSolrResponse> getAsyncTaskRequestStatus(String asyncId) static StringgetCollectionName(org.apache.solr.common.cloud.ZkNodeProps message) Collection name can be found in either of two message parameters (why??).runCollectionCommand(org.apache.solr.common.cloud.ZkNodeProps message, org.apache.solr.common.params.CollectionParams.CollectionAction action, long timeoutMs) WhenCollectionsHandler.invokeAction(org.apache.solr.request.SolrQueryRequest, org.apache.solr.response.SolrQueryResponse, org.apache.solr.core.CoreContainer, org.apache.solr.common.params.CollectionParams.CollectionAction, org.apache.solr.handler.admin.CollectionsHandler.CollectionOperation)does not enqueue to overseer queue and instead calls this method, this method is expected to do the equivalent of what Overseer does inOverseerCollectionMessageHandler.processMessage(org.apache.solr.common.cloud.ZkNodeProps, java.lang.String).voidrunConfigSetCommand(SolrQueryResponse rsp, org.apache.solr.common.params.ConfigSetParams.ConfigSetAction action, Map<String, Object> result, long timeoutMs) WhenCollectionsHandler.invokeAction(org.apache.solr.request.SolrQueryRequest, org.apache.solr.response.SolrQueryResponse, org.apache.solr.core.CoreContainer, org.apache.solr.common.params.CollectionParams.CollectionAction, org.apache.solr.handler.admin.CollectionsHandler.CollectionOperation)does not enqueue to overseer queue and instead calls this method, this method is expected to do the equivalent of what Overseer does inOverseerConfigSetMessageHandler.processMessage(org.apache.solr.common.cloud.ZkNodeProps, java.lang.String).voidBest effort wait for termination of all tasks for a (short) while, then return.
-
Field Details
-
ZK_PATH_SEPARATOR
- See Also:
-
-
Constructor Details
-
DistributedCollectionConfigSetCommandRunner
public DistributedCollectionConfigSetCommandRunner(CoreContainer coreContainer, org.apache.solr.common.cloud.SolrZkClient zkClient)
-
-
Method Details
-
getAsyncTaskRequestStatus
public org.apache.solr.common.util.Pair<org.apache.solr.client.solrj.response.RequestStatusState,OverseerSolrResponse> getAsyncTaskRequestStatus(String asyncId) throws Exception - Throws:
Exception
-
deleteSingleAsyncId
- Throws:
Exception
-
deleteAllAsyncIds
- Throws:
Exception
-
runConfigSetCommand
public void runConfigSetCommand(SolrQueryResponse rsp, org.apache.solr.common.params.ConfigSetParams.ConfigSetAction action, Map<String, Object> result, long timeoutMs) throws ExceptionWhenCollectionsHandler.invokeAction(org.apache.solr.request.SolrQueryRequest, org.apache.solr.response.SolrQueryResponse, org.apache.solr.core.CoreContainer, org.apache.solr.common.params.CollectionParams.CollectionAction, org.apache.solr.handler.admin.CollectionsHandler.CollectionOperation)does not enqueue to overseer queue and instead calls this method, this method is expected to do the equivalent of what Overseer does inOverseerConfigSetMessageHandler.processMessage(org.apache.solr.common.cloud.ZkNodeProps, java.lang.String).The steps leading to that call in the Overseer execution path are (and the equivalent is done here):
OverseerTaskProcessor.run()gets the message from the ZK queue, grabs the corresponding locks (write lock on the config set target of the API command and a read lock on the base config set if any - the case for config set creation) then executes the command using an executor service (it also checks the asyncId if any is specified but async calls are not supported for Config Set API calls).- In
OverseerTaskProcessor.Runner.run()(run on an executor thread) a call is made toOverseerConfigSetMessageHandler.processMessage(org.apache.solr.common.cloud.ZkNodeProps, java.lang.String)which does a few checks and calls the appropriate Config Set method.
- Throws:
Exception
-
runCollectionCommand
public OverseerSolrResponse runCollectionCommand(org.apache.solr.common.cloud.ZkNodeProps message, org.apache.solr.common.params.CollectionParams.CollectionAction action, long timeoutMs) WhenCollectionsHandler.invokeAction(org.apache.solr.request.SolrQueryRequest, org.apache.solr.response.SolrQueryResponse, org.apache.solr.core.CoreContainer, org.apache.solr.common.params.CollectionParams.CollectionAction, org.apache.solr.handler.admin.CollectionsHandler.CollectionOperation)does not enqueue to overseer queue and instead calls this method, this method is expected to do the equivalent of what Overseer does inOverseerCollectionMessageHandler.processMessage(org.apache.solr.common.cloud.ZkNodeProps, java.lang.String).The steps leading to that call in the Overseer execution path are (and the equivalent is done here):
OverseerTaskProcessor.run()gets the message from the ZK queue, grabs the corresponding lock (Collection API calls do locking to prevent non compatible concurrent modifications of a collection), marks the async id of the task as running then executes the command using an executor service- In
OverseerTaskProcessor.Runner.run()(run on an executor thread) a call is made toOverseerCollectionMessageHandler.processMessage(org.apache.solr.common.cloud.ZkNodeProps, java.lang.String)which sets the logging context, callsCollApiCmds.CollectionApiCommand.call(org.apache.solr.common.cloud.ClusterState, org.apache.solr.common.cloud.ZkNodeProps, org.apache.solr.common.util.NamedList<java.lang.Object>)
-
stopAndWaitForPendingTasksToComplete
public void stopAndWaitForPendingTasksToComplete()Best effort wait for termination of all tasks for a (short) while, then return. This method is called when the JVM shuts down so tasks that did not complete are expected to be stopped mid processing. -
getCollectionName
Collection name can be found in either of two message parameters (why??). Return it from where it's defined. (see also parametercollectionNameParamNameofMutatingCommand(String))
-