incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1202064 - /incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LongMessage.java
Date Tue, 15 Nov 2011 06:52:29 GMT
Author: edwardyoon
Date: Tue Nov 15 06:52:28 2011
New Revision: 1202064

URL: http://svn.apache.org/viewvc?rev=1202064&view=rev
Log:
Add LongMessage

Added:
    incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LongMessage.java

Added: incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LongMessage.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LongMessage.java?rev=1202064&view=auto
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LongMessage.java (added)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LongMessage.java Tue Nov 15
06:52:28 2011
@@ -0,0 +1,48 @@
+package org.apache.hama.bsp;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+
+/**
+ * A message that consists of a string tag and a long data. 
+ */
+public class LongMessage extends BSPMessage {
+
+  private String tag;
+  private long data;
+
+  public LongMessage() {
+    super();
+  }
+
+  public LongMessage(String tag, long data) {
+    super();
+    this.data = data;
+    this.tag = tag;
+  }
+
+  @Override
+  public String getTag() {
+    return tag;
+  }
+
+  @Override
+  public Long getData() {
+    return data;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeUTF(tag);
+    out.writeLong(data);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    tag = in.readUTF();
+    data = in.readLong();
+  }
+
+}



Mime
View raw message