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,
new HashingSharder(reduceShards));
output.setContext(context);
List<? extends OutputWriter<KeyValue<ByteBuffer, List<ByteBuffer>>>> writers =
output.createWriters(readers.size());
Preconditions.checkState(readers.size() == writers.size(), "%s: %s readers, %s writers",
shardedJobId, readers.size(), writers.size());
ImmutableList.Builder<WorkerShardTask<KeyValue<ByteBuffer, ByteBuffer>,
KeyValue<ByteBuffer, List<ByteBuffer>>, SortContext>> sortTasks =
ImmutableList.builder();