有没有办法使用内置的 Apache beam Redis I/O 转换执行 Redis GET 命令?

Is there a way to perform a Redis GET command with the built-in Apache beam Redis I/O transform?

我对 Google Cloud Dataflow 的用例是在管道期间使用 Redis 作为缓存,因为要发生的转换取决于一些缓存数据。这意味着执行 Redis GET 命令。官方内置 Redis I/O 转换的文档提到支持一些方法:

阅读 - "provides a source which returns a bounded PCollection containing key/value pairs as KV"

readAll - "can be used to request Redis server using input PCollection elements as key pattern (as String)"

看起来 readAll 不对应于 GET 命令,因为输入 PCollection 将用于过滤扫描整个 Redis 源的结果,所以这不是我要找的。

我想知道在查看支持我的用例的内置 I/O 转换时是否遗漏了什么,或者是否有开源第三方 I/O 转换支持它。或者,这是否与 Apache Beam 根本不兼容?

您可以使用 RedisConnectionConfiguration。它将为您提供可在转换中使用的可序列化连接。