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 2016/04/01 07:29:20 UTC

[1/3] storm git commit: STORM-1669: Fix SolrUpdateBolt flush bug

Repository: storm
Updated Branches:
  refs/heads/1.x-branch 97e7d25fe -> 11f23153a


STORM-1669: Fix SolrUpdateBolt flush bug

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

Branch: refs/heads/1.x-branch
Commit: 81997ece6422d2b80ef02b86521772276debc03f
Parents: 652d2f6
Author: Xin Wang <be...@163.com>
Authored: Thu Mar 31 12:30:35 2016 +0800
Committer: vesense <be...@163.com>
Committed: Thu Mar 31 12:37:22 2016 +0800

----------------------------------------------------------------------
 .../apache/storm/solr/bolt/SolrUpdateBolt.java  | 23 ++++++++------------
 1 file changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/81997ece/external/storm-solr/src/main/java/org/apache/storm/solr/bolt/SolrUpdateBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-solr/src/main/java/org/apache/storm/solr/bolt/SolrUpdateBolt.java b/external/storm-solr/src/main/java/org/apache/storm/solr/bolt/SolrUpdateBolt.java
index cab9899..ff0a96e 100644
--- a/external/storm-solr/src/main/java/org/apache/storm/solr/bolt/SolrUpdateBolt.java
+++ b/external/storm-solr/src/main/java/org/apache/storm/solr/bolt/SolrUpdateBolt.java
@@ -18,14 +18,12 @@
 
 package org.apache.storm.solr.bolt;
 
-import org.apache.storm.Config;
 import org.apache.storm.task.OutputCollector;
 import org.apache.storm.task.TopologyContext;
 import org.apache.storm.topology.OutputFieldsDeclarer;
 import org.apache.storm.topology.base.BaseRichBolt;
 import org.apache.storm.tuple.Tuple;
 import org.apache.storm.utils.TupleUtils;
-import org.apache.storm.utils.Utils;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -45,6 +43,11 @@ import java.util.Map;
 public class SolrUpdateBolt extends BaseRichBolt {
     private static final Logger LOG = LoggerFactory.getLogger(SolrUpdateBolt.class);
 
+    /**
+     * Half of the default Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS
+     */
+    private static final int DEFAULT_TICK_TUPLE_INTERVAL_SECS = 15;
+
     private final SolrConfig solrConfig;
     private final SolrMapper solrMapper;
     private final SolrCommitStrategy commitStgy;    // if null, acks every tuple
@@ -52,7 +55,7 @@ public class SolrUpdateBolt extends BaseRichBolt {
     private SolrClient solrClient;
     private OutputCollector collector;
     private List<Tuple> toCommitTuples;
-    private int tickTupleInterval;
+    private int tickTupleInterval = DEFAULT_TICK_TUPLE_INTERVAL_SECS;
 
     public SolrUpdateBolt(SolrConfig solrConfig, SolrMapper solrMapper) {
         this(solrConfig, solrMapper, null);
@@ -72,17 +75,6 @@ public class SolrUpdateBolt extends BaseRichBolt {
         this.collector = collector;
         this.solrClient = new CloudSolrClient(solrConfig.getZkHostString());
         this.toCommitTuples = new ArrayList<>(capacity());
-
-        setTickTupleInterval(stormConf);   
-    }
-
-    private void setTickTupleInterval(Map stormConf) {
-        this.tickTupleInterval = solrConfig.getTickTupleInterval();
-        if(stormConf.containsKey(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS)  && tickTupleInterval == 0) {
-            Integer topologyTimeout = Utils.getInt(stormConf.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS));
-            tickTupleInterval = (int)(Math.floor(topologyTimeout / 2));
-            LOG.debug("Setting tick tuple interval to [{}] based on topology timeout", tickTupleInterval);
-        }
     }
 
     private int capacity() {
@@ -153,6 +145,9 @@ public class SolrUpdateBolt extends BaseRichBolt {
 
     @Override
     public Map<String, Object> getComponentConfiguration() {
+        if (solrConfig.getTickTupleInterval() > 0) {
+            this.tickTupleInterval = solrConfig.getTickTupleInterval();
+        }
         return TupleUtils.putTickFrequencyIntoComponentConfig(super.getComponentConfiguration(), tickTupleInterval);
     }
 


[3/3] storm git commit: add STORM-1669 to changelog

Posted by pt...@apache.org.
add STORM-1669 to changelog


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

Branch: refs/heads/1.x-branch
Commit: 11f23153a911c5bad945740ebdf262f16630532a
Parents: 0747c7c
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Apr 1 01:02:20 2016 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Apr 1 01:02:20 2016 -0400

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


http://git-wip-us.apache.org/repos/asf/storm/blob/11f23153/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 54a8489..3a044c6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 1.0.0
+ * STORM-1669: Fix SolrUpdateBolt flush bug
  * STORM-1668: Flux silently fails while setting a non-existent property.
  * STORM-1573: Add batch support for MongoInsertBolt
  * STORM-1660: remove flux gitignore file and move rules to top level gitignore


[2/3] storm git commit: Merge branch 'STORM-1669-1.x' of github.com:vesense/storm into 1.x-branch

Posted by pt...@apache.org.
Merge branch 'STORM-1669-1.x' of github.com:vesense/storm into 1.x-branch


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

Branch: refs/heads/1.x-branch
Commit: 0747c7c4178a9db30027ad3234cadc2fcd468f74
Parents: 97e7d25 81997ec
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Apr 1 01:01:10 2016 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Apr 1 01:01:10 2016 -0400

----------------------------------------------------------------------
 .../apache/storm/solr/bolt/SolrUpdateBolt.java  | 23 ++++++++------------
 1 file changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------