You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/04/21 18:43:46 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #9722: Optimize FileWriteOutBytes to avoid high system cpu usage

suneet-s commented on a change in pull request #9722:
URL: https://github.com/apache/druid/pull/9722#discussion_r412402855



##########
File path: processing/src/main/java/org/apache/druid/segment/writeout/FileWriteOutBytes.java
##########
@@ -105,8 +110,8 @@ public void write(byte[] b, int off, int len) throws IOException
   @Override
   public long size() throws IOException
   {
-    flush();
-    return ch.size();
+    flushIfNeeded(0); // To avoid check the declared IOException never thrown error

Review comment:
       I think this is cleaner
   
   ```
     public long size()
     {
       return writeOutBytes;
     }
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org