storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [4/6] storm git commit: apply defensive programming to switch statements
Date Tue, 24 Mar 2015 14:57:36 GMT
apply defensive programming to switch statements


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

Branch: refs/heads/master
Commit: 62b5a7e58ac2441edb0717d24c751697623b239c
Parents: b129080
Author: Jungtaek Lim <kabhwan@gmail.com>
Authored: Thu Mar 12 08:36:49 2015 +0900
Committer: Jungtaek Lim <kabhwan@gmail.com>
Committed: Thu Mar 12 08:36:49 2015 +0900

----------------------------------------------------------------------
 .../main/java/org/apache/storm/redis/bolt/RedisLookupBolt.java    | 3 +++
 .../src/main/java/org/apache/storm/redis/bolt/RedisStoreBolt.java | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/62b5a7e5/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisLookupBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisLookupBolt.java
b/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisLookupBolt.java
index c40e983..bbd7e6a 100644
--- a/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisLookupBolt.java
+++ b/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisLookupBolt.java
@@ -86,6 +86,9 @@ public class RedisLookupBolt extends AbstractRedisBolt {
                 case HYPER_LOG_LOG:
                     lookupValue = jedisCommand.pfcount(key);
                     break;
+
+                default:
+                    throw new IllegalArgumentException("Cannot process such data type: "
+ dataType);
             }
 
             List<Values> values = lookupMapper.toTuple(input, lookupValue);

http://git-wip-us.apache.org/repos/asf/storm/blob/62b5a7e5/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisStoreBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisStoreBolt.java
b/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisStoreBolt.java
index 5602c44..761c5ed 100644
--- a/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisStoreBolt.java
+++ b/external/storm-redis/src/main/java/org/apache/storm/redis/bolt/RedisStoreBolt.java
@@ -80,6 +80,9 @@ public class RedisStoreBolt extends AbstractRedisBolt {
                 case HYPER_LOG_LOG:
                     jedisCommand.pfadd(key, value);
                     break;
+
+                default:
+                    throw new IllegalArgumentException("Cannot process such data type: "
+ dataType);
             }
 
             collector.ack(input);


Mime
View raw message