From 67abffa10554b07ab3093aca93f44576c4cb21fe Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Thu, 14 May 2020 14:24:42 -0700 Subject: [PATCH] Revert "HBASE-24086 Disable output stream capability enforcement when running on LocalFileSystem" This reverts commit 03d73f151b26dd35cd9d0d36bc22a9bc9a077188. --- .../apache/hadoop/hbase/util/CommonFSUtils.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java index 77615db9a05..ef6d48908a9 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java @@ -1,4 +1,4 @@ -/* +/** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -39,7 +39,6 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.LocatedFileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; @@ -347,20 +346,11 @@ public abstract class CommonFSUtils { public static FileSystem getWALFileSystem(final Configuration c) throws IOException { Path p = getWALRootDir(c); FileSystem fs = p.getFileSystem(c); - // hadoop-core does fs caching, so need to propagate this if set + // hadoop-core does fs caching, so need to propogate this if set String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE); if (enforceStreamCapability != null) { fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability); } - if (fs instanceof LocalFileSystem) { - // running on LocalFileSystem, which does not support the required capabilities `HSYNC` - // and `HFLUSH`. disable enforcement. - final boolean value = false; - LOG.warn("Cannot enforce durability guarantees while running on " + fs.getUri() - + ". Setting " + UNSAFE_STREAM_CAPABILITY_ENFORCE + "=" + value - + " for this FileSystem."); - fs.getConf().setBoolean(UNSAFE_STREAM_CAPABILITY_ENFORCE, value); - } return fs; }