JooHyukKim commented on code in PR #21004:
URL: https://github.com/apache/pulsar/pull/21004#discussion_r1295653178
##########
pulsar-io/kinesis/src/main/java/org/apache/pulsar/io/kinesis/KinesisSourceConfig.java:
##########
@@ -122,24 +123,27 @@ public class KinesisSourceConfig extends
BaseKinesisConfig implements Serializab
)
private String dynamoEndpoint = "";
- @FieldDoc(
- required = false,
- defaultValue = "",
- help = "Cloudwatch end-point url. It can be found at
https://docs.aws.amazon.com/general/latest/gr/rande.html"
- )
- private String cloudwatchEndpoint = "";
-
@FieldDoc(
required = false,
defaultValue = "true",
help = "When true, uses Kinesis enhanced fan-out, when false, uses
polling"
)
private boolean useEnhancedFanOut = true;
-
- public static KinesisSourceConfig load(String yamlFile) throws IOException
{
- ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
- return mapper.readValue(new File(yamlFile), KinesisSourceConfig.class);
+ public static KinesisSourceConfig load(Map<String, Object> config,
SourceContext sourceContext) {
+ KinesisSourceConfig kinesisSourceConfig =
IOConfigUtils.loadWithSecrets(config,
+ KinesisSourceConfig.class, sourceContext);
+ checkArgument(isNotBlank(kinesisSourceConfig.getAwsRegion())
+ || (isNotBlank(kinesisSourceConfig.getAwsEndpoint())
+ &&
isNotBlank(kinesisSourceConfig.getCloudwatchEndpoint())
+ &&
isNotBlank(kinesisSourceConfig.getDynamoEndpoint())),
Review Comment:
WDYT of implementing like...
```java
checkArgument(kinesisSourceConfig.isValidEndpointsConfigured(),
"Either......// rest omitted
```
... this? But this might against convention so far, so not a strong
suggestion
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]