コード例 #1
0
ファイル: MapReduceJob.java プロジェクト: bslatkin/8-bits
 @Override
 public Value<MapReduceResult<R>> run(
     ResultAndCounters<List<AppEngineFile>> mapResult, ShuffleResult<K, V, O> shuffleResult) {
   @SuppressWarnings("unchecked")
   PromisedValue<MapReduceResult<R>> result = (PromisedValue) newPromise(MapReduceResult.class);
   String shardedJobId = mrJobId + "-reduce";
   startShardedJob(
       mrSpec.getJobName() + " (reduce phase)",
       shardedJobId,
       mapResult.getCounters(),
       shuffleResult.getReducerReaders(),
       mrSpec.getOutput(),
       shuffleResult.getReducerWriters(),
       new TaskCreator<KeyValue<K, ReducerInput<V>>, O, ReducerContext<O>>() {
         @Override
         public WorkerShardTask<KeyValue<K, ReducerInput<V>>, O, ReducerContext<O>> createTask(
             int shard,
             int shardCount,
             InputReader<KeyValue<K, ReducerInput<V>>> reader,
             OutputWriter<O> writer) {
           return new ReduceShardTask<K, V, O>(
               mrJobId,
               shard,
               shardCount,
               reader,
               mrSpec.getReducer(),
               writer,
               settings.getMillisPerSlice());
         }
       },
       result.getHandle(),
       settings);
   setStatusConsoleUrl(settings.getBaseUrl() + "detail?mapreduce_id=" + shardedJobId);
   return result;
 }
コード例 #2
0
ファイル: MapReduceJob.java プロジェクト: bslatkin/8-bits
 @Override
 public Value<Void> run(ShuffleResult<K, V, O> shuffleResult) {
   futureCall(
       new DeleteFilesJob("" + this),
       immediate(shuffleResult.getReducerInputFiles()),
       Util.jobSettings(settings));
   return immediate(null);
 }