use of com.alibaba.maxgraph.frontendservice.query.ZKStatementStore in project GraphScope by alibaba.
the class Frontend method initAndStartGremlinServer.
protected void initAndStartGremlinServer() throws Exception {
SchemaFetcher schemaFetcher;
String vineyardSchemaPath = this.instanceConfig.getVineyardSchemaPath();
LOG.info("Read schema from vineyard schema file " + vineyardSchemaPath);
schemaFetcher = new JsonFileSchemaFetcher(vineyardSchemaPath);
this.remoteGraph = new RemoteGraph(this, schemaFetcher);
this.remoteGraph.refresh();
this.graph = new TinkerMaxGraph(instanceConfig, remoteGraph, new DefaultGraphDfs());
this.graphGremlinServer = new MaxGraphServer(this.graph);
int tmpGremlinServerPort = instanceConfig.getGremlinServerPort() > 0 ? instanceConfig.getGremlinServerPort() : 0;
ProcessorLoader processorLoader;
switch(instanceConfig.getGremlinServerMode()) {
case TIMELY:
case MIXED:
{
processorLoader = MixedProcessorLoader.newProcessorLoader(graph, this.instanceConfig, new ExecutorAddressFetcher(clientManager), schemaFetcher, new ZKStatementStore(instanceConfig), new MaxGraphRecordProcessorManager(this.graph, this), this.getFrontendQueryManager());
break;
}
default:
{
processorLoader = GremlinProcessorLoader.newProcessorLoader();
break;
}
}
this.graphGremlinServer.start(tmpGremlinServerPort, processorLoader, instanceConfig.getInstanceAuthType() == 1);
this.gremlinServerPort = tmpGremlinServerPort > 0 ? tmpGremlinServerPort : this.graphGremlinServer.getGremlinServerPort();
LOG.info("gremlin server port:{}", this.gremlinServerPort);
}
Aggregations