Help Center/ Graph Engine Service/ devg/ Using the Service Plane SDK/ Incrementally Importing Data to Graphs
Updated on 2022-09-14 GMT+08:00
Incrementally Importing Data to Graphs
You can use a specific API provided by GES to incrementally import data to graphs. The sample code is as follows:
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("EW39NCDEXJ4E1JTN2PCP");
obsParameters.setSecretKey("rhsS0TP89IdNnDe6dug1iraEbQUeNZlbJ3QGgW5D");
obsParameters.setRegion("southchina");
importGraphReq.setObsParameters(obsParameters);
//Import data to graphs.
AsyncAPIResp res = graphClient.incrementImport(importGraphReq);
//Obtain the JobId.
String jobId = res.getJobId();
ImportGraphJobReq req = new ImportGraphJobReq();
req.setJobId(jobId);
//Query the import result based on the JobId.
System.out.println(graphClient.queryJobStatus(req));
} Parent topic: Using the Service Plane SDK
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.