本文整理汇总了Java中com.google.appengine.tools.mapreduce.outputs.InMemoryOutput类的典型用法代码示例。如果您正苦于以下问题:Java InMemoryOutput类的具体用法?Java InMemoryOutput怎么用?Java InMemoryOutput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InMemoryOutput类属于com.google.appengine.tools.mapreduce.outputs包,在下文中一共展示了InMemoryOutput类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCreationJobSpec
import com.google.appengine.tools.mapreduce.outputs.InMemoryOutput; //导入依赖的package包/类
private MapReduceSpecification<Entity, String, Long, KeyValue<String, Long>, List<List<KeyValue<String, Long>>>> getCreationJobSpec(int bytesPerEntity, int entities,
int shardCount) {
// [START mapSpec]
// new DatastoreInput()
DatastoreInput input = new DatastoreInput("MessageJDO", 4);
MessageUpdater mapper = new MessageUpdater();
// return new MapSpecification.Builder<Long, Void, Void>(input, mapper)
// .setJobName("Update Message Entities")
// .build();
return new MapReduceSpecification.Builder<Entity, String, Long, KeyValue<String, Long>, List<List<KeyValue<String, Long>>>>(new DatastoreInput("MessageJDO", 4 ),
new CountMapper(), new CountReducer(), new InMemoryOutput<KeyValue<String, Long>>())
.setKeyMarshaller(Marshallers.getStringMarshaller())
.setValueMarshaller(Marshallers.getLongMarshaller())
.setJobName("MapReduceTest count")
.setNumReducers(4)
.build();
// return spec;
}
示例2: createMapreduce
import com.google.appengine.tools.mapreduce.outputs.InMemoryOutput; //导入依赖的package包/类
private static String createMapreduce(String jobName) throws Exception {
MapReduceJob<String, String, String, String, List<List<String>>> mapReduceJob =
new MapReduceJob<>(
new MapReduceSpecification.Builder<String, String, String, String, List<List<String>>>()
.setJobName(jobName)
.setInput(input)
.setMapper(new TestMapper())
.setReducer(new TestReducer())
.setOutput(new InMemoryOutput<>())
.setNumReducers(2)
.build(),
new MapReduceSettings.Builder().setWorkerQueueName(QUEUE_NAME).build());
PipelineService pipelineService = PipelineServiceFactory.newPipelineService();
return pipelineService.startNewPipeline(mapReduceJob, new JobSetting.OnQueue(QUEUE_NAME));
}