homatthew commented on code in PR #3751:
URL: https://github.com/apache/gobblin/pull/3751#discussion_r1306075652


##########
gobblin-modules/gobblin-orc/src/main/java/org/apache/gobblin/writer/GobblinBaseOrcWriter.java:
##########
@@ -140,9 +190,17 @@ public State getFinalState() {
   @Override
   public void flush()
       throws IOException {
-    if (rowBatch.size > 0) {
-      orcFileWriter.addRowBatch(rowBatch);
-      rowBatch.reset();
+    try {
+      this.orcFileWriterLock.readLock().lock();
+      if (rowBatch.size > 0) {
+        if (this.orcFileWriter == null) {

Review Comment:
   The current code does a lazy init iff the estimated record size is not 
provided in the config. It's not clear to me why we do this.



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