class FixLzoCodecPath extends AbstractUpgradeServerAction {

  public static String fixLzoJarPath(String oldPropertyValue) {
    // Makes sure that LZO codec path uses ${hdp.version} instead of hardcoded hdp version,
    // so it replaces variations of /usr/hdp/2.3.4.0-3485/hadoop/lib/hadoop-lzo-0.6.0.2.3.4.0-3485.jar
    // with /usr/hdp/${hdp.version}/hadoop/lib/hadoop-lzo-0.6.0.${hdp.version}.jar
    return oldPropertyValue.replaceAll(
      "(/usr/hdp/)[^\\\\:]+(/hadoop/lib/hadoop-lzo-(\\d\\.)+)(\\$\\{hdp.version\\}|(\\d\\.){3}\\d-\\d+)(\\.jar)",
      "$1\\$\\{hdp.version\\}$2\\$\\{hdp.version\\}$6");
  }

}