use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.
the class MaxNode method start.
public void start() {
List<Thread> startThreads = new ArrayList<>();
for (NodeBase store : this.stores) {
startThreads.add(new Thread(() -> {
store.start();
logger.info("[" + store.getName() + "] started");
}));
}
for (NodeBase frontend : this.frontends) {
startThreads.add(new Thread(() -> {
frontend.start();
logger.info("[" + frontend.getName() + "] started");
}));
}
for (NodeBase ingestor : this.ingestors) {
startThreads.add(new Thread(() -> {
ingestor.start();
logger.info("[" + ingestor.getName() + "] started");
}));
}
startThreads.add(new Thread(() -> {
this.coordinator.start();
logger.info("[" + this.coordinator.getName() + "] started");
}));
for (Thread startThread : startThreads) {
startThread.start();
}
for (Thread startThread : startThreads) {
try {
startThread.join();
} catch (InterruptedException e) {
throw new MaxGraphException(e);
}
}
logger.info("maxnode started");
}
use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.
the class Store method start.
@Override
public void start() {
this.metaService.start();
try {
this.storeService.start();
} catch (IOException e) {
throw new MaxGraphException(e);
}
long availSnapshotId;
try {
availSnapshotId = this.storeService.recover();
} catch (IOException | InterruptedException e) {
throw new MaxGraphException(e);
}
this.writerAgent.init(availSnapshotId);
this.writerAgent.start();
this.backupAgent.start();
try {
this.rpcServer.start();
} catch (IOException e) {
throw new MaxGraphException(e);
}
this.discovery.start();
this.channelManager.start();
this.executorService.start();
}
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();
}
use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.
the class GraphWriter method writeBatch.
public long writeBatch(String requestId, String writeSession, List<WriteRequest> writeRequests) {
CompletableFuture<Long> future = new CompletableFuture<>();
writeBatch(requestId, writeSession, writeRequests, new CompletionCallback<Long>() {
@Override
public void onCompleted(Long res) {
future.complete(res);
}
@Override
public void onError(Throwable t) {
future.completeExceptionally(t);
}
});
try {
return future.get();
} catch (InterruptedException | ExecutionException e) {
throw new MaxGraphException(e);
}
}
use of com.alibaba.maxgraph.compiler.api.exception.MaxGraphException in project GraphScope by alibaba.
the class MaxTestGraphProvider method loadGraphData.
@Override
public void loadGraphData(Graph graph, LoadGraphWith loadGraphWith, Class testClass, String testName) {
try {
((MaxTestGraph) graph).loadSchema(null == loadGraphWith ? LoadGraphWith.GraphData.CLASSIC : loadGraphWith.value());
} catch (URISyntaxException | IOException e) {
logger.error("load schema failed", e);
throw new MaxGraphException(e);
}
super.loadGraphData(graph, loadGraphWith, testClass, testName);
logger.info("vertex value map list: " + graph.traversal().V().valueMap().toList());
logger.info("edge value map list: " + graph.traversal().E().valueMap().toList());
}
Aggregations