-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support sinking arbitrary Redis commands (#16)
- Loading branch information
1 parent
921e36c
commit 4bae458
Showing
17 changed files
with
295 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM redislabs/redistimeseries:1.4.6 as redistimeseries | ||
FROM redis:6 | ||
|
||
ENV LIBRARY_PATH /usr/lib/redis/modules | ||
|
||
COPY --from=redistimeseries ${LIBRARY_PATH}/redistimeseries.so ${LIBRARY_PATH}/redistimeseries.so | ||
|
||
ENTRYPOINT ["redis-server"] | ||
CMD ["/usr/local/etc/redis/redis.conf", "--loadmodule", "/usr/lib/redis/modules/redistimeseries.so"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/io/github/jaredpetersen/kafkaconnectredis/sink/writer/LettuceVoidOutput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.github.jaredpetersen.kafkaconnectredis.sink.writer; | ||
|
||
import io.lettuce.core.codec.RedisCodec; | ||
import io.lettuce.core.output.CommandOutput; | ||
import java.nio.ByteBuffer; | ||
|
||
/** | ||
* Void output of a Redis command used to "fire and forget". | ||
* <p /> | ||
* Temporary stopgap until https://github.com/lettuce-io/lettuce-core/issues/1529 is released. | ||
* | ||
* @param <K> Key type. | ||
* @param <V> Value type. | ||
*/ | ||
class LettuceVoidOutput<K, V> extends CommandOutput<K, V, Void> { | ||
public LettuceVoidOutput(RedisCodec<K, V> codec) { | ||
super(codec, null); | ||
} | ||
|
||
@Override | ||
public void set(ByteBuffer bytes) { | ||
} | ||
|
||
@Override | ||
public void set(long integer) { | ||
} | ||
|
||
@Override | ||
public void set(double number) { | ||
} | ||
|
||
@Override | ||
public void set(boolean value) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...a/io/github/jaredpetersen/kafkaconnectredis/sink/writer/record/RedisArbitraryCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.github.jaredpetersen.kafkaconnectredis.sink.writer.record; | ||
|
||
import java.util.List; | ||
import lombok.Builder; | ||
import lombok.Value; | ||
|
||
@Value | ||
@Builder(builderClassName = "Builder") | ||
public class RedisArbitraryCommand implements RedisCommand { | ||
Command command = Command.ARBITRARY; | ||
Payload payload; | ||
|
||
@Value | ||
@lombok.Builder(builderClassName = "Builder") | ||
public static class Payload { | ||
String command; | ||
List<String> arguments; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
public interface RedisCommand { | ||
enum Command { | ||
ARBITRARY, | ||
SET, | ||
EXPIRE, | ||
EXPIREAT, | ||
|
1 change: 0 additions & 1 deletion
1
src/main/java/io/github/jaredpetersen/kafkaconnectredis/source/config/RedisSourceConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.