- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
所以我有一个数据流作业在做
p.apply(RedisIO.read()
.withEndpoint(<public endpoint>, 6379)
.withAuth(<password>)
.withTimeout(60000)
.withKeyPattern("UID*"))
.apply(ParDo.of(new Format()))
.apply(TextIO.write().to(options.getOutput()));
redis 端点是使用没有防火墙设置的密码进行公共(public)身份验证的。当我运行上面的命令时,出现以下错误。
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-
plugin:1.6.0:java (default-cli) on project word-count-beam: An
exception occured while executing the Java class.
org.apache.beam.sdk.util.UserCodeException:
redis.clients.jedis.exceptions.JedisConnectionException:
java.net.ConnectException: Connection refused -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-
cli) on project word-count-beam: An exception occured while executing
the Java class. org.apache.beam.sdk.util.UserCodeException:
redis.clients.jedis.exceptions.JedisConnectionException:
java.net.ConnectException: Connection refused
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception
occured while executing the Java class.
org.apache.beam.sdk.util.UserCodeException: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused
at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:339)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: org.apache.beam.runners.direct.repackaged.com.google.common.util.concurrent
.UncheckedExecutionException:
org.apache.beam.sdk.util.UserCodeException:
redis.clients.jedis.exceptions.JedisConnectionException:
java.net.ConnectException: Connection refused
因此未与公共(public) redis 端点建立连接。当我通过 DirectRunner 运行时,我遇到了同样的错误。我在这里遗漏了什么吗?
最佳答案
RedisIO 的 Apache Beam 源代码中存在一个已知错误,其中 withEndpoint 会忽略输入主机并将尝试使用本地主机。在没有本地主机的情况下尝试连接到本地主机上的 Redis 服务器会出现您所看到的错误。
您可以阅读有关问题的更多信息 here ,并查看带有修复的拉取请求 here .
在该拉取请求被合并之前,您应该能够通过复制 RedisIO.java 自己实现更改来解决问题。进入你的项目并改变
.setConnectionConfiguration(connectionConfiguration().withHost(host))
.setConnectionConfiguration(connectionConfiguration().withPort(port))
到
.setConnectionConfiguration(connectionConfiguration().withHost(host).withPort(port))
请注意,同样的错误在 RedisIO 中出现了 3 次,一次是针对 Read(第 168 行)、ReadAll(第 233 行)和 Write(第 365 行)。
关于redis - 使用 apache beam sdk 时无法连接到 Redis 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50173933/
我正在使用 Apache Beam 从 Kafka 读取数据。由于乱序写入 Kafka,我想使用有效负载中的事件时间戳而不是默认的 LogAppendTime。 我看到了一个解决方案 Apache B
我有一个通用输入请求,其中包含需要转换和保存的输入。如果需要转换生成的输出,我会为它实现一个新的处理器(转换器)。 class Request { Input input; Transform
我已经在 Apache Beam 上工作了几天。我想快速迭代我正在工作的应用程序,并确保我正在构建的管道没有错误。在 Spark 中我们可以使用 sc.parallelise当我们应用一些 Actio
我有一个简单的波束管道,它使用带有 tf 变换的通用句子编码器获取一些文本并获得嵌入。与使用 tf 1 制作的演示非常相似。 import tensorflow as tf import apache
使用Apache Beam丰富数据时,对每个数据项都进行一次API调用会不会出错? (我是 Apache Beam 的新手) 最佳答案 不,但您可以批处理 API 调用以获得更好的性能。查看 this
我的任务是为一款应用添加支持,以便通过 Android 上的“NFC”在设备之间传输大型数据文件(数十兆字节)。 我知道 Android 上真正的 NFC 非常慢,但我知道 ICS 支持将批量数据传输
NFC:S-beam 和 Android beam 有什么区别?有人可以解释 Wifi-Direct/Bluetooth 激活和传输数据的确切流程吗? 最佳答案 在 stackexchanged 上解
我正在使用 Beam 管道计算流式数据的电话号码频率。我使用的滑动窗口每 5 分钟重复一次,总周期为 15 分钟,因此正如预期的那样,对于某些输入,当输入落在多个窗口中时,我会得到多个输出。 计算出现
输入的PCollection是http requests,是一个有界数据集。我想在 ParDo 中进行异步 http 调用(Java),解析响应并将结果放入输出 PCollection 中。我的代码如
输入的PCollection是http requests,是一个有界数据集。我想在 ParDo 中进行异步 http 调用(Java),解析响应并将结果放入输出 PCollection 中。我的代码如
在使用 PAssert 为我的光束管道编写单元测试时,管道输出对象很好,但在与以下断言错误进行比较时测试失败: java.lang.AssertionError: Decode pubsub mess
我正在尝试从 here 运行 Wordcount 演示与 Samza Runner。这是我的build.gradle plugins { id 'eclipse' id 'java' id
我正在尝试使用 Beam 和 Flink runner 设置流处理管道。 Flink 是一个本地 session 部署,包含以下 docker-compose 文件: version: "3" ser
在尝试编译我的 Phoenix 项目的发行版时,出现以下错误: $ mix release .... ==> Generated .appup for myapp 0.0.1 -> 0.0.2 ===
我正在尝试使用 Apache beam-dataflow 连接到安装在云实例中的配置单元实例。当我运行它时,出现以下异常。当我使用 Apache Beam 访问此数据库时,就会发生这种情况。我见过很多
我正在使用 zsh,并且我已经安装了 gcloud,以便通过我的 Mac 上的本地终端与 GCP 进行交互。我遇到了这个错误“zsh:找不到匹配项:apache-beam[gcp]”。但是,当我在 G
主要记录两种不同的beam search版本 版本一 使用类似层次遍历的方式进行搜索,用队列进行维护,每次循环对当前层的所有节点进行搜索,这些节点每个分别对应topk个节点作为下一层候选节点,取
我的目标是创建一个每秒调用后端(云托管)服务最多次数的管道......我该如何实现? 背景故事:想象一下后端服务使用单个输入调用并返回单个输出。该服务具有与其关联的配额,允许每秒最大请求数(假设每秒
我想写入一个 gs 文件,但在编译时我不知道文件名。它的名称基于在运行时定义的行为。我该如何继续? 最佳答案 如果你使用 Beam Java,你可以使用 FileIO.writeDynamic()为此
我试图弄清楚如何使用Apache Beam读取大型CSV文件。 “大”是指几千兆字节(因此一次将整个CSV读取到内存中是不切实际的)。 到目前为止,我已经尝试了以下选项: 使用TextIO.read(
我是一名优秀的程序员,十分优秀!