Search in sources :

Example 1 with JsonFileSchemaFetcher

use of com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher in project GraphScope by alibaba.

the class Frontend method initAndStartGremlinServer.

@Override
protected void initAndStartGremlinServer() throws Exception {
    SchemaFetcher schemaFetcher;
    String vineyardSchemaPath = this.instanceConfig.getVineyardSchemaPath();
    logger.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());
    // add gaia compiler
    AsyncRpcChannelFetcher gaiaRpcFetcher = new AddressChannelFetcher(new ExecutorAddressFetcher(this.clientManager));
    GraphStoreService gaiaStoreService = new VineyardGraphStore(schemaFetcher);
    AbstractBroadcastProcessor broadcastProcessor = new AsyncRpcBroadcastProcessor(gaiaRpcFetcher);
    gaiaGraphServer = new GaiaGraphServer(this.graph, instanceConfig, gaiaStoreService, broadcastProcessor, new VineyardConfig(instanceConfig));
    gaiaGraphServer.start(0, null, false);
    this.gremlinServerPort = gaiaGraphServer.getGremlinServerPort();
}
Also used : SchemaFetcher(com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher) JsonFileSchemaFetcher(com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher) RemoteGraph(com.alibaba.maxgraph.frontendservice.RemoteGraph) AbstractBroadcastProcessor(com.alibaba.graphscope.gaia.broadcast.AbstractBroadcastProcessor) AsyncRpcChannelFetcher(com.alibaba.graphscope.gaia.broadcast.channel.AsyncRpcChannelFetcher) ExecutorAddressFetcher(com.alibaba.maxgraph.frontendservice.server.ExecutorAddressFetcher) DefaultGraphDfs(com.alibaba.maxgraph.compiler.dfs.DefaultGraphDfs) AsyncRpcBroadcastProcessor(com.alibaba.graphscope.gaia.broadcast.AsyncRpcBroadcastProcessor) JsonFileSchemaFetcher(com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher) TinkerMaxGraph(com.alibaba.maxgraph.structure.graph.TinkerMaxGraph) GraphStoreService(com.alibaba.graphscope.gaia.store.GraphStoreService)

Example 2 with JsonFileSchemaFetcher

use of com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher 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)

Example 3 with JsonFileSchemaFetcher

use of com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher in project GraphScope by alibaba.

the class Frontend method initAndStartGremlinServer.

@Override
protected void initAndStartGremlinServer() throws Exception {
    SchemaFetcher schemaFetcher;
    String vineyardSchemaPath = this.instanceConfig.getVineyardSchemaPath();
    logger.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());
    // add ir compiler
    Configs configs = getConfigs(this.instanceConfig);
    IrMetaFetcher irMetaFetcher = getStoreConfigs(this.instanceConfig);
    RpcAddressFetcher addressFetcher = new ExecutorAddressFetcher(this.clientManager);
    RpcChannelFetcher channelFetcher = new RpcAddressChannelFetcher(addressFetcher);
    this.gremlinServer = new IrGremlinServer(this.instanceConfig.getGremlinServerPort());
    this.gremlinServer.start(configs, irMetaFetcher, channelFetcher, new IrMetaQueryCallback(irMetaFetcher), TestGraphFactory.VINEYARD);
    this.gremlinServerPort = gremlinServer.getGremlinServerPort();
}
Also used : SchemaFetcher(com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher) JsonFileSchemaFetcher(com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher) RemoteGraph(com.alibaba.maxgraph.frontendservice.RemoteGraph) ExecutorAddressFetcher(com.alibaba.maxgraph.frontendservice.server.ExecutorAddressFetcher) IrGremlinServer(com.alibaba.graphscope.gremlin.service.IrGremlinServer) DefaultGraphDfs(com.alibaba.maxgraph.compiler.dfs.DefaultGraphDfs) RpcChannelFetcher(com.alibaba.graphscope.common.client.RpcChannelFetcher) JsonFileSchemaFetcher(com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher) RpcAddressFetcher(com.alibaba.maxgraph.common.rpc.RpcAddressFetcher) TinkerMaxGraph(com.alibaba.maxgraph.structure.graph.TinkerMaxGraph) IrMetaFetcher(com.alibaba.graphscope.common.store.IrMetaFetcher) IrMetaQueryCallback(com.alibaba.graphscope.common.manager.IrMetaQueryCallback) Configs(com.alibaba.graphscope.common.config.Configs)

Aggregations

SchemaFetcher (com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher)3 DefaultGraphDfs (com.alibaba.maxgraph.compiler.dfs.DefaultGraphDfs)3 JsonFileSchemaFetcher (com.alibaba.maxgraph.compiler.schema.JsonFileSchemaFetcher)3 ExecutorAddressFetcher (com.alibaba.maxgraph.frontendservice.server.ExecutorAddressFetcher)3 TinkerMaxGraph (com.alibaba.maxgraph.structure.graph.TinkerMaxGraph)3 RemoteGraph (com.alibaba.maxgraph.frontendservice.RemoteGraph)2 RpcChannelFetcher (com.alibaba.graphscope.common.client.RpcChannelFetcher)1 Configs (com.alibaba.graphscope.common.config.Configs)1 IrMetaQueryCallback (com.alibaba.graphscope.common.manager.IrMetaQueryCallback)1 IrMetaFetcher (com.alibaba.graphscope.common.store.IrMetaFetcher)1 AbstractBroadcastProcessor (com.alibaba.graphscope.gaia.broadcast.AbstractBroadcastProcessor)1 AsyncRpcBroadcastProcessor (com.alibaba.graphscope.gaia.broadcast.AsyncRpcBroadcastProcessor)1 AsyncRpcChannelFetcher (com.alibaba.graphscope.gaia.broadcast.channel.AsyncRpcChannelFetcher)1 GraphStoreService (com.alibaba.graphscope.gaia.store.GraphStoreService)1 IrGremlinServer (com.alibaba.graphscope.gremlin.service.IrGremlinServer)1 RpcAddressFetcher (com.alibaba.maxgraph.common.rpc.RpcAddressFetcher)1 ZKStatementStore (com.alibaba.maxgraph.frontendservice.query.ZKStatementStore)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