MonsterChenzhuo commented on a change in pull request #17847:
URL: https://github.com/apache/flink/pull/17847#discussion_r757587810



##########
File path: 
flink-connectors/flink-connector-mongodb/src/main/java/org/apache/flink/mongodb/streaming/sink/MongoBulkWriter.java
##########
@@ -0,0 +1,272 @@
+package org.apache.flink.mongodb.streaming.sink;
+
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.mongodb.streaming.serde.DocumentSerializer;
+import org.apache.flink.util.concurrent.ExecutorThreadFactory;
+
+import com.mongodb.MongoException;
+import com.mongodb.bulk.BulkWriteResult;
+import com.mongodb.client.MongoCollection;
+import com.mongodb.client.model.BulkWriteOptions;
+import com.mongodb.client.model.Filters;
+import com.mongodb.client.model.UpdateOneModel;
+import com.mongodb.client.model.UpdateOptions;
+import com.mongodb.client.model.WriteModel;
+import org.bson.Document;
+import org.bson.conversions.Bson;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.concurrent.NotThreadSafe;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Consumer;
+
+public class MongoBulkWriter<IN> implements SinkWriter<IN, DocumentBulk, 
DocumentBulk> {

Review comment:
       @AHeise Your suggestion is great, I have already started to implement 
it, and I expect to finish this by the end of the week, so I'll have to ask you 
to look at it then.




-- 
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]


Reply via email to