use of com.alibaba.graphscope.proto.write.WriteRequestPb in project GraphScope by alibaba.
the class MaxGraphClient method addEdge.
public void addEdge(String label, String srcLabel, String dstLabel, Map<String, String> srcPk, Map<String, String> dstPk, Map<String, String> properties) {
VertexRecordKey srcVertexKey = new VertexRecordKey(srcLabel, Collections.unmodifiableMap(srcPk));
VertexRecordKey dstVertexKey = new VertexRecordKey(dstLabel, Collections.unmodifiableMap(dstPk));
EdgeRecordKey edgeRecordKey = new EdgeRecordKey(label, srcVertexKey, dstVertexKey);
WriteRequestPb writeRequest = WriteRequestPb.newBuilder().setWriteType(WriteTypePb.INSERT).setDataRecord(DataRecordPb.newBuilder().setEdgeRecordKey(edgeRecordKey.toProto()).putAllProperties(properties).build()).build();
this.batchWriteBuilder.addWriteRequests(writeRequest);
}
use of com.alibaba.graphscope.proto.write.WriteRequestPb in project GraphScope by alibaba.
the class MaxGraphClient method addVertex.
public void addVertex(String label, Map<String, String> properties) {
VertexRecordKey vertexRecordKey = new VertexRecordKey(label);
WriteRequestPb writeRequest = WriteRequestPb.newBuilder().setWriteType(WriteTypePb.INSERT).setDataRecord(DataRecordPb.newBuilder().setVertexRecordKey(vertexRecordKey.toProto()).putAllProperties(properties).build()).build();
this.batchWriteBuilder.addWriteRequests(writeRequest);
}
Aggregations