【问题标题】:Google App Engine MapReduceSpecification exceptionGoogle App Engine MapReduceSpecification 异常
【发布时间】:2013-09-04 08:04:12
【问题描述】:

重写以简化。为什么会这样编译:

MapReduceSpecification.of(
   "Something, anything", 
   input,
   mapper, // (extends Mapper<Job, Long, String>)
   Marshallers.getLongMarshaller(),
   Marshallers.getStringMarshaller(),
   NoReducer.<Long, String, String>create(),
   NoOutput.<String, String>create((int)1L)
);

但事实并非如此。注意 cmets 中不同的“映射器”扩展:

MapReduceSpecification.of(
   "Something, anything", 
   input,
   mapper, // (extends Mapper<Job, Long, JobSummary>)
   Marshallers.getLongMarshaller(),
   Marshallers.getSerializationMarshaller(),
   NoReducer.<Long, JobSummary, JobSummary>create(),
   NoOutput.<JobSummary, JobSummary>create((int)1L)
);

抛出此编译异常:

The method
of(String,
Input<I>,
Mapper<I,K,V>,
Marshaller<K>,
Marshaller<V>,
Reducer<K,V,O>, Output<O,R>)
in the type MapReduceSpecification is not applicable for the arguments
(String,
JobInput,
JobMapper,
Marshaller<Long>,
Marshaller<Serializable>,
NoReducer<Long,JobSummary,JobSummary>,
NoOutput<JobSummary,JobSummary>)    

JobSummary 很简单(出于本示例的目的):

public class JobSummary implements Serializable {
   public String Text;
}

任何关于我错过了 I、K、V、O、R 的神秘组合的哪一点的见解?

【问题讨论】:

    标签: google-app-engine mapreduce


    【解决方案1】:

    使用特定于类的实现复制 SerializationMarshaller 似乎已经解决了这个问题。这是一个非常不令人满意的解决方案,但它确实有效。

    【讨论】:

      猜你喜欢
      • 2012-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-09
      • 2015-01-02
      • 1970-01-01
      • 1970-01-01
      • 2020-12-31
      相关资源
      最近更新 更多