use of com.alibaba.maxgraph.common.cluster.InstanceConfig in project GraphScope by alibaba.
the class CoordinatorMain method main.
/**
* Start Coordinator service through arguments;
*
* @throws Exception
*/
public static void main(String[] args) throws Exception {
InstanceConfig instanceConfig = CommonUtil.getInstanceConfig(args, 0);
System.setProperty(InstanceConfig.JUTE_MAXBUFFER, instanceConfig.getJuteMaxbuffer());
Coordinator coordinator = new Coordinator(instanceConfig);
coordinator.start();
CountDownLatch shutdown = new CountDownLatch(1);
coordinator.waitShutdown(shutdown);
}
use of com.alibaba.maxgraph.common.cluster.InstanceConfig in project GraphScope by alibaba.
the class CommonUtil method getInstanceConfig.
public static InstanceConfig getInstanceConfig(String[] args, int serverId) throws IOException {
Map<String, String> params = getConfigFromSystemEnv();
if (params != null && !params.isEmpty()) {
LOG.info("read configs from system env:{}", params);
return new InstanceConfig(params);
}
InstanceConfig config;
if (args != null && args.length > 0) {
Properties properties = PropertyUtil.getProperties(args[0], false);
config = new InstanceConfig(properties);
} else {
String confPath = new File("").getCanonicalPath() + "/interactive_engine/src/assembly/conf/standalone.properties";
Properties properties = PropertyUtil.getProperties(confPath, false);
config = new InstanceConfig(properties);
}
config.set(InstanceConfig.SERVER_ID, serverId);
if (args != null && args.length > 2) {
String uniqueGraphName = args[2];
config.set(InstanceConfig.GRAPH_NAME, uniqueGraphName);
}
return config;
}
use of com.alibaba.maxgraph.common.cluster.InstanceConfig in project GraphScope by alibaba.
the class ServerDataApiClient method main.
public static void main(String[] args) throws Exception {
InstanceConfig instanceConfig = CommonUtil.getInstanceConfig(args, 0);
ServerDataApiClient client = new ServerDataApiClient(instanceConfig);
client.start();
try {
AllMetricsInfoResp allRealTimeMetrics = client.getAllRealTimeMetrics(Request.newBuilder().build());
System.out.println(allRealTimeMetrics.getInfoList());
} catch (StatusRuntimeException e) {
System.out.println(e.getStatus());
}
client.close();
}
use of com.alibaba.maxgraph.common.cluster.InstanceConfig in project GraphScope by alibaba.
the class MaxGraphServiceProducer method makeGraphService.
@Override
public AbstractService makeGraphService(SchemaFetcher schemaFetcher, ChannelManager channelManager, NodeDiscovery discovery, GraphWriter graphWriter, WriteSessionGenerator writeSessionGenerator, MetaService metaService) {
MaxGraphImpl maxGraphImpl = new MaxGraphImpl(discovery, schemaFetcher, graphWriter, writeSessionGenerator, metaService);
TinkerMaxGraph graph = new TinkerMaxGraph(new InstanceConfig(configs.getInnerProperties()), maxGraphImpl, new DefaultGraphDfs());
return new ReadOnlyGraphServer(configs, graph, schemaFetcher, new DiscoveryAddressFetcher(discovery));
}
Aggregations