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);
}
}
Aggregations