Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.

On this page

Show all

Help Center/ Graph Engine Service/ devg/ Using the Service Plane SDK/ Incrementally Importing Data to Graphs

Incrementally Importing Data to Graphs

Updated on 2022-09-14 GMT+08:00
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));
}
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback