Repository navigation
Add Kinesis Source - #31
Conversation
| throw new IllegalArgumentException("Option 'endpointUrl' is not specified") | ||
| }) | ||
| val streamNames = caseInsensitiveOptions.getOrElse("streamNames", { | ||
| throw new IllegalArgumentException("Option 'streamNames' is not specified") |
There was a problem hiding this comment.
this is the most important option, and needs to be checked first. Also the lets make it just "streams"
There was a problem hiding this comment.
Add an example in the error message to show how names can be comma separated.
| parameters: Map[String, String]): Source = { | ||
| val caseInsensitiveOptions = new CaseInsensitiveMap(parameters) | ||
| val regionName = caseInsensitiveOptions.getOrElse("regionName", { | ||
| throw new IllegalArgumentException("Option 'regionName' is not specified") |
There was a problem hiding this comment.
We should not check for both regionName and endpointUrl. Only one of them is sufficient. Ultimately the source should take only endpointUrl. If the user specifies region, then you can derive the endpoint from it.
Regions.getCurrentRegion.getServiceEndpoint("kinesis")
Also make the names "region" and "endpoint".
| }).split(",", -1).toSet | ||
| if (streams.isEmpty || streams.exists(_.isEmpty)) { | ||
| throw new IllegalArgumentException( | ||
| "Option 'streams' is invalid. Please use comma separated string (e.g., 'stream1,stream2')") |
There was a problem hiding this comment.
If the user hasnt comma separated multiple names (e.g. stream1|stream2), then this condition wont be true anyways. So this condition is about avoiding empty names, and accordingly the error statement should make it clear...
Option 'stream' is invalid, as stream names cannot be empty.
No description provided.