static AttributeMap getSdkHttpConfigurationOptions()

in flink-connector-aws-base/src/main/java/org/apache/flink/connector/aws/util/AWSGeneralUtil.java [301:339]


    static AttributeMap getSdkHttpConfigurationOptions(final Properties configProperties) {
        final AttributeMap.Builder clientConfiguration =
                AttributeMap.builder().put(SdkHttpConfigurationOption.TCP_KEEPALIVE, true);

        Optional.ofNullable(
                        configProperties.getProperty(
                                AWSConfigConstants.HTTP_CLIENT_MAX_CONCURRENCY))
                .map(Integer::parseInt)
                .ifPresent(
                        integer ->
                                clientConfiguration.put(
                                        SdkHttpConfigurationOption.MAX_CONNECTIONS, integer));

        Optional.ofNullable(
                        configProperties.getProperty(
                                AWSConfigConstants.HTTP_CLIENT_READ_TIMEOUT_MILLIS))
                .map(Integer::parseInt)
                .map(Duration::ofMillis)
                .ifPresent(
                        timeout ->
                                clientConfiguration.put(
                                        SdkHttpConfigurationOption.READ_TIMEOUT, timeout));

        Optional.ofNullable(configProperties.getProperty(AWSConfigConstants.TRUST_ALL_CERTIFICATES))
                .map(Boolean::parseBoolean)
                .ifPresent(
                        bool ->
                                clientConfiguration.put(
                                        SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES, bool));

        Optional.ofNullable(configProperties.getProperty(AWSConfigConstants.HTTP_PROTOCOL_VERSION))
                .map(Protocol::valueOf)
                .ifPresent(
                        protocol ->
                                clientConfiguration.put(
                                        SdkHttpConfigurationOption.PROTOCOL, protocol));

        return clientConfiguration.build();
    }