Search in sources :

Example 1 with SnapshotUpdateCommitter

use of com.alibaba.graphscope.groot.frontend.SnapshotUpdateCommitter in project GraphScope by alibaba.

the class IrServiceProducer method makeGraphService.

@Override
public AbstractService makeGraphService(SchemaFetcher schemaFetcher, ChannelManager channelManager) {
    int executorCount = CommonConfig.STORE_NODE_COUNT.get(configs);
    RpcChannelFetcher channelFetcher = new RpcChannelManagerFetcher(channelManager, executorCount, RoleType.GAIA_RPC);
    com.alibaba.graphscope.common.config.Configs irConfigs = getConfigs();
    IrMetaFetcher irMetaFetcher = new GrootMetaFetcher(schemaFetcher);
    SnapshotUpdateCommitter updateCommitter = new SnapshotUpdateCommitter(channelManager);
    int frontendId = CommonConfig.NODE_IDX.get(configs);
    FrontendQueryManager queryManager = new FrontendQueryManager(irMetaFetcher, frontendId, updateCommitter);
    return new AbstractService() {

        private IrGremlinServer irGremlinServer = new IrGremlinServer(GremlinConfig.GREMLIN_PORT.get(configs));

        @Override
        public void start() {
            try {
                irGremlinServer.start(irConfigs, irMetaFetcher, channelFetcher, queryManager, TestGraphFactory.GROOT);
                queryManager.start();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        @Override
        public void stop() {
            try {
                irGremlinServer.close();
                queryManager.stop();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    };
}
Also used : AbstractService(com.alibaba.maxgraph.servers.AbstractService) IrGremlinServer(com.alibaba.graphscope.gremlin.service.IrGremlinServer) RpcChannelFetcher(com.alibaba.graphscope.common.client.RpcChannelFetcher) IrMetaFetcher(com.alibaba.graphscope.common.store.IrMetaFetcher) SnapshotUpdateCommitter(com.alibaba.graphscope.groot.frontend.SnapshotUpdateCommitter)

Aggregations

RpcChannelFetcher (com.alibaba.graphscope.common.client.RpcChannelFetcher)1 IrMetaFetcher (com.alibaba.graphscope.common.store.IrMetaFetcher)1 IrGremlinServer (com.alibaba.graphscope.gremlin.service.IrGremlinServer)1 SnapshotUpdateCommitter (com.alibaba.graphscope.groot.frontend.SnapshotUpdateCommitter)1 AbstractService (com.alibaba.maxgraph.servers.AbstractService)1