4.13.2.1 Starting and Stopping the PGX Engine
You can start the graph server (PGX ) from the application by making a call to
instance.startEngine()
which takes a JSON object as an argument for PGX
configuration.
Note:
- See Connecting with Java for more information about connecting to a graph server (PGX) instance
and obtaining a
ServerInstance
object. - See Configuration Parameters for the Graph Server (PGX) Engine for the various configuration options for the graph server (PGX).
Stopping the PGX Engine
You can stop the PGX engine using one of the following APIs:
instance.shutdownEngineNow(); // cancels pending tasks, throws exception if engine is not running
instance.shutdownEngineNowIfRunning(); // cancels pending tasks, only tries to shut down if engine is running
if (instance.shutdownEngine(30, TimeUnit.SECONDS) == false) {
// doesn't accept new tasks but finishes up remaining tasks
// pending tasks didn't finish after 30 seconds
}
Note:
Shutting down the PGX engine keeps the Apache Tomcat server alive, but new sessions cannot be created. Also, all the current sessions and tasks will be cancelled and terminated.Parent topic: Connecting with Java