java.lang.Object
org.elasticsearch.node.ShutdownPrepareService
This class was created to extract out the logic from
Node.prepareForClose() to facilitate testing.
Invokes hooks to prepare this node to be closed. This should be called when Elasticsearch receives a request to shut down gracefully from the underlying operating system, before system resources are closed.
Note that this class is part of infrastructure to react to signals from the operating system - most graceful shutdown
logic should use Node Shutdown, see NodesShutdownMetadata.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionShutdownPrepareService(Settings settings, HttpServerTransport httpServerTransport, TaskManager taskManager, TerminationHandler terminationHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddShutdownHook(String name, Runnable action) booleanvoidInvokes hooks to prepare this node to be closed.
-
Field Details
-
MAXIMUM_SHUTDOWN_TIMEOUT_SETTING
-
MAXIMUM_REINDEXING_TIMEOUT_SETTING
-
-
Constructor Details
-
ShutdownPrepareService
public ShutdownPrepareService(Settings settings, HttpServerTransport httpServerTransport, TaskManager taskManager, TerminationHandler terminationHandler)
-
-
Method Details
-
addShutdownHook
-
isShuttingDown
public boolean isShuttingDown() -
prepareForShutdown
public void prepareForShutdown()Invokes hooks to prepare this node to be closed. This should be called when Elasticsearch receives a request to shut down gracefully from the underlying operating system, before system resources are closed. This method will block until the node is ready to shut down.Note that this class is part of infrastructure to react to signals from the operating system - most graceful shutdown logic should use Node Shutdown, see
NodesShutdownMetadata.
-