Class KinesisConfigUtil
- java.lang.Object
-
- org.apache.flink.streaming.connectors.kinesis.util.KinesisConfigUtil
-
@Internal public class KinesisConfigUtil extends Object
Utilities for Flink Kinesis connector configuration.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringAGGREGATION_MAX_COUNTMaximum number of items to pack into an aggregated record.protected static StringCOLLECTION_MAX_COUNTMaximum number of items to pack into an PutRecords request.protected static longDEFAULT_RATE_LIMITDefault values for RateLimit.protected static intDEFAULT_THREAD_POOL_SIZEDefault values for ThreadPoolSize.protected static com.amazonaws.services.kinesis.producer.KinesisProducerConfiguration.ThreadingModelDEFAULT_THREADING_MODELDefault value for ThreadingModel.protected static StringRATE_LIMITLimits the maximum allowed put rate for a shard, as a percentage of the backend limits.protected static StringTHREAD_POOL_SIZEThe maximum number of threads that the native process' thread pool will be configured with.protected static StringTHREADING_MODELThe threading model that KinesisProducer will use.
-
Constructor Summary
Constructors Constructor Description KinesisConfigUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertiesbackfillConsumerKeys(Properties configProps)A set of configuration parameters associated with the describeStreams API may be used if: 1) an legacy client wants to consume from Kinesis 2) a current client wants to consumer from DynamoDB streamsstatic PropertiesgetV2ConsumerClientProperties(Properties configProps)static com.amazonaws.services.kinesis.producer.KinesisProducerConfigurationgetValidatedProducerConfiguration(Properties config)Validate configuration properties forFlinkKinesisProducer, and return a constructed KinesisProducerConfiguration.static DateparseStreamTimestampStartingPosition(Properties consumerConfig)Parses the timestamp in which to start consuming from the stream, from the given properties.static PropertiesreplaceDeprecatedProducerKeys(Properties configProps)Replace deprecated configuration properties forFlinkKinesisProducer.static voidvalidateAwsConfiguration(Properties config)Validate configuration properties related to Amazon AWS service.static voidvalidateConsumerConfiguration(Properties config)Validate configuration properties forFlinkKinesisConsumer.static voidvalidateConsumerConfiguration(Properties config, List<String> streams)Validate configuration properties forFlinkKinesisConsumer.static voidvalidateEfoConfiguration(Properties config, List<String> streams)Validate if the given config is a valid EFO configuration.static ConsumerConfigConstants.RecordPublisherTypevalidateRecordPublisherType(Properties config)Validate the record publisher type.
-
-
-
Field Detail
-
COLLECTION_MAX_COUNT
protected static final String COLLECTION_MAX_COUNT
Maximum number of items to pack into an PutRecords request.- See Also:
- Constant Field Values
-
AGGREGATION_MAX_COUNT
protected static final String AGGREGATION_MAX_COUNT
Maximum number of items to pack into an aggregated record.- See Also:
- Constant Field Values
-
RATE_LIMIT
protected static final String RATE_LIMIT
Limits the maximum allowed put rate for a shard, as a percentage of the backend limits. The default value is set as 100% in Flink. KPL's default value is 150% but it makes KPL throw RateLimitExceededException too frequently and breaks Flink sink as a result.- See Also:
- Constant Field Values
-
THREADING_MODEL
protected static final String THREADING_MODEL
The threading model that KinesisProducer will use.- See Also:
- Constant Field Values
-
THREAD_POOL_SIZE
protected static final String THREAD_POOL_SIZE
The maximum number of threads that the native process' thread pool will be configured with.- See Also:
- Constant Field Values
-
DEFAULT_RATE_LIMIT
protected static final long DEFAULT_RATE_LIMIT
Default values for RateLimit.- See Also:
- Constant Field Values
-
DEFAULT_THREADING_MODEL
protected static final com.amazonaws.services.kinesis.producer.KinesisProducerConfiguration.ThreadingModel DEFAULT_THREADING_MODEL
Default value for ThreadingModel.
-
DEFAULT_THREAD_POOL_SIZE
protected static final int DEFAULT_THREAD_POOL_SIZE
Default values for ThreadPoolSize.- See Also:
- Constant Field Values
-
-
Method Detail
-
validateConsumerConfiguration
public static void validateConsumerConfiguration(Properties config)
Validate configuration properties forFlinkKinesisConsumer.
-
validateConsumerConfiguration
public static void validateConsumerConfiguration(Properties config, List<String> streams)
Validate configuration properties forFlinkKinesisConsumer.
-
validateRecordPublisherType
public static ConsumerConfigConstants.RecordPublisherType validateRecordPublisherType(Properties config)
Validate the record publisher type.- Parameters:
config- config properties- Returns:
- if
ConsumerConfigConstants.RECORD_PUBLISHER_TYPEis set, return the parsed record publisher type. Else return polling record publisher type.
-
validateEfoConfiguration
public static void validateEfoConfiguration(Properties config, List<String> streams)
Validate if the given config is a valid EFO configuration.- Parameters:
config- config properties.streams- the streams which is sent to match the EFO consumer arn if the EFO registration mode is set to `NONE`.
-
replaceDeprecatedProducerKeys
public static Properties replaceDeprecatedProducerKeys(Properties configProps)
Replace deprecated configuration properties forFlinkKinesisProducer. This should be remove along with deprecated keys
-
backfillConsumerKeys
public static Properties backfillConsumerKeys(Properties configProps)
A set of configuration parameters associated with the describeStreams API may be used if: 1) an legacy client wants to consume from Kinesis 2) a current client wants to consumer from DynamoDB streamsIn the context of 1), the set of configurations needs to be translated to the corresponding configurations in the Kinesis listShards API. In the mean time, keep these configs since they are applicable in the context of 2), i.e., polling data from a DynamoDB stream.
- Parameters:
configProps- original config properties.- Returns:
- backfilled config properties.
-
getValidatedProducerConfiguration
public static com.amazonaws.services.kinesis.producer.KinesisProducerConfiguration getValidatedProducerConfiguration(Properties config)
Validate configuration properties forFlinkKinesisProducer, and return a constructed KinesisProducerConfiguration.
-
validateAwsConfiguration
public static void validateAwsConfiguration(Properties config)
Validate configuration properties related to Amazon AWS service.
-
parseStreamTimestampStartingPosition
public static Date parseStreamTimestampStartingPosition(Properties consumerConfig)
Parses the timestamp in which to start consuming from the stream, from the given properties.- Parameters:
consumerConfig- the properties to parse timestamp from- Returns:
- the timestamp
-
getV2ConsumerClientProperties
public static Properties getV2ConsumerClientProperties(Properties configProps)
-
-