/** Families with no ID assigned yet. */
final List<FamilyLayout> unassigned = Lists.newArrayList();
final Iterator<FamilyDesc> itFamilyDesc = lgDesc.getFamilies().iterator();
while (itFamilyDesc.hasNext()) {
final FamilyDesc familyDesc = itFamilyDesc.next();
final boolean isRename = (familyDesc.getRenamedFrom() != null);
final String refFName = isRename ? familyDesc.getRenamedFrom() : familyDesc.getName();
familyDesc.setRenamedFrom(null);
if (isRename && (reference == null)) {
throw new InvalidLayoutException(String.format(
"Invalid rename: no reference locality group '%s' for family '%s'.",
getName(), refFName));
}
final FamilyLayout refFLayout =
(reference != null) ? reference.getFamilyMap().get(refFName) : null;
if (isRename && (refFLayout == null)) {
throw new InvalidLayoutException(String.format(
"Invalid rename: cannot find reference family '%s' in locality group '%s'.",
refFName, getName()));
}
final ColumnId refFId = refFIdMap.remove(refFName);
if (familyDesc.getDelete()) {
if (refFId == null) {
throw new InvalidLayoutException(String.format(
"Deleted family '%s' unknown in reference locality group '%s'.",
refFName, getName()));
}