if(isMultipleSources) {
int schemaId1 = tupleMRConf.getSchemaIdByName(w1.getSchema().getName());
int schemaId2 = tupleMRConf.getSchemaIdByName(w2.getSchema().getName());
int[] indexes1 = serInfo.getCommonSchemaIndexTranslation(schemaId1);
int[] indexes2 = serInfo.getCommonSchemaIndexTranslation(schemaId2);
Criteria c = tupleMRConf.getCommonCriteria();
int comparison = compare(serInfo.getCommonSchema(), c, w1, indexes1, w2, indexes2,serInfo.getCommonSchemaSerializers());
if(comparison != 0) {
return comparison;
} else if(schemaId1 != schemaId2) {
int r = schemaId1 - schemaId2;
return (tupleMRConf.getSchemasOrder() == Order.ASC) ? r : -r;
}
int schemaId = schemaId1;
c = tupleMRConf.getSpecificOrderBys().get(schemaId);
if(c != null) {
int[] indexes = serInfo.getSpecificSchemaIndexTranslation(schemaId);
return compare(serInfo.getSpecificSchema(schemaId), c, w1, indexes, w2, indexes,serInfo.getSpecificSchemaSerializers().get(schemaId));
} else {
return 0;
}
} else {
int[] indexes = serInfo.getCommonSchemaIndexTranslation(0);
Criteria c = tupleMRConf.getCommonCriteria();
return compare(serInfo.getCommonSchema(), c, w1, indexes, w2, indexes,serInfo.getCommonSchemaSerializers());
}
}