use of org.apache.tinkerpop.gremlin.server.GraphManager in project janusgraph by JanusGraph.
the class JanusGraphHttpChannelizer method init.
@Override
public void init(final ServerGremlinExecutor serverGremlinExecutor) {
this.serverGremlinExecutor = serverGremlinExecutor;
super.init(serverGremlinExecutor);
final GraphManager graphManager = serverGremlinExecutor.getGraphManager();
Preconditions.checkArgument(graphManager instanceof JanusGraphManager, "Must use JanusGraphManager with a JanusGraphChannelizer.");
((JanusGraphManager) graphManager).configureGremlinExecutor(serverGremlinExecutor.getGremlinExecutor());
}
use of org.apache.tinkerpop.gremlin.server.GraphManager in project janusgraph by JanusGraph.
the class JanusGraphServer method start.
public synchronized CompletableFuture<Void> start() {
if (serverStarted != null) {
return serverStarted;
}
serverStarted = new CompletableFuture<>();
try {
logger.info("Configuring JanusGraph Server from {}", confPath);
janusGraphSettings = JanusGraphSettings.read(confPath);
gremlinServer = new GremlinServer(janusGraphSettings);
CompletableFuture<Void> grpcServerFuture = CompletableFuture.completedFuture(null);
if (janusGraphSettings.getGrpcServer().isEnabled()) {
grpcServerFuture = CompletableFuture.runAsync(() -> {
GraphManager graphManager = gremlinServer.getServerGremlinExecutor().getGraphManager();
grpcServer = createGrpcServer(janusGraphSettings, graphManager);
try {
grpcServer.start();
} catch (IOException e) {
throw new IllegalStateException(e);
}
});
}
CompletableFuture<Void> gremlinServerFuture = gremlinServer.start().thenAcceptAsync(JanusGraphServer::configure);
serverStarted = CompletableFuture.allOf(gremlinServerFuture, grpcServerFuture);
} catch (Exception ex) {
serverStarted.completeExceptionally(ex);
}
return serverStarted;
}
Aggregations