giraph-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Panagiotis Liakos <>
Subject how should I configure ByteArrayEdges<IntWritable, NullWritable>?
Date Mon, 07 Sep 2015 13:59:26 GMT
Hello all,

I am trying to create a ByteArrayEdges object for a given vertex. All
out-neighbors can be represented using Integers and there are no
weights in the graph so I am using Edge<IntWritable, NullWritable> to
populate my object.

Please see the following example:

public void error(){
   GiraphConfiguration giraphConfiguration = new GiraphConfiguration();
   ImmutableClassesGiraphConfiguration immutableClassesGiraphConfiguration =
    new ImmutableClassesGiraphConfiguration(giraphConfiguration);
ByteArrayEdges<IntWritable, NullWritable> edges =
    (ByteArrayEdges<IntWritable, NullWritable>)
   List<Edge<IntWritable, NullWritable>> initialEdges = Lists.newArrayList(
       EdgeFactory.create(new IntWritable(1)),
       EdgeFactory.create(new IntWritable(2)));
for(Iterator<Edge<IntWritable, NullWritable>> edgeIter =
edges.iterator(); edgeIter.hasNext();){;

This results in correctly building the object which dedicates 4 bytes
for each out-neighbor.
However, when iterating over the edges with a ByteArrayEdgeIterator I
receive an IllegalStateException. (java.lang.IllegalStateException:
next: Failed on pos 8 edge (targetVertexId = 8589934593, value = 0.0))

I inserted a printStackTrace() call and I get this error: ensureRemaining: Only 0 bytes remaining, trying to read 8

Does anyone know how I am supposed to configure this so that the
iterator behaves normally?


View raw message