You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/05/19 23:52:28 UTC
[03/24] git commit: Added comments to the new multilang objects.
Added comments to the new multilang objects.
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/3701bfcb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/3701bfcb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/3701bfcb
Branch: refs/heads/master
Commit: 3701bfcbe3ed90e1ddf73605a0e5cd0bf4f0dbd4
Parents: a7918f8
Author: John Gilmore <jg...@ml.sun.ac.za>
Authored: Mon Oct 7 11:47:48 2013 +0200
Committer: John Gilmore <jg...@ml.sun.ac.za>
Committed: Mon Oct 7 11:47:48 2013 +0200
----------------------------------------------------------------------
project.clj | 2 +-
.../src/jvm/backtype/storm/multilang/Emission.java | 12 +++++++++++-
.../src/jvm/backtype/storm/multilang/ISerializer.java | 5 +++++
.../src/jvm/backtype/storm/multilang/Immission.java | 12 +++++++++++-
.../jvm/backtype/storm/multilang/JsonSerializer.java | 3 +++
.../jvm/backtype/storm/multilang/NoOutputException.java | 4 ++++
.../src/jvm/backtype/storm/multilang/SpoutMsg.java | 10 ++++++++++
7 files changed, 45 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/3701bfcb/project.clj
----------------------------------------------------------------------
diff --git a/project.clj b/project.clj
index f913924..6e59efc 100644
--- a/project.clj
+++ b/project.clj
@@ -10,7 +10,7 @@
:archive "https://groups.google.com/group/storm-user"
:post "storm-user@googlegroups.com"}
:dependencies [~@DEPENDENCIES]
- :plugins [[~'lein-sub "0.2.1"],[no-man-is-an-island/lein-eclipse "2.0.0"]]
+ :plugins [[~'lein-sub "0.2.1"]]
:min-lein-version "2.0.0"
:sub [~@MODULES]
))
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/3701bfcb/storm-core/src/jvm/backtype/storm/multilang/Emission.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/multilang/Emission.java b/storm-core/src/jvm/backtype/storm/multilang/Emission.java
index 1054458..d477d8b 100644
--- a/storm-core/src/jvm/backtype/storm/multilang/Emission.java
+++ b/storm-core/src/jvm/backtype/storm/multilang/Emission.java
@@ -3,6 +3,16 @@ package backtype.storm.multilang;
import java.util.ArrayList;
import java.util.List;
+/**
+ * Emission is an object that represents the data sent to a shell component
+ * from a process that implements a multi-language protocol. It is the union
+ * of all data types that a component can send to Storm.
+ *
+ * <p> Emissions are objects received from the ISerializer interface, after
+ * the serializer has deserialized the data from the underlying wire protocol.
+ * The Emission class allows for a decoupling between the serialized
+ * representation of the data and the data itself.</p>
+ */
public class Emission {
private String command;
private String id;
@@ -11,7 +21,7 @@ public class Emission {
private long task;
private String msg;
private List<Object> tuple;
-
+
public String getCommand() {
return command;
}
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/3701bfcb/storm-core/src/jvm/backtype/storm/multilang/ISerializer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/multilang/ISerializer.java b/storm-core/src/jvm/backtype/storm/multilang/ISerializer.java
index 61a28a9..691b432 100644
--- a/storm-core/src/jvm/backtype/storm/multilang/ISerializer.java
+++ b/storm-core/src/jvm/backtype/storm/multilang/ISerializer.java
@@ -9,6 +9,11 @@ import java.util.Map;
import backtype.storm.task.TopologyContext;
+/**
+ * The ISerializer interface describes the methods that an object should implement
+ * to provide serialization and de-serialization capabilities to non-JVM
+ * language components.
+ */
public interface ISerializer extends Serializable {
void initialize (OutputStream processIn, InputStream processOut);
Number connect (Map conf, TopologyContext context) throws IOException, NoOutputException;
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/3701bfcb/storm-core/src/jvm/backtype/storm/multilang/Immission.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/multilang/Immission.java b/storm-core/src/jvm/backtype/storm/multilang/Immission.java
index c20df53..968f728 100644
--- a/storm-core/src/jvm/backtype/storm/multilang/Immission.java
+++ b/storm-core/src/jvm/backtype/storm/multilang/Immission.java
@@ -2,13 +2,23 @@ package backtype.storm.multilang;
import java.util.List;
+/**
+ * Immission is an object that represents the data sent from a shell component
+ * to a process that implements a multi-language protocol. It is the union
+ * of all data types that a component can receive from Storm.
+ *
+ * <p> Immissions are objects sent to the ISerializer interface, for
+ * serialization according to the wire protocol implemented by the serializer.
+ * The Immission class allows for a decoupling between the serialized
+ * representation of the data and the data itself.</p>
+ */
public class Immission {
private String id;
private String comp;
private String stream;
private long task;
private List<Object> tuple;
-
+
public String getId() {
return id;
}
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/3701bfcb/storm-core/src/jvm/backtype/storm/multilang/JsonSerializer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/multilang/JsonSerializer.java b/storm-core/src/jvm/backtype/storm/multilang/JsonSerializer.java
index 88eead2..ba574e5 100644
--- a/storm-core/src/jvm/backtype/storm/multilang/JsonSerializer.java
+++ b/storm-core/src/jvm/backtype/storm/multilang/JsonSerializer.java
@@ -18,6 +18,9 @@ import backtype.storm.task.TopologyContext;
import backtype.storm.tuple.Tuple;
import backtype.storm.utils.Utils;
+/**
+ * JsonSerializer implements the JSON multilang protocol.
+ */
public class JsonSerializer implements ISerializer {
private DataOutputStream processIn;
private BufferedReader processOut;
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/3701bfcb/storm-core/src/jvm/backtype/storm/multilang/NoOutputException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/multilang/NoOutputException.java b/storm-core/src/jvm/backtype/storm/multilang/NoOutputException.java
index 595a0ae..8ffb7dd 100644
--- a/storm-core/src/jvm/backtype/storm/multilang/NoOutputException.java
+++ b/storm-core/src/jvm/backtype/storm/multilang/NoOutputException.java
@@ -1,5 +1,9 @@
package backtype.storm.multilang;
+/**
+ * A NoOutputException states that no data has been received from the connected
+ * non-JVM process.
+ */
public class NoOutputException extends Exception {
public NoOutputException() { super(); }
public NoOutputException(String message) { super(message); }
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/3701bfcb/storm-core/src/jvm/backtype/storm/multilang/SpoutMsg.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/multilang/SpoutMsg.java b/storm-core/src/jvm/backtype/storm/multilang/SpoutMsg.java
index 00967cb..c8063eb 100644
--- a/storm-core/src/jvm/backtype/storm/multilang/SpoutMsg.java
+++ b/storm-core/src/jvm/backtype/storm/multilang/SpoutMsg.java
@@ -1,5 +1,15 @@
package backtype.storm.multilang;
+/**
+ * SpoutMsg is an object that represents the data sent from a shell spout
+ * to a process that implements a multi-language spout. The SpoutMsg is used
+ * to send a "next", "ack" or "fail" message to a spout.
+ *
+ * <p> Spout messages are objects sent to the ISerializer interface, for
+ * serialization according to the wire protocol implemented by the serializer.
+ * The SpoutMsg class allows for a decoupling between the serialized
+ * representation of the data and the data itself.</p>
+ */
public class SpoutMsg {
private String command;
private String id;