add a missing source file
git-svn-id: https://hyracks.googlecode.com/svn/branches/fullstack_staging@2076 123451ca-8445-de46-9d55-352943316053
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultMessageCombiner.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultMessageCombiner.java
new file mode 100644
index 0000000..ccf19ee
--- /dev/null
+++ b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultMessageCombiner.java
@@ -0,0 +1,41 @@
+package edu.uci.ics.pregelix.api.util;
+
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.io.WritableComparable;
+
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.pregelix.api.graph.MessageCombiner;
+import edu.uci.ics.pregelix.api.graph.MsgList;
+
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class DefaultMessageCombiner<I extends WritableComparable, M extends Writable> extends
+ MessageCombiner<I, M, MsgList> {
+ private MsgList<M> msgList;
+
+ @Override
+ public void init(MsgList providedMsgList) {
+ this.msgList = providedMsgList;
+ this.msgList.clearElements();
+ }
+
+ @Override
+ public void step(I vertexIndex, M msg) throws HyracksDataException {
+ msgList.addElement(msg);
+ }
+
+ @Override
+ public void step(MsgList partialAggregate) throws HyracksDataException {
+ msgList.addAllElements(partialAggregate);
+ }
+
+ @Override
+ public MsgList finishPartial() {
+ return msgList;
+ }
+
+ @Override
+ public MsgList<M> finishFinal() {
+ return msgList;
+ }
+
+}