@Deprecated
    static Optional<GlobalStreamExchangeMode> getGlobalStreamExchangeMode(ReadableConfig config) {
        return config.getOptional(ExecutionConfigOptions.TABLE_EXEC_SHUFFLE_MODE)
                .map(
                        value -> {
                            try {
                                return GlobalStreamExchangeMode.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()));
                            }
                        });
    }
@Test
    void testInvalidLegacyShuffleMode() {
        final Configuration configuration = new Configuration();
        configuration.set(ExecutionConfigOptions.TABLE_EXEC_SHUFFLE_MODE, "invalid-value");
        assertThatThrownBy(() -> StreamExchangeModeUtils.getGlobalStreamExchangeMode(configuration))
                .isInstanceOf(IllegalArgumentException.class);
    }