You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by fj...@apache.org on 2019/07/04 15:41:27 UTC
[incubator-druid] branch master updated: fix FileUtils performance
regression due to FilterOutputStream (#8024)
This is an automated email from the ASF dual-hosted git repository.
fjy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git
The following commit(s) were added to refs/heads/master by this push:
new 6760505 fix FileUtils performance regression due to FilterOutputStream (#8024)
6760505 is described below
commit 6760505a7e7874654925fbfc3bac8c7f634b7f8e
Author: Himanshu <g....@gmail.com>
AuthorDate: Thu Jul 4 08:41:17 2019 -0700
fix FileUtils performance regression due to FilterOutputStream (#8024)
---
.../main/java/org/apache/druid/java/util/common/FileUtils.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/core/src/main/java/org/apache/druid/java/util/common/FileUtils.java b/core/src/main/java/org/apache/druid/java/util/common/FileUtils.java
index 17f0ed0..6025ad6 100644
--- a/core/src/main/java/org/apache/druid/java/util/common/FileUtils.java
+++ b/core/src/main/java/org/apache/druid/java/util/common/FileUtils.java
@@ -242,6 +242,14 @@ public class FileUtils
{
return new FilterOutputStream(out)
{
+ // Default implementation of this method in FilterOutputStream converts single write operation to
+ // multiple write operations of 1 byte each, which is terribly inefficient.
+ @Override
+ public void write(byte b[], int off, int len) throws IOException
+ {
+ out.write(b, off, len);
+ }
+
@Override
public void close()
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org