Skip to content

Commit 50c0cbe

Browse files
committed
cleanup
1 parent da465a7 commit 50c0cbe

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/main/java/org/sourcelab/storm/spout/redis/RedisStreamSpoutConfig.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,14 @@ private RedisStreamSpoutConfig(
8989
) {
9090
// Connection
9191
if (redisCluster != null && redisServer != null) {
92-
throw new IllegalStateException("TODO");
92+
throw new IllegalStateException(
93+
"You cannot configure connection details for both a single Redis server and RedisCluster. "
94+
+ "Use either Builder.withServer() OR Builder.withClusterNode(), but NOT both. "
95+
+ "If talking to a single Redis instance use Builder.withServer(). "
96+
+ "If talking to a RedisCluster use Builder.withClusterNode() to configure one or more nodes in the cluster."
97+
);
9398
} else if (redisCluster == null && redisServer == null) {
94-
throw new IllegalStateException("TODO");
99+
throw new IllegalStateException("You must configure connection details for either a single Redis server and RedisCluster.");
95100
}
96101

97102
this.redisCluster = redisCluster;
@@ -254,7 +259,12 @@ public Builder withServer(final String host, final int port, final String passwo
254259
private Builder withServer(final RedisServer redisServer) {
255260
if (!clusterNodes.isEmpty()) {
256261
// Cannot define both cluster servers and redis server instances.
257-
throw new IllegalArgumentException("TODO");
262+
throw new IllegalStateException(
263+
"You cannot configure connection details for both a single Redis server and RedisCluster. "
264+
+ "Use either Builder.withServer() OR Builder.withClusterNode(), but NOT both. "
265+
+ "If talking to a single Redis instance use Builder.withServer(). "
266+
+ "If talking to a RedisCluster use Builder.withClusterNode() to configure one or more nodes in the cluster."
267+
);
258268
}
259269
this.redisServer = Objects.requireNonNull(redisServer);
260270
return this;
@@ -301,7 +311,12 @@ public Builder withClusterNode(final String host, final int port, final String p
301311
private Builder withClusterNode(final RedisServer node) {
302312
if (redisServer != null) {
303313
// Cannot define both cluster servers and redis server instances.
304-
throw new IllegalArgumentException("TODO");
314+
throw new IllegalStateException(
315+
"You cannot configure connection details for both a single Redis server and RedisCluster. "
316+
+ "Use either Builder.withServer() OR Builder.withClusterNode(), but NOT both. "
317+
+ "If talking to a single Redis instance use Builder.withServer(). "
318+
+ "If talking to a RedisCluster use Builder.withClusterNode() to configure one or more nodes in the cluster."
319+
);
305320
}
306321
clusterNodes.add(Objects.requireNonNull(node));
307322
return this;

0 commit comments

Comments
 (0)