Skip to content

Commit

Permalink
HDDS-11390. Removed hsync and hflush capability check in ContentGener…
Browse files Browse the repository at this point in the history
…ator (apache#7153)
  • Loading branch information
hemantk-12 authored Sep 4, 2024
1 parent 877504a commit 966b8d0
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@

import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.hadoop.fs.StreamCapabilities;
import org.apache.hadoop.fs.Syncable;
import org.apache.hadoop.fs.impl.StoreImplementationUtils;
import org.apache.hadoop.ozone.client.io.OzoneDataStreamOutput;

/**
Expand Down Expand Up @@ -109,20 +107,17 @@ private void doFlushOrSync(OutputStream outputStream) throws IOException {
// noop
break;
case HFLUSH:
if (StoreImplementationUtils.hasCapability(
outputStream, StreamCapabilities.HSYNC)) {
((Syncable)outputStream).hflush();
if (outputStream instanceof Syncable) {
((Syncable) outputStream).hflush();
}
break;
case HSYNC:
if (StoreImplementationUtils.hasCapability(
outputStream, StreamCapabilities.HSYNC)) {
((Syncable)outputStream).hsync();
if (outputStream instanceof Syncable) {
((Syncable) outputStream).hsync();
}
break;
default:
throw new IllegalArgumentException("Unsupported sync option"
+ flushOrSync);
throw new IllegalArgumentException("Unsupported sync option" + flushOrSync);
}
}

Expand Down

0 comments on commit 966b8d0

Please sign in to comment.