Search in sources :

Example 1 with FanOutRecordPublisherConfiguration

use of org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.FanOutRecordPublisherConfiguration in project flink by apache.

the class KinesisProxyV2Factory method createKinesisProxyV2.

/**
 * Uses the given properties to instantiate a new instance of {@link KinesisProxyV2}.
 *
 * @param configProps the properties used to parse configuration
 * @return the Kinesis proxy
 */
public static KinesisProxyV2Interface createKinesisProxyV2(final Properties configProps) {
    Preconditions.checkNotNull(configProps);
    final AttributeMap convertedProperties = AwsV2Util.convertProperties(configProps);
    final AttributeMap.Builder clientConfiguration = AttributeMap.builder();
    populateDefaultValues(clientConfiguration);
    final SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(convertedProperties.merge(clientConfiguration.build()), NettyNioAsyncHttpClient.builder());
    final FanOutRecordPublisherConfiguration configuration = new FanOutRecordPublisherConfiguration(configProps, emptyList());
    Properties legacyConfigProps = new Properties(configProps);
    legacyConfigProps.setProperty(KinesisDataStreamsConfigConstants.KINESIS_CLIENT_USER_AGENT_PREFIX, AWSAsyncSinkUtil.formatFlinkUserAgentPrefix(KinesisDataStreamsConfigConstants.BASE_KINESIS_USER_AGENT_PREFIX_FORMAT));
    final KinesisAsyncClient client = AWSAsyncSinkUtil.createAwsAsyncClient(legacyConfigProps, httpClient, KinesisAsyncClient.builder(), KinesisDataStreamsConfigConstants.BASE_KINESIS_USER_AGENT_PREFIX_FORMAT, KinesisDataStreamsConfigConstants.KINESIS_CLIENT_USER_AGENT_PREFIX);
    return new KinesisProxyV2(client, httpClient, configuration, BACKOFF);
}
Also used : KinesisAsyncClient(software.amazon.awssdk.services.kinesis.KinesisAsyncClient) AttributeMap(software.amazon.awssdk.utils.AttributeMap) FanOutRecordPublisherConfiguration(org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.FanOutRecordPublisherConfiguration) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Properties(java.util.Properties)

Example 2 with FanOutRecordPublisherConfiguration

use of org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.FanOutRecordPublisherConfiguration in project flink by apache.

the class StreamConsumerRegistrarUtil method createStreamConsumerRegistrar.

private static StreamConsumerRegistrar createStreamConsumerRegistrar(final Properties configProps, final List<String> streams) {
    FullJitterBackoff backoff = new FullJitterBackoff();
    FanOutRecordPublisherConfiguration configuration = new FanOutRecordPublisherConfiguration(configProps, streams);
    KinesisProxyV2Interface kinesis = KinesisProxyV2Factory.createKinesisProxyV2(configProps);
    return new StreamConsumerRegistrar(kinesis, configuration, backoff);
}
Also used : FanOutRecordPublisherConfiguration(org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.FanOutRecordPublisherConfiguration) StreamConsumerRegistrar(org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.StreamConsumerRegistrar) KinesisProxyV2Interface(org.apache.flink.streaming.connectors.kinesis.proxy.KinesisProxyV2Interface) FullJitterBackoff(org.apache.flink.streaming.connectors.kinesis.proxy.FullJitterBackoff)

Aggregations

FanOutRecordPublisherConfiguration (org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.FanOutRecordPublisherConfiguration)2 Properties (java.util.Properties)1 StreamConsumerRegistrar (org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.StreamConsumerRegistrar)1 FullJitterBackoff (org.apache.flink.streaming.connectors.kinesis.proxy.FullJitterBackoff)1 KinesisProxyV2Interface (org.apache.flink.streaming.connectors.kinesis.proxy.KinesisProxyV2Interface)1 SdkAsyncHttpClient (software.amazon.awssdk.http.async.SdkAsyncHttpClient)1 KinesisAsyncClient (software.amazon.awssdk.services.kinesis.KinesisAsyncClient)1 AttributeMap (software.amazon.awssdk.utils.AttributeMap)1