int portId,
FlowElementInput input,
ShuffleDescription desciption) {
assert input != null;
assert desciption != null;
ShuffleKey keyInfo = desciption.getKeyInfo();
Type inputType = input.getDescription().getDataType();
DataClassRepository dataClasses = environment.getDataClasses();
DataClass source = dataClasses.load(inputType);
DataClass target = dataClasses.load(desciption.getOutputType());
if (source == null) {
error("データクラス{0}は定義されていません", inputType);
}
if (target == null) {
error("データクラス{0}は定義されていません", desciption.getOutputType());
}
if (source == null || target == null) {
return null;
}
List<ShuffleModel.Term> terms = Lists.create();
for (String name : keyInfo.getGroupProperties()) {
int termId = terms.size() + 1;
DataClass.Property property = target.findProperty(name);
if (property == null) {
error("データクラス{0}にはプロパティ{1}が定義されていません", target, name);
continue;
}
terms.add(new ShuffleModel.Term(
termId,
property,
ShuffleModel.Arrangement.GROUPING));
}
for (ShuffleKey.Order order : keyInfo.getOrderings()) {
int termId = terms.size() + 1;
DataClass.Property property = target.findProperty(order.getProperty());
if (property == null) {
error("データクラス{0}にはプロパティ{1}が定義されていません",
target,