I noticed the protocol buffers store strings in their uncompressed
form. Is there any provision to produce and consume protobufs in
compressed form? This would be specially helpful if a lot of fields
were repeated strings.
--~--~-~--~~~---~--~~
You received this
Hi,
I'm wondering how would one go about implementing self-referential
data structures? As an exercise, I tried to implement a PB version of
the adjacency list representation of a graph. I'm having a hard time
getting it work. Any suggestions?
Thanks!
--- graph.proto ---
package graph;
UndirectedGraphNode {
required string id = 0;
repeated UndirectedGraphNodeReference neighbors;
}
message UndirectedGraph {
repeated UndirectedGraphNode nodes;
}
--
Jeremy Leader
[EMAIL PROTECTED]
GDR wrote:
Hi,
I'm wondering how would one go about implementing self-referential
data
;
}
On Oct 22, 2:14 pm, Jeremy Leader [EMAIL PROTECTED] wrote:
I was assuming all the properties of a node (weight, label, color,
whatever) would be in UndirectedGraphNode; UndirectedGraphNodeReference
would only have the id and nothing else.
--
Jeremy Leader
[EMAIL PROTECTED]
GDR wrote:
Thanks
weight = 2;
repeated UndirectedGraphNodeReference neighbors = 2;
}
message UndirectedGraph {
repeated UndirectedGraphNode nodes = 1;
}
On Oct 22, 2:36 pm, GDR [EMAIL PROTECTED] wrote:
That does solve the duplicate information problem but it makes updates
to node attributes (like weight
to their neighbors, and you'd
probably need a map from node id to node object reference, which you'd
use during deserialization.
--
Jeremy Leader
[EMAIL PROTECTED]
GDR wrote:
my bad. The code snippet should be as follows:
for(UndirectedGraphNode node : UndirectedGraph.getNodesList
,
given that you can't actually store the entire graph in memory, let
alone a protobuf message? What graph operations are you looking to
parallelize?
-dave
On Oct 23, 12:12 am, GDR [EMAIL PROTECTED] wrote:
Thanks. I am trying to use protocol buffers with a map reduce
framework to work