class ShuffleModeUtils {

	static GlobalDataExchangeMode getShuffleModeAsGlobalDataExchangeMode(final Configuration configuration) {
		final String value = configuration.getString(ExecutionConfigOptions.TABLE_EXEC_SHUFFLE_MODE);

		try {
			return GlobalDataExchangeMode.valueOf(convertLegacyShuffleMode(value).toUpperCase());
		} catch (IllegalArgumentException e) {
			throw new IllegalArgumentException(
				String.format("Unsupported value %s for config %s.", value, ExecutionConfigOptions.TABLE_EXEC_SHUFFLE_MODE.key()));
		}
	}

}