Search in sources :

Example 1 with GraknPidManager

use of ai.grakn.bootup.graknengine.pid.GraknPidManager in project grakn by graknlabs.

the class Grakn method main.

/**
 * Invocation from class 'GraknProcess' in grakn-dist project
 *
 * @param args
 */
public static void main(String[] args) {
    Thread.setDefaultUncaughtExceptionHandler(newUncaughtExceptionHandler(LOG));
    try {
        String graknPidFileProperty = Optional.ofNullable(GraknSystemProperty.GRAKN_PID_FILE.value()).orElseThrow(() -> new RuntimeException(ErrorMessage.GRAKN_PIDFILE_SYSTEM_PROPERTY_UNDEFINED.getMessage()));
        Path pidfile = Paths.get(graknPidFileProperty);
        GraknPidManager graknPidManager = GraknPidManagerFactory.newGraknPidManagerForUnixOS(pidfile);
        graknPidManager.trackGraknPid();
        // Start Engine
        GraknEngineServer graknEngineServer = GraknEngineServerFactory.createGraknEngineServer();
        graknEngineServer.start();
    } catch (IOException e) {
        LOG.error(ErrorMessage.UNCAUGHT_EXCEPTION.getMessage(), e);
    }
}
Also used : Path(java.nio.file.Path) GraknEngineServer(ai.grakn.engine.GraknEngineServer) IOException(java.io.IOException) GraknPidManager(ai.grakn.bootup.graknengine.pid.GraknPidManager)

Aggregations

GraknPidManager (ai.grakn.bootup.graknengine.pid.GraknPidManager)1 GraknEngineServer (ai.grakn.engine.GraknEngineServer)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1