messageStore.addPartitionMessages(0, messages);
}
@Test
public void testLongDoubleMessageStore() throws IOException {
LongDoubleMessageStore messageStore =
new LongDoubleMessageStore(service, new DoubleSumMessageCombiner());
insertLongDoubleMessages(messageStore);
Iterable<DoubleWritable> m0 =
messageStore.getVertexMessages(new LongWritable(0));
Assert.assertEquals(1, Iterables.size(m0));
Assert.assertEquals(10.0, m0.iterator().next().get());
Iterable<DoubleWritable> m1 =
messageStore.getVertexMessages(new LongWritable(1));
Assert.assertEquals(1, Iterables.size(m1));
Assert.assertEquals(8.0, m1.iterator().next().get());
Iterable<DoubleWritable> m2 =
messageStore.getVertexMessages(new LongWritable(2));
Assert.assertEquals(1, Iterables.size(m2));
Assert.assertEquals(3.0, m2.iterator().next().get());
Assert.assertTrue(
Iterables.isEmpty(messageStore.getVertexMessages(new LongWritable(3))));
}