wuchong commented on a change in pull request #11466:  [FLINK-15400][connectors 
/ elasticsearch] elasticsearch table sink support dynamic index.
URL: https://github.com/apache/flink/pull/11466#discussion_r399090184
 
 

 ##########
 File path: 
flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchUpsertTableSinkBase.java
 ##########
 @@ -431,7 +438,8 @@ public ElasticsearchUpsertSinkFunction(
                                SerializationSchema<Row> serializationSchema,
                                XContentType contentType,
                                RequestFactory requestFactory,
-                               int[] keyFieldIndices) {
+                               int[] keyFieldIndices,
+                               IndexFormatter indexFormatter) {
 
 Review comment:
   I would suggest to accept a `IndexGenerator` interface, not a 
`IndexFormatter`.  `IndexFormatter` is just a factory to create 
`IndexGenerator`, even can be called `IndexGeneratorFactory`.  So that, in the 
future, DataStream users can also customize their special index generator. But 
can also use `IndexGeneratorFactory` in their DataStream jobs. 
   ```java
   interface IndexGenerator extends Serializable {
     String generate(Row row);
   }
   ```
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to