Search in sources :

Example 1 with GraphStoreService

use of com.alibaba.graphscope.gaia.store.GraphStoreService in project GraphScope by alibaba.

the class QueryTest method main.

public static void main(String[] args) {
    GaiaConfig config = new ExperimentalGaiaConfig("conf");
    GraphStoreService graphStore = new ExperimentalGraphStore(config);
    IdMaker queryIdMaker = new IncrementalQueryIdMaker();
    test_CR_1_1(config, graphStore, queryIdMaker);
    test_CR_1_2(config, graphStore, queryIdMaker);
    test_CR_2(config, graphStore, queryIdMaker);
    test_CR_3_1(config, graphStore, queryIdMaker);
    test_CR_3_2(config, graphStore, queryIdMaker);
    test_CR_5(config, graphStore, queryIdMaker);
    test_CR_6(config, graphStore, queryIdMaker);
    test_CR_7(config, graphStore, queryIdMaker);
    test_CR_8(config, graphStore, queryIdMaker);
    test_CR_9(config, graphStore, queryIdMaker);
    test_CR_11(config, graphStore, queryIdMaker);
    test_CR_12(config, graphStore, queryIdMaker);
}
Also used : IncrementalQueryIdMaker(com.alibaba.graphscope.gaia.idmaker.IncrementalQueryIdMaker) ExperimentalGraphStore(com.alibaba.graphscope.gaia.store.ExperimentalGraphStore) GraphStoreService(com.alibaba.graphscope.gaia.store.GraphStoreService) GaiaConfig(com.alibaba.graphscope.gaia.config.GaiaConfig) ExperimentalGaiaConfig(com.alibaba.graphscope.gaia.config.ExperimentalGaiaConfig) ExperimentalGaiaConfig(com.alibaba.graphscope.gaia.config.ExperimentalGaiaConfig) IdMaker(com.alibaba.graphscope.gaia.idmaker.IdMaker) TagIdMaker(com.alibaba.graphscope.gaia.idmaker.TagIdMaker) IncrementalQueryIdMaker(com.alibaba.graphscope.gaia.idmaker.IncrementalQueryIdMaker)

Example 2 with GraphStoreService

use of com.alibaba.graphscope.gaia.store.GraphStoreService 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 3 with GraphStoreService

use of com.alibaba.graphscope.gaia.store.GraphStoreService in project GraphScope by alibaba.

the class GremlinServiceMain method main.

public static void main(String[] args) throws Exception {
    logger.info("start server");
    Settings settings = load();
    GremlinServer server = new GremlinServer(settings);
    // create graph
    GaiaConfig gaiaConfig = new ExperimentalGaiaConfig("conf");
    GraphStoreService storeService = new ExperimentalGraphStore(gaiaConfig);
    GaiaProcessorLoader.load(gaiaConfig, storeService);
    // set global variables
    Graph traversalGraph = server.getServerGremlinExecutor().getGraphManager().getGraph("graph");
    GlobalEngineConf.setGlobalVariables(traversalGraph.variables());
    // bind g to traversal source
    Bindings globalBindings = PlanUtils.getGlobalBindings(server.getServerGremlinExecutor().getGremlinExecutor());
    globalBindings.put("g", traversalGraph.traversal());
    // start gremlin server
    server.start().exceptionally(t -> {
        logger.error("Gremlin Server was unable to start and will now begin shutdown" + " {}", t);
        server.stop().join();
        return null;
    }).join();
}
Also used : Logger(org.slf4j.Logger) Bindings(javax.script.Bindings) GaiaConfig(com.alibaba.graphscope.gaia.config.GaiaConfig) GremlinServer(org.apache.tinkerpop.gremlin.server.GremlinServer) ExperimentalGraphStore(com.alibaba.graphscope.gaia.store.ExperimentalGraphStore) Settings(org.apache.tinkerpop.gremlin.server.Settings) GaiaProcessorLoader(com.alibaba.graphscope.gaia.processor.GaiaProcessorLoader) Graph(org.apache.tinkerpop.gremlin.structure.Graph) PlanUtils(com.alibaba.graphscope.gaia.plan.PlanUtils) LoggerFactory(org.slf4j.LoggerFactory) ExperimentalGaiaConfig(com.alibaba.graphscope.gaia.config.ExperimentalGaiaConfig) GraphStoreService(com.alibaba.graphscope.gaia.store.GraphStoreService) GremlinServer(org.apache.tinkerpop.gremlin.server.GremlinServer) Graph(org.apache.tinkerpop.gremlin.structure.Graph) ExperimentalGraphStore(com.alibaba.graphscope.gaia.store.ExperimentalGraphStore) GraphStoreService(com.alibaba.graphscope.gaia.store.GraphStoreService) GaiaConfig(com.alibaba.graphscope.gaia.config.GaiaConfig) ExperimentalGaiaConfig(com.alibaba.graphscope.gaia.config.ExperimentalGaiaConfig) Bindings(javax.script.Bindings) Settings(org.apache.tinkerpop.gremlin.server.Settings) ExperimentalGaiaConfig(com.alibaba.graphscope.gaia.config.ExperimentalGaiaConfig)

Example 4 with GraphStoreService

use of com.alibaba.graphscope.gaia.store.GraphStoreService in project GraphScope by alibaba.

the class GaiaServiceProducer method makeGraphService.

@Override
public AbstractService makeGraphService(SchemaFetcher schemaFetcher, ChannelManager channelManager) {
    int executorCount = CommonConfig.STORE_NODE_COUNT.get(this.configs);
    AsyncRpcChannelFetcher gaiaRpcFetcher = new ChannelManagerFetcher(channelManager, executorCount, RoleType.GAIA_RPC);
    GraphStoreService gaiaStoreService = new MaxGraphStore(schemaFetcher);
    return new GaiaGraphServer(configs, gaiaStoreService, new AsyncRpcBroadcastProcessor(gaiaRpcFetcher), new MaxGraphConfig(configs));
}
Also used : AsyncRpcBroadcastProcessor(com.alibaba.graphscope.gaia.broadcast.AsyncRpcBroadcastProcessor) GraphStoreService(com.alibaba.graphscope.gaia.store.GraphStoreService) AsyncRpcChannelFetcher(com.alibaba.graphscope.gaia.broadcast.channel.AsyncRpcChannelFetcher)

Aggregations

GraphStoreService (com.alibaba.graphscope.gaia.store.GraphStoreService)4 AsyncRpcBroadcastProcessor (com.alibaba.graphscope.gaia.broadcast.AsyncRpcBroadcastProcessor)2 AsyncRpcChannelFetcher (com.alibaba.graphscope.gaia.broadcast.channel.AsyncRpcChannelFetcher)2 ExperimentalGaiaConfig (com.alibaba.graphscope.gaia.config.ExperimentalGaiaConfig)2 GaiaConfig (com.alibaba.graphscope.gaia.config.GaiaConfig)2 ExperimentalGraphStore (com.alibaba.graphscope.gaia.store.ExperimentalGraphStore)2 AbstractBroadcastProcessor (com.alibaba.graphscope.gaia.broadcast.AbstractBroadcastProcessor)1 IdMaker (com.alibaba.graphscope.gaia.idmaker.IdMaker)1 IncrementalQueryIdMaker (com.alibaba.graphscope.gaia.idmaker.IncrementalQueryIdMaker)1 TagIdMaker (com.alibaba.graphscope.gaia.idmaker.TagIdMaker)1 PlanUtils (com.alibaba.graphscope.gaia.plan.PlanUtils)1 GaiaProcessorLoader (com.alibaba.graphscope.gaia.processor.GaiaProcessorLoader)1 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 RemoteGraph (com.alibaba.maxgraph.frontendservice.RemoteGraph)1 ExecutorAddressFetcher (com.alibaba.maxgraph.frontendservice.server.ExecutorAddressFetcher)1 TinkerMaxGraph (com.alibaba.maxgraph.structure.graph.TinkerMaxGraph)1 Bindings (javax.script.Bindings)1 GremlinServer (org.apache.tinkerpop.gremlin.server.GremlinServer)1