Apache-Beam 异常,而 运行 日食中的 WordCount 示例

Apache-Beam exception while running WordCount example in eclipse

使用

在 eclipse 中下载了 maven 依赖项
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-runners-direct-java</artifactId>
<version>0.2.0-incubating</version></dependency>

当下载和运行WordCount例子后把gs路径改成C://examples//misc.txt.Getting下面exception.I没有通过任何runner.How 在从 eclipse 运行ning 时传递 运行ner 选项和输出参数??

    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.IllegalStateException: Failed to validate C://examples//misc.txt
    at org.apache.beam.sdk.io.TextIO$Read$Bound.apply(TextIO.java:288)
    at org.apache.beam.sdk.io.TextIO$Read$Bound.apply(TextIO.java:195)
    at org.apache.beam.sdk.runners.PipelineRunner.apply(PipelineRunner.java:76)
    at org.apache.beam.runners.direct.DirectRunner.apply(DirectRunner.java:205)
    at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:401)
    at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:324)
    at org.apache.beam.sdk.values.PBegin.apply(PBegin.java:59)
    at org.apache.beam.sdk.Pipeline.apply(Pipeline.java:174)
    at org.apache.beam.examples.WordCount.main(WordCount.java:206)
Caused by: java.io.IOException: Unable to find handler for C://examples//misc.txt
    at org.apache.beam.sdk.util.IOChannelUtils.getFactory(IOChannelUtils.java:188)
    at org.apache.beam.sdk.io.TextIO$Read$Bound.apply(TextIO.java:283)
    ... 8 more

我相信 Apache Beam 会解析类似于 http://domain/file 的语法 C://directory/file —— 它会认为 C 是一个协议名称,而 directory 是一个域。内部异常是说 C 是一个未知协议。

引用本地文件时请尽量避免使用://符号。我建议使用常规 Windows 标准:C:\directory\file.