Search in sources :

Example 1 with InstanceConfig

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);
}
Also used : InstanceConfig(com.alibaba.maxgraph.common.cluster.InstanceConfig) CountDownLatch(java.util.concurrent.CountDownLatch)

Example 2 with InstanceConfig

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;
}
Also used : InstanceConfig(com.alibaba.maxgraph.common.cluster.InstanceConfig) Properties(java.util.Properties) File(java.io.File)

Example 3 with InstanceConfig

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();
}
Also used : InstanceConfig(com.alibaba.maxgraph.common.cluster.InstanceConfig) StatusRuntimeException(io.grpc.StatusRuntimeException)

Example 4 with InstanceConfig

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));
}
Also used : InstanceConfig(com.alibaba.maxgraph.common.cluster.InstanceConfig) TinkerMaxGraph(com.alibaba.maxgraph.structure.graph.TinkerMaxGraph) DefaultGraphDfs(com.alibaba.maxgraph.compiler.dfs.DefaultGraphDfs)

Aggregations

InstanceConfig (com.alibaba.maxgraph.common.cluster.InstanceConfig)4 DefaultGraphDfs (com.alibaba.maxgraph.compiler.dfs.DefaultGraphDfs)1 TinkerMaxGraph (com.alibaba.maxgraph.structure.graph.TinkerMaxGraph)1 StatusRuntimeException (io.grpc.StatusRuntimeException)1 File (java.io.File)1 Properties (java.util.Properties)1 CountDownLatch (java.util.concurrent.CountDownLatch)1