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:43:34 UTC
[1/2] storm git commit: Merge branch 'clarify-expire-is-optional' of
https://github.com/HeartSaVioR/storm into STORM-752
Repository: storm
Updated Branches:
refs/heads/0.10.x-branch bafb86bb0 -> 90c599448
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
Conflicts:
external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisClusterStateUpdater.java
external/storm-redis/src/main/java/org/apache/storm/redis/trident/state/RedisStateUpdater.java
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/add152c3
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/add152c3
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/add152c3
Branch: refs/heads/0.10.x-branch
Commit: add152c383e2fc9322a0403bd119568976a31081
Parents: bafb86b
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:39:30 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/add152c3/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/add152c3/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 e72735a..8512888 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 TridentTupleMapper tupleMapper;
- private final int expireIntervalSec;
+ private int expireIntervalSec = 0;
- public RedisClusterStateUpdater(String redisKeyPrefix, TridentTupleMapper tupleMapper, int expireIntervalSec) {
+ public RedisClusterStateUpdater(String redisKeyPrefix, TridentTupleMapper 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/add152c3/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 67f7c51..c53476f 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 TridentTupleMapper tupleMapper;
- private final int expireIntervalSec;
+ private int expireIntervalSec = 0;
- public RedisStateUpdater(String redisKeyPrefix, TridentTupleMapper tupleMapper, int expireIntervalSec) {
+ public RedisStateUpdater(String redisKeyPrefix, TridentTupleMapper 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/add152c3/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 9a28cb7..a610f54 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
@@ -56,7 +56,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/add152c3/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 31434dc..8bea3ce 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);
[2/2] 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/90c59944
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/90c59944
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/90c59944
Branch: refs/heads/0.10.x-branch
Commit: 90c59944881f3b4850d43177541a7cff66123341
Parents: add152c
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Fri May 22 16:40:19 2015 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Fri May 22 16:40:19 2015 -0500
----------------------------------------------------------------------
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/90c59944/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 114dbaa..e03dc8e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
## 0.10.0
+ * STORM-752: [storm-redis] Clarify Redis*StateUpdater's expire is optional
* STORM-786: KafkaBolt should ack tick tuples
* STORM-512: KafkaBolt doesn't handle ticks properly
* STORM-788: Fix key for process latencies