From 7ec03c3034b6040b7ea52b064dc18a875a2403c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Z=C3=BCgner?= Date: Tue, 13 Aug 2024 11:13:44 +0200 Subject: [PATCH] Dont call hsync() and hflush() hflush and hsync are only needed for special cases and are overkill here --- .../parquet/hadoop/util/HadoopPositionOutputStream.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopPositionOutputStream.java b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopPositionOutputStream.java index df22e23772..1c9282e173 100644 --- a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopPositionOutputStream.java +++ b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopPositionOutputStream.java @@ -50,8 +50,9 @@ public void write(byte[] b, int off, int len) throws IOException { wrapped.write(b, off, len); } + @Deprecated public void sync() throws IOException { - wrapped.hsync(); + // sync is not necessary for Parquet use cases. } @Override @@ -61,8 +62,6 @@ public void flush() throws IOException { @Override public void close() throws IOException { - try (FSDataOutputStream fdos = wrapped) { - fdos.hflush(); - } + wrapped.close(); } }