Skip to content

Commit d8f1617

Browse files
committed
Override write(byte[] b, int off, int len) in FilterOutputStream for better performance
Closes #8748
1 parent 943dbb8 commit d8f1617

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/elasticsearch/common/blobstore/fs/FsBlobContainer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ public InputStream openInput(String name) throws IOException {
8989
public OutputStream createOutput(String blobName) throws IOException {
9090
final File file = new File(path, blobName);
9191
return new BufferedOutputStream(new FilterOutputStream(new FileOutputStream(file)) {
92+
93+
@Override // FilterOutputStream#write(byte[] b, int off, int len) is trappy writes every single byte
94+
public void write(byte[] b, int off, int len) throws IOException { out.write(b, off, len);}
95+
9296
@Override
9397
public void close() throws IOException {
9498
super.close();

0 commit comments

Comments
 (0)