@Override
    public String validate(String value) {
      try {
        float fvalue = Float.parseFloat(value);
        if (fvalue < 0 || fvalue > 1) {
          return "Invalid ratio " + value + ", which should be in between 0 to 1";
        }
      } catch (NumberFormatException e) {
        return e.toString();
      }
      return null;
    }
validate value for a ConfVar, return non-null string for fail message
common/src/java/org/apache/hadoop/hive/conf/Validator.java