Search in sources :

Example 1 with MaxGraphRecordProcessorManager

use of com.alibaba.maxgraph.frontendservice.server.manager.MaxGraphRecordProcessorManager 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);
}
Also used : ZKStatementStore(com.alibaba.maxgraph.frontendservice.query.ZKStatementStore) JsonFileSchemaFetcher(com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher) SchemaFetcher(com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher) JsonFileSchemaFetcher(com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher) TinkerMaxGraph(com.alibaba.maxgraph.structure.graph.TinkerMaxGraph) MixedProcessorLoader(com.alibaba.maxgraph.server.processor.MixedProcessorLoader) GremlinProcessorLoader(com.alibaba.maxgraph.server.GremlinProcessorLoader) ProcessorLoader(com.alibaba.maxgraph.server.ProcessorLoader) MaxGraphRecordProcessorManager(com.alibaba.maxgraph.frontendservice.server.manager.MaxGraphRecordProcessorManager) ExecutorAddressFetcher(com.alibaba.maxgraph.frontendservice.server.ExecutorAddressFetcher) MaxGraphServer(com.alibaba.maxgraph.server.MaxGraphServer) Endpoint(com.alibaba.maxgraph.sdkcommon.client.Endpoint) DefaultGraphDfs(com.alibaba.maxgraph.compiler.dfs.DefaultGraphDfs)

Aggregations

SchemaFetcher (com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher)1 DefaultGraphDfs (com.alibaba.maxgraph.compiler.dfs.DefaultGraphDfs)1 JsonFileSchemaFetcher (com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher)1 ZKStatementStore (com.alibaba.maxgraph.frontendservice.query.ZKStatementStore)1 ExecutorAddressFetcher (com.alibaba.maxgraph.frontendservice.server.ExecutorAddressFetcher)1 MaxGraphRecordProcessorManager (com.alibaba.maxgraph.frontendservice.server.manager.MaxGraphRecordProcessorManager)1 Endpoint (com.alibaba.maxgraph.sdkcommon.client.Endpoint)1 GremlinProcessorLoader (com.alibaba.maxgraph.server.GremlinProcessorLoader)1 MaxGraphServer (com.alibaba.maxgraph.server.MaxGraphServer)1 ProcessorLoader (com.alibaba.maxgraph.server.ProcessorLoader)1 MixedProcessorLoader (com.alibaba.maxgraph.server.processor.MixedProcessorLoader)1 TinkerMaxGraph (com.alibaba.maxgraph.structure.graph.TinkerMaxGraph)1