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);
}
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);
}
Aggregations