[hbase] 01/02: Revert "HBASE-24086 Disable output stream capability enforcement when running on LocalFileSystem"

2020-05-14 Thread ndimiduk
This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 67abffa10554b07ab3093aca93f44576c4cb21fe
Author: Nick Dimiduk 
AuthorDate: Thu May 14 14:24:42 2020 -0700

Revert "HBASE-24086 Disable output stream capability enforcement when 
running on LocalFileSystem"

This reverts commit 03d73f151b26dd35cd9d0d36bc22a9bc9a077188.
---
 .../java/org/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 77615db..ef6d489 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;
   }
 



[hbase] 01/02: Revert "HBASE-24086 Disable output stream capability enforcement when running on LocalFileSystem"

2020-05-14 Thread ndimiduk
This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 894e0c025f6df4c96535074e262d354d343431c1
Author: Nick Dimiduk 
AuthorDate: Thu May 14 14:11:07 2020 -0700

Revert "HBASE-24086 Disable output stream capability enforcement when 
running on LocalFileSystem"

This reverts commit 1d912790d5d122693ddd6589972c5599e2ae5cae.
---
 .../java/org/apache/hadoop/hbase/util/CommonFSUtils.java   | 14 +++---
 1 file changed, 3 insertions(+), 11 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 bed6551..7ed2a78 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
@@ -33,7 +33,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;
@@ -45,6 +44,7 @@ import org.apache.hadoop.ipc.RemoteException;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
 import 
org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
 import org.apache.hbase.thirdparty.com.google.common.collect.Lists;
 
@@ -352,19 +352,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 {}. 
Setting {}={} for"
-+ " this FileSystem.", fs.getUri(), UNSAFE_STREAM_CAPABILITY_ENFORCE, 
value);
-  fs.getConf().setBoolean(UNSAFE_STREAM_CAPABILITY_ENFORCE, value);
-}
 return fs;
   }
 



[hbase] 01/02: Revert "HBASE-24086 Disable output stream capability enforcement when running on LocalFileSystem"

2020-05-14 Thread ndimiduk
This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 888eaa094dc191490b08809e76502f771e0d288b
Author: Nick Dimiduk 
AuthorDate: Thu May 14 14:06:30 2020 -0700

Revert "HBASE-24086 Disable output stream capability enforcement when 
running on LocalFileSystem"

This reverts commit 5de9d7120012938361972fb0b4ee56ca99e9cc6f.
---
 .../java/org/apache/hadoop/hbase/util/CommonFSUtils.java  | 15 ---
 1 file changed, 4 insertions(+), 11 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 2e21605..a8c24c5 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
@@ -28,12 +28,12 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import org.apache.hadoop.HadoopIllegalArgumentException;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FSDataOutputStreamBuilder;
 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;
@@ -41,6 +41,7 @@ import org.apache.hadoop.fs.RemoteIterator;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.ipc.RemoteException;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -349,19 +350,11 @@ public final 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 {}. 
Setting {}={} for"
-+ " this FileSystem.", fs.getUri(), UNSAFE_STREAM_CAPABILITY_ENFORCE, 
value);
-  fs.getConf().setBoolean(UNSAFE_STREAM_CAPABILITY_ENFORCE, value);
-}
 return fs;
   }
 



[hbase] 01/02: Revert "HBASE-24086 Disable output stream capability enforcement when running on LocalFileSystem"

2020-05-14 Thread ndimiduk
This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 2ab394ddb16040d0bc97f6b873be398e9c473bdf
Author: Nick Dimiduk 
AuthorDate: Thu May 14 13:31:41 2020 -0700

Revert "HBASE-24086 Disable output stream capability enforcement when 
running on LocalFileSystem"

This reverts commit 4e31ada43b2aa80634e3417bb773c604a0928ab0.
---
 .../java/org/apache/hadoop/hbase/util/CommonFSUtils.java  | 15 ---
 1 file changed, 4 insertions(+), 11 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 2e21605..a8c24c5 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
@@ -28,12 +28,12 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import org.apache.hadoop.HadoopIllegalArgumentException;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FSDataOutputStreamBuilder;
 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;
@@ -41,6 +41,7 @@ import org.apache.hadoop.fs.RemoteIterator;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.ipc.RemoteException;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -349,19 +350,11 @@ public final 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 {}. 
Setting {}={} for"
-+ " this FileSystem.", fs.getUri(), UNSAFE_STREAM_CAPABILITY_ENFORCE, 
value);
-  fs.getConf().setBoolean(UNSAFE_STREAM_CAPABILITY_ENFORCE, value);
-}
 return fs;
   }