private List<FieldDeclaration> prepareFields() {
List<FieldDeclaration> fields = Lists.create();
// shufles
for (ShuffleModel.Segment segment : shuffle.getSegments()) {
SimpleName shuffleName = names.create("shuffle");
shuffleNames.put(segment, shuffleName);
Name shuffleTypeName = segment.getCompiled().getCombineOutputType().getQualifiedName();
fields.add(factory.newFieldDeclaration(
null,
new AttributeBuilder(factory)
.Private()
.toAttributes(),
importer.toType(shuffleTypeName),
shuffleName,
null));
}
// rendezvous
for (ReduceUnit unit : reduceUnits) {
if (unit.canCombine() == false) {
continue;
}
Fragment first = unit.getFragments().get(0);
SimpleName rendezvousName = names.create("combine");
rendezvousNames.put(first, rendezvousName);
fields.add(factory.newFieldDeclaration(
null,
new AttributeBuilder(factory)
.Private()