public Value<MapReduceResult<FilesByShard>> run(MapReduceResult<FilesByShard> mapResult) {
Context context = new BaseContext(mrJobId);
int mapShards = findMaxFilesPerShard(mapResult.getOutputResult());
int reduceShards = mrSpec.getNumReducers();
FilesByShard filesByShard = mapResult.getOutputResult();
filesByShard.splitShards(Math.max(mapShards, reduceShards));
GoogleCloudStorageSortInput input = new GoogleCloudStorageSortInput(filesByShard);
((Input<?>) input).setContext(context);
List<? extends InputReader<KeyValue<ByteBuffer, ByteBuffer>>> readers = input.createReaders();
Output<KeyValue<ByteBuffer, List<ByteBuffer>>, FilesByShard> output =
new GoogleCloudStorageSortOutput(settings.getBucketName(), mrJobId,