@Test public void testSingleStringGetMandatoryConfig() throws IOException { Configuration config = new Configuration(); assertThrows(IOException.class, () -> getMandatoryConfig(config, PROPERTY_ONE)); config.set(PROPERTY_ONE.getKey(), ""); assertThrows(IOException.class, () -> getMandatoryConfig(config, PROPERTY_ONE)); config.set(PROPERTY_ONE.getKey(), VALUE_ONE); assertThat(getMandatoryConfig(config, PROPERTY_ONE)).isEqualTo(VALUE_ONE); }
public static <T extends HadoopConfigurationProperty<?>> String getMandatoryConfig( Configuration config, T property) throws IOException { String value = config.get(property.getKey()); if (Strings.isNullOrEmpty(value)) { throw new IOException("Must supply a value for configuration setting: " + property.getKey()); } return value; }
ConfigurationUtil { public static <T extends HadoopConfigurationProperty<?>> String getMandatoryConfig( Configuration config, T property) throws IOException { String value = config.get(property.getKey()); if (Strings.isNullOrEmpty(value)) { throw new IOException("Must supply a value for configuration setting: " + property.getKey()); } return value; } }
ConfigurationUtil { public static <T extends HadoopConfigurationProperty<?>> String getMandatoryConfig( Configuration config, T property) throws IOException { String value = config.get(property.getKey()); if (Strings.isNullOrEmpty(value)) { throw new IOException("Must supply a value for configuration setting: " + property.getKey()); } return value; }  }
ConfigurationUtil { public static <T extends HadoopConfigurationProperty<?>> String getMandatoryConfig( Configuration config, T property) throws IOException { String value = config.get(property.getKey()); if (Strings.isNullOrEmpty(value)) { throw new IOException("Must supply a value for configuration setting: " + property.getKey()); } return value; }  static String getMandatoryConfig(
      Configuration config, T property); static Map<String, String> getMandatoryConfig(
      Configuration config, List<T> properties); }
ConfigurationUtil { public static <T extends HadoopConfigurationProperty<?>> String getMandatoryConfig( Configuration config, T property) throws IOException { String value = config.get(property.getKey()); if (Strings.isNullOrEmpty(value)) { throw new IOException("Must supply a value for configuration setting: " + property.getKey()); } return value; }  static String getMandatoryConfig(
      Configuration config, T property); static Map<String, String> getMandatoryConfig(
      Configuration config, List<T> properties);  }