z3d1k commented on code in PR #85:
URL:
https://github.com/apache/flink-connector-aws/pull/85#discussion_r1247896610
##########
flink-connector-dynamodb/src/test/java/org/apache/flink/connector/dynamodb/sink/DynamoDbSinkWriterTest.java:
##########
@@ -68,17 +69,19 @@ public class DynamoDbSinkWriterTest {
public void testSuccessfulRequestWithNoDeduplication() throws Exception {
List<String> overwriteByPartitionKeys = Collections.emptyList();
List<DynamoDbWriteRequest> inputRequests =
- ImmutableList.of(
- sinkPutRequest(item("pk", "1")),
- sinkPutRequest(item("pk", "2")),
- sinkDeleteRequest(item("pk", "3")),
- sinkDeleteRequest(item("pk", "4")));
+ Stream.of(
+ sinkPutRequest(item("pk", "1")),
+ sinkPutRequest(item("pk", "2")),
+ sinkDeleteRequest(item("pk", "3")),
+ sinkDeleteRequest(item("pk", "4")))
+ .collect(toList());
Review Comment:
nit: Here and in other places - using `Arrays.asList(...)` instead of
`Stream.of(...).collect(toList())` can be better as we don't need to through
Stream to create list.
##########
flink-connector-dynamodb/src/main/java/org/apache/flink/connector/dynamodb/table/DynamoDbDynamicSinkFactory.java:
##########
@@ -72,6 +70,10 @@ public String factoryIdentifier() {
@Override
public Set<ConfigOption<?>> requiredOptions() {
- return ImmutableSet.of(TABLE_NAME, AWS_REGION);
+ final Set<ConfigOption<?>> requiredOptions = new HashSet<>();
+ requiredOptions.add(TABLE_NAME);
+ requiredOptions.add(AWS_REGION);
+
+ return requiredOptions;
Review Comment:
Is this set available for external modification? If yes -
`Collections.unmodifiableSet(requiredOptions)` can be used to preserve
semantics of immutable collection.
--
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]