use of com.alibaba.graphscope.gaia.config.GaiaConfig 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);
}
use of com.alibaba.graphscope.gaia.config.GaiaConfig in project GraphScope by alibaba.
the class GaiaGraphServer method start.
@Override
public void start(int port, ProcessorLoader processorLoader, boolean hasAuth) {
logger.info(GremlinServer.getHeader());
this.settings.port = instanceConfig.getGremlinServerPort();
this.settings.host = "0.0.0.0";
if (settings.gremlinPool == 0) {
settings.gremlinPool = Runtime.getRuntime().availableProcessors();
}
this.server = new GremlinServer(settings);
loadProcessor(gaiaConfig, broadcastProcessor, storeService);
// bind g to traversal source
Graph traversalGraph = TraversalSourceGraph.open(new BaseConfiguration());
ServerGremlinExecutor serverGremlinExecutor = PlanUtils.getServerGremlinExecutor(this.server);
serverGremlinExecutor.getGraphManager().putGraph("graph", traversalGraph);
serverGremlinExecutor.getGraphManager().putTraversalSource("g", traversalGraph.traversal());
Bindings globalBindings = PlanUtils.getGlobalBindings(server.getServerGremlinExecutor().getGremlinExecutor());
globalBindings.put("graph", traversalGraph);
globalBindings.put("g", traversalGraph.traversal());
// start gremlin server
try {
server.start().exceptionally(t -> {
logger.error("Gremlin Server was unable to start and will now begin" + " shutdown {}", t);
server.stop().join();
return null;
}).join();
} catch (Exception e) {
throw new RuntimeException(e);
}
logger.info("Gremlin Server started....");
}
use of com.alibaba.graphscope.gaia.config.GaiaConfig 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();
}
use of com.alibaba.graphscope.gaia.config.GaiaConfig in project GraphScope by alibaba.
the class GaiaGraphServer method start.
@Override
public void start() {
this.loadSettings();
logger.info(GremlinServer.getHeader());
this.settings.port = GremlinConfig.GREMLIN_PORT.get(this.configs);
this.settings.host = "0.0.0.0";
if (settings.gremlinPool == 0) {
settings.gremlinPool = Runtime.getRuntime().availableProcessors();
}
settings.writeBufferHighWaterMark = GremlinConfig.SERVER_WRITE_BUFFER_HIGH_WATER.get(this.configs);
settings.writeBufferLowWaterMark = GremlinConfig.SERVER_WRITE_BUFFER_LOW_WATER.get(this.configs);
this.server = new GremlinServer(settings);
loadProcessor(gaiaConfig, broadcastProcessor, storeService);
// bind g to traversal source
Graph traversalGraph = TraversalSourceGraph.open(new BaseConfiguration());
ServerGremlinExecutor serverGremlinExecutor = PlanUtils.getServerGremlinExecutor(this.server);
serverGremlinExecutor.getGraphManager().putGraph("graph", traversalGraph);
serverGremlinExecutor.getGraphManager().putTraversalSource("g", traversalGraph.traversal());
Bindings globalBindings = PlanUtils.getGlobalBindings(server.getServerGremlinExecutor().getGremlinExecutor());
globalBindings.put("graph", traversalGraph);
globalBindings.put("g", traversalGraph.traversal());
// start gremlin server
try {
server.start().exceptionally(t -> {
logger.error("Gremlin Server was unable to start and will now begin" + " shutdown {}", t);
server.stop().join();
return null;
}).join();
} catch (Exception e) {
throw new RuntimeException(e);
}
logger.info("Gremlin Server started....");
}
Aggregations