You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2016/12/18 11:26:19 UTC

[1/3] storm git commit: STORM-1308: tick-tuple-test conversion to Java

Repository: storm
Updated Branches:
  refs/heads/master 6b1394f38 -> 7988af127


STORM-1308: tick-tuple-test conversion to Java

* Closes #1814


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/3c879e87
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/3c879e87
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/3c879e87

Branch: refs/heads/master
Commit: 3c879e8785d1ee21cfb4710930080b5170b9ec60
Parents: 6b1394f
Author: kamleshbhatt <kb...@gmail.com>
Authored: Tue Dec 6 00:22:33 2016 +0530
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Sun Dec 18 20:25:19 2016 +0900

----------------------------------------------------------------------
 .../clj/org/apache/storm/tick_tuple_test.clj    |  54 ----------
 .../jvm/org/apache/storm/TickTupleTest.java     | 102 +++++++++++++++++++
 2 files changed, 102 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/3c879e87/storm-core/test/clj/org/apache/storm/tick_tuple_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/tick_tuple_test.clj b/storm-core/test/clj/org/apache/storm/tick_tuple_test.clj
deleted file mode 100644
index f478dd4..0000000
--- a/storm-core/test/clj/org/apache/storm/tick_tuple_test.clj
+++ /dev/null
@@ -1,54 +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.
-(ns org.apache.storm.tick-tuple-test
-  (:use [clojure test])
-  (:use [org.apache.storm config])
-  (:use [org.apache.storm.internal clojure])
-  (:import [org.apache.storm Thrift LocalCluster$Builder])
-  (:import [org.apache.storm.utils Utils]))
-
-(defbolt noop-bolt ["tuple"] {:prepare true}
-  [conf context collector]
-  (bolt
-   (execute [tuple])))
-
-(defspout noop-spout ["tuple"]
-  [conf context collector]
-  (spout
-   (nextTuple [])))
-
-(deftest test-tick-tuple-works-with-system-bolt
-    (with-open [cluster (.build (doto (LocalCluster$Builder.)
-                                    (.withSimulatedTime)))]
-    (let [topology (Thrift/buildTopology
-                    {"1" (Thrift/prepareSpoutDetails noop-spout)}
-                    {"2" (Thrift/prepareBoltDetails
-                           {(Utils/getGlobalStreamId "1" nil)
-                            (Thrift/prepareFieldsGrouping ["tuple"])}
-                           noop-bolt)})]
-      (try
-        (.submitTopology cluster
-                               "test"
-                               {TOPOLOGY-TICK-TUPLE-FREQ-SECS 1}
-                               topology)
-        (.advanceClusterTime cluster 2)
-        ;; if reaches here, it means everything works ok.
-        (is true)
-        (catch Exception e
-          (is false))))))
-
-
-

http://git-wip-us.apache.org/repos/asf/storm/blob/3c879e87/storm-core/test/jvm/org/apache/storm/TickTupleTest.java
----------------------------------------------------------------------
diff --git a/storm-core/test/jvm/org/apache/storm/TickTupleTest.java b/storm-core/test/jvm/org/apache/storm/TickTupleTest.java
new file mode 100644
index 0000000..503bd2a
--- /dev/null
+++ b/storm-core/test/jvm/org/apache/storm/TickTupleTest.java
@@ -0,0 +1,102 @@
+/**
+ * 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 org.apache.storm;
+
+import org.apache.storm.generated.StormTopology;
+import org.apache.storm.spout.SpoutOutputCollector;
+import org.apache.storm.task.OutputCollector;
+import org.apache.storm.task.TopologyContext;
+import org.apache.storm.topology.IRichSpout;
+import org.apache.storm.topology.OutputFieldsDeclarer;
+import org.apache.storm.topology.TopologyBuilder;
+import org.apache.storm.topology.base.BaseRichBolt;
+import org.apache.storm.topology.base.BaseRichSpout;
+import org.apache.storm.tuple.Fields;
+import org.apache.storm.tuple.Tuple;
+import org.apache.storm.utils.Utils;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Map;
+
+public class TickTupleTest {
+
+    @Test
+    public void testTickTupleWorksWithSystemBolt() throws Exception {
+        ILocalCluster cluster = null;
+        try {
+            cluster =  new LocalCluster.Builder().withSimulatedTime().withNimbusDaemon(true).build();
+            StormTopology topology = createNoOpTopology();
+            Config stormConf = new Config();
+            stormConf.putAll(Utils.readDefaultConfig());
+            stormConf.put("storm.cluster.mode", "local");
+            stormConf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, 1);
+            cluster.submitTopology("test", stormConf,  topology);
+            cluster.advanceClusterTime(2);
+            Assert.assertTrue("Test is passed", true);
+        } finally {
+            cluster.close();
+        }
+
+    }
+
+    private IRichSpout makeNoOpSpout() {
+        return new BaseRichSpout() {
+            @Override
+            public void declareOutputFields(OutputFieldsDeclarer declarer) {
+                declarer.declare(new Fields("tuple"));
+            }
+
+            @Override
+            public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
+            }
+
+            @Override
+            public void nextTuple() {
+            }
+
+            private void writeObject(java.io.ObjectOutputStream stream) {
+            }
+        };
+    }
+
+    private BaseRichBolt makeNoOpBolt() {
+        return new BaseRichBolt() {
+            @Override
+            public void prepare(Map conf, TopologyContext topologyContext, OutputCollector outputCollector) {}
+            @Override
+            public void execute(Tuple tuple) {}
+
+            @Override
+            public void cleanup() { }
+
+            @Override
+            public void declareOutputFields(OutputFieldsDeclarer ofd) {}
+
+            private void writeObject(java.io.ObjectOutputStream stream) {}
+        };
+    }
+
+    private StormTopology createNoOpTopology() {
+        TopologyBuilder builder = new TopologyBuilder();
+        builder.setSpout("1", makeNoOpSpout());
+        builder.setBolt("2", makeNoOpBolt()).fieldsGrouping("1", new Fields("tuple"));
+        return builder.createTopology();
+    }
+}


[3/3] storm git commit: STORM-1308: CHANGELOG

Posted by ka...@apache.org.
STORM-1308: CHANGELOG


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/7988af12
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/7988af12
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/7988af12

Branch: refs/heads/master
Commit: 7988af1271f0b60a74160515fc569e40f43902be
Parents: 9f50c9d
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Sun Dec 18 20:26:02 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Sun Dec 18 20:26:02 2016 +0900

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/7988af12/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0ddc200..ba43c94 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 2.0.0
+ * STORM-1308: port backtype.storm.tick-tuple-test to java
  * STORM-2245: integration-test constant compilation failure
  * STORM-1607: Add MongoMapState for supporting trident's exactly once semantics
  * STORM-2204: Adding caching capabilities in HBaseLookupBolt


[2/3] storm git commit: Merge branch 'STORM-1308-merge'

Posted by ka...@apache.org.
Merge branch 'STORM-1308-merge'


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/9f50c9d9
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/9f50c9d9
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/9f50c9d9

Branch: refs/heads/master
Commit: 9f50c9d9f24a9d866adec3fa8917a3922bd22460
Parents: 6b1394f 3c879e8
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Sun Dec 18 20:25:47 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Sun Dec 18 20:25:47 2016 +0900

----------------------------------------------------------------------
 .../clj/org/apache/storm/tick_tuple_test.clj    |  54 ----------
 .../jvm/org/apache/storm/TickTupleTest.java     | 102 +++++++++++++++++++
 2 files changed, 102 insertions(+), 54 deletions(-)
----------------------------------------------------------------------