更新时间:2024-04-17 GMT+08:00
增量导入图
您可以使用GES提供的接口增量导入图。示例代码如下:
public static void incrementImport(GraphClient graphClient) throws ApiException { ImportGraphReq importGraphReq = new ImportGraphReq(); importGraphReq.setGraphName(graphName); importGraphReq.setEdgesetPath("/home/lh/movie/ranking_edge.csv"); importGraphReq.setEdgesetFormat("csv"); importGraphReq.setVertexsetPath("/home/lh/movie/movies_vertex.csv"); importGraphReq.setVertexsetFormat("csv_prop"); ObsParameters obsParameters = new ObsParameters(); obsParameters.setAccessKey("XXXXXXXX"); obsParameters.setSecretKey("XXXXXXXX"); obsParameters.setRegion("southchina"); importGraphReq.setObsParameters(obsParameters); // 执行导入图 AsyncAPIResp res = graphClient.incrementImport(importGraphReq); // 获取JobId String jobId = res.getJobId(); ImportGraphJobReq req = new ImportGraphJobReq(); req.setJobId(jobId); // 根据JobId查询导图结果 System.out.println(graphClient.queryJobStatus(req)); }
父主题: 使用业务面SDK