public IndexMetaData upgradeIndexMetaData(IndexMetaData indexMetaData){
  if (isUpgraded(indexMetaData)) {
    return indexMetaData;
  }
  checkSupportedVersion(indexMetaData);
  IndexMetaData newMetaData=upgradeLegacyRoutingSettings(indexMetaData);
  newMetaData=addDefaultUnitsIfNeeded(newMetaData);
  checkMappingsCompatibility(newMetaData);
  newMetaData=upgradeSettings(newMetaData);
  newMetaData=markAsUpgraded(newMetaData);
  return newMetaData;
}

public IndexMetaData upgradeIndexMetaData ( IndexMetaData indexMetaData ) { if ( isUpgraded ( indexMetaData ) ) { return indexMetaData ; } checkSupportedVersion ( indexMetaData ) ; IndexMetaData newMetaData = upgradeLegacyRoutingSettings ( indexMetaData ) ; newMetaData = addDefaultUnitsIfNeeded ( newMetaData ) ; checkMappingsCompatibility ( newMetaData ) ; newMetaData = upgradeSettings ( newMetaData ) ; newMetaData = markAsUpgraded ( newMetaData ) ; return newMetaData ; }
checks that the index can be upgraded to the current version of the master node . < p / > if the index does not need upgrade it returns the index metadata unchanged , otherwise it returns a modified index metadata . if index cannot be updated the method throws an exception .
