code: public static String getMandatoryConfig(Configuration config, String key)
        throws IOException {
      String value = config.get(key);
      if (Strings.isNullOrEmpty(value)) {
        throw new IOException("Must supply a value for configuration setting: " + key);
      }
      return value;
    }
docs: Gets value for the given key or throws if value is not found.