Repository: storm Updated Branches: refs/heads/master 2aaa71809 -> fd64c3d2d
New method in the Tuple interface "boolean isTuple()" for easier handling of TickTuples. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/6c6bec9b Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/6c6bec9b Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/6c6bec9b Branch: refs/heads/master Commit: 6c6bec9b1b2b07b5dfb5000297c11911eda5389d Parents: 24b5eef Author: Niels Basjes <[email protected]> Authored: Wed Oct 1 11:50:48 2014 +0200 Committer: Niels Basjes <[email protected]> Committed: Wed Oct 1 11:50:48 2014 +0200 ---------------------------------------------------------------------- storm-core/src/jvm/backtype/storm/tuple/Tuple.java | 9 +++++++-- storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/6c6bec9b/storm-core/src/jvm/backtype/storm/tuple/Tuple.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/backtype/storm/tuple/Tuple.java b/storm-core/src/jvm/backtype/storm/tuple/Tuple.java index 113b300..b3f5e56 100644 --- a/storm-core/src/jvm/backtype/storm/tuple/Tuple.java +++ b/storm-core/src/jvm/backtype/storm/tuple/Tuple.java @@ -153,7 +153,7 @@ public interface Tuple { * Gets the id of the component that created this tuple. */ public String getSourceComponent(); - + /** * Gets the id of the task that created this tuple. */ @@ -163,7 +163,12 @@ public interface Tuple { * Gets the id of the stream that this tuple was emitted to. */ public String getSourceStreamId(); - + + /** + * Returns if this tuple is a tick tuple or not. + */ + public boolean isTick(); + /** * Gets the message id that associated with this tuple. */ http://git-wip-us.apache.org/repos/asf/storm/blob/6c6bec9b/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java b/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java index 818eff1..7ff2c8c 100644 --- a/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java +++ b/storm-core/src/jvm/backtype/storm/tuple/TupleImpl.java @@ -17,6 +17,7 @@ */ package backtype.storm.tuple; +import backtype.storm.Constants; import backtype.storm.generated.GlobalStreamId; import backtype.storm.task.GeneralTopologyContext; import backtype.storm.utils.IndifferentAccessMap; @@ -212,7 +213,12 @@ public class TupleImpl extends IndifferentAccessMap implements Seqable, Indexed, public String getSourceStreamId() { return streamId; } - + + public boolean isTick() { + return this.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) && + this.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID); + } + public MessageId getMessageId() { return id; }
