gpt4 book ai didi

java - 找不到 org.apache.hadoop.mapred.LocalClientProtocolProvider

转载 作者:可可西里 更新时间:2023-11-01 14:21:10 24 4
gpt4 key购买 nike

我用 Java 编写了一个程序来执行嵌入的 Pig 语句。我执行了java语句registryQuery。但是当我尝试存储结果时,我给出了 org.apache.hadoop.mapred.localClientProtocolProvider not found 的错误。我不明白这个错误。

附上句子:

这是java代码

 pigServer.registerQuery("source = load '"+ inputFile + "' USING    org.apache.pig.backend.hadoop.hbase.HBaseStorage( " +
"'datos:bikes', '-loadKey true')"+
"as (id1:int, bikes:int) ;");

Path output = new Path("consulta1");

pigServer.store("source","consulta1");

这是 java 异常:

14/06/07 04:01:27 INFO pigstats.ScriptState: Pig features used in the script: UNKNOWN
14/06/07 04:01:27 WARN conf.Configuration: mapred.textoutputformat.separator is deprecated. Instead, use mapreduce.output.textoutputformat.separator
14/06/07 04:01:27 INFO mapReduceLayer.MRCompiler: File concatenation threshold: 100 optimistic? false
14/06/07 04:01:27 INFO mapReduceLayer.MultiQueryOptimizer: MR plan size before optimization: 1
14/06/07 04:01:27 INFO mapReduceLayer.MultiQueryOptimizer: MR plan size after optimization: 1
Exception in thread "main" java.util.ServiceConfigurationError:
org.apache.hadoop.mapreduce.protocol.ClientProtocolProvider: Provider
org.apache.hadoop.mapred.LocalClientProtocolProvider not found
at java.util.ServiceLoader.fail(ServiceLoader.java:214)
at java.util.ServiceLoader.access$400(ServiceLoader.java:164)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:350)
at java.util.ServiceLoader$1.next(ServiceLoader.java:421)
at org.apache.hadoop.mapreduce.Cluster.initialize(Cluster.java:90)
at org.apache.hadoop.mapreduce.Cluster.<init>(Cluster.java:83)
at org.apache.hadoop.mapreduce.Cluster.<init>(Cluster.java:76)
at org.apache.hadoop.mapred.JobClient.init(JobClient.java:478)
at org.apache.hadoop.mapred.JobClient.<init>(JobClient.java:457)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:152)
at org.apache.pig.PigServer.launchPlan(PigServer.java:1266)
at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1251)
at org.apache.pig.PigServer.storeEx(PigServer.java:933)
at org.apache.pig.PigServer.store(PigServer.java:900)
at org.apache.pig.PigServer.store(PigServer.java:868)
at bicing.pig.PigEstadisticas.runMyQuery(PigEstadisticas.java:97)
at bicing.pig.PigEstadisticas.main(PigEstadisticas.java:45)

什么是 org.apache.hadoop.mapred.LocalClientProtocolProvider?

有人能帮帮我吗?

最佳答案

这是一个老问题,但由于这可以帮助其他人,所以我正在回答。

这个问题的原因是类

org.apache.hadoop.mapred.LocalClientProtocolProvider

在您的类路径中找不到。我通过添加以下 Maven 依赖项在我的设置中解决了这个错误。

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-common</artifactId>
<version>2.4.1</version>
</dependency>

关于这个类的功能,我目前没有更多的信息,因为我自己正在学习hadoop和Pig。

关于java - 找不到 org.apache.hadoop.mapred.LocalClientProtocolProvider,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24096834/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com