use of com.alibaba.maxgraph.Message in project GraphScope by alibaba.
the class ResultParserUtils method parseEntry.
private static QueryResult parseEntry(Message.RawMessageProto message, GraphSchema schema, Graph graph) {
try {
Message.EntryProto entry = Message.EntryProto.parseFrom(message.getExtra().getExtraValueProp().getValueEntity().getPayload());
EntryValueResult entryValueResult = new EntryValueResult();
entryValueResult.setKey(parseRawMessage(entry.getKey(), schema, graph));
entryValueResult.setValue(parseRawMessage(entry.getValue(), schema, graph));
return entryValueResult;
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException(e);
}
}
use of com.alibaba.maxgraph.Message in project GraphScope by alibaba.
the class ResultParserUtils method parseEdge.
private static EdgeResult parseEdge(Message.RawMessageProto message, GraphSchema schema, Graph graph) {
long id = message.getId();
int typeId = message.getTypeId();
Message.ExtraEdgeEntityProto edgeEntity = message.getExtra().getExtraEdge();
List<Message.PropertyEntityProto> propertyList = message.getExtra().getExtraValueProp().getPropListList();
EdgeResult edgeResult = new EdgeResult(id, parseVertex(edgeEntity.getSrcId(), edgeEntity.getSrcTypeId(), schema, graph, 0), parseVertex(edgeEntity.getDstId(), edgeEntity.getDstTypeId(), schema, graph, 0), getEdgeLabel(typeId, id, schema));
if (null != propertyList) {
for (Message.PropertyEntityProto propertyEntity : propertyList) {
edgeResult.addProperty(parseProperty(propertyEntity, edgeResult, schema, graph));
}
}
return edgeResult;
}
use of com.alibaba.maxgraph.Message in project GraphScope by alibaba.
the class ResultParserUtils method parsePathEntry.
private static QueryResult parsePathEntry(Message.RawMessageProto message, GraphSchema schema, Graph graph) {
try {
Message.PathEntityProto pathEntity = Message.PathEntityProto.parseFrom(message.getExtra().getExtraValueProp().getValueEntity().getPayload());
QueryResult pathValue = parseRawMessage(pathEntity.getMessage(), schema, graph);
PathValueResult pathValueResult = new PathValueResult(pathValue, Sets.newHashSet(pathEntity.getLabelListList()));
return pathValueResult;
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException(e);
}
}
Aggregations