You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2015/05/22 23:42:54 UTC

[1/3] storm git commit: [storm-redis] Clarify Redis*StateUpdater's expire is optional

Repository: storm
Updated Branches:
  refs/heads/master 427e95494 -> 106af613f


[storm-redis] Clarify Redis*StateUpdater's expire is optional


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

Branch: refs/heads/master
Commit: 86f7c171a7638aa7c3bab5b14ff9c886dfb2909e
Parents: 330e135
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Fri Mar 27 07:52:51 2015 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Fri Mar 27 07:52:51 2015 +0900

----------------------------------------------------------------------
 external/storm-redis/README.md                              | 4 ++--
 .../storm/redis/trident/state/RedisClusterStateUpdater.java | 9 +++++++--
 .../apache/storm/redis/trident/state/RedisStateUpdater.java | 9 +++++++--
 .../apache/storm/redis/trident/WordCountTridentRedis.java   | 2 +-
 .../storm/redis/trident/WordCountTridentRedisCluster.java   | 2 +-
 5 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/86f7c171/external/storm-redis/README.md
----------------------------------------------------------------------
diff --git a/external/storm-redis/README.md b/external/storm-redis/README.md
index b01854f..17b5904 100644
--- a/external/storm-redis/README.md
+++ b/external/storm-redis/README.md
@@ -88,7 +88,7 @@ RedisState
 
         stream.partitionPersist(factory,
                                 fields,
-                                new RedisStateUpdater("test_", tupleMapper, 86400000),
+                                new RedisStateUpdater("test_", tupleMapper).withExpire(86400000),
                                 new Fields());
 ```
 
@@ -109,7 +109,7 @@ RedisClusterState
 
         stream.partitionPersist(factory,
                                 fields,
-                                new RedisClusterStateUpdater("test_", tupleMapper, 86400000),
+                                new RedisClusterStateUpdater("test_", tupleMapper).withExpire(86400000),
                                 new Fields());
 ```
 

http://git-wip-us.apache.org/repos/asf/storm/blob/86f7c171/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisClusterStateUpdater.java
----------------------------------------------------------------------
diff --git a/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisClusterStateUpdater.java b/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisClusterStateUpdater.java
index 023b527..e00cfb6 100644
--- a/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisClusterStateUpdater.java
+++ b/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisClusterStateUpdater.java
@@ -32,16 +32,21 @@ public class RedisClusterStateUpdater extends BaseStateUpdater<RedisClusterState
 
     private final String redisKeyPrefix;
     private final TupleMapper tupleMapper;
-    private final int expireIntervalSec;
+    private int expireIntervalSec = 0;
 
-    public RedisClusterStateUpdater(String redisKeyPrefix, TupleMapper tupleMapper, int expireIntervalSec) {
+    public RedisClusterStateUpdater(String redisKeyPrefix, TupleMapper tupleMapper) {
         this.redisKeyPrefix = redisKeyPrefix;
         this.tupleMapper = tupleMapper;
+    }
+
+    public RedisClusterStateUpdater withExpire(int expireIntervalSec) {
         if (expireIntervalSec > 0) {
             this.expireIntervalSec = expireIntervalSec;
         } else {
             this.expireIntervalSec = 0;
         }
+
+        return this;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/storm/blob/86f7c171/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisStateUpdater.java
----------------------------------------------------------------------
diff --git a/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisStateUpdater.java b/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisStateUpdater.java
index 664a222..2939d3d 100644
--- a/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisStateUpdater.java
+++ b/external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisStateUpdater.java
@@ -32,16 +32,21 @@ public class RedisStateUpdater extends BaseStateUpdater<RedisState> {
 
     private final String redisKeyPrefix;
     private final TupleMapper tupleMapper;
-    private final int expireIntervalSec;
+    private int expireIntervalSec = 0;
 
-    public RedisStateUpdater(String redisKeyPrefix, TupleMapper tupleMapper, int expireIntervalSec) {
+    public RedisStateUpdater(String redisKeyPrefix, TupleMapper tupleMapper) {
         this.redisKeyPrefix = redisKeyPrefix;
         this.tupleMapper = tupleMapper;
+    }
+
+    public RedisStateUpdater withExpire(int expireIntervalSec) {
         if (expireIntervalSec > 0) {
             this.expireIntervalSec = expireIntervalSec;
         } else {
             this.expireIntervalSec = 0;
         }
+
+        return this;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/storm/blob/86f7c171/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedis.java
----------------------------------------------------------------------
diff --git a/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedis.java b/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedis.java
index 8b6ebc5..eb13399 100644
--- a/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedis.java
+++ b/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedis.java
@@ -55,7 +55,7 @@ public class WordCountTridentRedis {
 
         stream.partitionPersist(factory,
                                 fields,
-                                new RedisStateUpdater("test_", tupleMapper, 86400000),
+                                new RedisStateUpdater("test_", tupleMapper).withExpire(86400000),
                                 new Fields());
 
         TridentState state = topology.newStaticState(factory);

http://git-wip-us.apache.org/repos/asf/storm/blob/86f7c171/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedisCluster.java
----------------------------------------------------------------------
diff --git a/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedisCluster.java b/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedisCluster.java
index ddb6939..8562e77 100644
--- a/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedisCluster.java
+++ b/external/storm-redis/src/test/java/org/apache/storm/redis/trident/WordCountTridentRedisCluster.java
@@ -63,7 +63,7 @@ public class WordCountTridentRedisCluster {
 
         stream.partitionPersist(factory,
                                 fields,
-                                new RedisClusterStateUpdater("test_", tupleMapper, 86400000),
+                                new RedisClusterStateUpdater("test_", tupleMapper).withExpire(86400000),
                                 new Fields());
 
         TridentState state = topology.newStaticState(factory);


[3/3] storm git commit: Added STORM-752 to Changelog

Posted by bo...@apache.org.
Added STORM-752 to Changelog


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

Branch: refs/heads/master
Commit: 106af613f310353ac0a49a1f37244a916e6770e4
Parents: 88af3e3
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Fri May 22 16:42:19 2015 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Fri May 22 16:42:19 2015 -0500

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


http://git-wip-us.apache.org/repos/asf/storm/blob/106af613/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53d6486..e30f440 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -53,6 +53,7 @@
  * STORM-749: Remove CSRF check from the REST API.
 
 ## 0.10.0
+ * STORM-752: [storm-redis] Clarify Redis*StateUpdater's expire is optional
  * STORM-681: Auto insert license header with genthrift.sh
  * STORM-707: Client (Netty): improve logging to help troubleshooting connection woes
  * STORM-699: storm-jdbc should support custom insert queries. 


[2/3] storm git commit: Merge branch 'clarify-expire-is-optional' of https://github.com/HeartSaVioR/storm into STORM-752

Posted by bo...@apache.org.
Merge branch 'clarify-expire-is-optional' of https://github.com/HeartSaVioR/storm into STORM-752

STORM-752: [storm-redis] Clarify Redis*StateUpdater's expire is optional


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

Branch: refs/heads/master
Commit: 88af3e3ff393974e89fc47cc5497a910880786d9
Parents: 427e954 86f7c17
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Fri May 22 16:25:59 2015 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Fri May 22 16:25:59 2015 -0500

----------------------------------------------------------------------
 external/storm-redis/README.md                              | 4 ++--
 .../storm/redis/trident/state/RedisClusterStateUpdater.java | 9 +++++++--
 .../apache/storm/redis/trident/state/RedisStateUpdater.java | 9 +++++++--
 .../apache/storm/redis/trident/WordCountTridentRedis.java   | 2 +-
 .../storm/redis/trident/WordCountTridentRedisCluster.java   | 2 +-
 5 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/88af3e3f/external/storm-redis/README.md
----------------------------------------------------------------------