Skip to content

Commit 4e7cc5c

Browse files
author
Julien Ruaux
committed
refactor: Organized switch statement by data structure type
1 parent fc99e65 commit 4e7cc5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/redis/kafka/connect/sink/RedisEnterpriseSinkTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ private String offsetKey(String topic, Integer partition) {
135135

136136
private RedisOperation<byte[], byte[], SinkRecord> operation() {
137137
switch (config.getType()) {
138-
case STREAM:
139-
return Xadd.<byte[], byte[], SinkRecord>key(this::collectionKey).body(this::map).build();
140138
case HASH:
141139
return Hset.<byte[], byte[], SinkRecord>key(this::key).map(this::map).del(this::isDelete).build();
142140
case JSON:
143141
return JsonSet.<byte[], byte[], SinkRecord>key(this::key).path(".".getBytes(config.getCharset()))
144142
.value(this::value).del(this::isDelete).build();
145143
case STRING:
146144
return Set.<byte[], byte[], SinkRecord>key(this::key).value(this::value).del(this::isDelete).build();
145+
case STREAM:
146+
return Xadd.<byte[], byte[], SinkRecord>key(this::collectionKey).body(this::map).build();
147147
case LIST:
148148
if (config.getPushDirection() == RedisEnterpriseSinkConfig.PushDirection.LEFT) {
149149
return Lpush.<byte[], byte[], SinkRecord>key(this::collectionKey).member(this::member).build();

0 commit comments

Comments
 (0)