You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/07 12:23:03 UTC

[GitHub] [flink] deadwind4 commented on a change in pull request #18033: [FLINK-25141][connector/elasticsearch][docs] Add sink parallelism option

deadwind4 commented on a change in pull request #18033:
URL: https://github.com/apache/flink/pull/18033#discussion_r780231023



##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/table/ElasticsearchDynamicSinkFactoryBaseTest.java
##########
@@ -227,4 +232,19 @@ public void validateWrongCredential() {
                                                 "")
                                         .build()));
     }
+
+    @Test
+    public void testSinkParallelism() {
+        ElasticsearchDynamicSinkFactoryBase sinkFactory = createSinkFactory();
+        DynamicTableSink sink =
+                sinkFactory.createDynamicTableSink(
+                        createPrefilledTestContext()
+                                .withOption(SINK_PARALLELISM.key(), "2")
+                                .build());
+        Assertions.assertTrue(sink instanceof ElasticsearchDynamicSink);
+        ElasticsearchDynamicSink esSink = (ElasticsearchDynamicSink) sink;
+        SinkProvider provider =
+                (SinkProvider) esSink.getSinkRuntimeProvider(new ElasticsearchUtil.MockContext());
+        Assertions.assertEquals(2, (long) provider.getParallelism().get());

Review comment:
       I have used assertJ in this test case.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org