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:37 UTC
[17/27] storm git commit: Replaced TupleHelpers in the examples with
the new tuple.isTick()
Replaced TupleHelpers in the examples with the new tuple.isTick()
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/6b000407
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/6b000407
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/6b000407
Branch: refs/heads/0.10.x-branch
Commit: 6b0004070c80ae8f01e4bc38b759d57f482feeb2
Parents: 6537b36
Author: Niels Basjes <nb...@bol.com>
Authored: Wed Oct 29 15:50:18 2014 +0100
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri May 15 15:27:14 2015 -0400
----------------------------------------------------------------------
.../storm/starter/bolt/AbstractRankerBolt.java | 3 +-
.../storm/starter/bolt/RollingCountBolt.java | 3 +-
.../jvm/storm/starter/util/TupleHelpers.java | 33 --------------------
3 files changed, 2 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/6b000407/examples/storm-starter/src/jvm/storm/starter/bolt/AbstractRankerBolt.java
----------------------------------------------------------------------
diff --git a/examples/storm-starter/src/jvm/storm/starter/bolt/AbstractRankerBolt.java b/examples/storm-starter/src/jvm/storm/starter/bolt/AbstractRankerBolt.java
index cc5c0e7..83c2cfc 100644
--- a/examples/storm-starter/src/jvm/storm/starter/bolt/AbstractRankerBolt.java
+++ b/examples/storm-starter/src/jvm/storm/starter/bolt/AbstractRankerBolt.java
@@ -26,7 +26,6 @@ import backtype.storm.tuple.Tuple;
import backtype.storm.tuple.Values;
import org.apache.log4j.Logger;
import storm.starter.tools.Rankings;
-import storm.starter.util.TupleHelpers;
import java.util.HashMap;
import java.util.Map;
@@ -78,7 +77,7 @@ public abstract class AbstractRankerBolt extends BaseBasicBolt {
*/
@Override
public final void execute(Tuple tuple, BasicOutputCollector collector) {
- if (TupleHelpers.isTickTuple(tuple)) {
+ if (tuple.isTick()) {
getLogger().debug("Received tick tuple, triggering emit of current rankings");
emitRankings(collector);
}
http://git-wip-us.apache.org/repos/asf/storm/blob/6b000407/examples/storm-starter/src/jvm/storm/starter/bolt/RollingCountBolt.java
----------------------------------------------------------------------
diff --git a/examples/storm-starter/src/jvm/storm/starter/bolt/RollingCountBolt.java b/examples/storm-starter/src/jvm/storm/starter/bolt/RollingCountBolt.java
index f83906c..f023c0b 100644
--- a/examples/storm-starter/src/jvm/storm/starter/bolt/RollingCountBolt.java
+++ b/examples/storm-starter/src/jvm/storm/starter/bolt/RollingCountBolt.java
@@ -28,7 +28,6 @@ import backtype.storm.tuple.Values;
import org.apache.log4j.Logger;
import storm.starter.tools.NthLastModifiedTimeTracker;
import storm.starter.tools.SlidingWindowCounter;
-import storm.starter.util.TupleHelpers;
import java.util.HashMap;
import java.util.Map;
@@ -95,7 +94,7 @@ public class RollingCountBolt extends BaseRichBolt {
@Override
public void execute(Tuple tuple) {
- if (TupleHelpers.isTickTuple(tuple)) {
+ if (tuple.isTick()) {
LOG.debug("Received tick tuple, triggering emit of current window counts");
emitCurrentWindowCounts();
}
http://git-wip-us.apache.org/repos/asf/storm/blob/6b000407/examples/storm-starter/src/jvm/storm/starter/util/TupleHelpers.java
----------------------------------------------------------------------
diff --git a/examples/storm-starter/src/jvm/storm/starter/util/TupleHelpers.java b/examples/storm-starter/src/jvm/storm/starter/util/TupleHelpers.java
deleted file mode 100644
index 4ea669e..0000000
--- a/examples/storm-starter/src/jvm/storm/starter/util/TupleHelpers.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package storm.starter.util;
-
-import backtype.storm.Constants;
-import backtype.storm.tuple.Tuple;
-
-public final class TupleHelpers {
-
- private TupleHelpers() {
- }
-
- public static boolean isTickTuple(Tuple tuple) {
- return tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) && tuple.getSourceStreamId().equals(
- Constants.SYSTEM_TICK_STREAM_ID);
- }
-
-}