You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2015/05/15 23:27:29 UTC
[09/27] storm git commit: sync storm.js with master
sync storm.js with master
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/17c1368c
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/17c1368c
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/17c1368c
Branch: refs/heads/0.10.x-branch
Commit: 17c1368c8a61f037874916c709562dcbf2b94267
Parents: cb5afe3
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Mon Apr 6 17:02:39 2015 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri May 15 15:12:17 2015 -0400
----------------------------------------------------------------------
.../src/main/resources/resources/storm.js | 25 +++++++++++++-------
1 file changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/17c1368c/storm-multilang/multilang-javascript/src/main/resources/resources/storm.js
----------------------------------------------------------------------
diff --git a/storm-multilang/multilang-javascript/src/main/resources/resources/storm.js b/storm-multilang/multilang-javascript/src/main/resources/resources/storm.js
index f5dcad2..dc6efc1 100755
--- a/storm-multilang/multilang-javascript/src/main/resources/resources/storm.js
+++ b/storm-multilang/multilang-javascript/src/main/resources/resources/storm.js
@@ -15,7 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
- /**
+
+/**
* Base classes in node-js for storm Bolt and Spout.
* Implements the storm multilang protocol for nodejs.
*/
@@ -97,7 +98,7 @@ Storm.prototype.handleNewChunk = function(chunk) {
}
}
return messages;
- }
+}
Storm.prototype.isTaskIds = function(msg) {
return (msg instanceof Array);
@@ -260,13 +261,19 @@ BasicBolt.prototype.__emit = function(commandDetails) {
BasicBolt.prototype.handleNewCommand = function(command) {
var self = this;
var tup = new Tuple(command["id"], command["comp"], command["stream"], command["task"], command["tuple"]);
+
+ if (tup.task === -1 && tup.stream === "__heartbeat") {
+ self.sync();
+ return;
+ }
+
var callback = function(err) {
- if (err) {
- self.fail(tup, err);
- return;
- }
- self.ack(tup);
- }
+ if (err) {
+ self.fail(tup, err);
+ return;
+ }
+ self.ack(tup);
+ }
this.process(tup, callback);
}
@@ -363,4 +370,4 @@ Spout.prototype.__emit = function(commandDetails) {
}
module.exports.BasicBolt = BasicBolt;
-module.exports.Spout = Spout;
+module.exports.Spout = Spout;
\ No newline at end of file