}
}
protected int compareMultipleSources(byte[] b1, int s1, int l1, byte[] b2, int s2,
int l2) throws IOException {
Schema commonSchema = serInfo.getCommonSchema();
Criteria commonOrder = tupleMRConf.getCommonCriteria();
int comparison = compare(b1, s1, b2, s2, commonSchema, commonOrder, offsets, nulls);
if (comparison != 0) {
return comparison;
}
int schemaId1 = readVInt(b1, offsets.offset1);
int schemaId2 = readVInt(b2, offsets.offset2);
if (schemaId1 != schemaId2) {
int r = schemaId1 - schemaId2;
return (tupleMRConf.getSchemasOrder() == Order.ASC) ? r : -r;
}
int vintSize = WritableUtils.decodeVIntSize(b1[offsets.offset1]);
offsets.offset1 += vintSize;
offsets.offset2 += vintSize;
// sources are the same
Criteria criteria = tupleMRConf.getSpecificOrderBys().get(schemaId1);
if (criteria == null) {
return 0;
}
Schema specificSchema = serInfo.getSpecificSchema(schemaId1);
return compare(b1, offsets.offset1, b2, offsets.offset2, specificSchema, criteria,
offsets, nulls);
}