Module org.elasticsearch.xcore
Class AbstractTransportSetUpgradeModeAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<SetUpgradeModeActionRequest,AcknowledgedResponse>
org.elasticsearch.action.support.HandledTransportAction<SetUpgradeModeActionRequest,AcknowledgedResponse>
org.elasticsearch.action.support.master.TransportMasterNodeAction<SetUpgradeModeActionRequest,AcknowledgedResponse>
org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAction<SetUpgradeModeActionRequest>
org.elasticsearch.xpack.core.action.AbstractTransportSetUpgradeModeAction
- All Implemented Interfaces:
ActionWithReservedState<SetUpgradeModeActionRequest>
public abstract class AbstractTransportSetUpgradeModeAction
extends AcknowledgedTransportMasterNodeAction<SetUpgradeModeActionRequest>
-
Field Summary
Fields inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
clusterService, executor, threadPool, transportServiceFields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTransportSetUpgradeModeAction(String actionName, String taskQueuePrefix, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected ClusterBlockExceptioncheckBlock(SetUpgradeModeActionRequest request, ClusterState state) protected abstract ClusterStatecreateUpdatedState(SetUpgradeModeActionRequest request, ClusterState state) This is called from the ClusterState updater and is expected to return quickly.protected abstract StringDefine the feature name, used in log messages and naming the task on the task queue.protected voidmasterOperation(Task task, SetUpgradeModeActionRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener) protected abstract booleanupgradeMode(ClusterState state) Parse the ClusterState for the implementation'sMetadata.Customand find the upgradeMode boolean stored there.protected abstract voidupgradeModeSuccessfullyChanged(Task task, SetUpgradeModeActionRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener) This method is only called when the cluster state was successfully changed.Methods inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
doExecute, localExecuteMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, executeDirect, localOnlyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.reservedstate.ActionWithReservedState
modifiedKeys, reservedStateHandlerName, validateForReservedState
-
Constructor Details
-
AbstractTransportSetUpgradeModeAction
public AbstractTransportSetUpgradeModeAction(String actionName, String taskQueuePrefix, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Details
-
masterOperation
protected void masterOperation(Task task, SetUpgradeModeActionRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener) throws Exception - Specified by:
masterOperationin classTransportMasterNodeAction<SetUpgradeModeActionRequest,AcknowledgedResponse> - Throws:
Exception
-
featureName
Define the feature name, used in log messages and naming the task on the task queue. -
upgradeMode
Parse the ClusterState for the implementation'sMetadata.Customand find the upgradeMode boolean stored there. We will compare this boolean with the request's desired state to determine if we should change the metadata. -
createUpdatedState
protected abstract ClusterState createUpdatedState(SetUpgradeModeActionRequest request, ClusterState state) This is called from the ClusterState updater and is expected to return quickly. -
upgradeModeSuccessfullyChanged
protected abstract void upgradeModeSuccessfullyChanged(Task task, SetUpgradeModeActionRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener) This method is only called when the cluster state was successfully changed. If we failed to update for any reason, this will not be called. The ClusterState param is the previous ClusterState before we called update. -
checkBlock
- Specified by:
checkBlockin classTransportMasterNodeAction<SetUpgradeModeActionRequest,AcknowledgedResponse>
-