Search in sources :

Example 1 with MaxGraphException

use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.

the class GaiaEngine method start.

@Override
public void start() {
    try (GaiaPortsResponse gaiaPortsResponse = GaiaLibrary.INSTANCE.startEngine(this.pointer)) {
        if (!gaiaPortsResponse.success) {
            throw new MaxGraphException(gaiaPortsResponse.errMsg);
        }
        engineNodeProvider.apply(gaiaPortsResponse.enginePort);
        rpcNodeProvider.apply(gaiaPortsResponse.rpcPort);
    }
    this.engineDiscovery.start();
    this.engineDiscovery.addListener(this);
    this.rpcDiscovery.start();
}
Also used : GaiaPortsResponse(com.alibaba.maxgraph.servers.jna.GaiaPortsResponse) MaxGraphException(com.alibaba.maxgraph.compiler.api.exception.MaxGraphException)

Example 2 with MaxGraphException

use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.

the class Coordinator method start.

@Override
public void start() {
    if (this.curator != null) {
        this.curator.start();
    }
    this.graphInitializer.initializeIfNeeded();
    this.metaService.start();
    this.idAllocator.start();
    try {
        this.rpcServer.start();
    } catch (IOException e) {
        throw new MaxGraphException(e);
    }
    this.discovery.start();
    this.channelManager.start();
    this.snapshotManager.start();
    this.snapshotNotifier.start();
    this.schemaManager.start();
    this.logRecycler.start();
    this.backupManager.start();
    this.garbageCollectManager.start();
}
Also used : IOException(java.io.IOException) MaxGraphException(com.alibaba.maxgraph.compiler.api.exception.MaxGraphException)

Example 3 with MaxGraphException

use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.

the class Frontend method start.

@Override
public void start() {
    if (this.curator != null) {
        this.curator.start();
    }
    this.metaService.start();
    try {
        this.rpcServer.start();
    } catch (IOException e) {
        throw new MaxGraphException(e);
    }
    this.discovery.start();
    this.channelManager.start();
    this.graphService.start();
    try {
        this.serviceServer.start();
    } catch (IOException e) {
        throw new MaxGraphException(e);
    }
}
Also used : IOException(java.io.IOException) MaxGraphException(com.alibaba.maxgraph.compiler.api.exception.MaxGraphException)

Example 4 with MaxGraphException

use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.

the class Ingestor method start.

@Override
public void start() {
    if (this.curator != null) {
        this.curator.start();
    }
    this.metaService.start();
    try {
        this.rpcServer.start();
    } catch (IOException e) {
        throw new MaxGraphException(e);
    }
    this.discovery.start();
    this.channelManager.start();
    this.ingestService.start();
}
Also used : IOException(java.io.IOException) MaxGraphException(com.alibaba.maxgraph.compiler.api.exception.MaxGraphException)

Example 5 with MaxGraphException

use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.

the class MaxGraph method main.

public static void main(String[] args) throws IOException {
    String configFile = System.getProperty("config.file");
    Configs conf = new Configs(configFile);
    NodeBase node;
    if (args.length == 0) {
        logger.warn("No role type, use MaxNode");
        try {
            node = new MaxNode(conf);
        } catch (Exception e) {
            throw new MaxGraphException(e);
        }
    } else {
        String roleName = args[0];
        if (roleName.equalsIgnoreCase("store-gaia") || roleName.equalsIgnoreCase("frontend-gaia")) {
            conf = Configs.newBuilder(conf).put(CommonConfig.ENGINE_TYPE.getKey(), "gaia").build();
        }
        RoleType roleType = RoleType.fromName(roleName);
        switch(roleType) {
            case FRONTEND:
                node = new Frontend(conf);
                break;
            case INGESTOR:
                node = new Ingestor(conf);
                break;
            case STORE:
                node = new Store(conf);
                break;
            case COORDINATOR:
                node = new Coordinator(conf);
                break;
            default:
                throw new IllegalArgumentException("invalid roleType [" + roleType + "]");
        }
    }
    new NodeLauncher(node).start();
    logger.info("node started. [" + node.getName() + "]");
}
Also used : RoleType(com.alibaba.maxgraph.common.RoleType) MaxGraphException(com.alibaba.maxgraph.compiler.api.exception.MaxGraphException) MaxGraphException(com.alibaba.maxgraph.compiler.api.exception.MaxGraphException) IOException(java.io.IOException) Configs(com.alibaba.maxgraph.common.config.Configs)

Aggregations

MaxGraphException (com.alibaba.maxgraph.compiler.api.exception.MaxGraphException)24 IOException (java.io.IOException)14 URISyntaxException (java.net.URISyntaxException)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 ExecutionException (java.util.concurrent.ExecutionException)3 RoleType (com.alibaba.maxgraph.common.RoleType)2 Configs (com.alibaba.maxgraph.common.config.Configs)2 GaiaPortsResponse (com.alibaba.maxgraph.servers.jna.GaiaPortsResponse)2 FileNotFoundException (java.io.FileNotFoundException)2 HashMap (java.util.HashMap)2 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)2 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)2 GremlinConfig (com.alibaba.maxgraph.common.config.GremlinConfig)1 RpcAddressFetcher (com.alibaba.maxgraph.common.rpc.RpcAddressFetcher)1 BackupException (com.alibaba.maxgraph.compiler.api.exception.BackupException)1 GraphSchema (com.alibaba.maxgraph.compiler.api.schema.GraphSchema)1 SchemaFetcher (com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher)1 DropSchemaResponse (com.alibaba.maxgraph.proto.groot.DropSchemaResponse)1 LoadJsonSchemaResponse (com.alibaba.maxgraph.proto.groot.LoadJsonSchemaResponse)1 MaxGraphWsAndHttpSocketChannelizer (com.alibaba.maxgraph.server.MaxGraphWsAndHttpSocketChannelizer)1