hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [hbase-site] branch asf-site updated: Published site at 569ac1232a51f727a09b5065b1ec6c87d089fc08.
Date Mon, 20 Jan 2020 14:45:58 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/asf-site by this push:
     new fab4e14  Published site at 569ac1232a51f727a09b5065b1ec6c87d089fc08.
fab4e14 is described below

commit fab4e143f862666ae922f6ee59b2b466d4676757
Author: jenkins <builds@apache.org>
AuthorDate: Mon Jan 20 14:45:46 2020 +0000

    Published site at 569ac1232a51f727a09b5065b1ec6c87d089fc08.
---
 acid-semantics.html                                |    2 +-
 apache_hbase_reference_guide.pdf                   |    4 +-
 apidocs/index-all.html                             |    2 +
 apidocs/org/apache/hadoop/hbase/net/Address.html   |    2 +-
 .../apache/hadoop/hbase/util/ByteRangeUtils.html   |   54 +-
 .../org/apache/hadoop/hbase/net/Address.html       |    2 +-
 .../apache/hadoop/hbase/util/ByteRangeUtils.html   |   97 +-
 book.html                                          |    2 +-
 bulk-loads.html                                    |    2 +-
 checkstyle-aggregate.html                          |    2 +-
 coc.html                                           |    2 +-
 dependencies.html                                  |    2 +-
 dependency-convergence.html                        |    2 +-
 dependency-info.html                               |    2 +-
 dependency-management.html                         |    2 +-
 devapidocs/constant-values.html                    |    4 +-
 .../org/apache/hadoop/hbase/net/Address.html       |    2 +-
 .../apache/hadoop/hbase/util/ByteRangeUtils.html   |   20 +-
 .../util/CommonFSUtils.DfsBuilderUtility.html      |   28 +-
 .../util/CommonFSUtils.StreamCapabilities.html     |   10 +-
 ...mmonFSUtils.StreamLacksCapabilityException.html |    6 +-
 .../apache/hadoop/hbase/util/CommonFSUtils.html    |   99 +-
 .../src-html/org/apache/hadoop/hbase/Version.html  |    4 +-
 .../org/apache/hadoop/hbase/net/Address.html       |    2 +-
 .../apache/hadoop/hbase/util/ByteRangeUtils.html   |   97 +-
 .../util/CommonFSUtils.DfsBuilderUtility.html      | 1704 ++++++++++----------
 .../util/CommonFSUtils.StreamCapabilities.html     | 1704 ++++++++++----------
 ...mmonFSUtils.StreamLacksCapabilityException.html | 1704 ++++++++++----------
 .../apache/hadoop/hbase/util/CommonFSUtils.html    | 1704 ++++++++++----------
 downloads.html                                     |    2 +-
 export_control.html                                |    2 +-
 index.html                                         |    2 +-
 issue-tracking.html                                |    2 +-
 mail-lists.html                                    |    2 +-
 metrics.html                                       |    2 +-
 old_news.html                                      |    2 +-
 plugin-management.html                             |    2 +-
 plugins.html                                       |    2 +-
 poweredbyhbase.html                                |    2 +-
 project-info.html                                  |    2 +-
 project-reports.html                               |    2 +-
 project-summary.html                               |    2 +-
 pseudo-distributed.html                            |    2 +-
 replication.html                                   |    2 +-
 resources.html                                     |    2 +-
 source-repository.html                             |    2 +-
 sponsors.html                                      |    2 +-
 supportingprojects.html                            |    2 +-
 team-list.html                                     |    2 +-
 49 files changed, 3506 insertions(+), 3801 deletions(-)

diff --git a/acid-semantics.html b/acid-semantics.html
index a97c48c..a65117e 100644
--- a/acid-semantics.html
+++ b/acid-semantics.html
@@ -467,7 +467,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/apache_hbase_reference_guide.pdf b/apache_hbase_reference_guide.pdf
index 96363bb..84598f6 100644
--- a/apache_hbase_reference_guide.pdf
+++ b/apache_hbase_reference_guide.pdf
@@ -5,8 +5,8 @@
 /Author (Apache HBase Team)
 /Creator (Asciidoctor PDF 1.5.0.alpha.15, based on Prawn 2.2.2)
 /Producer (Apache HBase Team)
-/ModDate (D:20200119144047+00'00')
-/CreationDate (D:20200119144047+00'00')
+/ModDate (D:20200120144241+00'00')
+/CreationDate (D:20200120144241+00'00')
 >>
 endobj
 2 0 obj
diff --git a/apidocs/index-all.html b/apidocs/index-all.html
index 7ad7e0e..c618f31 100644
--- a/apidocs/index-all.html
+++ b/apidocs/index-all.html
@@ -972,6 +972,8 @@
 <dd>
 <div class="block">Utility methods for working with <a href="org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util"><code>ByteRange</code></a>.</div>
 </dd>
+<dt><span class="memberNameLink"><a href="org/apache/hadoop/hbase/util/ByteRangeUtils.html#ByteRangeUtils--">ByteRangeUtils()</a></span> - Constructor for class org.apache.hadoop.hbase.util.<a href="org/apache/hadoop/hbase/util/ByteRangeUtils.html" title="class in org.apache.hadoop.hbase.util">ByteRangeUtils</a></dt>
+<dd>&nbsp;</dd>
 <dt><a href="org/apache/hadoop/hbase/util/Bytes.html" title="class in org.apache.hadoop.hbase.util"><span class="typeNameLink">Bytes</span></a> - Class in <a href="org/apache/hadoop/hbase/util/package-summary.html">org.apache.hadoop.hbase.util</a></dt>
 <dd>
 <div class="block">Utility class that handles byte arrays, conversions to/from other types,
diff --git a/apidocs/org/apache/hadoop/hbase/net/Address.html b/apidocs/org/apache/hadoop/hbase/net/Address.html
index d221660..0cd513d 100644
--- a/apidocs/org/apache/hadoop/hbase/net/Address.html
+++ b/apidocs/org/apache/hadoop/hbase/net/Address.html
@@ -114,7 +114,7 @@ var activeTableTab = "activeTableTab";
 <hr>
 <br>
 <pre>@InterfaceAudience.Public
-public final class <a href="../../../../../src-html/org/apache/hadoop/hbase/net/Address.html#line.34">Address</a>
+public class <a href="../../../../../src-html/org/apache/hadoop/hbase/net/Address.html#line.34">Address</a>
 extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
 implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../org/apache/hadoop/hbase/net/Address.html" title="class in org.apache.hadoop.hbase.net">Address</a>&gt;</pre>
 <div class="block">An immutable type to hold a hostname and port combo, like an Endpoint
diff --git a/apidocs/org/apache/hadoop/hbase/util/ByteRangeUtils.html b/apidocs/org/apache/hadoop/hbase/util/ByteRangeUtils.html
index 29699aa..85d739e 100644
--- a/apidocs/org/apache/hadoop/hbase/util/ByteRangeUtils.html
+++ b/apidocs/org/apache/hadoop/hbase/util/ByteRangeUtils.html
@@ -76,13 +76,13 @@ var activeTableTab = "activeTableTab";
 <li>Summary:&nbsp;</li>
 <li>Nested&nbsp;|&nbsp;</li>
 <li>Field&nbsp;|&nbsp;</li>
-<li>Constr&nbsp;|&nbsp;</li>
+<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
 <li><a href="#method.summary">Method</a></li>
 </ul>
 <ul class="subNavList">
 <li>Detail:&nbsp;</li>
 <li>Field&nbsp;|&nbsp;</li>
-<li>Constr&nbsp;|&nbsp;</li>
+<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
 <li><a href="#method.detail">Method</a></li>
 </ul>
 </div>
@@ -110,7 +110,7 @@ var activeTableTab = "activeTableTab";
 <hr>
 <br>
 <pre>@InterfaceAudience.Public
-public final class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.33">ByteRangeUtils</a>
+public class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.33">ByteRangeUtils</a>
 extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
 <div class="block">Utility methods for working with <a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util"><code>ByteRange</code></a>.</div>
 </li>
@@ -119,6 +119,23 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <div class="summary">
 <ul class="blockList">
 <li class="blockList">
+<!-- ======== CONSTRUCTOR SUMMARY ======== -->
+<ul class="blockList">
+<li class="blockList"><a name="constructor.summary">
+<!--   -->
+</a>
+<h3>Constructor Summary</h3>
+<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
+<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
+<tr>
+<th class="colOne" scope="col">Constructor and Description</th>
+</tr>
+<tr class="altColor">
+<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/util/ByteRangeUtils.html#ByteRangeUtils--">ByteRangeUtils</a></span>()</code>&nbsp;</td>
+</tr>
+</table>
+</li>
+</ul>
 <!-- ========== METHOD SUMMARY =========== -->
 <ul class="blockList">
 <li class="blockList"><a name="method.summary">
@@ -172,6 +189,23 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <div class="details">
 <ul class="blockList">
 <li class="blockList">
+<!-- ========= CONSTRUCTOR DETAIL ======== -->
+<ul class="blockList">
+<li class="blockList"><a name="constructor.detail">
+<!--   -->
+</a>
+<h3>Constructor Detail</h3>
+<a name="ByteRangeUtils--">
+<!--   -->
+</a>
+<ul class="blockListLast">
+<li class="blockList">
+<h4>ByteRangeUtils</h4>
+<pre>public&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.33">ByteRangeUtils</a>()</pre>
+</li>
+</ul>
+</li>
+</ul>
 <!-- ============ METHOD DETAIL ========== -->
 <ul class="blockList">
 <li class="blockList"><a name="method.detail">
@@ -184,7 +218,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>numEqualPrefixBytes</h4>
-<pre>public static&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.37">numEqualPrefixBytes</a>(<a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;left,
+<pre>public static&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.34">numEqualPrefixBytes</a>(<a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;left,
                                       <a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;right,
                                       int&nbsp;rightInnerOffset)</pre>
 </li>
@@ -195,7 +229,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>copyToNewArrays</h4>
-<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;byte[]&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.51">copyToNewArrays</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../../org/apache/ha [...]
+<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;byte[]&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.48">copyToNewArrays</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../../org/apache/ha [...]
 </li>
 </ul>
 <a name="fromArrays-java.util.Collection-">
@@ -204,7 +238,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>fromArrays</h4>
-<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.62">fromArrays</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collecti [...]
+<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.59">fromArrays</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collecti [...]
 </li>
 </ul>
 <a name="write-java.io.OutputStream-org.apache.hadoop.hbase.util.ByteRange-">
@@ -213,7 +247,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>write</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.73">write</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;os,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.70">write</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;os,
                          <a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;byteRange)
                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
@@ -228,7 +262,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>write</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.77">write</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;os,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.74">write</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;os,
                          <a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;byteRange,
                          int&nbsp;byteRangeInnerOffset)
                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -293,13 +327,13 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <li>Summary:&nbsp;</li>
 <li>Nested&nbsp;|&nbsp;</li>
 <li>Field&nbsp;|&nbsp;</li>
-<li>Constr&nbsp;|&nbsp;</li>
+<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
 <li><a href="#method.summary">Method</a></li>
 </ul>
 <ul class="subNavList">
 <li>Detail:&nbsp;</li>
 <li>Field&nbsp;|&nbsp;</li>
-<li>Constr&nbsp;|&nbsp;</li>
+<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
 <li><a href="#method.detail">Method</a></li>
 </ul>
 </div>
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/net/Address.html b/apidocs/src-html/org/apache/hadoop/hbase/net/Address.html
index e7d1363..579526f 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/net/Address.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/net/Address.html
@@ -39,7 +39,7 @@
 <span class="sourceLineNo">031</span> * We cannot have Guava classes in our API hence this Type.<a name="line.31"></a>
 <span class="sourceLineNo">032</span> */<a name="line.32"></a>
 <span class="sourceLineNo">033</span>@InterfaceAudience.Public<a name="line.33"></a>
-<span class="sourceLineNo">034</span>public final class Address implements Comparable&lt;Address&gt; {<a name="line.34"></a>
+<span class="sourceLineNo">034</span>public class Address implements Comparable&lt;Address&gt; {<a name="line.34"></a>
 <span class="sourceLineNo">035</span>  private HostAndPort hostAndPort;<a name="line.35"></a>
 <span class="sourceLineNo">036</span><a name="line.36"></a>
 <span class="sourceLineNo">037</span>  private Address(HostAndPort hostAndPort) {<a name="line.37"></a>
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html b/apidocs/src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html
index 63a5485..6b838ca 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html
@@ -38,56 +38,53 @@
 <span class="sourceLineNo">030</span> * Utility methods for working with {@link ByteRange}.<a name="line.30"></a>
 <span class="sourceLineNo">031</span> */<a name="line.31"></a>
 <span class="sourceLineNo">032</span>@InterfaceAudience.Public<a name="line.32"></a>
-<span class="sourceLineNo">033</span>public final class ByteRangeUtils {<a name="line.33"></a>
-<span class="sourceLineNo">034</span>  private ByteRangeUtils() {<a name="line.34"></a>
-<span class="sourceLineNo">035</span>  }<a name="line.35"></a>
-<span class="sourceLineNo">036</span><a name="line.36"></a>
-<span class="sourceLineNo">037</span>  public static int numEqualPrefixBytes(ByteRange left, ByteRange right, int rightInnerOffset) {<a name="line.37"></a>
-<span class="sourceLineNo">038</span>    int maxCompares = Math.min(left.getLength(), right.getLength() - rightInnerOffset);<a name="line.38"></a>
-<span class="sourceLineNo">039</span>    final byte[] lbytes = left.getBytes();<a name="line.39"></a>
-<span class="sourceLineNo">040</span>    final byte[] rbytes = right.getBytes();<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    final int loffset = left.getOffset();<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    final int roffset = right.getOffset();<a name="line.42"></a>
-<span class="sourceLineNo">043</span>    for (int i = 0; i &lt; maxCompares; ++i) {<a name="line.43"></a>
-<span class="sourceLineNo">044</span>      if (lbytes[loffset + i] != rbytes[roffset + rightInnerOffset + i]) {<a name="line.44"></a>
-<span class="sourceLineNo">045</span>        return i;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>      }<a name="line.46"></a>
-<span class="sourceLineNo">047</span>    }<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    return maxCompares;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>  }<a name="line.49"></a>
-<span class="sourceLineNo">050</span><a name="line.50"></a>
-<span class="sourceLineNo">051</span>  public static ArrayList&lt;byte[]&gt; copyToNewArrays(Collection&lt;ByteRange&gt; ranges) {<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    if (ranges == null) {<a name="line.52"></a>
-<span class="sourceLineNo">053</span>      return new ArrayList&lt;&gt;(0);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    }<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    ArrayList&lt;byte[]&gt; arrays = Lists.newArrayListWithCapacity(ranges.size());<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    for (ByteRange range : ranges) {<a name="line.56"></a>
-<span class="sourceLineNo">057</span>      arrays.add(range.deepCopyToNewArray());<a name="line.57"></a>
-<span class="sourceLineNo">058</span>    }<a name="line.58"></a>
-<span class="sourceLineNo">059</span>    return arrays;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>  }<a name="line.60"></a>
-<span class="sourceLineNo">061</span><a name="line.61"></a>
-<span class="sourceLineNo">062</span>  public static ArrayList&lt;ByteRange&gt; fromArrays(Collection&lt;byte[]&gt; arrays) {<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    if (arrays == null) {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>      return new ArrayList&lt;&gt;(0);<a name="line.64"></a>
-<span class="sourceLineNo">065</span>    }<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    ArrayList&lt;ByteRange&gt; ranges = Lists.newArrayListWithCapacity(arrays.size());<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    for (byte[] array : arrays) {<a name="line.67"></a>
-<span class="sourceLineNo">068</span>      ranges.add(new SimpleMutableByteRange(array));<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    }<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    return ranges;<a name="line.70"></a>
-<span class="sourceLineNo">071</span>  }<a name="line.71"></a>
-<span class="sourceLineNo">072</span><a name="line.72"></a>
-<span class="sourceLineNo">073</span>  public static void write(OutputStream os, ByteRange byteRange) throws IOException {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>    os.write(byteRange.getBytes(), byteRange.getOffset(), byteRange.getLength());<a name="line.74"></a>
-<span class="sourceLineNo">075</span>  }<a name="line.75"></a>
-<span class="sourceLineNo">076</span><a name="line.76"></a>
-<span class="sourceLineNo">077</span>  public static void write(OutputStream os, ByteRange byteRange, int byteRangeInnerOffset)<a name="line.77"></a>
-<span class="sourceLineNo">078</span>      throws IOException {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    os.write(byteRange.getBytes(), byteRange.getOffset() + byteRangeInnerOffset,<a name="line.79"></a>
-<span class="sourceLineNo">080</span>      byteRange.getLength() - byteRangeInnerOffset);<a name="line.80"></a>
-<span class="sourceLineNo">081</span>  }<a name="line.81"></a>
-<span class="sourceLineNo">082</span>}<a name="line.82"></a>
+<span class="sourceLineNo">033</span>public class ByteRangeUtils {<a name="line.33"></a>
+<span class="sourceLineNo">034</span>  public static int numEqualPrefixBytes(ByteRange left, ByteRange right, int rightInnerOffset) {<a name="line.34"></a>
+<span class="sourceLineNo">035</span>    int maxCompares = Math.min(left.getLength(), right.getLength() - rightInnerOffset);<a name="line.35"></a>
+<span class="sourceLineNo">036</span>    final byte[] lbytes = left.getBytes();<a name="line.36"></a>
+<span class="sourceLineNo">037</span>    final byte[] rbytes = right.getBytes();<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    final int loffset = left.getOffset();<a name="line.38"></a>
+<span class="sourceLineNo">039</span>    final int roffset = right.getOffset();<a name="line.39"></a>
+<span class="sourceLineNo">040</span>    for (int i = 0; i &lt; maxCompares; ++i) {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>      if (lbytes[loffset + i] != rbytes[roffset + rightInnerOffset + i]) {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>        return i;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>      }<a name="line.43"></a>
+<span class="sourceLineNo">044</span>    }<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    return maxCompares;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>  }<a name="line.46"></a>
+<span class="sourceLineNo">047</span><a name="line.47"></a>
+<span class="sourceLineNo">048</span>  public static ArrayList&lt;byte[]&gt; copyToNewArrays(Collection&lt;ByteRange&gt; ranges) {<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    if (ranges == null) {<a name="line.49"></a>
+<span class="sourceLineNo">050</span>      return new ArrayList&lt;&gt;(0);<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    }<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    ArrayList&lt;byte[]&gt; arrays = Lists.newArrayListWithCapacity(ranges.size());<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    for (ByteRange range : ranges) {<a name="line.53"></a>
+<span class="sourceLineNo">054</span>      arrays.add(range.deepCopyToNewArray());<a name="line.54"></a>
+<span class="sourceLineNo">055</span>    }<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    return arrays;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>  }<a name="line.57"></a>
+<span class="sourceLineNo">058</span><a name="line.58"></a>
+<span class="sourceLineNo">059</span>  public static ArrayList&lt;ByteRange&gt; fromArrays(Collection&lt;byte[]&gt; arrays) {<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    if (arrays == null) {<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      return new ArrayList&lt;&gt;(0);<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    ArrayList&lt;ByteRange&gt; ranges = Lists.newArrayListWithCapacity(arrays.size());<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    for (byte[] array : arrays) {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>      ranges.add(new SimpleMutableByteRange(array));<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    }<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    return ranges;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>  }<a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>  public static void write(OutputStream os, ByteRange byteRange) throws IOException {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    os.write(byteRange.getBytes(), byteRange.getOffset(), byteRange.getLength());<a name="line.71"></a>
+<span class="sourceLineNo">072</span>  }<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>  public static void write(OutputStream os, ByteRange byteRange, int byteRangeInnerOffset)<a name="line.74"></a>
+<span class="sourceLineNo">075</span>      throws IOException {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    os.write(byteRange.getBytes(), byteRange.getOffset() + byteRangeInnerOffset,<a name="line.76"></a>
+<span class="sourceLineNo">077</span>      byteRange.getLength() - byteRangeInnerOffset);<a name="line.77"></a>
+<span class="sourceLineNo">078</span>  }<a name="line.78"></a>
+<span class="sourceLineNo">079</span>}<a name="line.79"></a>
 
 
 
diff --git a/book.html b/book.html
index f21294d..7c4f7c9 100644
--- a/book.html
+++ b/book.html
@@ -44300,7 +44300,7 @@ org/apache/hadoop/hbase/security/access/AccessControlClient.revoke:(Lorg/apache/
 <div id="footer">
 <div id="footer-text">
 Version 3.0.0-SNAPSHOT<br>
-Last updated 2020-01-19 14:30:16 UTC
+Last updated 2020-01-20 14:31:53 UTC
 </div>
 </div>
 </body>
diff --git a/bulk-loads.html b/bulk-loads.html
index cbe0f4a..2e5cdde 100644
--- a/bulk-loads.html
+++ b/bulk-loads.html
@@ -172,7 +172,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/checkstyle-aggregate.html b/checkstyle-aggregate.html
index 68c1476..1dce505 100644
--- a/checkstyle-aggregate.html
+++ b/checkstyle-aggregate.html
@@ -86564,7 +86564,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/coc.html b/coc.html
index f969f67..ddd0caf 100644
--- a/coc.html
+++ b/coc.html
@@ -241,7 +241,7 @@ email to <a class="externalLink" href="mailto:private@hbase.apache.org">the priv
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/dependencies.html b/dependencies.html
index 33f3b15..20bef94 100644
--- a/dependencies.html
+++ b/dependencies.html
@@ -313,7 +313,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/dependency-convergence.html b/dependency-convergence.html
index 08f5d8d..4983277 100644
--- a/dependency-convergence.html
+++ b/dependency-convergence.html
@@ -558,7 +558,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/dependency-info.html b/dependency-info.html
index 5ec41d5..6882541 100644
--- a/dependency-info.html
+++ b/dependency-info.html
@@ -194,7 +194,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/dependency-management.html b/dependency-management.html
index 105fd76..bf86b2e 100644
--- a/dependency-management.html
+++ b/dependency-management.html
@@ -928,7 +928,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/devapidocs/constant-values.html b/devapidocs/constant-values.html
index bed57c1..796fe33 100644
--- a/devapidocs/constant-values.html
+++ b/devapidocs/constant-values.html
@@ -4109,14 +4109,14 @@
 <!--   -->
 </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
 <td><code><a href="org/apache/hadoop/hbase/Version.html#date">date</a></code></td>
-<td class="colLast"><code>"Sun Jan 19 14:37:18 UTC 2020"</code></td>
+<td class="colLast"><code>"Mon Jan 20 14:39:11 UTC 2020"</code></td>
 </tr>
 <tr class="rowColor">
 <td class="colFirst"><a name="org.apache.hadoop.hbase.Version.revision">
 <!--   -->
 </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
 <td><code><a href="org/apache/hadoop/hbase/Version.html#revision">revision</a></code></td>
-<td class="colLast"><code>"75b85016ebeeee43b9fa7b5477778f253ca293ee"</code></td>
+<td class="colLast"><code>"569ac1232a51f727a09b5065b1ec6c87d089fc08"</code></td>
 </tr>
 <tr class="altColor">
 <td class="colFirst"><a name="org.apache.hadoop.hbase.Version.srcChecksum">
diff --git a/devapidocs/org/apache/hadoop/hbase/net/Address.html b/devapidocs/org/apache/hadoop/hbase/net/Address.html
index 67b2dad..9106079 100644
--- a/devapidocs/org/apache/hadoop/hbase/net/Address.html
+++ b/devapidocs/org/apache/hadoop/hbase/net/Address.html
@@ -114,7 +114,7 @@ var activeTableTab = "activeTableTab";
 <hr>
 <br>
 <pre>@InterfaceAudience.Public
-public final class <a href="../../../../../src-html/org/apache/hadoop/hbase/net/Address.html#line.34">Address</a>
+public class <a href="../../../../../src-html/org/apache/hadoop/hbase/net/Address.html#line.34">Address</a>
 extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
 implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../org/apache/hadoop/hbase/net/Address.html" title="class in org.apache.hadoop.hbase.net">Address</a>&gt;</pre>
 <div class="block">An immutable type to hold a hostname and port combo, like an Endpoint
diff --git a/devapidocs/org/apache/hadoop/hbase/util/ByteRangeUtils.html b/devapidocs/org/apache/hadoop/hbase/util/ByteRangeUtils.html
index 73357b2..85d739e 100644
--- a/devapidocs/org/apache/hadoop/hbase/util/ByteRangeUtils.html
+++ b/devapidocs/org/apache/hadoop/hbase/util/ByteRangeUtils.html
@@ -110,7 +110,7 @@ var activeTableTab = "activeTableTab";
 <hr>
 <br>
 <pre>@InterfaceAudience.Public
-public final class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.33">ByteRangeUtils</a>
+public class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.33">ByteRangeUtils</a>
 extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
 <div class="block">Utility methods for working with <a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util"><code>ByteRange</code></a>.</div>
 </li>
@@ -128,12 +128,10 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
 <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
 <tr>
-<th class="colFirst" scope="col">Modifier</th>
-<th class="colLast" scope="col">Constructor and Description</th>
+<th class="colOne" scope="col">Constructor and Description</th>
 </tr>
 <tr class="altColor">
-<td class="colFirst"><code>private </code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/util/ByteRangeUtils.html#ByteRangeUtils--">ByteRangeUtils</a></span>()</code>&nbsp;</td>
+<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/util/ByteRangeUtils.html#ByteRangeUtils--">ByteRangeUtils</a></span>()</code>&nbsp;</td>
 </tr>
 </table>
 </li>
@@ -203,7 +201,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>ByteRangeUtils</h4>
-<pre>private&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.34">ByteRangeUtils</a>()</pre>
+<pre>public&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.33">ByteRangeUtils</a>()</pre>
 </li>
 </ul>
 </li>
@@ -220,7 +218,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>numEqualPrefixBytes</h4>
-<pre>public static&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.37">numEqualPrefixBytes</a>(<a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;left,
+<pre>public static&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.34">numEqualPrefixBytes</a>(<a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;left,
                                       <a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;right,
                                       int&nbsp;rightInnerOffset)</pre>
 </li>
@@ -231,7 +229,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>copyToNewArrays</h4>
-<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;byte[]&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.51">copyToNewArrays</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../../org/apache/ha [...]
+<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;byte[]&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.48">copyToNewArrays</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../../org/apache/ha [...]
 </li>
 </ul>
 <a name="fromArrays-java.util.Collection-">
@@ -240,7 +238,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>fromArrays</h4>
-<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.62">fromArrays</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collecti [...]
+<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.59">fromArrays</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collecti [...]
 </li>
 </ul>
 <a name="write-java.io.OutputStream-org.apache.hadoop.hbase.util.ByteRange-">
@@ -249,7 +247,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>write</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.73">write</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;os,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.70">write</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;os,
                          <a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;byteRange)
                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
@@ -264,7 +262,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>write</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.77">write</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;os,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html#line.74">write</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;os,
                          <a href="../../../../../org/apache/hadoop/hbase/util/ByteRange.html" title="interface in org.apache.hadoop.hbase.util">ByteRange</a>&nbsp;byteRange,
                          int&nbsp;byteRangeInnerOffset)
                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
diff --git a/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html b/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html
index 4baa8e3..b3731f5 100644
--- a/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html
+++ b/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html
@@ -113,7 +113,7 @@ var activeTableTab = "activeTableTab";
 </dl>
 <hr>
 <br>
-<pre>private static class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.840">CommonFSUtils.DfsBuilderUtility</a>
+<pre>private static class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.762">CommonFSUtils.DfsBuilderUtility</a>
 extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
 </li>
 </ul>
@@ -257,7 +257,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>dfsClass</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt; <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.841">dfsClass</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt; <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.763">dfsClass</a></pre>
 </li>
 </ul>
 <a name="createMethod">
@@ -266,7 +266,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>createMethod</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.842">createMethod</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.764">createMethod</a></pre>
 </li>
 </ul>
 <a name="overwriteMethod">
@@ -275,7 +275,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>overwriteMethod</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.843">overwriteMethod</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.765">overwriteMethod</a></pre>
 </li>
 </ul>
 <a name="bufferSizeMethod">
@@ -284,7 +284,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>bufferSizeMethod</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.844">bufferSizeMethod</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.766">bufferSizeMethod</a></pre>
 </li>
 </ul>
 <a name="blockSizeMethod">
@@ -293,7 +293,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>blockSizeMethod</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.845">blockSizeMethod</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.767">blockSizeMethod</a></pre>
 </li>
 </ul>
 <a name="recursiveMethod">
@@ -302,7 +302,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>recursiveMethod</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.846">recursiveMethod</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.768">recursiveMethod</a></pre>
 </li>
 </ul>
 <a name="replicateMethod">
@@ -311,7 +311,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>replicateMethod</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.847">replicateMethod</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.769">replicateMethod</a></pre>
 </li>
 </ul>
 <a name="replicationMethod">
@@ -320,7 +320,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>replicationMethod</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.848">replicationMethod</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.770">replicationMethod</a></pre>
 </li>
 </ul>
 <a name="buildMethod">
@@ -329,7 +329,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>buildMethod</h4>
-<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.849">buildMethod</a></pre>
+<pre>static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.771">buildMethod</a></pre>
 </li>
 </ul>
 <a name="allMethodsPresent">
@@ -338,7 +338,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>allMethodsPresent</h4>
-<pre>static&nbsp;boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.850">allMethodsPresent</a></pre>
+<pre>static&nbsp;boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.772">allMethodsPresent</a></pre>
 </li>
 </ul>
 </li>
@@ -355,7 +355,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>DfsBuilderUtility</h4>
-<pre>private&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.840">DfsBuilderUtility</a>()</pre>
+<pre>private&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.762">DfsBuilderUtility</a>()</pre>
 </li>
 </ul>
 </li>
@@ -372,7 +372,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>createHelper</h4>
-<pre>static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.892">createHelper</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.814">createHelper</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                             org.apache.hadoop.fs.Path&nbsp;path,
                                                             boolean&nbsp;overwritable,
                                                             int&nbsp;bufferSize,
@@ -394,7 +394,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>createHelper</h4>
-<pre>static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.924">createHelper</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html#line.846">createHelper</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                             org.apache.hadoop.fs.Path&nbsp;path,
                                                             boolean&nbsp;overwritable)
                                                      throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
diff --git a/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html b/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html
index 72560a0..50ade44 100644
--- a/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html
+++ b/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html
@@ -107,7 +107,7 @@
 </dl>
 <hr>
 <br>
-<pre>private static class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.969">CommonFSUtils.StreamCapabilities</a>
+<pre>private static class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.891">CommonFSUtils.StreamCapabilities</a>
 extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
 </li>
 </ul>
@@ -194,7 +194,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>PRESENT</h4>
-<pre>public static final&nbsp;boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html#line.970">PRESENT</a></pre>
+<pre>public static final&nbsp;boolean <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html#line.892">PRESENT</a></pre>
 </li>
 </ul>
 <a name="CLASS">
@@ -203,7 +203,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>CLASS</h4>
-<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt; <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html#line.971">CLASS</a></pre>
+<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt; <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html#line.893">CLASS</a></pre>
 </li>
 </ul>
 <a name="METHOD">
@@ -212,7 +212,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>METHOD</h4>
-<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html#line.972">METHOD</a></pre>
+<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html#line.894">METHOD</a></pre>
 </li>
 </ul>
 </li>
@@ -229,7 +229,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>StreamCapabilities</h4>
-<pre>private&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html#line.969">StreamCapabilities</a>()</pre>
+<pre>private&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html#line.891">StreamCapabilities</a>()</pre>
 </li>
 </ul>
 </li>
diff --git a/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html b/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html
index e63251a..9732281 100644
--- a/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html
+++ b/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html
@@ -121,7 +121,7 @@
 </dl>
 <hr>
 <br>
-<pre>public static class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.1040">CommonFSUtils.StreamLacksCapabilityException</a>
+<pre>public static class <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.962">CommonFSUtils.StreamLacksCapabilityException</a>
 extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
 <div class="block">Helper exception for those cases where the place where we need to check a stream capability
  is not where we have the needed context to explain the impact and mitigation for a lack.</div>
@@ -196,7 +196,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.h
 <ul class="blockList">
 <li class="blockList">
 <h4>StreamLacksCapabilityException</h4>
-<pre>public&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html#line.1041">StreamLacksCapabilityException</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message,
+<pre>public&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html#line.963">StreamLacksCapabilityException</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message,
                                       <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a>&nbsp;cause)</pre>
 </li>
 </ul>
@@ -206,7 +206,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.h
 <ul class="blockListLast">
 <li class="blockList">
 <h4>StreamLacksCapabilityException</h4>
-<pre>public&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html#line.1044">StreamLacksCapabilityException</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)</pre>
+<pre>public&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html#line.966">StreamLacksCapabilityException</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)</pre>
 </li>
 </ul>
 </li>
diff --git a/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.html b/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.html
index 56911a3..3a9348a 100644
--- a/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.html
+++ b/devapidocs/org/apache/hadoop/hbase/util/CommonFSUtils.html
@@ -613,7 +613,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockListLast">
 <li class="blockList">
 <h4>warningMap</h4>
-<pre>private static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;org.apache.hadoop.fs.FileSystem,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a>&gt; <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.502">warningMap</a></pre>
+<pre>private static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;org.apache.hadoop.fs.FileSystem,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a>&gt; <a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.455">warningMap</a></pre>
 </li>
 </ul>
 </li>
@@ -728,21 +728,15 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getDefaultBlockSize</h4>
-<pre>public static&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.159">getDefaultBlockSize</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
-                                       org.apache.hadoop.fs.Path&nbsp;path)
-                                throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
+<pre>public static&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.155">getDefaultBlockSize</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+                                       org.apache.hadoop.fs.Path&nbsp;path)</pre>
 <div class="block">Return the number of bytes that large input files should be optimally
- be split into to minimize i/o time.
-
- use reflection to search for getDefaultBlockSize(Path f)
- if the method doesn't exist, fall back to using getDefaultBlockSize()</div>
+ be split into to minimize i/o time.</div>
 <dl>
 <dt><span class="paramLabel">Parameters:</span></dt>
 <dd><code>fs</code> - filesystem object</dd>
 <dt><span class="returnLabel">Returns:</span></dt>
 <dd>the default block size for the path's filesystem</dd>
-<dt><span class="throwsLabel">Throws:</span></dt>
-<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - e</dd>
 </dl>
 </li>
 </ul>
@@ -752,13 +746,8 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getDefaultReplication</h4>
-<pre>public static&nbsp;short&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.193">getDefaultReplication</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
-                                          org.apache.hadoop.fs.Path&nbsp;path)
-                                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
-<dl>
-<dt><span class="throwsLabel">Throws:</span></dt>
-<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
-</dl>
+<pre>public static&nbsp;short&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.166">getDefaultReplication</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+                                          org.apache.hadoop.fs.Path&nbsp;path)</pre>
 </li>
 </ul>
 <a name="getDefaultBufferSize-org.apache.hadoop.fs.FileSystem-">
@@ -767,7 +756,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getDefaultBufferSize</h4>
-<pre>public static&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.227">getDefaultBufferSize</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs)</pre>
+<pre>public static&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.180">getDefaultBufferSize</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs)</pre>
 <div class="block">Returns the default buffer size to use during writes.
 
  The size of the buffer should probably be a multiple of hardware
@@ -787,7 +776,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>create</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.248">create</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.201">create</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                              org.apache.hadoop.fs.Path&nbsp;path,
                                                              org.apache.hadoop.fs.permission.FsPermission&nbsp;perm,
                                                              boolean&nbsp;overwrite)
@@ -819,7 +808,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getFilePermissions</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.permission.FsPermission&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.270">getFilePermissions</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;org.apache.hadoop.fs.permission.FsPermission&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.223">getFilePermissions</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                                               org.apache.hadoop.conf.Configuration&nbsp;conf,
                                                                               <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;permssionConfKey)</pre>
 <div class="block">Get the file permissions specified in the configuration, if they are
@@ -844,7 +833,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>validateRootPath</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.304">validateRootPath</a>(org.apache.hadoop.fs.Path&nbsp;root)
+<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.257">validateRootPath</a>(org.apache.hadoop.fs.Path&nbsp;root)
                                                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Verifies root directory path is a valid URI with a scheme</div>
 <dl>
@@ -863,7 +852,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>removeWALRootPath</h4>
-<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.327">removeWALRootPath</a>(org.apache.hadoop.fs.Path&nbsp;path,
+<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.280">removeWALRootPath</a>(org.apache.hadoop.fs.Path&nbsp;path,
                                        org.apache.hadoop.conf.Configuration&nbsp;conf)
                                 throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Checks for the presence of the WAL log root path (using the provided conf object) in the given
@@ -886,7 +875,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getPath</h4>
-<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.348">getPath</a>(org.apache.hadoop.fs.Path&nbsp;p)</pre>
+<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.301">getPath</a>(org.apache.hadoop.fs.Path&nbsp;p)</pre>
 <div class="block">Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This
  method returns the 'path' component of a Path's URI: e.g. If a Path is
  <code>hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir</code>,
@@ -907,7 +896,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getRootDir</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.358">getRootDir</a>(org.apache.hadoop.conf.Configuration&nbsp;c)
+<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.311">getRootDir</a>(org.apache.hadoop.conf.Configuration&nbsp;c)
                                             throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="paramLabel">Parameters:</span></dt>
@@ -926,7 +915,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>setRootDir</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.364">setRootDir</a>(org.apache.hadoop.conf.Configuration&nbsp;c,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.317">setRootDir</a>(org.apache.hadoop.conf.Configuration&nbsp;c,
                               org.apache.hadoop.fs.Path&nbsp;root)</pre>
 </li>
 </ul>
@@ -936,7 +925,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>setFsDefault</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.368">setFsDefault</a>(org.apache.hadoop.conf.Configuration&nbsp;c,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.321">setFsDefault</a>(org.apache.hadoop.conf.Configuration&nbsp;c,
                                 org.apache.hadoop.fs.Path&nbsp;root)</pre>
 </li>
 </ul>
@@ -946,7 +935,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getRootDirFileSystem</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.FileSystem&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.372">getRootDirFileSystem</a>(org.apache.hadoop.conf.Configuration&nbsp;c)
+<pre>public static&nbsp;org.apache.hadoop.fs.FileSystem&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.325">getRootDirFileSystem</a>(org.apache.hadoop.conf.Configuration&nbsp;c)
                                                             throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -960,7 +949,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getWALRootDir</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.383">getWALRootDir</a>(org.apache.hadoop.conf.Configuration&nbsp;c)
+<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.336">getWALRootDir</a>(org.apache.hadoop.conf.Configuration&nbsp;c)
                                                throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="paramLabel">Parameters:</span></dt>
@@ -979,7 +968,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>setWALRootDir</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.393">setWALRootDir</a>(org.apache.hadoop.conf.Configuration&nbsp;c,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.346">setWALRootDir</a>(org.apache.hadoop.conf.Configuration&nbsp;c,
                                  org.apache.hadoop.fs.Path&nbsp;root)</pre>
 </li>
 </ul>
@@ -989,7 +978,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getWALFileSystem</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.FileSystem&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.397">getWALFileSystem</a>(org.apache.hadoop.conf.Configuration&nbsp;c)
+<pre>public static&nbsp;org.apache.hadoop.fs.FileSystem&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.350">getWALFileSystem</a>(org.apache.hadoop.conf.Configuration&nbsp;c)
                                                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="throwsLabel">Throws:</span></dt>
@@ -1003,7 +992,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>isValidWALRootDir</h4>
-<pre>private static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.408">isValidWALRootDir</a>(org.apache.hadoop.fs.Path&nbsp;walDir,
+<pre>private static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.361">isValidWALRootDir</a>(org.apache.hadoop.fs.Path&nbsp;walDir,
                                          org.apache.hadoop.conf.Configuration&nbsp;c)
                                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
@@ -1018,7 +1007,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getWALRegionDir</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.429">getWALRegionDir</a>(org.apache.hadoop.conf.Configuration&nbsp;conf,
+<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.382">getWALRegionDir</a>(org.apache.hadoop.conf.Configuration&nbsp;conf,
                                                         <a href="../../../../../org/apache/hadoop/hbase/TableName.html" title="class in org.apache.hadoop.hbase">TableName</a>&nbsp;tableName,
                                                         <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodedRegionName)
                                                  throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -1041,7 +1030,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <ul class="blockList">
 <li class="blockList">
 <h4>getWALTableDir</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.441">getWALTableDir</a>(org.apache.hadoop.conf.Configuration&nbsp;conf,
+<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.394">getWALTableDir</a>(org.apache.hadoop.conf.Configuration&nbsp;conf,
                                                        <a href="../../../../../org/apache/hadoop/hbase/TableName.html" title="class in org.apache.hadoop.hbase">TableName</a>&nbsp;tableName)
                                                 throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Returns the Table directory under the WALRootDir for the specified table name</div>
@@ -1063,7 +1052,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html
 <li class="blockList">
 <h4>getWrongWALRegionDir</h4>
 <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
-public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.454">getWrongWALRegionDir</a>(org.apache.hadoop.conf.Configuration&nbsp;conf,
+public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.407">getWrongWALRegionDir</a>(org.apache.hadoop.conf.Configuration&nbsp;conf,
                                                                          <a href="../../../../../org/apache/hadoop/hbase/TableName.html" title="class in org.apache.hadoop.hbase">TableName</a>&nbsp;tableName,
                                                                          <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodedRegionName)
                                                                   throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -1082,7 +1071,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>getTableDir</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.469">getTableDir</a>(org.apache.hadoop.fs.Path&nbsp;rootdir,
+<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.422">getTableDir</a>(org.apache.hadoop.fs.Path&nbsp;rootdir,
                                                     <a href="../../../../../org/apache/hadoop/hbase/TableName.html" title="class in org.apache.hadoop.hbase">TableName</a>&nbsp;tableName)</pre>
 <div class="block">Returns the <code>Path</code> object representing the table directory under
  path rootdir</div>
@@ -1101,7 +1090,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>getTableName</h4>
-<pre>public static&nbsp;<a href="../../../../../org/apache/hadoop/hbase/TableName.html" title="class in org.apache.hadoop.hbase">TableName</a>&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.482">getTableName</a>(org.apache.hadoop.fs.Path&nbsp;tablePath)</pre>
+<pre>public static&nbsp;<a href="../../../../../org/apache/hadoop/hbase/TableName.html" title="class in org.apache.hadoop.hbase">TableName</a>&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.435">getTableName</a>(org.apache.hadoop.fs.Path&nbsp;tablePath)</pre>
 <div class="block">Returns the <a href="../../../../../org/apache/hadoop/hbase/TableName.html" title="class in org.apache.hadoop.hbase"><code>TableName</code></a> object representing
  the table directory under
  path rootdir</div>
@@ -1119,7 +1108,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>getNamespaceDir</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.494">getNamespaceDir</a>(org.apache.hadoop.fs.Path&nbsp;rootdir,
+<pre>public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.447">getNamespaceDir</a>(org.apache.hadoop.fs.Path&nbsp;rootdir,
                                                         <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;namespace)</pre>
 <div class="block">Returns the <code>Path</code> object representing
  the namespace directory under path rootdir</div>
@@ -1138,7 +1127,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>setStoragePolicy</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.520">setStoragePolicy</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.473">setStoragePolicy</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                     org.apache.hadoop.fs.Path&nbsp;path,
                                     <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;storagePolicy)</pre>
 <div class="block">Sets storage policy for given path.
@@ -1165,7 +1154,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>setStoragePolicy</h4>
-<pre>static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.530">setStoragePolicy</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.483">setStoragePolicy</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                              org.apache.hadoop.fs.Path&nbsp;path,
                              <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;storagePolicy,
                              boolean&nbsp;throwException)
@@ -1182,7 +1171,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>invokeSetStoragePolicy</h4>
-<pre>private static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.569">invokeSetStoragePolicy</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>private static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.522">invokeSetStoragePolicy</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                            org.apache.hadoop.fs.Path&nbsp;path,
                                            <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;storagePolicy)
                                     throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -1198,7 +1187,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>isHDFS</h4>
-<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.658">isHDFS</a>(org.apache.hadoop.conf.Configuration&nbsp;conf)
+<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.580">isHDFS</a>(org.apache.hadoop.conf.Configuration&nbsp;conf)
                       throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="paramLabel">Parameters:</span></dt>
@@ -1216,7 +1205,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>isRecoveredEdits</h4>
-<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.669">isRecoveredEdits</a>(org.apache.hadoop.fs.Path&nbsp;path)</pre>
+<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.591">isRecoveredEdits</a>(org.apache.hadoop.fs.Path&nbsp;path)</pre>
 <div class="block">Checks if the given path is the one with 'recovered.edits' dir.</div>
 <dl>
 <dt><span class="paramLabel">Parameters:</span></dt>
@@ -1232,7 +1221,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>getCurrentFileSystem</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.FileSystem&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.678">getCurrentFileSystem</a>(org.apache.hadoop.conf.Configuration&nbsp;conf)
+<pre>public static&nbsp;org.apache.hadoop.fs.FileSystem&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.600">getCurrentFileSystem</a>(org.apache.hadoop.conf.Configuration&nbsp;conf)
                                                             throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <dl>
 <dt><span class="paramLabel">Parameters:</span></dt>
@@ -1250,7 +1239,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>listStatus</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.FileStatus[]&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.696">listStatus</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;org.apache.hadoop.fs.FileStatus[]&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.618">listStatus</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                            org.apache.hadoop.fs.Path&nbsp;dir,
                                                            org.apache.hadoop.fs.PathFilter&nbsp;filter)
                                                     throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -1279,7 +1268,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>listStatus</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.FileStatus[]&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.721">listStatus</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;org.apache.hadoop.fs.FileStatus[]&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.643">listStatus</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                            org.apache.hadoop.fs.Path&nbsp;dir)
                                                     throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Calls fs.listStatus() and treats FileNotFoundException as non-fatal
@@ -1301,7 +1290,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>listLocatedStatus</h4>
-<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;org.apache.hadoop.fs.LocatedFileStatus&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.732">listLocatedStatus</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;org.apache.hadoop.fs.LocatedFileStatus&gt;&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.654">listLocatedStatus</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                                              org.apache.hadoop.fs.Path&nbsp;dir)
                                                                       throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call</div>
@@ -1322,7 +1311,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>delete</h4>
-<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.762">delete</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.684">delete</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                              org.apache.hadoop.fs.Path&nbsp;path,
                              boolean&nbsp;recursive)
                       throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -1345,7 +1334,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>isExists</h4>
-<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.775">isExists</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.697">isExists</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                org.apache.hadoop.fs.Path&nbsp;path)
                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
 <div class="block">Calls fs.exists(). Checks if the specified path exists</div>
@@ -1366,7 +1355,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>logFileSystemState</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.786">logFileSystemState</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.708">logFileSystemState</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                       org.apache.hadoop.fs.Path&nbsp;root,
                                       org.slf4j.Logger&nbsp;log)
                                throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -1387,7 +1376,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>logFSTree</h4>
-<pre>private static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.797">logFSTree</a>(org.slf4j.Logger&nbsp;log,
+<pre>private static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.719">logFSTree</a>(org.slf4j.Logger&nbsp;log,
                               org.apache.hadoop.fs.FileSystem&nbsp;fs,
                               org.apache.hadoop.fs.Path&nbsp;root,
                               <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;prefix)
@@ -1407,7 +1396,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>renameAndSetModifyTime</h4>
-<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.814">renameAndSetModifyTime</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.736">renameAndSetModifyTime</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                              org.apache.hadoop.fs.Path&nbsp;src,
                                              org.apache.hadoop.fs.Path&nbsp;dest)
                                       throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -1423,7 +1412,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>checkShortCircuitReadBufferSize</h4>
-<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.825">checkShortCircuitReadBufferSize</a>(org.apache.hadoop.conf.Configuration&nbsp;conf)</pre>
+<pre>public static&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.747">checkShortCircuitReadBufferSize</a>(org.apache.hadoop.conf.Configuration&nbsp;conf)</pre>
 <div class="block">Check if short circuit read buffer size is set and if not, set it to hbase value.</div>
 <dl>
 <dt><span class="paramLabel">Parameters:</span></dt>
@@ -1437,7 +1426,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>createForWal</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.950">createForWal</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.872">createForWal</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                                    org.apache.hadoop.fs.Path&nbsp;path,
                                                                    boolean&nbsp;overwritable)
                                                             throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
@@ -1457,7 +1446,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockList">
 <li class="blockList">
 <h4>createForWal</h4>
-<pre>public static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.961">createForWal</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
+<pre>public static&nbsp;org.apache.hadoop.fs.FSDataOutputStream&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.883">createForWal</a>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
                                                                    org.apache.hadoop.fs.Path&nbsp;path,
                                                                    boolean&nbsp;overwritable,
                                                                    int&nbsp;bufferSize,
@@ -1481,7 +1470,7 @@ public static&nbsp;org.apache.hadoop.fs.Path&nbsp;<a href="../../../../../src-ht
 <ul class="blockListLast">
 <li class="blockList">
 <h4>hasCapability</h4>
-<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.1009">hasCapability</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;stream,
+<pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html#line.931">hasCapability</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;stream,
                                     <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;capability)</pre>
 <div class="block">If our FileSystem version includes the StreamCapabilities class, check if the given stream has
  a particular capability.</div>
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
index d6ef85c..cab05fa 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
@@ -18,9 +18,9 @@
 <span class="sourceLineNo">010</span>  justification="Intentional; to be modified in test")<a name="line.10"></a>
 <span class="sourceLineNo">011</span>public class Version {<a name="line.11"></a>
 <span class="sourceLineNo">012</span>  public static final String version = new String("3.0.0-SNAPSHOT");<a name="line.12"></a>
-<span class="sourceLineNo">013</span>  public static final String revision = "75b85016ebeeee43b9fa7b5477778f253ca293ee";<a name="line.13"></a>
+<span class="sourceLineNo">013</span>  public static final String revision = "569ac1232a51f727a09b5065b1ec6c87d089fc08";<a name="line.13"></a>
 <span class="sourceLineNo">014</span>  public static final String user = "jenkins";<a name="line.14"></a>
-<span class="sourceLineNo">015</span>  public static final String date = "Sun Jan 19 14:37:18 UTC 2020";<a name="line.15"></a>
+<span class="sourceLineNo">015</span>  public static final String date = "Mon Jan 20 14:39:11 UTC 2020";<a name="line.15"></a>
 <span class="sourceLineNo">016</span>  public static final String url = "git://jenkins-websites-he-de.apache.org/home/jenkins/jenkins-slave/workspace/hbase_generate_website/hbase";<a name="line.16"></a>
 <span class="sourceLineNo">017</span>  public static final String srcChecksum = "(stdin)=";<a name="line.17"></a>
 <span class="sourceLineNo">018</span>}<a name="line.18"></a>
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/net/Address.html b/devapidocs/src-html/org/apache/hadoop/hbase/net/Address.html
index e7d1363..579526f 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/net/Address.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/net/Address.html
@@ -39,7 +39,7 @@
 <span class="sourceLineNo">031</span> * We cannot have Guava classes in our API hence this Type.<a name="line.31"></a>
 <span class="sourceLineNo">032</span> */<a name="line.32"></a>
 <span class="sourceLineNo">033</span>@InterfaceAudience.Public<a name="line.33"></a>
-<span class="sourceLineNo">034</span>public final class Address implements Comparable&lt;Address&gt; {<a name="line.34"></a>
+<span class="sourceLineNo">034</span>public class Address implements Comparable&lt;Address&gt; {<a name="line.34"></a>
 <span class="sourceLineNo">035</span>  private HostAndPort hostAndPort;<a name="line.35"></a>
 <span class="sourceLineNo">036</span><a name="line.36"></a>
 <span class="sourceLineNo">037</span>  private Address(HostAndPort hostAndPort) {<a name="line.37"></a>
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html b/devapidocs/src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html
index 63a5485..6b838ca 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/util/ByteRangeUtils.html
@@ -38,56 +38,53 @@
 <span class="sourceLineNo">030</span> * Utility methods for working with {@link ByteRange}.<a name="line.30"></a>
 <span class="sourceLineNo">031</span> */<a name="line.31"></a>
 <span class="sourceLineNo">032</span>@InterfaceAudience.Public<a name="line.32"></a>
-<span class="sourceLineNo">033</span>public final class ByteRangeUtils {<a name="line.33"></a>
-<span class="sourceLineNo">034</span>  private ByteRangeUtils() {<a name="line.34"></a>
-<span class="sourceLineNo">035</span>  }<a name="line.35"></a>
-<span class="sourceLineNo">036</span><a name="line.36"></a>
-<span class="sourceLineNo">037</span>  public static int numEqualPrefixBytes(ByteRange left, ByteRange right, int rightInnerOffset) {<a name="line.37"></a>
-<span class="sourceLineNo">038</span>    int maxCompares = Math.min(left.getLength(), right.getLength() - rightInnerOffset);<a name="line.38"></a>
-<span class="sourceLineNo">039</span>    final byte[] lbytes = left.getBytes();<a name="line.39"></a>
-<span class="sourceLineNo">040</span>    final byte[] rbytes = right.getBytes();<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    final int loffset = left.getOffset();<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    final int roffset = right.getOffset();<a name="line.42"></a>
-<span class="sourceLineNo">043</span>    for (int i = 0; i &lt; maxCompares; ++i) {<a name="line.43"></a>
-<span class="sourceLineNo">044</span>      if (lbytes[loffset + i] != rbytes[roffset + rightInnerOffset + i]) {<a name="line.44"></a>
-<span class="sourceLineNo">045</span>        return i;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>      }<a name="line.46"></a>
-<span class="sourceLineNo">047</span>    }<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    return maxCompares;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>  }<a name="line.49"></a>
-<span class="sourceLineNo">050</span><a name="line.50"></a>
-<span class="sourceLineNo">051</span>  public static ArrayList&lt;byte[]&gt; copyToNewArrays(Collection&lt;ByteRange&gt; ranges) {<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    if (ranges == null) {<a name="line.52"></a>
-<span class="sourceLineNo">053</span>      return new ArrayList&lt;&gt;(0);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    }<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    ArrayList&lt;byte[]&gt; arrays = Lists.newArrayListWithCapacity(ranges.size());<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    for (ByteRange range : ranges) {<a name="line.56"></a>
-<span class="sourceLineNo">057</span>      arrays.add(range.deepCopyToNewArray());<a name="line.57"></a>
-<span class="sourceLineNo">058</span>    }<a name="line.58"></a>
-<span class="sourceLineNo">059</span>    return arrays;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>  }<a name="line.60"></a>
-<span class="sourceLineNo">061</span><a name="line.61"></a>
-<span class="sourceLineNo">062</span>  public static ArrayList&lt;ByteRange&gt; fromArrays(Collection&lt;byte[]&gt; arrays) {<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    if (arrays == null) {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>      return new ArrayList&lt;&gt;(0);<a name="line.64"></a>
-<span class="sourceLineNo">065</span>    }<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    ArrayList&lt;ByteRange&gt; ranges = Lists.newArrayListWithCapacity(arrays.size());<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    for (byte[] array : arrays) {<a name="line.67"></a>
-<span class="sourceLineNo">068</span>      ranges.add(new SimpleMutableByteRange(array));<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    }<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    return ranges;<a name="line.70"></a>
-<span class="sourceLineNo">071</span>  }<a name="line.71"></a>
-<span class="sourceLineNo">072</span><a name="line.72"></a>
-<span class="sourceLineNo">073</span>  public static void write(OutputStream os, ByteRange byteRange) throws IOException {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>    os.write(byteRange.getBytes(), byteRange.getOffset(), byteRange.getLength());<a name="line.74"></a>
-<span class="sourceLineNo">075</span>  }<a name="line.75"></a>
-<span class="sourceLineNo">076</span><a name="line.76"></a>
-<span class="sourceLineNo">077</span>  public static void write(OutputStream os, ByteRange byteRange, int byteRangeInnerOffset)<a name="line.77"></a>
-<span class="sourceLineNo">078</span>      throws IOException {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    os.write(byteRange.getBytes(), byteRange.getOffset() + byteRangeInnerOffset,<a name="line.79"></a>
-<span class="sourceLineNo">080</span>      byteRange.getLength() - byteRangeInnerOffset);<a name="line.80"></a>
-<span class="sourceLineNo">081</span>  }<a name="line.81"></a>
-<span class="sourceLineNo">082</span>}<a name="line.82"></a>
+<span class="sourceLineNo">033</span>public class ByteRangeUtils {<a name="line.33"></a>
+<span class="sourceLineNo">034</span>  public static int numEqualPrefixBytes(ByteRange left, ByteRange right, int rightInnerOffset) {<a name="line.34"></a>
+<span class="sourceLineNo">035</span>    int maxCompares = Math.min(left.getLength(), right.getLength() - rightInnerOffset);<a name="line.35"></a>
+<span class="sourceLineNo">036</span>    final byte[] lbytes = left.getBytes();<a name="line.36"></a>
+<span class="sourceLineNo">037</span>    final byte[] rbytes = right.getBytes();<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    final int loffset = left.getOffset();<a name="line.38"></a>
+<span class="sourceLineNo">039</span>    final int roffset = right.getOffset();<a name="line.39"></a>
+<span class="sourceLineNo">040</span>    for (int i = 0; i &lt; maxCompares; ++i) {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>      if (lbytes[loffset + i] != rbytes[roffset + rightInnerOffset + i]) {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>        return i;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>      }<a name="line.43"></a>
+<span class="sourceLineNo">044</span>    }<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    return maxCompares;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>  }<a name="line.46"></a>
+<span class="sourceLineNo">047</span><a name="line.47"></a>
+<span class="sourceLineNo">048</span>  public static ArrayList&lt;byte[]&gt; copyToNewArrays(Collection&lt;ByteRange&gt; ranges) {<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    if (ranges == null) {<a name="line.49"></a>
+<span class="sourceLineNo">050</span>      return new ArrayList&lt;&gt;(0);<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    }<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    ArrayList&lt;byte[]&gt; arrays = Lists.newArrayListWithCapacity(ranges.size());<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    for (ByteRange range : ranges) {<a name="line.53"></a>
+<span class="sourceLineNo">054</span>      arrays.add(range.deepCopyToNewArray());<a name="line.54"></a>
+<span class="sourceLineNo">055</span>    }<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    return arrays;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>  }<a name="line.57"></a>
+<span class="sourceLineNo">058</span><a name="line.58"></a>
+<span class="sourceLineNo">059</span>  public static ArrayList&lt;ByteRange&gt; fromArrays(Collection&lt;byte[]&gt; arrays) {<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    if (arrays == null) {<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      return new ArrayList&lt;&gt;(0);<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    ArrayList&lt;ByteRange&gt; ranges = Lists.newArrayListWithCapacity(arrays.size());<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    for (byte[] array : arrays) {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>      ranges.add(new SimpleMutableByteRange(array));<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    }<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    return ranges;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>  }<a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>  public static void write(OutputStream os, ByteRange byteRange) throws IOException {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    os.write(byteRange.getBytes(), byteRange.getOffset(), byteRange.getLength());<a name="line.71"></a>
+<span class="sourceLineNo">072</span>  }<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>  public static void write(OutputStream os, ByteRange byteRange, int byteRangeInnerOffset)<a name="line.74"></a>
+<span class="sourceLineNo">075</span>      throws IOException {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    os.write(byteRange.getBytes(), byteRange.getOffset() + byteRangeInnerOffset,<a name="line.76"></a>
+<span class="sourceLineNo">077</span>      byteRange.getLength() - byteRangeInnerOffset);<a name="line.77"></a>
+<span class="sourceLineNo">078</span>  }<a name="line.78"></a>
+<span class="sourceLineNo">079</span>}<a name="line.79"></a>
 
 
 
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html b/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html
index a739df0..fb9defa 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.DfsBuilderUtility.html
@@ -157,903 +157,825 @@
 <span class="sourceLineNo">149</span>   * Return the number of bytes that large input files should be optimally<a name="line.149"></a>
 <span class="sourceLineNo">150</span>   * be split into to minimize i/o time.<a name="line.150"></a>
 <span class="sourceLineNo">151</span>   *<a name="line.151"></a>
-<span class="sourceLineNo">152</span>   * use reflection to search for getDefaultBlockSize(Path f)<a name="line.152"></a>
-<span class="sourceLineNo">153</span>   * if the method doesn't exist, fall back to using getDefaultBlockSize()<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   *<a name="line.154"></a>
-<span class="sourceLineNo">155</span>   * @param fs filesystem object<a name="line.155"></a>
-<span class="sourceLineNo">156</span>   * @return the default block size for the path's filesystem<a name="line.156"></a>
-<span class="sourceLineNo">157</span>   * @throws IOException e<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   */<a name="line.158"></a>
-<span class="sourceLineNo">159</span>  public static long getDefaultBlockSize(final FileSystem fs, final Path path) throws IOException {<a name="line.159"></a>
-<span class="sourceLineNo">160</span>    Method m = null;<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    Class&lt;? extends FileSystem&gt; cls = fs.getClass();<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    try {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>      m = cls.getMethod("getDefaultBlockSize", Path.class);<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    } catch (NoSuchMethodException e) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>      LOG.info("FileSystem doesn't support getDefaultBlockSize");<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    } catch (SecurityException e) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>      LOG.info("Doesn't have access to getDefaultBlockSize on FileSystems", e);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      m = null; // could happen on setAccessible()<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    }<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    if (m == null) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      return fs.getDefaultBlockSize(path);<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    } else {<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      try {<a name="line.173"></a>
-<span class="sourceLineNo">174</span>        Object ret = m.invoke(fs, path);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        return ((Long)ret).longValue();<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      } catch (Exception e) {<a name="line.176"></a>
-<span class="sourceLineNo">177</span>        throw new IOException(e);<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      }<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    }<a name="line.179"></a>
-<span class="sourceLineNo">180</span>  }<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>  /*<a name="line.182"></a>
-<span class="sourceLineNo">183</span>   * Get the default replication.<a name="line.183"></a>
-<span class="sourceLineNo">184</span>   *<a name="line.184"></a>
-<span class="sourceLineNo">185</span>   * use reflection to search for getDefaultReplication(Path f)<a name="line.185"></a>
-<span class="sourceLineNo">186</span>   * if the method doesn't exist, fall back to using getDefaultReplication()<a name="line.186"></a>
-<span class="sourceLineNo">187</span>   *<a name="line.187"></a>
-<span class="sourceLineNo">188</span>   * @param fs filesystem object<a name="line.188"></a>
-<span class="sourceLineNo">189</span>   * @param f path of file<a name="line.189"></a>
-<span class="sourceLineNo">190</span>   * @return default replication for the path's filesystem<a name="line.190"></a>
-<span class="sourceLineNo">191</span>   * @throws IOException e<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   */<a name="line.192"></a>
-<span class="sourceLineNo">193</span>  public static short getDefaultReplication(final FileSystem fs, final Path path)<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      throws IOException {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    Method m = null;<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    Class&lt;? extends FileSystem&gt; cls = fs.getClass();<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    try {<a name="line.197"></a>
-<span class="sourceLineNo">198</span>      m = cls.getMethod("getDefaultReplication", Path.class);<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    } catch (NoSuchMethodException e) {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>      LOG.info("FileSystem doesn't support getDefaultReplication");<a name="line.200"></a>
-<span class="sourceLineNo">201</span>    } catch (SecurityException e) {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>      LOG.info("Doesn't have access to getDefaultReplication on FileSystems", e);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      m = null; // could happen on setAccessible()<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    }<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    if (m == null) {<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      return fs.getDefaultReplication(path);<a name="line.206"></a>
-<span class="sourceLineNo">207</span>    } else {<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      try {<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        Object ret = m.invoke(fs, path);<a name="line.209"></a>
-<span class="sourceLineNo">210</span>        return ((Number)ret).shortValue();<a name="line.210"></a>
-<span class="sourceLineNo">211</span>      } catch (Exception e) {<a name="line.211"></a>
-<span class="sourceLineNo">212</span>        throw new IOException(e);<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      }<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>  }<a name="line.215"></a>
-<span class="sourceLineNo">216</span><a name="line.216"></a>
-<span class="sourceLineNo">217</span>  /**<a name="line.217"></a>
-<span class="sourceLineNo">218</span>   * Returns the default buffer size to use during writes.<a name="line.218"></a>
-<span class="sourceLineNo">219</span>   *<a name="line.219"></a>
-<span class="sourceLineNo">220</span>   * The size of the buffer should probably be a multiple of hardware<a name="line.220"></a>
-<span class="sourceLineNo">221</span>   * page size (4096 on Intel x86), and it determines how much data is<a name="line.221"></a>
-<span class="sourceLineNo">222</span>   * buffered during read and write operations.<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   *<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   * @param fs filesystem object<a name="line.224"></a>
-<span class="sourceLineNo">225</span>   * @return default buffer size to use during writes<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>  public static int getDefaultBufferSize(final FileSystem fs) {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    return fs.getConf().getInt("io.file.buffer.size", 4096);<a name="line.228"></a>
-<span class="sourceLineNo">229</span>  }<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>  /**<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   * Create the specified file on the filesystem. By default, this will:<a name="line.232"></a>
-<span class="sourceLineNo">233</span>   * &lt;ol&gt;<a name="line.233"></a>
-<span class="sourceLineNo">234</span>   * &lt;li&gt;apply the umask in the configuration (if it is enabled)&lt;/li&gt;<a name="line.234"></a>
-<span class="sourceLineNo">235</span>   * &lt;li&gt;use the fs configured buffer size (or 4096 if not set)&lt;/li&gt;<a name="line.235"></a>
-<span class="sourceLineNo">236</span>   * &lt;li&gt;use the default replication&lt;/li&gt;<a name="line.236"></a>
-<span class="sourceLineNo">237</span>   * &lt;li&gt;use the default block size&lt;/li&gt;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>   * &lt;li&gt;not track progress&lt;/li&gt;<a name="line.238"></a>
-<span class="sourceLineNo">239</span>   * &lt;/ol&gt;<a name="line.239"></a>
-<span class="sourceLineNo">240</span>   *<a name="line.240"></a>
-<span class="sourceLineNo">241</span>   * @param fs {@link FileSystem} on which to write the file<a name="line.241"></a>
-<span class="sourceLineNo">242</span>   * @param path {@link Path} to the file to write<a name="line.242"></a>
-<span class="sourceLineNo">243</span>   * @param perm intial permissions<a name="line.243"></a>
-<span class="sourceLineNo">244</span>   * @param overwrite Whether or not the created file should be overwritten.<a name="line.244"></a>
-<span class="sourceLineNo">245</span>   * @return output stream to the created file<a name="line.245"></a>
-<span class="sourceLineNo">246</span>   * @throws IOException if the file cannot be created<a name="line.246"></a>
-<span class="sourceLineNo">247</span>   */<a name="line.247"></a>
-<span class="sourceLineNo">248</span>  public static FSDataOutputStream create(FileSystem fs, Path path,<a name="line.248"></a>
-<span class="sourceLineNo">249</span>      FsPermission perm, boolean overwrite) throws IOException {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    if (LOG.isTraceEnabled()) {<a name="line.250"></a>
-<span class="sourceLineNo">251</span>      LOG.trace("Creating file={} with permission={}, overwrite={}", path, perm, overwrite);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    }<a name="line.252"></a>
-<span class="sourceLineNo">253</span>    return fs.create(path, perm, overwrite, getDefaultBufferSize(fs),<a name="line.253"></a>
-<span class="sourceLineNo">254</span>        getDefaultReplication(fs, path), getDefaultBlockSize(fs, path), null);<a name="line.254"></a>
-<span class="sourceLineNo">255</span>  }<a name="line.255"></a>
-<span class="sourceLineNo">256</span><a name="line.256"></a>
-<span class="sourceLineNo">257</span>  /**<a name="line.257"></a>
-<span class="sourceLineNo">258</span>   * Get the file permissions specified in the configuration, if they are<a name="line.258"></a>
-<span class="sourceLineNo">259</span>   * enabled.<a name="line.259"></a>
-<span class="sourceLineNo">260</span>   *<a name="line.260"></a>
-<span class="sourceLineNo">261</span>   * @param fs filesystem that the file will be created on.<a name="line.261"></a>
-<span class="sourceLineNo">262</span>   * @param conf configuration to read for determining if permissions are<a name="line.262"></a>
-<span class="sourceLineNo">263</span>   *          enabled and which to use<a name="line.263"></a>
-<span class="sourceLineNo">264</span>   * @param permssionConfKey property key in the configuration to use when<a name="line.264"></a>
-<span class="sourceLineNo">265</span>   *          finding the permission<a name="line.265"></a>
-<span class="sourceLineNo">266</span>   * @return the permission to use when creating a new file on the fs. If<a name="line.266"></a>
-<span class="sourceLineNo">267</span>   *         special permissions are not specified in the configuration, then<a name="line.267"></a>
-<span class="sourceLineNo">268</span>   *         the default permissions on the the fs will be returned.<a name="line.268"></a>
-<span class="sourceLineNo">269</span>   */<a name="line.269"></a>
-<span class="sourceLineNo">270</span>  public static FsPermission getFilePermissions(final FileSystem fs,<a name="line.270"></a>
-<span class="sourceLineNo">271</span>      final Configuration conf, final String permssionConfKey) {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    boolean enablePermissions = conf.getBoolean(<a name="line.272"></a>
-<span class="sourceLineNo">273</span>        HConstants.ENABLE_DATA_FILE_UMASK, false);<a name="line.273"></a>
-<span class="sourceLineNo">274</span><a name="line.274"></a>
-<span class="sourceLineNo">275</span>    if (enablePermissions) {<a name="line.275"></a>
-<span class="sourceLineNo">276</span>      try {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>        // make sure that we have a mask, if not, go default.<a name="line.278"></a>
-<span class="sourceLineNo">279</span>        String mask = conf.get(permssionConfKey);<a name="line.279"></a>
-<span class="sourceLineNo">280</span>        if (mask == null) {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>          return FsPermission.getFileDefault();<a name="line.281"></a>
-<span class="sourceLineNo">282</span>        }<a name="line.282"></a>
-<span class="sourceLineNo">283</span>        // appy the umask<a name="line.283"></a>
-<span class="sourceLineNo">284</span>        FsPermission umask = new FsPermission(mask);<a name="line.284"></a>
-<span class="sourceLineNo">285</span>        return perm.applyUMask(umask);<a name="line.285"></a>
-<span class="sourceLineNo">286</span>      } catch (IllegalArgumentException e) {<a name="line.286"></a>
-<span class="sourceLineNo">287</span>        LOG.warn(<a name="line.287"></a>
-<span class="sourceLineNo">288</span>            "Incorrect umask attempted to be created: "<a name="line.288"></a>
-<span class="sourceLineNo">289</span>                + conf.get(permssionConfKey)<a name="line.289"></a>
-<span class="sourceLineNo">290</span>                + ", using default file permissions.", e);<a name="line.290"></a>
-<span class="sourceLineNo">291</span>        return FsPermission.getFileDefault();<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      }<a name="line.292"></a>
-<span class="sourceLineNo">293</span>    }<a name="line.293"></a>
-<span class="sourceLineNo">294</span>    return FsPermission.getFileDefault();<a name="line.294"></a>
-<span class="sourceLineNo">295</span>  }<a name="line.295"></a>
-<span class="sourceLineNo">296</span><a name="line.296"></a>
-<span class="sourceLineNo">297</span>  /**<a name="line.297"></a>
-<span class="sourceLineNo">298</span>   * Verifies root directory path is a valid URI with a scheme<a name="line.298"></a>
-<span class="sourceLineNo">299</span>   *<a name="line.299"></a>
-<span class="sourceLineNo">300</span>   * @param root root directory path<a name="line.300"></a>
-<span class="sourceLineNo">301</span>   * @return Passed &lt;code&gt;root&lt;/code&gt; argument.<a name="line.301"></a>
-<span class="sourceLineNo">302</span>   * @throws IOException if not a valid URI with a scheme<a name="line.302"></a>
-<span class="sourceLineNo">303</span>   */<a name="line.303"></a>
-<span class="sourceLineNo">304</span>  public static Path validateRootPath(Path root) throws IOException {<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    try {<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      URI rootURI = new URI(root.toString());<a name="line.306"></a>
-<span class="sourceLineNo">307</span>      String scheme = rootURI.getScheme();<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      if (scheme == null) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>        throw new IOException("Root directory does not have a scheme");<a name="line.309"></a>
-<span class="sourceLineNo">310</span>      }<a name="line.310"></a>
-<span class="sourceLineNo">311</span>      return root;<a name="line.311"></a>
-<span class="sourceLineNo">312</span>    } catch (URISyntaxException e) {<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      throw new IOException("Root directory path is not a valid " +<a name="line.313"></a>
-<span class="sourceLineNo">314</span>        "URI -- check your " + HConstants.HBASE_DIR + " configuration", e);<a name="line.314"></a>
-<span class="sourceLineNo">315</span>    }<a name="line.315"></a>
-<span class="sourceLineNo">316</span>  }<a name="line.316"></a>
-<span class="sourceLineNo">317</span><a name="line.317"></a>
-<span class="sourceLineNo">318</span>  /**<a name="line.318"></a>
-<span class="sourceLineNo">319</span>   * Checks for the presence of the WAL log root path (using the provided conf object) in the given<a name="line.319"></a>
-<span class="sourceLineNo">320</span>   * path. If it exists, this method removes it and returns the String representation of remaining<a name="line.320"></a>
-<span class="sourceLineNo">321</span>   * relative path.<a name="line.321"></a>
-<span class="sourceLineNo">322</span>   * @param path must not be null<a name="line.322"></a>
-<span class="sourceLineNo">323</span>   * @param conf must not be null<a name="line.323"></a>
-<span class="sourceLineNo">324</span>   * @return String representation of the remaining relative path<a name="line.324"></a>
-<span class="sourceLineNo">325</span>   * @throws IOException from underlying filesystem<a name="line.325"></a>
-<span class="sourceLineNo">326</span>   */<a name="line.326"></a>
-<span class="sourceLineNo">327</span>  public static String removeWALRootPath(Path path, final Configuration conf) throws IOException {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    Path root = getWALRootDir(conf);<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    String pathStr = path.toString();<a name="line.329"></a>
-<span class="sourceLineNo">330</span>    // check that the path is absolute... it has the root path in it.<a name="line.330"></a>
-<span class="sourceLineNo">331</span>    if (!pathStr.startsWith(root.toString())) {<a name="line.331"></a>
-<span class="sourceLineNo">332</span>      return pathStr;<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    }<a name="line.333"></a>
-<span class="sourceLineNo">334</span>    // if not, return as it is.<a name="line.334"></a>
-<span class="sourceLineNo">335</span>    return pathStr.substring(root.toString().length() + 1);// remove the "/" too.<a name="line.335"></a>
-<span class="sourceLineNo">336</span>  }<a name="line.336"></a>
-<span class="sourceLineNo">337</span><a name="line.337"></a>
-<span class="sourceLineNo">338</span>  /**<a name="line.338"></a>
-<span class="sourceLineNo">339</span>   * Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This<a name="line.339"></a>
-<span class="sourceLineNo">340</span>   * method returns the 'path' component of a Path's URI: e.g. If a Path is<a name="line.340"></a>
-<span class="sourceLineNo">341</span>   * &lt;code&gt;hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;,<a name="line.341"></a>
-<span class="sourceLineNo">342</span>   * this method returns &lt;code&gt;/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;.<a name="line.342"></a>
-<span class="sourceLineNo">343</span>   * This method is useful if you want to print out a Path without qualifying<a name="line.343"></a>
-<span class="sourceLineNo">344</span>   * Filesystem instance.<a name="line.344"></a>
-<span class="sourceLineNo">345</span>   * @param p Filesystem Path whose 'path' component we are to return.<a name="line.345"></a>
-<span class="sourceLineNo">346</span>   * @return Path portion of the Filesystem<a name="line.346"></a>
-<span class="sourceLineNo">347</span>   */<a name="line.347"></a>
-<span class="sourceLineNo">348</span>  public static String getPath(Path p) {<a name="line.348"></a>
-<span class="sourceLineNo">349</span>    return p.toUri().getPath();<a name="line.349"></a>
-<span class="sourceLineNo">350</span>  }<a name="line.350"></a>
-<span class="sourceLineNo">351</span><a name="line.351"></a>
-<span class="sourceLineNo">352</span>  /**<a name="line.352"></a>
-<span class="sourceLineNo">353</span>   * @param c configuration<a name="line.353"></a>
-<span class="sourceLineNo">354</span>   * @return {@link Path} to hbase root directory from<a name="line.354"></a>
-<span class="sourceLineNo">355</span>   *     configuration as a qualified Path.<a name="line.355"></a>
-<span class="sourceLineNo">356</span>   * @throws IOException e<a name="line.356"></a>
-<span class="sourceLineNo">357</span>   */<a name="line.357"></a>
-<span class="sourceLineNo">358</span>  public static Path getRootDir(final Configuration c) throws IOException {<a name="line.358"></a>
-<span class="sourceLineNo">359</span>    Path p = new Path(c.get(HConstants.HBASE_DIR));<a name="line.359"></a>
-<span class="sourceLineNo">360</span>    FileSystem fs = p.getFileSystem(c);<a name="line.360"></a>
-<span class="sourceLineNo">361</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.361"></a>
-<span class="sourceLineNo">362</span>  }<a name="line.362"></a>
-<span class="sourceLineNo">363</span><a name="line.363"></a>
-<span class="sourceLineNo">364</span>  public static void setRootDir(final Configuration c, final Path root) {<a name="line.364"></a>
-<span class="sourceLineNo">365</span>    c.set(HConstants.HBASE_DIR, root.toString());<a name="line.365"></a>
-<span class="sourceLineNo">366</span>  }<a name="line.366"></a>
-<span class="sourceLineNo">367</span><a name="line.367"></a>
-<span class="sourceLineNo">368</span>  public static void setFsDefault(final Configuration c, final Path root) {<a name="line.368"></a>
-<span class="sourceLineNo">369</span>    c.set("fs.defaultFS", root.toString());    // for hadoop 0.21+<a name="line.369"></a>
-<span class="sourceLineNo">370</span>  }<a name="line.370"></a>
-<span class="sourceLineNo">371</span><a name="line.371"></a>
-<span class="sourceLineNo">372</span>  public static FileSystem getRootDirFileSystem(final Configuration c) throws IOException {<a name="line.372"></a>
-<span class="sourceLineNo">373</span>    Path p = getRootDir(c);<a name="line.373"></a>
-<span class="sourceLineNo">374</span>    return p.getFileSystem(c);<a name="line.374"></a>
-<span class="sourceLineNo">375</span>  }<a name="line.375"></a>
-<span class="sourceLineNo">376</span><a name="line.376"></a>
-<span class="sourceLineNo">377</span>  /**<a name="line.377"></a>
-<span class="sourceLineNo">378</span>   * @param c configuration<a name="line.378"></a>
-<span class="sourceLineNo">379</span>   * @return {@link Path} to hbase log root directory: e.g. {@value HBASE_WAL_DIR} from<a name="line.379"></a>
-<span class="sourceLineNo">380</span>   *     configuration as a qualified Path. Defaults to HBase root dir.<a name="line.380"></a>
-<span class="sourceLineNo">381</span>   * @throws IOException e<a name="line.381"></a>
-<span class="sourceLineNo">382</span>   */<a name="line.382"></a>
-<span class="sourceLineNo">383</span>  public static Path getWALRootDir(final Configuration c) throws IOException {<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    Path p = new Path(c.get(HBASE_WAL_DIR, c.get(HConstants.HBASE_DIR)));<a name="line.384"></a>
-<span class="sourceLineNo">385</span>    if (!isValidWALRootDir(p, c)) {<a name="line.385"></a>
-<span class="sourceLineNo">386</span>      return getRootDir(c);<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    }<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    FileSystem fs = p.getFileSystem(c);<a name="line.388"></a>
-<span class="sourceLineNo">389</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.389"></a>
-<span class="sourceLineNo">390</span>  }<a name="line.390"></a>
-<span class="sourceLineNo">391</span><a name="line.391"></a>
-<span class="sourceLineNo">392</span>  @VisibleForTesting<a name="line.392"></a>
-<span class="sourceLineNo">393</span>  public static void setWALRootDir(final Configuration c, final Path root) {<a name="line.393"></a>
-<span class="sourceLineNo">394</span>    c.set(HBASE_WAL_DIR, root.toString());<a name="line.394"></a>
-<span class="sourceLineNo">395</span>  }<a name="line.395"></a>
-<span class="sourceLineNo">396</span><a name="line.396"></a>
-<span class="sourceLineNo">397</span>  public static FileSystem getWALFileSystem(final Configuration c) throws IOException {<a name="line.397"></a>
-<span class="sourceLineNo">398</span>    Path p = getWALRootDir(c);<a name="line.398"></a>
-<span class="sourceLineNo">399</span>    FileSystem fs = p.getFileSystem(c);<a name="line.399"></a>
-<span class="sourceLineNo">400</span>    // hadoop-core does fs caching, so need to propogate this if set<a name="line.400"></a>
-<span class="sourceLineNo">401</span>    String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);<a name="line.401"></a>
-<span class="sourceLineNo">402</span>    if (enforceStreamCapability != null) {<a name="line.402"></a>
-<span class="sourceLineNo">403</span>      fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);<a name="line.403"></a>
-<span class="sourceLineNo">404</span>    }<a name="line.404"></a>
-<span class="sourceLineNo">405</span>    return fs;<a name="line.405"></a>
-<span class="sourceLineNo">406</span>  }<a name="line.406"></a>
-<span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>  private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {<a name="line.408"></a>
-<span class="sourceLineNo">409</span>    Path rootDir = getRootDir(c);<a name="line.409"></a>
-<span class="sourceLineNo">410</span>    FileSystem fs = walDir.getFileSystem(c);<a name="line.410"></a>
-<span class="sourceLineNo">411</span>    Path qualifiedWalDir = walDir.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.411"></a>
-<span class="sourceLineNo">412</span>    if (!qualifiedWalDir.equals(rootDir)) {<a name="line.412"></a>
-<span class="sourceLineNo">413</span>      if (qualifiedWalDir.toString().startsWith(rootDir.toString() + "/")) {<a name="line.413"></a>
-<span class="sourceLineNo">414</span>        throw new IllegalStateException("Illegal WAL directory specified. " +<a name="line.414"></a>
-<span class="sourceLineNo">415</span>            "WAL directories are not permitted to be under the root directory if set.");<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      }<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    }<a name="line.417"></a>
-<span class="sourceLineNo">418</span>    return true;<a name="line.418"></a>
-<span class="sourceLineNo">419</span>  }<a name="line.419"></a>
-<span class="sourceLineNo">420</span><a name="line.420"></a>
-<span class="sourceLineNo">421</span>  /**<a name="line.421"></a>
-<span class="sourceLineNo">422</span>   * Returns the WAL region directory based on the given table name and region name<a name="line.422"></a>
-<span class="sourceLineNo">423</span>   * @param conf configuration to determine WALRootDir<a name="line.423"></a>
-<span class="sourceLineNo">424</span>   * @param tableName Table that the region is under<a name="line.424"></a>
-<span class="sourceLineNo">425</span>   * @param encodedRegionName Region name used for creating the final region directory<a name="line.425"></a>
-<span class="sourceLineNo">426</span>   * @return the region directory used to store WALs under the WALRootDir<a name="line.426"></a>
-<span class="sourceLineNo">427</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.427"></a>
-<span class="sourceLineNo">428</span>   */<a name="line.428"></a>
-<span class="sourceLineNo">429</span>  public static Path getWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.429"></a>
-<span class="sourceLineNo">430</span>      final String encodedRegionName) throws IOException {<a name="line.430"></a>
-<span class="sourceLineNo">431</span>    return new Path(getWALTableDir(conf, tableName), encodedRegionName);<a name="line.431"></a>
-<span class="sourceLineNo">432</span>  }<a name="line.432"></a>
-<span class="sourceLineNo">433</span><a name="line.433"></a>
-<span class="sourceLineNo">434</span>  /**<a name="line.434"></a>
-<span class="sourceLineNo">435</span>   * Returns the Table directory under the WALRootDir for the specified table name<a name="line.435"></a>
-<span class="sourceLineNo">436</span>   * @param conf configuration used to get the WALRootDir<a name="line.436"></a>
-<span class="sourceLineNo">437</span>   * @param tableName Table to get the directory for<a name="line.437"></a>
-<span class="sourceLineNo">438</span>   * @return a path to the WAL table directory for the specified table<a name="line.438"></a>
-<span class="sourceLineNo">439</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.439"></a>
-<span class="sourceLineNo">440</span>   */<a name="line.440"></a>
-<span class="sourceLineNo">441</span>  public static Path getWALTableDir(final Configuration conf, final TableName tableName)<a name="line.441"></a>
-<span class="sourceLineNo">442</span>      throws IOException {<a name="line.442"></a>
-<span class="sourceLineNo">443</span>    Path baseDir = new Path(getWALRootDir(conf), HConstants.BASE_NAMESPACE_DIR);<a name="line.443"></a>
-<span class="sourceLineNo">444</span>    return new Path(new Path(baseDir, tableName.getNamespaceAsString()),<a name="line.444"></a>
-<span class="sourceLineNo">445</span>      tableName.getQualifierAsString());<a name="line.445"></a>
-<span class="sourceLineNo">446</span>  }<a name="line.446"></a>
-<span class="sourceLineNo">447</span><a name="line.447"></a>
-<span class="sourceLineNo">448</span>  /**<a name="line.448"></a>
-<span class="sourceLineNo">449</span>   * For backward compatibility with HBASE-20734, where we store recovered edits in a wrong<a name="line.449"></a>
-<span class="sourceLineNo">450</span>   * directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.<a name="line.450"></a>
-<span class="sourceLineNo">451</span>   * @deprecated For compatibility, will be removed in 4.0.0.<a name="line.451"></a>
-<span class="sourceLineNo">452</span>   */<a name="line.452"></a>
-<span class="sourceLineNo">453</span>  @Deprecated<a name="line.453"></a>
-<span class="sourceLineNo">454</span>  public static Path getWrongWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.454"></a>
-<span class="sourceLineNo">455</span>      final String encodedRegionName) throws IOException {<a name="line.455"></a>
-<span class="sourceLineNo">456</span>    Path wrongTableDir = new Path(new Path(getWALRootDir(conf), tableName.getNamespaceAsString()),<a name="line.456"></a>
-<span class="sourceLineNo">457</span>      tableName.getQualifierAsString());<a name="line.457"></a>
-<span class="sourceLineNo">458</span>    return new Path(wrongTableDir, encodedRegionName);<a name="line.458"></a>
-<span class="sourceLineNo">459</span>  }<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>  /**<a name="line.461"></a>
-<span class="sourceLineNo">462</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under<a name="line.462"></a>
-<span class="sourceLineNo">463</span>   * path rootdir<a name="line.463"></a>
+<span class="sourceLineNo">152</span>   * @param fs filesystem object<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   * @return the default block size for the path's filesystem<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   */<a name="line.154"></a>
+<span class="sourceLineNo">155</span>  public static long getDefaultBlockSize(final FileSystem fs, final Path path) {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    return fs.getDefaultBlockSize(path);<a name="line.156"></a>
+<span class="sourceLineNo">157</span>  }<a name="line.157"></a>
+<span class="sourceLineNo">158</span><a name="line.158"></a>
+<span class="sourceLineNo">159</span>  /*<a name="line.159"></a>
+<span class="sourceLineNo">160</span>   * Get the default replication.<a name="line.160"></a>
+<span class="sourceLineNo">161</span>   *<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   * @param fs filesystem object<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   * @param f path of file<a name="line.163"></a>
+<span class="sourceLineNo">164</span>   * @return default replication for the path's filesystem<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   */<a name="line.165"></a>
+<span class="sourceLineNo">166</span>  public static short getDefaultReplication(final FileSystem fs, final Path path) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    return fs.getDefaultReplication(path);<a name="line.167"></a>
+<span class="sourceLineNo">168</span>  }<a name="line.168"></a>
+<span class="sourceLineNo">169</span><a name="line.169"></a>
+<span class="sourceLineNo">170</span>  /**<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   * Returns the default buffer size to use during writes.<a name="line.171"></a>
+<span class="sourceLineNo">172</span>   *<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   * The size of the buffer should probably be a multiple of hardware<a name="line.173"></a>
+<span class="sourceLineNo">174</span>   * page size (4096 on Intel x86), and it determines how much data is<a name="line.174"></a>
+<span class="sourceLineNo">175</span>   * buffered during read and write operations.<a name="line.175"></a>
+<span class="sourceLineNo">176</span>   *<a name="line.176"></a>
+<span class="sourceLineNo">177</span>   * @param fs filesystem object<a name="line.177"></a>
+<span class="sourceLineNo">178</span>   * @return default buffer size to use during writes<a name="line.178"></a>
+<span class="sourceLineNo">179</span>   */<a name="line.179"></a>
+<span class="sourceLineNo">180</span>  public static int getDefaultBufferSize(final FileSystem fs) {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    return fs.getConf().getInt("io.file.buffer.size", 4096);<a name="line.181"></a>
+<span class="sourceLineNo">182</span>  }<a name="line.182"></a>
+<span class="sourceLineNo">183</span><a name="line.183"></a>
+<span class="sourceLineNo">184</span>  /**<a name="line.184"></a>
+<span class="sourceLineNo">185</span>   * Create the specified file on the filesystem. By default, this will:<a name="line.185"></a>
+<span class="sourceLineNo">186</span>   * &lt;ol&gt;<a name="line.186"></a>
+<span class="sourceLineNo">187</span>   * &lt;li&gt;apply the umask in the configuration (if it is enabled)&lt;/li&gt;<a name="line.187"></a>
+<span class="sourceLineNo">188</span>   * &lt;li&gt;use the fs configured buffer size (or 4096 if not set)&lt;/li&gt;<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   * &lt;li&gt;use the default replication&lt;/li&gt;<a name="line.189"></a>
+<span class="sourceLineNo">190</span>   * &lt;li&gt;use the default block size&lt;/li&gt;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>   * &lt;li&gt;not track progress&lt;/li&gt;<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   * &lt;/ol&gt;<a name="line.192"></a>
+<span class="sourceLineNo">193</span>   *<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   * @param fs {@link FileSystem} on which to write the file<a name="line.194"></a>
+<span class="sourceLineNo">195</span>   * @param path {@link Path} to the file to write<a name="line.195"></a>
+<span class="sourceLineNo">196</span>   * @param perm intial permissions<a name="line.196"></a>
+<span class="sourceLineNo">197</span>   * @param overwrite Whether or not the created file should be overwritten.<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   * @return output stream to the created file<a name="line.198"></a>
+<span class="sourceLineNo">199</span>   * @throws IOException if the file cannot be created<a name="line.199"></a>
+<span class="sourceLineNo">200</span>   */<a name="line.200"></a>
+<span class="sourceLineNo">201</span>  public static FSDataOutputStream create(FileSystem fs, Path path,<a name="line.201"></a>
+<span class="sourceLineNo">202</span>      FsPermission perm, boolean overwrite) throws IOException {<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    if (LOG.isTraceEnabled()) {<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      LOG.trace("Creating file={} with permission={}, overwrite={}", path, perm, overwrite);<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    return fs.create(path, perm, overwrite, getDefaultBufferSize(fs),<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        getDefaultReplication(fs, path), getDefaultBlockSize(fs, path), null);<a name="line.207"></a>
+<span class="sourceLineNo">208</span>  }<a name="line.208"></a>
+<span class="sourceLineNo">209</span><a name="line.209"></a>
+<span class="sourceLineNo">210</span>  /**<a name="line.210"></a>
+<span class="sourceLineNo">211</span>   * Get the file permissions specified in the configuration, if they are<a name="line.211"></a>
+<span class="sourceLineNo">212</span>   * enabled.<a name="line.212"></a>
+<span class="sourceLineNo">213</span>   *<a name="line.213"></a>
+<span class="sourceLineNo">214</span>   * @param fs filesystem that the file will be created on.<a name="line.214"></a>
+<span class="sourceLineNo">215</span>   * @param conf configuration to read for determining if permissions are<a name="line.215"></a>
+<span class="sourceLineNo">216</span>   *          enabled and which to use<a name="line.216"></a>
+<span class="sourceLineNo">217</span>   * @param permssionConfKey property key in the configuration to use when<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   *          finding the permission<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   * @return the permission to use when creating a new file on the fs. If<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   *         special permissions are not specified in the configuration, then<a name="line.220"></a>
+<span class="sourceLineNo">221</span>   *         the default permissions on the the fs will be returned.<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   */<a name="line.222"></a>
+<span class="sourceLineNo">223</span>  public static FsPermission getFilePermissions(final FileSystem fs,<a name="line.223"></a>
+<span class="sourceLineNo">224</span>      final Configuration conf, final String permssionConfKey) {<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    boolean enablePermissions = conf.getBoolean(<a name="line.225"></a>
+<span class="sourceLineNo">226</span>        HConstants.ENABLE_DATA_FILE_UMASK, false);<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>    if (enablePermissions) {<a name="line.228"></a>
+<span class="sourceLineNo">229</span>      try {<a name="line.229"></a>
+<span class="sourceLineNo">230</span>        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>        // make sure that we have a mask, if not, go default.<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        String mask = conf.get(permssionConfKey);<a name="line.232"></a>
+<span class="sourceLineNo">233</span>        if (mask == null) {<a name="line.233"></a>
+<span class="sourceLineNo">234</span>          return FsPermission.getFileDefault();<a name="line.234"></a>
+<span class="sourceLineNo">235</span>        }<a name="line.235"></a>
+<span class="sourceLineNo">236</span>        // appy the umask<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        FsPermission umask = new FsPermission(mask);<a name="line.237"></a>
+<span class="sourceLineNo">238</span>        return perm.applyUMask(umask);<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      } catch (IllegalArgumentException e) {<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        LOG.warn(<a name="line.240"></a>
+<span class="sourceLineNo">241</span>            "Incorrect umask attempted to be created: "<a name="line.241"></a>
+<span class="sourceLineNo">242</span>                + conf.get(permssionConfKey)<a name="line.242"></a>
+<span class="sourceLineNo">243</span>                + ", using default file permissions.", e);<a name="line.243"></a>
+<span class="sourceLineNo">244</span>        return FsPermission.getFileDefault();<a name="line.244"></a>
+<span class="sourceLineNo">245</span>      }<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    }<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    return FsPermission.getFileDefault();<a name="line.247"></a>
+<span class="sourceLineNo">248</span>  }<a name="line.248"></a>
+<span class="sourceLineNo">249</span><a name="line.249"></a>
+<span class="sourceLineNo">250</span>  /**<a name="line.250"></a>
+<span class="sourceLineNo">251</span>   * Verifies root directory path is a valid URI with a scheme<a name="line.251"></a>
+<span class="sourceLineNo">252</span>   *<a name="line.252"></a>
+<span class="sourceLineNo">253</span>   * @param root root directory path<a name="line.253"></a>
+<span class="sourceLineNo">254</span>   * @return Passed &lt;code&gt;root&lt;/code&gt; argument.<a name="line.254"></a>
+<span class="sourceLineNo">255</span>   * @throws IOException if not a valid URI with a scheme<a name="line.255"></a>
+<span class="sourceLineNo">256</span>   */<a name="line.256"></a>
+<span class="sourceLineNo">257</span>  public static Path validateRootPath(Path root) throws IOException {<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    try {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>      URI rootURI = new URI(root.toString());<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      String scheme = rootURI.getScheme();<a name="line.260"></a>
+<span class="sourceLineNo">261</span>      if (scheme == null) {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>        throw new IOException("Root directory does not have a scheme");<a name="line.262"></a>
+<span class="sourceLineNo">263</span>      }<a name="line.263"></a>
+<span class="sourceLineNo">264</span>      return root;<a name="line.264"></a>
+<span class="sourceLineNo">265</span>    } catch (URISyntaxException e) {<a name="line.265"></a>
+<span class="sourceLineNo">266</span>      throw new IOException("Root directory path is not a valid " +<a name="line.266"></a>
+<span class="sourceLineNo">267</span>        "URI -- check your " + HConstants.HBASE_DIR + " configuration", e);<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    }<a name="line.268"></a>
+<span class="sourceLineNo">269</span>  }<a name="line.269"></a>
+<span class="sourceLineNo">270</span><a name="line.270"></a>
+<span class="sourceLineNo">271</span>  /**<a name="line.271"></a>
+<span class="sourceLineNo">272</span>   * Checks for the presence of the WAL log root path (using the provided conf object) in the given<a name="line.272"></a>
+<span class="sourceLineNo">273</span>   * path. If it exists, this method removes it and returns the String representation of remaining<a name="line.273"></a>
+<span class="sourceLineNo">274</span>   * relative path.<a name="line.274"></a>
+<span class="sourceLineNo">275</span>   * @param path must not be null<a name="line.275"></a>
+<span class="sourceLineNo">276</span>   * @param conf must not be null<a name="line.276"></a>
+<span class="sourceLineNo">277</span>   * @return String representation of the remaining relative path<a name="line.277"></a>
+<span class="sourceLineNo">278</span>   * @throws IOException from underlying filesystem<a name="line.278"></a>
+<span class="sourceLineNo">279</span>   */<a name="line.279"></a>
+<span class="sourceLineNo">280</span>  public static String removeWALRootPath(Path path, final Configuration conf) throws IOException {<a name="line.280"></a>
+<span class="sourceLineNo">281</span>    Path root = getWALRootDir(conf);<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    String pathStr = path.toString();<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    // check that the path is absolute... it has the root path in it.<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    if (!pathStr.startsWith(root.toString())) {<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      return pathStr;<a name="line.285"></a>
+<span class="sourceLineNo">286</span>    }<a name="line.286"></a>
+<span class="sourceLineNo">287</span>    // if not, return as it is.<a name="line.287"></a>
+<span class="sourceLineNo">288</span>    return pathStr.substring(root.toString().length() + 1);// remove the "/" too.<a name="line.288"></a>
+<span class="sourceLineNo">289</span>  }<a name="line.289"></a>
+<span class="sourceLineNo">290</span><a name="line.290"></a>
+<span class="sourceLineNo">291</span>  /**<a name="line.291"></a>
+<span class="sourceLineNo">292</span>   * Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This<a name="line.292"></a>
+<span class="sourceLineNo">293</span>   * method returns the 'path' component of a Path's URI: e.g. If a Path is<a name="line.293"></a>
+<span class="sourceLineNo">294</span>   * &lt;code&gt;hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;,<a name="line.294"></a>
+<span class="sourceLineNo">295</span>   * this method returns &lt;code&gt;/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;.<a name="line.295"></a>
+<span class="sourceLineNo">296</span>   * This method is useful if you want to print out a Path without qualifying<a name="line.296"></a>
+<span class="sourceLineNo">297</span>   * Filesystem instance.<a name="line.297"></a>
+<span class="sourceLineNo">298</span>   * @param p Filesystem Path whose 'path' component we are to return.<a name="line.298"></a>
+<span class="sourceLineNo">299</span>   * @return Path portion of the Filesystem<a name="line.299"></a>
+<span class="sourceLineNo">300</span>   */<a name="line.300"></a>
+<span class="sourceLineNo">301</span>  public static String getPath(Path p) {<a name="line.301"></a>
+<span class="sourceLineNo">302</span>    return p.toUri().getPath();<a name="line.302"></a>
+<span class="sourceLineNo">303</span>  }<a name="line.303"></a>
+<span class="sourceLineNo">304</span><a name="line.304"></a>
+<span class="sourceLineNo">305</span>  /**<a name="line.305"></a>
+<span class="sourceLineNo">306</span>   * @param c configuration<a name="line.306"></a>
+<span class="sourceLineNo">307</span>   * @return {@link Path} to hbase root directory from<a name="line.307"></a>
+<span class="sourceLineNo">308</span>   *     configuration as a qualified Path.<a name="line.308"></a>
+<span class="sourceLineNo">309</span>   * @throws IOException e<a name="line.309"></a>
+<span class="sourceLineNo">310</span>   */<a name="line.310"></a>
+<span class="sourceLineNo">311</span>  public static Path getRootDir(final Configuration c) throws IOException {<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    Path p = new Path(c.get(HConstants.HBASE_DIR));<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    FileSystem fs = p.getFileSystem(c);<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.314"></a>
+<span class="sourceLineNo">315</span>  }<a name="line.315"></a>
+<span class="sourceLineNo">316</span><a name="line.316"></a>
+<span class="sourceLineNo">317</span>  public static void setRootDir(final Configuration c, final Path root) {<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    c.set(HConstants.HBASE_DIR, root.toString());<a name="line.318"></a>
+<span class="sourceLineNo">319</span>  }<a name="line.319"></a>
+<span class="sourceLineNo">320</span><a name="line.320"></a>
+<span class="sourceLineNo">321</span>  public static void setFsDefault(final Configuration c, final Path root) {<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    c.set("fs.defaultFS", root.toString());    // for hadoop 0.21+<a name="line.322"></a>
+<span class="sourceLineNo">323</span>  }<a name="line.323"></a>
+<span class="sourceLineNo">324</span><a name="line.324"></a>
+<span class="sourceLineNo">325</span>  public static FileSystem getRootDirFileSystem(final Configuration c) throws IOException {<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    Path p = getRootDir(c);<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    return p.getFileSystem(c);<a name="line.327"></a>
+<span class="sourceLineNo">328</span>  }<a name="line.328"></a>
+<span class="sourceLineNo">329</span><a name="line.329"></a>
+<span class="sourceLineNo">330</span>  /**<a name="line.330"></a>
+<span class="sourceLineNo">331</span>   * @param c configuration<a name="line.331"></a>
+<span class="sourceLineNo">332</span>   * @return {@link Path} to hbase log root directory: e.g. {@value HBASE_WAL_DIR} from<a name="line.332"></a>
+<span class="sourceLineNo">333</span>   *     configuration as a qualified Path. Defaults to HBase root dir.<a name="line.333"></a>
+<span class="sourceLineNo">334</span>   * @throws IOException e<a name="line.334"></a>
+<span class="sourceLineNo">335</span>   */<a name="line.335"></a>
+<span class="sourceLineNo">336</span>  public static Path getWALRootDir(final Configuration c) throws IOException {<a name="line.336"></a>
+<span class="sourceLineNo">337</span>    Path p = new Path(c.get(HBASE_WAL_DIR, c.get(HConstants.HBASE_DIR)));<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    if (!isValidWALRootDir(p, c)) {<a name="line.338"></a>
+<span class="sourceLineNo">339</span>      return getRootDir(c);<a name="line.339"></a>
+<span class="sourceLineNo">340</span>    }<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    FileSystem fs = p.getFileSystem(c);<a name="line.341"></a>
+<span class="sourceLineNo">342</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.342"></a>
+<span class="sourceLineNo">343</span>  }<a name="line.343"></a>
+<span class="sourceLineNo">344</span><a name="line.344"></a>
+<span class="sourceLineNo">345</span>  @VisibleForTesting<a name="line.345"></a>
+<span class="sourceLineNo">346</span>  public static void setWALRootDir(final Configuration c, final Path root) {<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    c.set(HBASE_WAL_DIR, root.toString());<a name="line.347"></a>
+<span class="sourceLineNo">348</span>  }<a name="line.348"></a>
+<span class="sourceLineNo">349</span><a name="line.349"></a>
+<span class="sourceLineNo">350</span>  public static FileSystem getWALFileSystem(final Configuration c) throws IOException {<a name="line.350"></a>
+<span class="sourceLineNo">351</span>    Path p = getWALRootDir(c);<a name="line.351"></a>
+<span class="sourceLineNo">352</span>    FileSystem fs = p.getFileSystem(c);<a name="line.352"></a>
+<span class="sourceLineNo">353</span>    // hadoop-core does fs caching, so need to propogate this if set<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);<a name="line.354"></a>
+<span class="sourceLineNo">355</span>    if (enforceStreamCapability != null) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>      fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    }<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    return fs;<a name="line.358"></a>
+<span class="sourceLineNo">359</span>  }<a name="line.359"></a>
+<span class="sourceLineNo">360</span><a name="line.360"></a>
+<span class="sourceLineNo">361</span>  private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {<a name="line.361"></a>
+<span class="sourceLineNo">362</span>    Path rootDir = getRootDir(c);<a name="line.362"></a>
+<span class="sourceLineNo">363</span>    FileSystem fs = walDir.getFileSystem(c);<a name="line.363"></a>
+<span class="sourceLineNo">364</span>    Path qualifiedWalDir = walDir.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.364"></a>
+<span class="sourceLineNo">365</span>    if (!qualifiedWalDir.equals(rootDir)) {<a name="line.365"></a>
+<span class="sourceLineNo">366</span>      if (qualifiedWalDir.toString().startsWith(rootDir.toString() + "/")) {<a name="line.366"></a>
+<span class="sourceLineNo">367</span>        throw new IllegalStateException("Illegal WAL directory specified. " +<a name="line.367"></a>
+<span class="sourceLineNo">368</span>            "WAL directories are not permitted to be under the root directory if set.");<a name="line.368"></a>
+<span class="sourceLineNo">369</span>      }<a name="line.369"></a>
+<span class="sourceLineNo">370</span>    }<a name="line.370"></a>
+<span class="sourceLineNo">371</span>    return true;<a name="line.371"></a>
+<span class="sourceLineNo">372</span>  }<a name="line.372"></a>
+<span class="sourceLineNo">373</span><a name="line.373"></a>
+<span class="sourceLineNo">374</span>  /**<a name="line.374"></a>
+<span class="sourceLineNo">375</span>   * Returns the WAL region directory based on the given table name and region name<a name="line.375"></a>
+<span class="sourceLineNo">376</span>   * @param conf configuration to determine WALRootDir<a name="line.376"></a>
+<span class="sourceLineNo">377</span>   * @param tableName Table that the region is under<a name="line.377"></a>
+<span class="sourceLineNo">378</span>   * @param encodedRegionName Region name used for creating the final region directory<a name="line.378"></a>
+<span class="sourceLineNo">379</span>   * @return the region directory used to store WALs under the WALRootDir<a name="line.379"></a>
+<span class="sourceLineNo">380</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.380"></a>
+<span class="sourceLineNo">381</span>   */<a name="line.381"></a>
+<span class="sourceLineNo">382</span>  public static Path getWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.382"></a>
+<span class="sourceLineNo">383</span>      final String encodedRegionName) throws IOException {<a name="line.383"></a>
+<span class="sourceLineNo">384</span>    return new Path(getWALTableDir(conf, tableName), encodedRegionName);<a name="line.384"></a>
+<span class="sourceLineNo">385</span>  }<a name="line.385"></a>
+<span class="sourceLineNo">386</span><a name="line.386"></a>
+<span class="sourceLineNo">387</span>  /**<a name="line.387"></a>
+<span class="sourceLineNo">388</span>   * Returns the Table directory under the WALRootDir for the specified table name<a name="line.388"></a>
+<span class="sourceLineNo">389</span>   * @param conf configuration used to get the WALRootDir<a name="line.389"></a>
+<span class="sourceLineNo">390</span>   * @param tableName Table to get the directory for<a name="line.390"></a>
+<span class="sourceLineNo">391</span>   * @return a path to the WAL table directory for the specified table<a name="line.391"></a>
+<span class="sourceLineNo">392</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.392"></a>
+<span class="sourceLineNo">393</span>   */<a name="line.393"></a>
+<span class="sourceLineNo">394</span>  public static Path getWALTableDir(final Configuration conf, final TableName tableName)<a name="line.394"></a>
+<span class="sourceLineNo">395</span>      throws IOException {<a name="line.395"></a>
+<span class="sourceLineNo">396</span>    Path baseDir = new Path(getWALRootDir(conf), HConstants.BASE_NAMESPACE_DIR);<a name="line.396"></a>
+<span class="sourceLineNo">397</span>    return new Path(new Path(baseDir, tableName.getNamespaceAsString()),<a name="line.397"></a>
+<span class="sourceLineNo">398</span>      tableName.getQualifierAsString());<a name="line.398"></a>
+<span class="sourceLineNo">399</span>  }<a name="line.399"></a>
+<span class="sourceLineNo">400</span><a name="line.400"></a>
+<span class="sourceLineNo">401</span>  /**<a name="line.401"></a>
+<span class="sourceLineNo">402</span>   * For backward compatibility with HBASE-20734, where we store recovered edits in a wrong<a name="line.402"></a>
+<span class="sourceLineNo">403</span>   * directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.<a name="line.403"></a>
+<span class="sourceLineNo">404</span>   * @deprecated For compatibility, will be removed in 4.0.0.<a name="line.404"></a>
+<span class="sourceLineNo">405</span>   */<a name="line.405"></a>
+<span class="sourceLineNo">406</span>  @Deprecated<a name="line.406"></a>
+<span class="sourceLineNo">407</span>  public static Path getWrongWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.407"></a>
+<span class="sourceLineNo">408</span>      final String encodedRegionName) throws IOException {<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    Path wrongTableDir = new Path(new Path(getWALRootDir(conf), tableName.getNamespaceAsString()),<a name="line.409"></a>
+<span class="sourceLineNo">410</span>      tableName.getQualifierAsString());<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    return new Path(wrongTableDir, encodedRegionName);<a name="line.411"></a>
+<span class="sourceLineNo">412</span>  }<a name="line.412"></a>
+<span class="sourceLineNo">413</span><a name="line.413"></a>
+<span class="sourceLineNo">414</span>  /**<a name="line.414"></a>
+<span class="sourceLineNo">415</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under<a name="line.415"></a>
+<span class="sourceLineNo">416</span>   * path rootdir<a name="line.416"></a>
+<span class="sourceLineNo">417</span>   *<a name="line.417"></a>
+<span class="sourceLineNo">418</span>   * @param rootdir qualified path of HBase root directory<a name="line.418"></a>
+<span class="sourceLineNo">419</span>   * @param tableName name of table<a name="line.419"></a>
+<span class="sourceLineNo">420</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.420"></a>
+<span class="sourceLineNo">421</span>   */<a name="line.421"></a>
+<span class="sourceLineNo">422</span>  public static Path getTableDir(Path rootdir, final TableName tableName) {<a name="line.422"></a>
+<span class="sourceLineNo">423</span>    return new Path(getNamespaceDir(rootdir, tableName.getNamespaceAsString()),<a name="line.423"></a>
+<span class="sourceLineNo">424</span>        tableName.getQualifierAsString());<a name="line.424"></a>
+<span class="sourceLineNo">425</span>  }<a name="line.425"></a>
+<span class="sourceLineNo">426</span><a name="line.426"></a>
+<span class="sourceLineNo">427</span>  /**<a name="line.427"></a>
+<span class="sourceLineNo">428</span>   * Returns the {@link org.apache.hadoop.hbase.TableName} object representing<a name="line.428"></a>
+<span class="sourceLineNo">429</span>   * the table directory under<a name="line.429"></a>
+<span class="sourceLineNo">430</span>   * path rootdir<a name="line.430"></a>
+<span class="sourceLineNo">431</span>   *<a name="line.431"></a>
+<span class="sourceLineNo">432</span>   * @param tablePath path of table<a name="line.432"></a>
+<span class="sourceLineNo">433</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.433"></a>
+<span class="sourceLineNo">434</span>   */<a name="line.434"></a>
+<span class="sourceLineNo">435</span>  public static TableName getTableName(Path tablePath) {<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());<a name="line.436"></a>
+<span class="sourceLineNo">437</span>  }<a name="line.437"></a>
+<span class="sourceLineNo">438</span><a name="line.438"></a>
+<span class="sourceLineNo">439</span>  /**<a name="line.439"></a>
+<span class="sourceLineNo">440</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing<a name="line.440"></a>
+<span class="sourceLineNo">441</span>   * the namespace directory under path rootdir<a name="line.441"></a>
+<span class="sourceLineNo">442</span>   *<a name="line.442"></a>
+<span class="sourceLineNo">443</span>   * @param rootdir qualified path of HBase root directory<a name="line.443"></a>
+<span class="sourceLineNo">444</span>   * @param namespace namespace name<a name="line.444"></a>
+<span class="sourceLineNo">445</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.445"></a>
+<span class="sourceLineNo">446</span>   */<a name="line.446"></a>
+<span class="sourceLineNo">447</span>  public static Path getNamespaceDir(Path rootdir, final String namespace) {<a name="line.447"></a>
+<span class="sourceLineNo">448</span>    return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,<a name="line.448"></a>
+<span class="sourceLineNo">449</span>        new Path(namespace)));<a name="line.449"></a>
+<span class="sourceLineNo">450</span>  }<a name="line.450"></a>
+<span class="sourceLineNo">451</span><a name="line.451"></a>
+<span class="sourceLineNo">452</span>  // this mapping means that under a federated FileSystem implementation, we'll<a name="line.452"></a>
+<span class="sourceLineNo">453</span>  // only log the first failure from any of the underlying FileSystems at WARN and all others<a name="line.453"></a>
+<span class="sourceLineNo">454</span>  // will be at DEBUG.<a name="line.454"></a>
+<span class="sourceLineNo">455</span>  private static final Map&lt;FileSystem, Boolean&gt; warningMap = new ConcurrentHashMap&lt;&gt;();<a name="line.455"></a>
+<span class="sourceLineNo">456</span><a name="line.456"></a>
+<span class="sourceLineNo">457</span>  /**<a name="line.457"></a>
+<span class="sourceLineNo">458</span>   * Sets storage policy for given path.<a name="line.458"></a>
+<span class="sourceLineNo">459</span>   * If the passed path is a directory, we'll set the storage policy for all files<a name="line.459"></a>
+<span class="sourceLineNo">460</span>   * created in the future in said directory. Note that this change in storage<a name="line.460"></a>
+<span class="sourceLineNo">461</span>   * policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle.<a name="line.461"></a>
+<span class="sourceLineNo">462</span>   * If we're running on a version of FileSystem that doesn't support the given storage policy<a name="line.462"></a>
+<span class="sourceLineNo">463</span>   * (or storage policies at all), then we'll issue a log message and continue.<a name="line.463"></a>
 <span class="sourceLineNo">464</span>   *<a name="line.464"></a>
-<span class="sourceLineNo">465</span>   * @param rootdir qualified path of HBase root directory<a name="line.465"></a>
-<span class="sourceLineNo">466</span>   * @param tableName name of table<a name="line.466"></a>
-<span class="sourceLineNo">467</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.467"></a>
-<span class="sourceLineNo">468</span>   */<a name="line.468"></a>
-<span class="sourceLineNo">469</span>  public static Path getTableDir(Path rootdir, final TableName tableName) {<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    return new Path(getNamespaceDir(rootdir, tableName.getNamespaceAsString()),<a name="line.470"></a>
-<span class="sourceLineNo">471</span>        tableName.getQualifierAsString());<a name="line.471"></a>
-<span class="sourceLineNo">472</span>  }<a name="line.472"></a>
-<span class="sourceLineNo">473</span><a name="line.473"></a>
-<span class="sourceLineNo">474</span>  /**<a name="line.474"></a>
-<span class="sourceLineNo">475</span>   * Returns the {@link org.apache.hadoop.hbase.TableName} object representing<a name="line.475"></a>
-<span class="sourceLineNo">476</span>   * the table directory under<a name="line.476"></a>
-<span class="sourceLineNo">477</span>   * path rootdir<a name="line.477"></a>
-<span class="sourceLineNo">478</span>   *<a name="line.478"></a>
-<span class="sourceLineNo">479</span>   * @param tablePath path of table<a name="line.479"></a>
-<span class="sourceLineNo">480</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.480"></a>
-<span class="sourceLineNo">481</span>   */<a name="line.481"></a>
-<span class="sourceLineNo">482</span>  public static TableName getTableName(Path tablePath) {<a name="line.482"></a>
-<span class="sourceLineNo">483</span>    return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());<a name="line.483"></a>
-<span class="sourceLineNo">484</span>  }<a name="line.484"></a>
-<span class="sourceLineNo">485</span><a name="line.485"></a>
-<span class="sourceLineNo">486</span>  /**<a name="line.486"></a>
-<span class="sourceLineNo">487</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing<a name="line.487"></a>
-<span class="sourceLineNo">488</span>   * the namespace directory under path rootdir<a name="line.488"></a>
-<span class="sourceLineNo">489</span>   *<a name="line.489"></a>
-<span class="sourceLineNo">490</span>   * @param rootdir qualified path of HBase root directory<a name="line.490"></a>
-<span class="sourceLineNo">491</span>   * @param namespace namespace name<a name="line.491"></a>
-<span class="sourceLineNo">492</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.492"></a>
-<span class="sourceLineNo">493</span>   */<a name="line.493"></a>
-<span class="sourceLineNo">494</span>  public static Path getNamespaceDir(Path rootdir, final String namespace) {<a name="line.494"></a>
-<span class="sourceLineNo">495</span>    return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,<a name="line.495"></a>
-<span class="sourceLineNo">496</span>        new Path(namespace)));<a name="line.496"></a>
-<span class="sourceLineNo">497</span>  }<a name="line.497"></a>
-<span class="sourceLineNo">498</span><a name="line.498"></a>
-<span class="sourceLineNo">499</span>  // this mapping means that under a federated FileSystem implementation, we'll<a name="line.499"></a>
-<span class="sourceLineNo">500</span>  // only log the first failure from any of the underlying FileSystems at WARN and all others<a name="line.500"></a>
-<span class="sourceLineNo">501</span>  // will be at DEBUG.<a name="line.501"></a>
-<span class="sourceLineNo">502</span>  private static final Map&lt;FileSystem, Boolean&gt; warningMap = new ConcurrentHashMap&lt;&gt;();<a name="line.502"></a>
-<span class="sourceLineNo">503</span><a name="line.503"></a>
-<span class="sourceLineNo">504</span>  /**<a name="line.504"></a>
-<span class="sourceLineNo">505</span>   * Sets storage policy for given path.<a name="line.505"></a>
-<span class="sourceLineNo">506</span>   * If the passed path is a directory, we'll set the storage policy for all files<a name="line.506"></a>
-<span class="sourceLineNo">507</span>   * created in the future in said directory. Note that this change in storage<a name="line.507"></a>
-<span class="sourceLineNo">508</span>   * policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle.<a name="line.508"></a>
-<span class="sourceLineNo">509</span>   * If we're running on a version of FileSystem that doesn't support the given storage policy<a name="line.509"></a>
-<span class="sourceLineNo">510</span>   * (or storage policies at all), then we'll issue a log message and continue.<a name="line.510"></a>
-<span class="sourceLineNo">511</span>   *<a name="line.511"></a>
-<span class="sourceLineNo">512</span>   * See http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html<a name="line.512"></a>
-<span class="sourceLineNo">513</span>   *<a name="line.513"></a>
-<span class="sourceLineNo">514</span>   * @param fs We only do anything it implements a setStoragePolicy method<a name="line.514"></a>
-<span class="sourceLineNo">515</span>   * @param path the Path whose storage policy is to be set<a name="line.515"></a>
-<span class="sourceLineNo">516</span>   * @param storagePolicy Policy to set on &lt;code&gt;path&lt;/code&gt;; see hadoop 2.6+<a name="line.516"></a>
-<span class="sourceLineNo">517</span>   *   org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g<a name="line.517"></a>
-<span class="sourceLineNo">518</span>   *   'COLD', 'WARM', 'HOT', 'ONE_SSD', 'ALL_SSD', 'LAZY_PERSIST'.<a name="line.518"></a>
-<span class="sourceLineNo">519</span>   */<a name="line.519"></a>
-<span class="sourceLineNo">520</span>  public static void setStoragePolicy(final FileSystem fs, final Path path,<a name="line.520"></a>
-<span class="sourceLineNo">521</span>      final String storagePolicy) {<a name="line.521"></a>
-<span class="sourceLineNo">522</span>    try {<a name="line.522"></a>
-<span class="sourceLineNo">523</span>      setStoragePolicy(fs, path, storagePolicy, false);<a name="line.523"></a>
-<span class="sourceLineNo">524</span>    } catch (IOException e) {<a name="line.524"></a>
-<span class="sourceLineNo">525</span>      // should never arrive here<a name="line.525"></a>
-<span class="sourceLineNo">526</span>      LOG.warn("We have chosen not to throw exception but some unexpectedly thrown out", e);<a name="line.526"></a>
-<span class="sourceLineNo">527</span>    }<a name="line.527"></a>
-<span class="sourceLineNo">528</span>  }<a name="line.528"></a>
-<span class="sourceLineNo">529</span><a name="line.529"></a>
-<span class="sourceLineNo">530</span>  static void setStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy,<a name="line.530"></a>
-<span class="sourceLineNo">531</span>      boolean throwException) throws IOException {<a name="line.531"></a>
-<span class="sourceLineNo">532</span>    if (storagePolicy == null) {<a name="line.532"></a>
-<span class="sourceLineNo">533</span>      if (LOG.isTraceEnabled()) {<a name="line.533"></a>
-<span class="sourceLineNo">534</span>        LOG.trace("We were passed a null storagePolicy, exiting early.");<a name="line.534"></a>
-<span class="sourceLineNo">535</span>      }<a name="line.535"></a>
-<span class="sourceLineNo">536</span>      return;<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    }<a name="line.537"></a>
-<span class="sourceLineNo">538</span>    String trimmedStoragePolicy = storagePolicy.trim();<a name="line.538"></a>
-<span class="sourceLineNo">539</span>    if (trimmedStoragePolicy.isEmpty()) {<a name="line.539"></a>
-<span class="sourceLineNo">540</span>      if (LOG.isTraceEnabled()) {<a name="line.540"></a>
-<span class="sourceLineNo">541</span>        LOG.trace("We were passed an empty storagePolicy, exiting early.");<a name="line.541"></a>
+<span class="sourceLineNo">465</span>   * See http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html<a name="line.465"></a>
+<span class="sourceLineNo">466</span>   *<a name="line.466"></a>
+<span class="sourceLineNo">467</span>   * @param fs We only do anything it implements a setStoragePolicy method<a name="line.467"></a>
+<span class="sourceLineNo">468</span>   * @param path the Path whose storage policy is to be set<a name="line.468"></a>
+<span class="sourceLineNo">469</span>   * @param storagePolicy Policy to set on &lt;code&gt;path&lt;/code&gt;; see hadoop 2.6+<a name="line.469"></a>
+<span class="sourceLineNo">470</span>   *   org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g<a name="line.470"></a>
+<span class="sourceLineNo">471</span>   *   'COLD', 'WARM', 'HOT', 'ONE_SSD', 'ALL_SSD', 'LAZY_PERSIST'.<a name="line.471"></a>
+<span class="sourceLineNo">472</span>   */<a name="line.472"></a>
+<span class="sourceLineNo">473</span>  public static void setStoragePolicy(final FileSystem fs, final Path path,<a name="line.473"></a>
+<span class="sourceLineNo">474</span>      final String storagePolicy) {<a name="line.474"></a>
+<span class="sourceLineNo">475</span>    try {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>      setStoragePolicy(fs, path, storagePolicy, false);<a name="line.476"></a>
+<span class="sourceLineNo">477</span>    } catch (IOException e) {<a name="line.477"></a>
+<span class="sourceLineNo">478</span>      // should never arrive here<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      LOG.warn("We have chosen not to throw exception but some unexpectedly thrown out", e);<a name="line.479"></a>
+<span class="sourceLineNo">480</span>    }<a name="line.480"></a>
+<span class="sourceLineNo">481</span>  }<a name="line.481"></a>
+<span class="sourceLineNo">482</span><a name="line.482"></a>
+<span class="sourceLineNo">483</span>  static void setStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy,<a name="line.483"></a>
+<span class="sourceLineNo">484</span>      boolean throwException) throws IOException {<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    if (storagePolicy == null) {<a name="line.485"></a>
+<span class="sourceLineNo">486</span>      if (LOG.isTraceEnabled()) {<a name="line.486"></a>
+<span class="sourceLineNo">487</span>        LOG.trace("We were passed a null storagePolicy, exiting early.");<a name="line.487"></a>
+<span class="sourceLineNo">488</span>      }<a name="line.488"></a>
+<span class="sourceLineNo">489</span>      return;<a name="line.489"></a>
+<span class="sourceLineNo">490</span>    }<a name="line.490"></a>
+<span class="sourceLineNo">491</span>    String trimmedStoragePolicy = storagePolicy.trim();<a name="line.491"></a>
+<span class="sourceLineNo">492</span>    if (trimmedStoragePolicy.isEmpty()) {<a name="line.492"></a>
+<span class="sourceLineNo">493</span>      if (LOG.isTraceEnabled()) {<a name="line.493"></a>
+<span class="sourceLineNo">494</span>        LOG.trace("We were passed an empty storagePolicy, exiting early.");<a name="line.494"></a>
+<span class="sourceLineNo">495</span>      }<a name="line.495"></a>
+<span class="sourceLineNo">496</span>      return;<a name="line.496"></a>
+<span class="sourceLineNo">497</span>    } else {<a name="line.497"></a>
+<span class="sourceLineNo">498</span>      trimmedStoragePolicy = trimmedStoragePolicy.toUpperCase(Locale.ROOT);<a name="line.498"></a>
+<span class="sourceLineNo">499</span>    }<a name="line.499"></a>
+<span class="sourceLineNo">500</span>    if (trimmedStoragePolicy.equals(HConstants.DEFER_TO_HDFS_STORAGE_POLICY)) {<a name="line.500"></a>
+<span class="sourceLineNo">501</span>      if (LOG.isTraceEnabled()) {<a name="line.501"></a>
+<span class="sourceLineNo">502</span>        LOG.trace("We were passed the defer-to-hdfs policy {}, exiting early.",<a name="line.502"></a>
+<span class="sourceLineNo">503</span>          trimmedStoragePolicy);<a name="line.503"></a>
+<span class="sourceLineNo">504</span>      }<a name="line.504"></a>
+<span class="sourceLineNo">505</span>      return;<a name="line.505"></a>
+<span class="sourceLineNo">506</span>    }<a name="line.506"></a>
+<span class="sourceLineNo">507</span>    try {<a name="line.507"></a>
+<span class="sourceLineNo">508</span>      invokeSetStoragePolicy(fs, path, trimmedStoragePolicy);<a name="line.508"></a>
+<span class="sourceLineNo">509</span>    } catch (IOException e) {<a name="line.509"></a>
+<span class="sourceLineNo">510</span>      if (LOG.isTraceEnabled()) {<a name="line.510"></a>
+<span class="sourceLineNo">511</span>        LOG.trace("Failed to invoke set storage policy API on FS", e);<a name="line.511"></a>
+<span class="sourceLineNo">512</span>      }<a name="line.512"></a>
+<span class="sourceLineNo">513</span>      if (throwException) {<a name="line.513"></a>
+<span class="sourceLineNo">514</span>        throw e;<a name="line.514"></a>
+<span class="sourceLineNo">515</span>      }<a name="line.515"></a>
+<span class="sourceLineNo">516</span>    }<a name="line.516"></a>
+<span class="sourceLineNo">517</span>  }<a name="line.517"></a>
+<span class="sourceLineNo">518</span><a name="line.518"></a>
+<span class="sourceLineNo">519</span>  /*<a name="line.519"></a>
+<span class="sourceLineNo">520</span>   * All args have been checked and are good. Run the setStoragePolicy invocation.<a name="line.520"></a>
+<span class="sourceLineNo">521</span>   */<a name="line.521"></a>
+<span class="sourceLineNo">522</span>  private static void invokeSetStoragePolicy(final FileSystem fs, final Path path,<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      final String storagePolicy) throws IOException {<a name="line.523"></a>
+<span class="sourceLineNo">524</span>    Exception toThrow = null;<a name="line.524"></a>
+<span class="sourceLineNo">525</span><a name="line.525"></a>
+<span class="sourceLineNo">526</span>    try {<a name="line.526"></a>
+<span class="sourceLineNo">527</span>      fs.setStoragePolicy(path, storagePolicy);<a name="line.527"></a>
+<span class="sourceLineNo">528</span><a name="line.528"></a>
+<span class="sourceLineNo">529</span>      if (LOG.isDebugEnabled()) {<a name="line.529"></a>
+<span class="sourceLineNo">530</span>        LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);<a name="line.530"></a>
+<span class="sourceLineNo">531</span>      }<a name="line.531"></a>
+<span class="sourceLineNo">532</span>    } catch (Exception e) {<a name="line.532"></a>
+<span class="sourceLineNo">533</span>      toThrow = e;<a name="line.533"></a>
+<span class="sourceLineNo">534</span>      // This swallows FNFE, should we be throwing it? seems more likely to indicate dev<a name="line.534"></a>
+<span class="sourceLineNo">535</span>      // misuse than a runtime problem with HDFS.<a name="line.535"></a>
+<span class="sourceLineNo">536</span>      if (!warningMap.containsKey(fs)) {<a name="line.536"></a>
+<span class="sourceLineNo">537</span>        warningMap.put(fs, true);<a name="line.537"></a>
+<span class="sourceLineNo">538</span>        LOG.warn("Unable to set storagePolicy=" + storagePolicy + " for path=" + path + ". " +<a name="line.538"></a>
+<span class="sourceLineNo">539</span>            "DEBUG log level might have more details.", e);<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      } else if (LOG.isDebugEnabled()) {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>        LOG.debug("Unable to set storagePolicy=" + storagePolicy + " for path=" + path, e);<a name="line.541"></a>
 <span class="sourceLineNo">542</span>      }<a name="line.542"></a>
-<span class="sourceLineNo">543</span>      return;<a name="line.543"></a>
-<span class="sourceLineNo">544</span>    } else {<a name="line.544"></a>
-<span class="sourceLineNo">545</span>      trimmedStoragePolicy = trimmedStoragePolicy.toUpperCase(Locale.ROOT);<a name="line.545"></a>
-<span class="sourceLineNo">546</span>    }<a name="line.546"></a>
-<span class="sourceLineNo">547</span>    if (trimmedStoragePolicy.equals(HConstants.DEFER_TO_HDFS_STORAGE_POLICY)) {<a name="line.547"></a>
-<span class="sourceLineNo">548</span>      if (LOG.isTraceEnabled()) {<a name="line.548"></a>
-<span class="sourceLineNo">549</span>        LOG.trace("We were passed the defer-to-hdfs policy {}, exiting early.",<a name="line.549"></a>
-<span class="sourceLineNo">550</span>          trimmedStoragePolicy);<a name="line.550"></a>
-<span class="sourceLineNo">551</span>      }<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      return;<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    }<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    try {<a name="line.554"></a>
-<span class="sourceLineNo">555</span>      invokeSetStoragePolicy(fs, path, trimmedStoragePolicy);<a name="line.555"></a>
-<span class="sourceLineNo">556</span>    } catch (IOException e) {<a name="line.556"></a>
-<span class="sourceLineNo">557</span>      if (LOG.isTraceEnabled()) {<a name="line.557"></a>
-<span class="sourceLineNo">558</span>        LOG.trace("Failed to invoke set storage policy API on FS", e);<a name="line.558"></a>
-<span class="sourceLineNo">559</span>      }<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      if (throwException) {<a name="line.560"></a>
-<span class="sourceLineNo">561</span>        throw e;<a name="line.561"></a>
-<span class="sourceLineNo">562</span>      }<a name="line.562"></a>
-<span class="sourceLineNo">563</span>    }<a name="line.563"></a>
-<span class="sourceLineNo">564</span>  }<a name="line.564"></a>
-<span class="sourceLineNo">565</span><a name="line.565"></a>
-<span class="sourceLineNo">566</span>  /*<a name="line.566"></a>
-<span class="sourceLineNo">567</span>   * All args have been checked and are good. Run the setStoragePolicy invocation.<a name="line.567"></a>
-<span class="sourceLineNo">568</span>   */<a name="line.568"></a>
-<span class="sourceLineNo">569</span>  private static void invokeSetStoragePolicy(final FileSystem fs, final Path path,<a name="line.569"></a>
-<span class="sourceLineNo">570</span>      final String storagePolicy) throws IOException {<a name="line.570"></a>
-<span class="sourceLineNo">571</span>    Method m = null;<a name="line.571"></a>
-<span class="sourceLineNo">572</span>    Exception toThrow = null;<a name="line.572"></a>
-<span class="sourceLineNo">573</span>    try {<a name="line.573"></a>
-<span class="sourceLineNo">574</span>      m = fs.getClass().getDeclaredMethod("setStoragePolicy", Path.class, String.class);<a name="line.574"></a>
-<span class="sourceLineNo">575</span>      m.setAccessible(true);<a name="line.575"></a>
-<span class="sourceLineNo">576</span>    } catch (NoSuchMethodException e) {<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      toThrow = e;<a name="line.577"></a>
-<span class="sourceLineNo">578</span>      final String msg = "FileSystem doesn't support setStoragePolicy; HDFS-6584, HDFS-9345 " +<a name="line.578"></a>
-<span class="sourceLineNo">579</span>          "not available. This is normal and expected on earlier Hadoop versions.";<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      if (!warningMap.containsKey(fs)) {<a name="line.580"></a>
-<span class="sourceLineNo">581</span>        warningMap.put(fs, true);<a name="line.581"></a>
-<span class="sourceLineNo">582</span>        LOG.warn(msg, e);<a name="line.582"></a>
-<span class="sourceLineNo">583</span>      } else if (LOG.isDebugEnabled()) {<a name="line.583"></a>
-<span class="sourceLineNo">584</span>        LOG.debug(msg, e);<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      }<a name="line.585"></a>
-<span class="sourceLineNo">586</span>      m = null;<a name="line.586"></a>
-<span class="sourceLineNo">587</span>    } catch (SecurityException e) {<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      toThrow = e;<a name="line.588"></a>
-<span class="sourceLineNo">589</span>      final String msg = "No access to setStoragePolicy on FileSystem from the SecurityManager; " +<a name="line.589"></a>
-<span class="sourceLineNo">590</span>          "HDFS-6584, HDFS-9345 not available. This is unusual and probably warrants an email " +<a name="line.590"></a>
-<span class="sourceLineNo">591</span>          "to the user@hbase mailing list. Please be sure to include a link to your configs, and " +<a name="line.591"></a>
-<span class="sourceLineNo">592</span>          "logs that include this message and period of time before it. Logs around service " +<a name="line.592"></a>
-<span class="sourceLineNo">593</span>          "start up will probably be useful as well.";<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      if (!warningMap.containsKey(fs)) {<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        warningMap.put(fs, true);<a name="line.595"></a>
-<span class="sourceLineNo">596</span>        LOG.warn(msg, e);<a name="line.596"></a>
-<span class="sourceLineNo">597</span>      } else if (LOG.isDebugEnabled()) {<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        LOG.debug(msg, e);<a name="line.598"></a>
-<span class="sourceLineNo">599</span>      }<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      m = null; // could happen on setAccessible() or getDeclaredMethod()<a name="line.600"></a>
-<span class="sourceLineNo">601</span>    }<a name="line.601"></a>
-<span class="sourceLineNo">602</span>    if (m != null) {<a name="line.602"></a>
-<span class="sourceLineNo">603</span>      try {<a name="line.603"></a>
-<span class="sourceLineNo">604</span>        m.invoke(fs, path, storagePolicy);<a name="line.604"></a>
-<span class="sourceLineNo">605</span>        if (LOG.isDebugEnabled()) {<a name="line.605"></a>
-<span class="sourceLineNo">606</span>          LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);<a name="line.606"></a>
-<span class="sourceLineNo">607</span>        }<a name="line.607"></a>
-<span class="sourceLineNo">608</span>      } catch (Exception e) {<a name="line.608"></a>
-<span class="sourceLineNo">609</span>        toThrow = e;<a name="line.609"></a>
-<span class="sourceLineNo">610</span>        // This swallows FNFE, should we be throwing it? seems more likely to indicate dev<a name="line.610"></a>
-<span class="sourceLineNo">611</span>        // misuse than a runtime problem with HDFS.<a name="line.611"></a>
-<span class="sourceLineNo">612</span>        if (!warningMap.containsKey(fs)) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>          warningMap.put(fs, true);<a name="line.613"></a>
-<span class="sourceLineNo">614</span>          LOG.warn("Unable to set storagePolicy=" + storagePolicy + " for path=" + path + ". " +<a name="line.614"></a>
-<span class="sourceLineNo">615</span>              "DEBUG log level might have more details.", e);<a name="line.615"></a>
-<span class="sourceLineNo">616</span>        } else if (LOG.isDebugEnabled()) {<a name="line.616"></a>
-<span class="sourceLineNo">617</span>          LOG.debug("Unable to set storagePolicy=" + storagePolicy + " for path=" + path, e);<a name="line.617"></a>
-<span class="sourceLineNo">618</span>        }<a name="line.618"></a>
-<span class="sourceLineNo">619</span>        // check for lack of HDFS-7228<a name="line.619"></a>
-<span class="sourceLineNo">620</span>        if (e instanceof InvocationTargetException) {<a name="line.620"></a>
-<span class="sourceLineNo">621</span>          final Throwable exception = e.getCause();<a name="line.621"></a>
-<span class="sourceLineNo">622</span>          if (exception instanceof RemoteException &amp;&amp;<a name="line.622"></a>
-<span class="sourceLineNo">623</span>              HadoopIllegalArgumentException.class.getName().equals(<a name="line.623"></a>
-<span class="sourceLineNo">624</span>                ((RemoteException)exception).getClassName())) {<a name="line.624"></a>
-<span class="sourceLineNo">625</span>            if (LOG.isDebugEnabled()) {<a name="line.625"></a>
-<span class="sourceLineNo">626</span>              LOG.debug("Given storage policy, '" +storagePolicy +"', was rejected and probably " +<a name="line.626"></a>
-<span class="sourceLineNo">627</span>                "isn't a valid policy for the version of Hadoop you're running. I.e. if you're " +<a name="line.627"></a>
-<span class="sourceLineNo">628</span>                "trying to use SSD related policies then you're likely missing HDFS-7228. For " +<a name="line.628"></a>
-<span class="sourceLineNo">629</span>                "more information see the 'ArchivalStorage' docs for your Hadoop release.");<a name="line.629"></a>
-<span class="sourceLineNo">630</span>            }<a name="line.630"></a>
-<span class="sourceLineNo">631</span>          // Hadoop 2.8+, 3.0-a1+ added FileSystem.setStoragePolicy with a default implementation<a name="line.631"></a>
-<span class="sourceLineNo">632</span>          // that throws UnsupportedOperationException<a name="line.632"></a>
-<span class="sourceLineNo">633</span>          } else if (exception instanceof UnsupportedOperationException) {<a name="line.633"></a>
-<span class="sourceLineNo">634</span>            if (LOG.isDebugEnabled()) {<a name="line.634"></a>
-<span class="sourceLineNo">635</span>              LOG.debug("The underlying FileSystem implementation doesn't support " +<a name="line.635"></a>
-<span class="sourceLineNo">636</span>                  "setStoragePolicy. This is probably intentional on their part, since HDFS-9345 " +<a name="line.636"></a>
-<span class="sourceLineNo">637</span>                  "appears to be present in your version of Hadoop. For more information check " +<a name="line.637"></a>
-<span class="sourceLineNo">638</span>                  "the Hadoop documentation on 'ArchivalStorage', the Hadoop FileSystem " +<a name="line.638"></a>
-<span class="sourceLineNo">639</span>                  "specification docs from HADOOP-11981, and/or related documentation from the " +<a name="line.639"></a>
-<span class="sourceLineNo">640</span>                  "provider of the underlying FileSystem (its name should appear in the " +<a name="line.640"></a>
-<span class="sourceLineNo">641</span>                  "stacktrace that accompanies this message). Note in particular that Hadoop's " +<a name="line.641"></a>
-<span class="sourceLineNo">642</span>                  "local filesystem implementation doesn't support storage policies.", exception);<a name="line.642"></a>
-<span class="sourceLineNo">643</span>            }<a name="line.643"></a>
-<span class="sourceLineNo">644</span>          }<a name="line.644"></a>
-<span class="sourceLineNo">645</span>        }<a name="line.645"></a>
-<span class="sourceLineNo">646</span>      }<a name="line.646"></a>
-<span class="sourceLineNo">647</span>    }<a name="line.647"></a>
-<span class="sourceLineNo">648</span>    if (toThrow != null) {<a name="line.648"></a>
-<span class="sourceLineNo">649</span>      throw new IOException(toThrow);<a name="line.649"></a>
-<span class="sourceLineNo">650</span>    }<a name="line.650"></a>
-<span class="sourceLineNo">651</span>  }<a name="line.651"></a>
-<span class="sourceLineNo">652</span><a name="line.652"></a>
-<span class="sourceLineNo">653</span>  /**<a name="line.653"></a>
-<span class="sourceLineNo">654</span>   * @param conf must not be null<a name="line.654"></a>
-<span class="sourceLineNo">655</span>   * @return True if this filesystem whose scheme is 'hdfs'.<a name="line.655"></a>
-<span class="sourceLineNo">656</span>   * @throws IOException from underlying FileSystem<a name="line.656"></a>
-<span class="sourceLineNo">657</span>   */<a name="line.657"></a>
-<span class="sourceLineNo">658</span>  public static boolean isHDFS(final Configuration conf) throws IOException {<a name="line.658"></a>
-<span class="sourceLineNo">659</span>    FileSystem fs = FileSystem.get(conf);<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    String scheme = fs.getUri().getScheme();<a name="line.660"></a>
-<span class="sourceLineNo">661</span>    return scheme.equalsIgnoreCase("hdfs");<a name="line.661"></a>
-<span class="sourceLineNo">662</span>  }<a name="line.662"></a>
-<span class="sourceLineNo">663</span><a name="line.663"></a>
-<span class="sourceLineNo">664</span>  /**<a name="line.664"></a>
-<span class="sourceLineNo">665</span>   * Checks if the given path is the one with 'recovered.edits' dir.<a name="line.665"></a>
-<span class="sourceLineNo">666</span>   * @param path must not be null<a name="line.666"></a>
-<span class="sourceLineNo">667</span>   * @return True if we recovered edits<a name="line.667"></a>
-<span class="sourceLineNo">668</span>   */<a name="line.668"></a>
-<span class="sourceLineNo">669</span>  public static boolean isRecoveredEdits(Path path) {<a name="line.669"></a>
-<span class="sourceLineNo">670</span>    return path.toString().contains(HConstants.RECOVERED_EDITS_DIR);<a name="line.670"></a>
-<span class="sourceLineNo">671</span>  }<a name="line.671"></a>
-<span class="sourceLineNo">672</span><a name="line.672"></a>
-<span class="sourceLineNo">673</span>  /**<a name="line.673"></a>
-<span class="sourceLineNo">674</span>   * @param conf must not be null<a name="line.674"></a>
-<span class="sourceLineNo">675</span>   * @return Returns the filesystem of the hbase rootdir.<a name="line.675"></a>
-<span class="sourceLineNo">676</span>   * @throws IOException from underlying FileSystem<a name="line.676"></a>
-<span class="sourceLineNo">677</span>   */<a name="line.677"></a>
-<span class="sourceLineNo">678</span>  public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {<a name="line.678"></a>
-<span class="sourceLineNo">679</span>    return getRootDir(conf).getFileSystem(conf);<a name="line.679"></a>
-<span class="sourceLineNo">680</span>  }<a name="line.680"></a>
-<span class="sourceLineNo">681</span><a name="line.681"></a>
-<span class="sourceLineNo">682</span>  /**<a name="line.682"></a>
-<span class="sourceLineNo">683</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.683"></a>
-<span class="sourceLineNo">684</span>   * This accommodates differences between hadoop versions, where hadoop 1<a name="line.684"></a>
-<span class="sourceLineNo">685</span>   * does not throw a FileNotFoundException, and return an empty FileStatus[]<a name="line.685"></a>
-<span class="sourceLineNo">686</span>   * while Hadoop 2 will throw FileNotFoundException.<a name="line.686"></a>
-<span class="sourceLineNo">687</span>   *<a name="line.687"></a>
-<span class="sourceLineNo">688</span>   * Where possible, prefer FSUtils#listStatusWithStatusFilter(FileSystem,<a name="line.688"></a>
-<span class="sourceLineNo">689</span>   * Path, FileStatusFilter) instead.<a name="line.689"></a>
-<span class="sourceLineNo">690</span>   *<a name="line.690"></a>
-<span class="sourceLineNo">691</span>   * @param fs file system<a name="line.691"></a>
-<span class="sourceLineNo">692</span>   * @param dir directory<a name="line.692"></a>
-<span class="sourceLineNo">693</span>   * @param filter path filter<a name="line.693"></a>
-<span class="sourceLineNo">694</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.694"></a>
-<span class="sourceLineNo">695</span>   */<a name="line.695"></a>
-<span class="sourceLineNo">696</span>  public static FileStatus[] listStatus(final FileSystem fs,<a name="line.696"></a>
-<span class="sourceLineNo">697</span>      final Path dir, final PathFilter filter) throws IOException {<a name="line.697"></a>
-<span class="sourceLineNo">698</span>    FileStatus [] status = null;<a name="line.698"></a>
-<span class="sourceLineNo">699</span>    try {<a name="line.699"></a>
-<span class="sourceLineNo">700</span>      status = filter == null ? fs.listStatus(dir) : fs.listStatus(dir, filter);<a name="line.700"></a>
-<span class="sourceLineNo">701</span>    } catch (FileNotFoundException fnfe) {<a name="line.701"></a>
-<span class="sourceLineNo">702</span>      // if directory doesn't exist, return null<a name="line.702"></a>
-<span class="sourceLineNo">703</span>      if (LOG.isTraceEnabled()) {<a name="line.703"></a>
-<span class="sourceLineNo">704</span>        LOG.trace("{} doesn't exist", dir);<a name="line.704"></a>
-<span class="sourceLineNo">705</span>      }<a name="line.705"></a>
-<span class="sourceLineNo">706</span>    }<a name="line.706"></a>
-<span class="sourceLineNo">707</span>    if (status == null || status.length &lt; 1) {<a name="line.707"></a>
-<span class="sourceLineNo">708</span>      return null;<a name="line.708"></a>
-<span class="sourceLineNo">709</span>    }<a name="line.709"></a>
-<span class="sourceLineNo">710</span>    return status;<a name="line.710"></a>
-<span class="sourceLineNo">711</span>  }<a name="line.711"></a>
-<span class="sourceLineNo">712</span><a name="line.712"></a>
-<span class="sourceLineNo">713</span>  /**<a name="line.713"></a>
-<span class="sourceLineNo">714</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.714"></a>
-<span class="sourceLineNo">715</span>   * This would accommodates differences between hadoop versions<a name="line.715"></a>
+<span class="sourceLineNo">543</span><a name="line.543"></a>
+<span class="sourceLineNo">544</span>      // check for lack of HDFS-7228<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      if (e instanceof RemoteException &amp;&amp;<a name="line.545"></a>
+<span class="sourceLineNo">546</span>          HadoopIllegalArgumentException.class.getName().equals(<a name="line.546"></a>
+<span class="sourceLineNo">547</span>            ((RemoteException)e).getClassName())) {<a name="line.547"></a>
+<span class="sourceLineNo">548</span>        if (LOG.isDebugEnabled()) {<a name="line.548"></a>
+<span class="sourceLineNo">549</span>          LOG.debug("Given storage policy, '" +storagePolicy +"', was rejected and probably " +<a name="line.549"></a>
+<span class="sourceLineNo">550</span>            "isn't a valid policy for the version of Hadoop you're running. I.e. if you're " +<a name="line.550"></a>
+<span class="sourceLineNo">551</span>            "trying to use SSD related policies then you're likely missing HDFS-7228. For " +<a name="line.551"></a>
+<span class="sourceLineNo">552</span>            "more information see the 'ArchivalStorage' docs for your Hadoop release.");<a name="line.552"></a>
+<span class="sourceLineNo">553</span>        }<a name="line.553"></a>
+<span class="sourceLineNo">554</span>      // Hadoop 2.8+, 3.0-a1+ added FileSystem.setStoragePolicy with a default implementation<a name="line.554"></a>
+<span class="sourceLineNo">555</span>      // that throws UnsupportedOperationException<a name="line.555"></a>
+<span class="sourceLineNo">556</span>      } else if (e instanceof UnsupportedOperationException) {<a name="line.556"></a>
+<span class="sourceLineNo">557</span>        if (LOG.isDebugEnabled()) {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>          LOG.debug("The underlying FileSystem implementation doesn't support " +<a name="line.558"></a>
+<span class="sourceLineNo">559</span>              "setStoragePolicy. This is probably intentional on their part, since HDFS-9345 " +<a name="line.559"></a>
+<span class="sourceLineNo">560</span>              "appears to be present in your version of Hadoop. For more information check " +<a name="line.560"></a>
+<span class="sourceLineNo">561</span>              "the Hadoop documentation on 'ArchivalStorage', the Hadoop FileSystem " +<a name="line.561"></a>
+<span class="sourceLineNo">562</span>              "specification docs from HADOOP-11981, and/or related documentation from the " +<a name="line.562"></a>
+<span class="sourceLineNo">563</span>              "provider of the underlying FileSystem (its name should appear in the " +<a name="line.563"></a>
+<span class="sourceLineNo">564</span>              "stacktrace that accompanies this message). Note in particular that Hadoop's " +<a name="line.564"></a>
+<span class="sourceLineNo">565</span>              "local filesystem implementation doesn't support storage policies.", e);<a name="line.565"></a>
+<span class="sourceLineNo">566</span>        }<a name="line.566"></a>
+<span class="sourceLineNo">567</span>      }<a name="line.567"></a>
+<span class="sourceLineNo">568</span>    }<a name="line.568"></a>
+<span class="sourceLineNo">569</span><a name="line.569"></a>
+<span class="sourceLineNo">570</span>    if (toThrow != null) {<a name="line.570"></a>
+<span class="sourceLineNo">571</span>      throw new IOException(toThrow);<a name="line.571"></a>
+<span class="sourceLineNo">572</span>    }<a name="line.572"></a>
+<span class="sourceLineNo">573</span>  }<a name="line.573"></a>
+<span class="sourceLineNo">574</span><a name="line.574"></a>
+<span class="sourceLineNo">575</span>  /**<a name="line.575"></a>
+<span class="sourceLineNo">576</span>   * @param conf must not be null<a name="line.576"></a>
+<span class="sourceLineNo">577</span>   * @return True if this filesystem whose scheme is 'hdfs'.<a name="line.577"></a>
+<span class="sourceLineNo">578</span>   * @throws IOException from underlying FileSystem<a name="line.578"></a>
+<span class="sourceLineNo">579</span>   */<a name="line.579"></a>
+<span class="sourceLineNo">580</span>  public static boolean isHDFS(final Configuration conf) throws IOException {<a name="line.580"></a>
+<span class="sourceLineNo">581</span>    FileSystem fs = FileSystem.get(conf);<a name="line.581"></a>
+<span class="sourceLineNo">582</span>    String scheme = fs.getUri().getScheme();<a name="line.582"></a>
+<span class="sourceLineNo">583</span>    return scheme.equalsIgnoreCase("hdfs");<a name="line.583"></a>
+<span class="sourceLineNo">584</span>  }<a name="line.584"></a>
+<span class="sourceLineNo">585</span><a name="line.585"></a>
+<span class="sourceLineNo">586</span>  /**<a name="line.586"></a>
+<span class="sourceLineNo">587</span>   * Checks if the given path is the one with 'recovered.edits' dir.<a name="line.587"></a>
+<span class="sourceLineNo">588</span>   * @param path must not be null<a name="line.588"></a>
+<span class="sourceLineNo">589</span>   * @return True if we recovered edits<a name="line.589"></a>
+<span class="sourceLineNo">590</span>   */<a name="line.590"></a>
+<span class="sourceLineNo">591</span>  public static boolean isRecoveredEdits(Path path) {<a name="line.591"></a>
+<span class="sourceLineNo">592</span>    return path.toString().contains(HConstants.RECOVERED_EDITS_DIR);<a name="line.592"></a>
+<span class="sourceLineNo">593</span>  }<a name="line.593"></a>
+<span class="sourceLineNo">594</span><a name="line.594"></a>
+<span class="sourceLineNo">595</span>  /**<a name="line.595"></a>
+<span class="sourceLineNo">596</span>   * @param conf must not be null<a name="line.596"></a>
+<span class="sourceLineNo">597</span>   * @return Returns the filesystem of the hbase rootdir.<a name="line.597"></a>
+<span class="sourceLineNo">598</span>   * @throws IOException from underlying FileSystem<a name="line.598"></a>
+<span class="sourceLineNo">599</span>   */<a name="line.599"></a>
+<span class="sourceLineNo">600</span>  public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {<a name="line.600"></a>
+<span class="sourceLineNo">601</span>    return getRootDir(conf).getFileSystem(conf);<a name="line.601"></a>
+<span class="sourceLineNo">602</span>  }<a name="line.602"></a>
+<span class="sourceLineNo">603</span><a name="line.603"></a>
+<span class="sourceLineNo">604</span>  /**<a name="line.604"></a>
+<span class="sourceLineNo">605</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.605"></a>
+<span class="sourceLineNo">606</span>   * This accommodates differences between hadoop versions, where hadoop 1<a name="line.606"></a>
+<span class="sourceLineNo">607</span>   * does not throw a FileNotFoundException, and return an empty FileStatus[]<a name="line.607"></a>
+<span class="sourceLineNo">608</span>   * while Hadoop 2 will throw FileNotFoundException.<a name="line.608"></a>
+<span class="sourceLineNo">609</span>   *<a name="line.609"></a>
+<span class="sourceLineNo">610</span>   * Where possible, prefer FSUtils#listStatusWithStatusFilter(FileSystem,<a name="line.610"></a>
+<span class="sourceLineNo">611</span>   * Path, FileStatusFilter) instead.<a name="line.611"></a>
+<span class="sourceLineNo">612</span>   *<a name="line.612"></a>
+<span class="sourceLineNo">613</span>   * @param fs file system<a name="line.613"></a>
+<span class="sourceLineNo">614</span>   * @param dir directory<a name="line.614"></a>
+<span class="sourceLineNo">615</span>   * @param filter path filter<a name="line.615"></a>
+<span class="sourceLineNo">616</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.616"></a>
+<span class="sourceLineNo">617</span>   */<a name="line.617"></a>
+<span class="sourceLineNo">618</span>  public static FileStatus[] listStatus(final FileSystem fs,<a name="line.618"></a>
+<span class="sourceLineNo">619</span>      final Path dir, final PathFilter filter) throws IOException {<a name="line.619"></a>
+<span class="sourceLineNo">620</span>    FileStatus [] status = null;<a name="line.620"></a>
+<span class="sourceLineNo">621</span>    try {<a name="line.621"></a>
+<span class="sourceLineNo">622</span>      status = filter == null ? fs.listStatus(dir) : fs.listStatus(dir, filter);<a name="line.622"></a>
+<span class="sourceLineNo">623</span>    } catch (FileNotFoundException fnfe) {<a name="line.623"></a>
+<span class="sourceLineNo">624</span>      // if directory doesn't exist, return null<a name="line.624"></a>
+<span class="sourceLineNo">625</span>      if (LOG.isTraceEnabled()) {<a name="line.625"></a>
+<span class="sourceLineNo">626</span>        LOG.trace("{} doesn't exist", dir);<a name="line.626"></a>
+<span class="sourceLineNo">627</span>      }<a name="line.627"></a>
+<span class="sourceLineNo">628</span>    }<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    if (status == null || status.length &lt; 1) {<a name="line.629"></a>
+<span class="sourceLineNo">630</span>      return null;<a name="line.630"></a>
+<span class="sourceLineNo">631</span>    }<a name="line.631"></a>
+<span class="sourceLineNo">632</span>    return status;<a name="line.632"></a>
+<span class="sourceLineNo">633</span>  }<a name="line.633"></a>
+<span class="sourceLineNo">634</span><a name="line.634"></a>
+<span class="sourceLineNo">635</span>  /**<a name="line.635"></a>
+<span class="sourceLineNo">636</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.636"></a>
+<span class="sourceLineNo">637</span>   * This would accommodates differences between hadoop versions<a name="line.637"></a>
+<span class="sourceLineNo">638</span>   *<a name="line.638"></a>
+<span class="sourceLineNo">639</span>   * @param fs file system<a name="line.639"></a>
+<span class="sourceLineNo">640</span>   * @param dir directory<a name="line.640"></a>
+<span class="sourceLineNo">641</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.641"></a>
+<span class="sourceLineNo">642</span>   */<a name="line.642"></a>
+<span class="sourceLineNo">643</span>  public static FileStatus[] listStatus(final FileSystem fs, final Path dir) throws IOException {<a name="line.643"></a>
+<span class="sourceLineNo">644</span>    return listStatus(fs, dir, null);<a name="line.644"></a>
+<span class="sourceLineNo">645</span>  }<a name="line.645"></a>
+<span class="sourceLineNo">646</span><a name="line.646"></a>
+<span class="sourceLineNo">647</span>  /**<a name="line.647"></a>
+<span class="sourceLineNo">648</span>   * Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call<a name="line.648"></a>
+<span class="sourceLineNo">649</span>   *<a name="line.649"></a>
+<span class="sourceLineNo">650</span>   * @param fs file system<a name="line.650"></a>
+<span class="sourceLineNo">651</span>   * @param dir directory<a name="line.651"></a>
+<span class="sourceLineNo">652</span>   * @return LocatedFileStatus list<a name="line.652"></a>
+<span class="sourceLineNo">653</span>   */<a name="line.653"></a>
+<span class="sourceLineNo">654</span>  public static List&lt;LocatedFileStatus&gt; listLocatedStatus(final FileSystem fs,<a name="line.654"></a>
+<span class="sourceLineNo">655</span>      final Path dir) throws IOException {<a name="line.655"></a>
+<span class="sourceLineNo">656</span>    List&lt;LocatedFileStatus&gt; status = null;<a name="line.656"></a>
+<span class="sourceLineNo">657</span>    try {<a name="line.657"></a>
+<span class="sourceLineNo">658</span>      RemoteIterator&lt;LocatedFileStatus&gt; locatedFileStatusRemoteIterator = fs<a name="line.658"></a>
+<span class="sourceLineNo">659</span>          .listFiles(dir, false);<a name="line.659"></a>
+<span class="sourceLineNo">660</span>      while (locatedFileStatusRemoteIterator.hasNext()) {<a name="line.660"></a>
+<span class="sourceLineNo">661</span>        if (status == null) {<a name="line.661"></a>
+<span class="sourceLineNo">662</span>          status = Lists.newArrayList();<a name="line.662"></a>
+<span class="sourceLineNo">663</span>        }<a name="line.663"></a>
+<span class="sourceLineNo">664</span>        status.add(locatedFileStatusRemoteIterator.next());<a name="line.664"></a>
+<span class="sourceLineNo">665</span>      }<a name="line.665"></a>
+<span class="sourceLineNo">666</span>    } catch (FileNotFoundException fnfe) {<a name="line.666"></a>
+<span class="sourceLineNo">667</span>      // if directory doesn't exist, return null<a name="line.667"></a>
+<span class="sourceLineNo">668</span>      if (LOG.isTraceEnabled()) {<a name="line.668"></a>
+<span class="sourceLineNo">669</span>        LOG.trace("{} doesn't exist", dir);<a name="line.669"></a>
+<span class="sourceLineNo">670</span>      }<a name="line.670"></a>
+<span class="sourceLineNo">671</span>    }<a name="line.671"></a>
+<span class="sourceLineNo">672</span>    return status;<a name="line.672"></a>
+<span class="sourceLineNo">673</span>  }<a name="line.673"></a>
+<span class="sourceLineNo">674</span><a name="line.674"></a>
+<span class="sourceLineNo">675</span>  /**<a name="line.675"></a>
+<span class="sourceLineNo">676</span>   * Calls fs.delete() and returns the value returned by the fs.delete()<a name="line.676"></a>
+<span class="sourceLineNo">677</span>   *<a name="line.677"></a>
+<span class="sourceLineNo">678</span>   * @param fs must not be null<a name="line.678"></a>
+<span class="sourceLineNo">679</span>   * @param path must not be null<a name="line.679"></a>
+<span class="sourceLineNo">680</span>   * @param recursive delete tree rooted at path<a name="line.680"></a>
+<span class="sourceLineNo">681</span>   * @return the value returned by the fs.delete()<a name="line.681"></a>
+<span class="sourceLineNo">682</span>   * @throws IOException from underlying FileSystem<a name="line.682"></a>
+<span class="sourceLineNo">683</span>   */<a name="line.683"></a>
+<span class="sourceLineNo">684</span>  public static boolean delete(final FileSystem fs, final Path path, final boolean recursive)<a name="line.684"></a>
+<span class="sourceLineNo">685</span>      throws IOException {<a name="line.685"></a>
+<span class="sourceLineNo">686</span>    return fs.delete(path, recursive);<a name="line.686"></a>
+<span class="sourceLineNo">687</span>  }<a name="line.687"></a>
+<span class="sourceLineNo">688</span><a name="line.688"></a>
+<span class="sourceLineNo">689</span>  /**<a name="line.689"></a>
+<span class="sourceLineNo">690</span>   * Calls fs.exists(). Checks if the specified path exists<a name="line.690"></a>
+<span class="sourceLineNo">691</span>   *<a name="line.691"></a>
+<span class="sourceLineNo">692</span>   * @param fs must not be null<a name="line.692"></a>
+<span class="sourceLineNo">693</span>   * @param path must not be null<a name="line.693"></a>
+<span class="sourceLineNo">694</span>   * @return the value returned by fs.exists()<a name="line.694"></a>
+<span class="sourceLineNo">695</span>   * @throws IOException from underlying FileSystem<a name="line.695"></a>
+<span class="sourceLineNo">696</span>   */<a name="line.696"></a>
+<span class="sourceLineNo">697</span>  public static boolean isExists(final FileSystem fs, final Path path) throws IOException {<a name="line.697"></a>
+<span class="sourceLineNo">698</span>    return fs.exists(path);<a name="line.698"></a>
+<span class="sourceLineNo">699</span>  }<a name="line.699"></a>
+<span class="sourceLineNo">700</span><a name="line.700"></a>
+<span class="sourceLineNo">701</span>  /**<a name="line.701"></a>
+<span class="sourceLineNo">702</span>   * Log the current state of the filesystem from a certain root directory<a name="line.702"></a>
+<span class="sourceLineNo">703</span>   * @param fs filesystem to investigate<a name="line.703"></a>
+<span class="sourceLineNo">704</span>   * @param root root file/directory to start logging from<a name="line.704"></a>
+<span class="sourceLineNo">705</span>   * @param log log to output information<a name="line.705"></a>
+<span class="sourceLineNo">706</span>   * @throws IOException if an unexpected exception occurs<a name="line.706"></a>
+<span class="sourceLineNo">707</span>   */<a name="line.707"></a>
+<span class="sourceLineNo">708</span>  public static void logFileSystemState(final FileSystem fs, final Path root, Logger log)<a name="line.708"></a>
+<span class="sourceLineNo">709</span>      throws IOException {<a name="line.709"></a>
+<span class="sourceLineNo">710</span>    log.debug("File system contents for path {}", root);<a name="line.710"></a>
+<span class="sourceLineNo">711</span>    logFSTree(log, fs, root, "|-");<a name="line.711"></a>
+<span class="sourceLineNo">712</span>  }<a name="line.712"></a>
+<span class="sourceLineNo">713</span><a name="line.713"></a>
+<span class="sourceLineNo">714</span>  /**<a name="line.714"></a>
+<span class="sourceLineNo">715</span>   * Recursive helper to log the state of the FS<a name="line.715"></a>
 <span class="sourceLineNo">716</span>   *<a name="line.716"></a>
-<span class="sourceLineNo">717</span>   * @param fs file system<a name="line.717"></a>
-<span class="sourceLineNo">718</span>   * @param dir directory<a name="line.718"></a>
-<span class="sourceLineNo">719</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.719"></a>
-<span class="sourceLineNo">720</span>   */<a name="line.720"></a>
-<span class="sourceLineNo">721</span>  public static FileStatus[] listStatus(final FileSystem fs, final Path dir) throws IOException {<a name="line.721"></a>
-<span class="sourceLineNo">722</span>    return listStatus(fs, dir, null);<a name="line.722"></a>
-<span class="sourceLineNo">723</span>  }<a name="line.723"></a>
-<span class="sourceLineNo">724</span><a name="line.724"></a>
-<span class="sourceLineNo">725</span>  /**<a name="line.725"></a>
-<span class="sourceLineNo">726</span>   * Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call<a name="line.726"></a>
-<span class="sourceLineNo">727</span>   *<a name="line.727"></a>
-<span class="sourceLineNo">728</span>   * @param fs file system<a name="line.728"></a>
-<span class="sourceLineNo">729</span>   * @param dir directory<a name="line.729"></a>
-<span class="sourceLineNo">730</span>   * @return LocatedFileStatus list<a name="line.730"></a>
-<span class="sourceLineNo">731</span>   */<a name="line.731"></a>
-<span class="sourceLineNo">732</span>  public static List&lt;LocatedFileStatus&gt; listLocatedStatus(final FileSystem fs,<a name="line.732"></a>
-<span class="sourceLineNo">733</span>      final Path dir) throws IOException {<a name="line.733"></a>
-<span class="sourceLineNo">734</span>    List&lt;LocatedFileStatus&gt; status = null;<a name="line.734"></a>
-<span class="sourceLineNo">735</span>    try {<a name="line.735"></a>
-<span class="sourceLineNo">736</span>      RemoteIterator&lt;LocatedFileStatus&gt; locatedFileStatusRemoteIterator = fs<a name="line.736"></a>
-<span class="sourceLineNo">737</span>          .listFiles(dir, false);<a name="line.737"></a>
-<span class="sourceLineNo">738</span>      while (locatedFileStatusRemoteIterator.hasNext()) {<a name="line.738"></a>
-<span class="sourceLineNo">739</span>        if (status == null) {<a name="line.739"></a>
-<span class="sourceLineNo">740</span>          status = Lists.newArrayList();<a name="line.740"></a>
-<span class="sourceLineNo">741</span>        }<a name="line.741"></a>
-<span class="sourceLineNo">742</span>        status.add(locatedFileStatusRemoteIterator.next());<a name="line.742"></a>
-<span class="sourceLineNo">743</span>      }<a name="line.743"></a>
-<span class="sourceLineNo">744</span>    } catch (FileNotFoundException fnfe) {<a name="line.744"></a>
-<span class="sourceLineNo">745</span>      // if directory doesn't exist, return null<a name="line.745"></a>
-<span class="sourceLineNo">746</span>      if (LOG.isTraceEnabled()) {<a name="line.746"></a>
-<span class="sourceLineNo">747</span>        LOG.trace("{} doesn't exist", dir);<a name="line.747"></a>
-<span class="sourceLineNo">748</span>      }<a name="line.748"></a>
-<span class="sourceLineNo">749</span>    }<a name="line.749"></a>
-<span class="sourceLineNo">750</span>    return status;<a name="line.750"></a>
-<span class="sourceLineNo">751</span>  }<a name="line.751"></a>
-<span class="sourceLineNo">752</span><a name="line.752"></a>
-<span class="sourceLineNo">753</span>  /**<a name="line.753"></a>
-<span class="sourceLineNo">754</span>   * Calls fs.delete() and returns the value returned by the fs.delete()<a name="line.754"></a>
-<span class="sourceLineNo">755</span>   *<a name="line.755"></a>
-<span class="sourceLineNo">756</span>   * @param fs must not be null<a name="line.756"></a>
-<span class="sourceLineNo">757</span>   * @param path must not be null<a name="line.757"></a>
-<span class="sourceLineNo">758</span>   * @param recursive delete tree rooted at path<a name="line.758"></a>
-<span class="sourceLineNo">759</span>   * @return the value returned by the fs.delete()<a name="line.759"></a>
-<span class="sourceLineNo">760</span>   * @throws IOException from underlying FileSystem<a name="line.760"></a>
-<span class="sourceLineNo">761</span>   */<a name="line.761"></a>
-<span class="sourceLineNo">762</span>  public static boolean delete(final FileSystem fs, final Path path, final boolean recursive)<a name="line.762"></a>
-<span class="sourceLineNo">763</span>      throws IOException {<a name="line.763"></a>
-<span class="sourceLineNo">764</span>    return fs.delete(path, recursive);<a name="line.764"></a>
-<span class="sourceLineNo">765</span>  }<a name="line.765"></a>
-<span class="sourceLineNo">766</span><a name="line.766"></a>
-<span class="sourceLineNo">767</span>  /**<a name="line.767"></a>
-<span class="sourceLineNo">768</span>   * Calls fs.exists(). Checks if the specified path exists<a name="line.768"></a>
-<span class="sourceLineNo">769</span>   *<a name="line.769"></a>
-<span class="sourceLineNo">770</span>   * @param fs must not be null<a name="line.770"></a>
-<span class="sourceLineNo">771</span>   * @param path must not be null<a name="line.771"></a>
-<span class="sourceLineNo">772</span>   * @return the value returned by fs.exists()<a name="line.772"></a>
-<span class="sourceLineNo">773</span>   * @throws IOException from underlying FileSystem<a name="line.773"></a>
-<span class="sourceLineNo">774</span>   */<a name="line.774"></a>
-<span class="sourceLineNo">775</span>  public static boolean isExists(final FileSystem fs, final Path path) throws IOException {<a name="line.775"></a>
-<span class="sourceLineNo">776</span>    return fs.exists(path);<a name="line.776"></a>
-<span class="sourceLineNo">777</span>  }<a name="line.777"></a>
+<span class="sourceLineNo">717</span>   * @see #logFileSystemState(FileSystem, Path, Logger)<a name="line.717"></a>
+<span class="sourceLineNo">718</span>   */<a name="line.718"></a>
+<span class="sourceLineNo">719</span>  private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)<a name="line.719"></a>
+<span class="sourceLineNo">720</span>      throws IOException {<a name="line.720"></a>
+<span class="sourceLineNo">721</span>    FileStatus[] files = listStatus(fs, root, null);<a name="line.721"></a>
+<span class="sourceLineNo">722</span>    if (files == null) {<a name="line.722"></a>
+<span class="sourceLineNo">723</span>      return;<a name="line.723"></a>
+<span class="sourceLineNo">724</span>    }<a name="line.724"></a>
+<span class="sourceLineNo">725</span><a name="line.725"></a>
+<span class="sourceLineNo">726</span>    for (FileStatus file : files) {<a name="line.726"></a>
+<span class="sourceLineNo">727</span>      if (file.isDirectory()) {<a name="line.727"></a>
+<span class="sourceLineNo">728</span>        log.debug(prefix + file.getPath().getName() + "/");<a name="line.728"></a>
+<span class="sourceLineNo">729</span>        logFSTree(log, fs, file.getPath(), prefix + "---");<a name="line.729"></a>
+<span class="sourceLineNo">730</span>      } else {<a name="line.730"></a>
+<span class="sourceLineNo">731</span>        log.debug(prefix + file.getPath().getName());<a name="line.731"></a>
+<span class="sourceLineNo">732</span>      }<a name="line.732"></a>
+<span class="sourceLineNo">733</span>    }<a name="line.733"></a>
+<span class="sourceLineNo">734</span>  }<a name="line.734"></a>
+<span class="sourceLineNo">735</span><a name="line.735"></a>
+<span class="sourceLineNo">736</span>  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest)<a name="line.736"></a>
+<span class="sourceLineNo">737</span>      throws IOException {<a name="line.737"></a>
+<span class="sourceLineNo">738</span>    // set the modify time for TimeToLive Cleaner<a name="line.738"></a>
+<span class="sourceLineNo">739</span>    fs.setTimes(src, EnvironmentEdgeManager.currentTime(), -1);<a name="line.739"></a>
+<span class="sourceLineNo">740</span>    return fs.rename(src, dest);<a name="line.740"></a>
+<span class="sourceLineNo">741</span>  }<a name="line.741"></a>
+<span class="sourceLineNo">742</span><a name="line.742"></a>
+<span class="sourceLineNo">743</span>  /**<a name="line.743"></a>
+<span class="sourceLineNo">744</span>   * Check if short circuit read buffer size is set and if not, set it to hbase value.<a name="line.744"></a>
+<span class="sourceLineNo">745</span>   * @param conf must not be null<a name="line.745"></a>
+<span class="sourceLineNo">746</span>   */<a name="line.746"></a>
+<span class="sourceLineNo">747</span>  public static void checkShortCircuitReadBufferSize(final Configuration conf) {<a name="line.747"></a>
+<span class="sourceLineNo">748</span>    final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;<a name="line.748"></a>
+<span class="sourceLineNo">749</span>    final int notSet = -1;<a name="line.749"></a>
+<span class="sourceLineNo">750</span>    // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2<a name="line.750"></a>
+<span class="sourceLineNo">751</span>    final String dfsKey = "dfs.client.read.shortcircuit.buffer.size";<a name="line.751"></a>
+<span class="sourceLineNo">752</span>    int size = conf.getInt(dfsKey, notSet);<a name="line.752"></a>
+<span class="sourceLineNo">753</span>    // If a size is set, return -- we will use it.<a name="line.753"></a>
+<span class="sourceLineNo">754</span>    if (size != notSet) {<a name="line.754"></a>
+<span class="sourceLineNo">755</span>      return;<a name="line.755"></a>
+<span class="sourceLineNo">756</span>    }<a name="line.756"></a>
+<span class="sourceLineNo">757</span>    // But short circuit buffer size is normally not set.  Put in place the hbase wanted size.<a name="line.757"></a>
+<span class="sourceLineNo">758</span>    int hbaseSize = conf.getInt("hbase." + dfsKey, defaultSize);<a name="line.758"></a>
+<span class="sourceLineNo">759</span>    conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));<a name="line.759"></a>
+<span class="sourceLineNo">760</span>  }<a name="line.760"></a>
+<span class="sourceLineNo">761</span><a name="line.761"></a>
+<span class="sourceLineNo">762</span>  private static class DfsBuilderUtility {<a name="line.762"></a>
+<span class="sourceLineNo">763</span>    static Class&lt;?&gt; dfsClass = null;<a name="line.763"></a>
+<span class="sourceLineNo">764</span>    static Method createMethod;<a name="line.764"></a>
+<span class="sourceLineNo">765</span>    static Method overwriteMethod;<a name="line.765"></a>
+<span class="sourceLineNo">766</span>    static Method bufferSizeMethod;<a name="line.766"></a>
+<span class="sourceLineNo">767</span>    static Method blockSizeMethod;<a name="line.767"></a>
+<span class="sourceLineNo">768</span>    static Method recursiveMethod;<a name="line.768"></a>
+<span class="sourceLineNo">769</span>    static Method replicateMethod;<a name="line.769"></a>
+<span class="sourceLineNo">770</span>    static Method replicationMethod;<a name="line.770"></a>
+<span class="sourceLineNo">771</span>    static Method buildMethod;<a name="line.771"></a>
+<span class="sourceLineNo">772</span>    static boolean allMethodsPresent = false;<a name="line.772"></a>
+<span class="sourceLineNo">773</span><a name="line.773"></a>
+<span class="sourceLineNo">774</span>    static {<a name="line.774"></a>
+<span class="sourceLineNo">775</span>      String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";<a name="line.775"></a>
+<span class="sourceLineNo">776</span>      String builderName = dfsName + "$HdfsDataOutputStreamBuilder";<a name="line.776"></a>
+<span class="sourceLineNo">777</span>      Class&lt;?&gt; builderClass = null;<a name="line.777"></a>
 <span class="sourceLineNo">778</span><a name="line.778"></a>
-<span class="sourceLineNo">779</span>  /**<a name="line.779"></a>
-<span class="sourceLineNo">780</span>   * Log the current state of the filesystem from a certain root directory<a name="line.780"></a>
-<span class="sourceLineNo">781</span>   * @param fs filesystem to investigate<a name="line.781"></a>
-<span class="sourceLineNo">782</span>   * @param root root file/directory to start logging from<a name="line.782"></a>
-<span class="sourceLineNo">783</span>   * @param log log to output information<a name="line.783"></a>
-<span class="sourceLineNo">784</span>   * @throws IOException if an unexpected exception occurs<a name="line.784"></a>
-<span class="sourceLineNo">785</span>   */<a name="line.785"></a>
-<span class="sourceLineNo">786</span>  public static void logFileSystemState(final FileSystem fs, final Path root, Logger log)<a name="line.786"></a>
-<span class="sourceLineNo">787</span>      throws IOException {<a name="line.787"></a>
-<span class="sourceLineNo">788</span>    log.debug("File system contents for path {}", root);<a name="line.788"></a>
-<span class="sourceLineNo">789</span>    logFSTree(log, fs, root, "|-");<a name="line.789"></a>
-<span class="sourceLineNo">790</span>  }<a name="line.790"></a>
-<span class="sourceLineNo">791</span><a name="line.791"></a>
-<span class="sourceLineNo">792</span>  /**<a name="line.792"></a>
-<span class="sourceLineNo">793</span>   * Recursive helper to log the state of the FS<a name="line.793"></a>
-<span class="sourceLineNo">794</span>   *<a name="line.794"></a>
-<span class="sourceLineNo">795</span>   * @see #logFileSystemState(FileSystem, Path, Logger)<a name="line.795"></a>
-<span class="sourceLineNo">796</span>   */<a name="line.796"></a>
-<span class="sourceLineNo">797</span>  private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)<a name="line.797"></a>
-<span class="sourceLineNo">798</span>      throws IOException {<a name="line.798"></a>
-<span class="sourceLineNo">799</span>    FileStatus[] files = listStatus(fs, root, null);<a name="line.799"></a>
-<span class="sourceLineNo">800</span>    if (files == null) {<a name="line.800"></a>
-<span class="sourceLineNo">801</span>      return;<a name="line.801"></a>
-<span class="sourceLineNo">802</span>    }<a name="line.802"></a>
-<span class="sourceLineNo">803</span><a name="line.803"></a>
-<span class="sourceLineNo">804</span>    for (FileStatus file : files) {<a name="line.804"></a>
-<span class="sourceLineNo">805</span>      if (file.isDirectory()) {<a name="line.805"></a>
-<span class="sourceLineNo">806</span>        log.debug(prefix + file.getPath().getName() + "/");<a name="line.806"></a>
-<span class="sourceLineNo">807</span>        logFSTree(log, fs, file.getPath(), prefix + "---");<a name="line.807"></a>
-<span class="sourceLineNo">808</span>      } else {<a name="line.808"></a>
-<span class="sourceLineNo">809</span>        log.debug(prefix + file.getPath().getName());<a name="line.809"></a>
-<span class="sourceLineNo">810</span>      }<a name="line.810"></a>
-<span class="sourceLineNo">811</span>    }<a name="line.811"></a>
-<span class="sourceLineNo">812</span>  }<a name="line.812"></a>
-<span class="sourceLineNo">813</span><a name="line.813"></a>
-<span class="sourceLineNo">814</span>  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest)<a name="line.814"></a>
-<span class="sourceLineNo">815</span>      throws IOException {<a name="line.815"></a>
-<span class="sourceLineNo">816</span>    // set the modify time for TimeToLive Cleaner<a name="line.816"></a>
-<span class="sourceLineNo">817</span>    fs.setTimes(src, EnvironmentEdgeManager.currentTime(), -1);<a name="line.817"></a>
-<span class="sourceLineNo">818</span>    return fs.rename(src, dest);<a name="line.818"></a>
-<span class="sourceLineNo">819</span>  }<a name="line.819"></a>
-<span class="sourceLineNo">820</span><a name="line.820"></a>
-<span class="sourceLineNo">821</span>  /**<a name="line.821"></a>
-<span class="sourceLineNo">822</span>   * Check if short circuit read buffer size is set and if not, set it to hbase value.<a name="line.822"></a>
-<span class="sourceLineNo">823</span>   * @param conf must not be null<a name="line.823"></a>
-<span class="sourceLineNo">824</span>   */<a name="line.824"></a>
-<span class="sourceLineNo">825</span>  public static void checkShortCircuitReadBufferSize(final Configuration conf) {<a name="line.825"></a>
-<span class="sourceLineNo">826</span>    final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;<a name="line.826"></a>
-<span class="sourceLineNo">827</span>    final int notSet = -1;<a name="line.827"></a>
-<span class="sourceLineNo">828</span>    // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2<a name="line.828"></a>
-<span class="sourceLineNo">829</span>    final String dfsKey = "dfs.client.read.shortcircuit.buffer.size";<a name="line.829"></a>
-<span class="sourceLineNo">830</span>    int size = conf.getInt(dfsKey, notSet);<a name="line.830"></a>
-<span class="sourceLineNo">831</span>    // If a size is set, return -- we will use it.<a name="line.831"></a>
-<span class="sourceLineNo">832</span>    if (size != notSet) {<a name="line.832"></a>
-<span class="sourceLineNo">833</span>      return;<a name="line.833"></a>
-<span class="sourceLineNo">834</span>    }<a name="line.834"></a>
-<span class="sourceLineNo">835</span>    // But short circuit buffer size is normally not set.  Put in place the hbase wanted size.<a name="line.835"></a>
-<span class="sourceLineNo">836</span>    int hbaseSize = conf.getInt("hbase." + dfsKey, defaultSize);<a name="line.836"></a>
-<span class="sourceLineNo">837</span>    conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));<a name="line.837"></a>
-<span class="sourceLineNo">838</span>  }<a name="line.838"></a>
-<span class="sourceLineNo">839</span><a name="line.839"></a>
-<span class="sourceLineNo">840</span>  private static class DfsBuilderUtility {<a name="line.840"></a>
-<span class="sourceLineNo">841</span>    static Class&lt;?&gt; dfsClass = null;<a name="line.841"></a>
-<span class="sourceLineNo">842</span>    static Method createMethod;<a name="line.842"></a>
-<span class="sourceLineNo">843</span>    static Method overwriteMethod;<a name="line.843"></a>
-<span class="sourceLineNo">844</span>    static Method bufferSizeMethod;<a name="line.844"></a>
-<span class="sourceLineNo">845</span>    static Method blockSizeMethod;<a name="line.845"></a>
-<span class="sourceLineNo">846</span>    static Method recursiveMethod;<a name="line.846"></a>
-<span class="sourceLineNo">847</span>    static Method replicateMethod;<a name="line.847"></a>
-<span class="sourceLineNo">848</span>    static Method replicationMethod;<a name="line.848"></a>
-<span class="sourceLineNo">849</span>    static Method buildMethod;<a name="line.849"></a>
-<span class="sourceLineNo">850</span>    static boolean allMethodsPresent = false;<a name="line.850"></a>
+<span class="sourceLineNo">779</span>      try {<a name="line.779"></a>
+<span class="sourceLineNo">780</span>        dfsClass = Class.forName(dfsName);<a name="line.780"></a>
+<span class="sourceLineNo">781</span>      } catch (ClassNotFoundException e) {<a name="line.781"></a>
+<span class="sourceLineNo">782</span>        LOG.debug("{} not available, will not use builder API for file creation.", dfsName);<a name="line.782"></a>
+<span class="sourceLineNo">783</span>      }<a name="line.783"></a>
+<span class="sourceLineNo">784</span>      try {<a name="line.784"></a>
+<span class="sourceLineNo">785</span>        builderClass = Class.forName(builderName);<a name="line.785"></a>
+<span class="sourceLineNo">786</span>      } catch (ClassNotFoundException e) {<a name="line.786"></a>
+<span class="sourceLineNo">787</span>        LOG.debug("{} not available, will not use builder API for file creation.", builderName);<a name="line.787"></a>
+<span class="sourceLineNo">788</span>      }<a name="line.788"></a>
+<span class="sourceLineNo">789</span><a name="line.789"></a>
+<span class="sourceLineNo">790</span>      if (dfsClass != null &amp;&amp; builderClass != null) {<a name="line.790"></a>
+<span class="sourceLineNo">791</span>        try {<a name="line.791"></a>
+<span class="sourceLineNo">792</span>          createMethod = dfsClass.getMethod("createFile", Path.class);<a name="line.792"></a>
+<span class="sourceLineNo">793</span>          overwriteMethod = builderClass.getMethod("overwrite", boolean.class);<a name="line.793"></a>
+<span class="sourceLineNo">794</span>          bufferSizeMethod = builderClass.getMethod("bufferSize", int.class);<a name="line.794"></a>
+<span class="sourceLineNo">795</span>          blockSizeMethod = builderClass.getMethod("blockSize", long.class);<a name="line.795"></a>
+<span class="sourceLineNo">796</span>          recursiveMethod = builderClass.getMethod("recursive");<a name="line.796"></a>
+<span class="sourceLineNo">797</span>          replicateMethod = builderClass.getMethod("replicate");<a name="line.797"></a>
+<span class="sourceLineNo">798</span>          replicationMethod = builderClass.getMethod("replication", short.class);<a name="line.798"></a>
+<span class="sourceLineNo">799</span>          buildMethod = builderClass.getMethod("build");<a name="line.799"></a>
+<span class="sourceLineNo">800</span><a name="line.800"></a>
+<span class="sourceLineNo">801</span>          allMethodsPresent = true;<a name="line.801"></a>
+<span class="sourceLineNo">802</span>          LOG.debug("Using builder API via reflection for DFS file creation.");<a name="line.802"></a>
+<span class="sourceLineNo">803</span>        } catch (NoSuchMethodException e) {<a name="line.803"></a>
+<span class="sourceLineNo">804</span>          LOG.debug("Could not find method on builder; will use old DFS API for file creation {}",<a name="line.804"></a>
+<span class="sourceLineNo">805</span>              e.getMessage());<a name="line.805"></a>
+<span class="sourceLineNo">806</span>        }<a name="line.806"></a>
+<span class="sourceLineNo">807</span>      }<a name="line.807"></a>
+<span class="sourceLineNo">808</span>    }<a name="line.808"></a>
+<span class="sourceLineNo">809</span><a name="line.809"></a>
+<span class="sourceLineNo">810</span>    /**<a name="line.810"></a>
+<span class="sourceLineNo">811</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.811"></a>
+<span class="sourceLineNo">812</span>     * replication enabled.<a name="line.812"></a>
+<span class="sourceLineNo">813</span>     */<a name="line.813"></a>
+<span class="sourceLineNo">814</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable,<a name="line.814"></a>
+<span class="sourceLineNo">815</span>        int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.815"></a>
+<span class="sourceLineNo">816</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.816"></a>
+<span class="sourceLineNo">817</span>        try {<a name="line.817"></a>
+<span class="sourceLineNo">818</span>          Object builder;<a name="line.818"></a>
+<span class="sourceLineNo">819</span><a name="line.819"></a>
+<span class="sourceLineNo">820</span>          builder = createMethod.invoke(fs, path);<a name="line.820"></a>
+<span class="sourceLineNo">821</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.821"></a>
+<span class="sourceLineNo">822</span>          builder = bufferSizeMethod.invoke(builder, bufferSize);<a name="line.822"></a>
+<span class="sourceLineNo">823</span>          builder = blockSizeMethod.invoke(builder, blockSize);<a name="line.823"></a>
+<span class="sourceLineNo">824</span>          if (isRecursive) {<a name="line.824"></a>
+<span class="sourceLineNo">825</span>            builder = recursiveMethod.invoke(builder);<a name="line.825"></a>
+<span class="sourceLineNo">826</span>          }<a name="line.826"></a>
+<span class="sourceLineNo">827</span>          builder = replicateMethod.invoke(builder);<a name="line.827"></a>
+<span class="sourceLineNo">828</span>          builder = replicationMethod.invoke(builder, replication);<a name="line.828"></a>
+<span class="sourceLineNo">829</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.829"></a>
+<span class="sourceLineNo">830</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.830"></a>
+<span class="sourceLineNo">831</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.831"></a>
+<span class="sourceLineNo">832</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.832"></a>
+<span class="sourceLineNo">833</span>        }<a name="line.833"></a>
+<span class="sourceLineNo">834</span>      }<a name="line.834"></a>
+<span class="sourceLineNo">835</span><a name="line.835"></a>
+<span class="sourceLineNo">836</span>      if (isRecursive) {<a name="line.836"></a>
+<span class="sourceLineNo">837</span>        return fs.create(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.837"></a>
+<span class="sourceLineNo">838</span>      }<a name="line.838"></a>
+<span class="sourceLineNo">839</span>      return fs.createNonRecursive(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.839"></a>
+<span class="sourceLineNo">840</span>    }<a name="line.840"></a>
+<span class="sourceLineNo">841</span><a name="line.841"></a>
+<span class="sourceLineNo">842</span>    /**<a name="line.842"></a>
+<span class="sourceLineNo">843</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.843"></a>
+<span class="sourceLineNo">844</span>     * replication enabled.<a name="line.844"></a>
+<span class="sourceLineNo">845</span>     */<a name="line.845"></a>
+<span class="sourceLineNo">846</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable)<a name="line.846"></a>
+<span class="sourceLineNo">847</span>        throws IOException {<a name="line.847"></a>
+<span class="sourceLineNo">848</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.848"></a>
+<span class="sourceLineNo">849</span>        try {<a name="line.849"></a>
+<span class="sourceLineNo">850</span>          Object builder;<a name="line.850"></a>
 <span class="sourceLineNo">851</span><a name="line.851"></a>
-<span class="sourceLineNo">852</span>    static {<a name="line.852"></a>
-<span class="sourceLineNo">853</span>      String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";<a name="line.853"></a>
-<span class="sourceLineNo">854</span>      String builderName = dfsName + "$HdfsDataOutputStreamBuilder";<a name="line.854"></a>
-<span class="sourceLineNo">855</span>      Class&lt;?&gt; builderClass = null;<a name="line.855"></a>
-<span class="sourceLineNo">856</span><a name="line.856"></a>
-<span class="sourceLineNo">857</span>      try {<a name="line.857"></a>
-<span class="sourceLineNo">858</span>        dfsClass = Class.forName(dfsName);<a name="line.858"></a>
-<span class="sourceLineNo">859</span>      } catch (ClassNotFoundException e) {<a name="line.859"></a>
-<span class="sourceLineNo">860</span>        LOG.debug("{} not available, will not use builder API for file creation.", dfsName);<a name="line.860"></a>
-<span class="sourceLineNo">861</span>      }<a name="line.861"></a>
-<span class="sourceLineNo">862</span>      try {<a name="line.862"></a>
-<span class="sourceLineNo">863</span>        builderClass = Class.forName(builderName);<a name="line.863"></a>
-<span class="sourceLineNo">864</span>      } catch (ClassNotFoundException e) {<a name="line.864"></a>
-<span class="sourceLineNo">865</span>        LOG.debug("{} not available, will not use builder API for file creation.", builderName);<a name="line.865"></a>
-<span class="sourceLineNo">866</span>      }<a name="line.866"></a>
-<span class="sourceLineNo">867</span><a name="line.867"></a>
-<span class="sourceLineNo">868</span>      if (dfsClass != null &amp;&amp; builderClass != null) {<a name="line.868"></a>
-<span class="sourceLineNo">869</span>        try {<a name="line.869"></a>
-<span class="sourceLineNo">870</span>          createMethod = dfsClass.getMethod("createFile", Path.class);<a name="line.870"></a>
-<span class="sourceLineNo">871</span>          overwriteMethod = builderClass.getMethod("overwrite", boolean.class);<a name="line.871"></a>
-<span class="sourceLineNo">872</span>          bufferSizeMethod = builderClass.getMethod("bufferSize", int.class);<a name="line.872"></a>
-<span class="sourceLineNo">873</span>          blockSizeMethod = builderClass.getMethod("blockSize", long.class);<a name="line.873"></a>
-<span class="sourceLineNo">874</span>          recursiveMethod = builderClass.getMethod("recursive");<a name="line.874"></a>
-<span class="sourceLineNo">875</span>          replicateMethod = builderClass.getMethod("replicate");<a name="line.875"></a>
-<span class="sourceLineNo">876</span>          replicationMethod = builderClass.getMethod("replication", short.class);<a name="line.876"></a>
-<span class="sourceLineNo">877</span>          buildMethod = builderClass.getMethod("build");<a name="line.877"></a>
-<span class="sourceLineNo">878</span><a name="line.878"></a>
-<span class="sourceLineNo">879</span>          allMethodsPresent = true;<a name="line.879"></a>
-<span class="sourceLineNo">880</span>          LOG.debug("Using builder API via reflection for DFS file creation.");<a name="line.880"></a>
-<span class="sourceLineNo">881</span>        } catch (NoSuchMethodException e) {<a name="line.881"></a>
-<span class="sourceLineNo">882</span>          LOG.debug("Could not find method on builder; will use old DFS API for file creation {}",<a name="line.882"></a>
-<span class="sourceLineNo">883</span>              e.getMessage());<a name="line.883"></a>
-<span class="sourceLineNo">884</span>        }<a name="line.884"></a>
-<span class="sourceLineNo">885</span>      }<a name="line.885"></a>
-<span class="sourceLineNo">886</span>    }<a name="line.886"></a>
-<span class="sourceLineNo">887</span><a name="line.887"></a>
-<span class="sourceLineNo">888</span>    /**<a name="line.888"></a>
-<span class="sourceLineNo">889</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.889"></a>
-<span class="sourceLineNo">890</span>     * replication enabled.<a name="line.890"></a>
-<span class="sourceLineNo">891</span>     */<a name="line.891"></a>
-<span class="sourceLineNo">892</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable,<a name="line.892"></a>
-<span class="sourceLineNo">893</span>        int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.893"></a>
-<span class="sourceLineNo">894</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.894"></a>
-<span class="sourceLineNo">895</span>        try {<a name="line.895"></a>
-<span class="sourceLineNo">896</span>          Object builder;<a name="line.896"></a>
-<span class="sourceLineNo">897</span><a name="line.897"></a>
-<span class="sourceLineNo">898</span>          builder = createMethod.invoke(fs, path);<a name="line.898"></a>
-<span class="sourceLineNo">899</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.899"></a>
-<span class="sourceLineNo">900</span>          builder = bufferSizeMethod.invoke(builder, bufferSize);<a name="line.900"></a>
-<span class="sourceLineNo">901</span>          builder = blockSizeMethod.invoke(builder, blockSize);<a name="line.901"></a>
-<span class="sourceLineNo">902</span>          if (isRecursive) {<a name="line.902"></a>
-<span class="sourceLineNo">903</span>            builder = recursiveMethod.invoke(builder);<a name="line.903"></a>
-<span class="sourceLineNo">904</span>          }<a name="line.904"></a>
-<span class="sourceLineNo">905</span>          builder = replicateMethod.invoke(builder);<a name="line.905"></a>
-<span class="sourceLineNo">906</span>          builder = replicationMethod.invoke(builder, replication);<a name="line.906"></a>
-<span class="sourceLineNo">907</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.907"></a>
-<span class="sourceLineNo">908</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.908"></a>
-<span class="sourceLineNo">909</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.909"></a>
-<span class="sourceLineNo">910</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.910"></a>
-<span class="sourceLineNo">911</span>        }<a name="line.911"></a>
-<span class="sourceLineNo">912</span>      }<a name="line.912"></a>
-<span class="sourceLineNo">913</span><a name="line.913"></a>
-<span class="sourceLineNo">914</span>      if (isRecursive) {<a name="line.914"></a>
-<span class="sourceLineNo">915</span>        return fs.create(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.915"></a>
-<span class="sourceLineNo">916</span>      }<a name="line.916"></a>
-<span class="sourceLineNo">917</span>      return fs.createNonRecursive(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.917"></a>
+<span class="sourceLineNo">852</span>          builder = createMethod.invoke(fs, path);<a name="line.852"></a>
+<span class="sourceLineNo">853</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.853"></a>
+<span class="sourceLineNo">854</span>          builder = replicateMethod.invoke(builder);<a name="line.854"></a>
+<span class="sourceLineNo">855</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.855"></a>
+<span class="sourceLineNo">856</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.856"></a>
+<span class="sourceLineNo">857</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.857"></a>
+<span class="sourceLineNo">858</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.858"></a>
+<span class="sourceLineNo">859</span>        }<a name="line.859"></a>
+<span class="sourceLineNo">860</span>      }<a name="line.860"></a>
+<span class="sourceLineNo">861</span><a name="line.861"></a>
+<span class="sourceLineNo">862</span>      return fs.create(path, overwritable);<a name="line.862"></a>
+<span class="sourceLineNo">863</span>    }<a name="line.863"></a>
+<span class="sourceLineNo">864</span>  }<a name="line.864"></a>
+<span class="sourceLineNo">865</span><a name="line.865"></a>
+<span class="sourceLineNo">866</span>  /**<a name="line.866"></a>
+<span class="sourceLineNo">867</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.867"></a>
+<span class="sourceLineNo">868</span>   * replication enabled.<a name="line.868"></a>
+<span class="sourceLineNo">869</span>   * &lt;p&gt;<a name="line.869"></a>
+<span class="sourceLineNo">870</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.870"></a>
+<span class="sourceLineNo">871</span>   */<a name="line.871"></a>
+<span class="sourceLineNo">872</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable)<a name="line.872"></a>
+<span class="sourceLineNo">873</span>      throws IOException {<a name="line.873"></a>
+<span class="sourceLineNo">874</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable);<a name="line.874"></a>
+<span class="sourceLineNo">875</span>  }<a name="line.875"></a>
+<span class="sourceLineNo">876</span><a name="line.876"></a>
+<span class="sourceLineNo">877</span>  /**<a name="line.877"></a>
+<span class="sourceLineNo">878</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.878"></a>
+<span class="sourceLineNo">879</span>   * replication enabled.<a name="line.879"></a>
+<span class="sourceLineNo">880</span>   * &lt;p&gt;<a name="line.880"></a>
+<span class="sourceLineNo">881</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.881"></a>
+<span class="sourceLineNo">882</span>   */<a name="line.882"></a>
+<span class="sourceLineNo">883</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable,<a name="line.883"></a>
+<span class="sourceLineNo">884</span>      int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.884"></a>
+<span class="sourceLineNo">885</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable, bufferSize, replication,<a name="line.885"></a>
+<span class="sourceLineNo">886</span>        blockSize, isRecursive);<a name="line.886"></a>
+<span class="sourceLineNo">887</span>  }<a name="line.887"></a>
+<span class="sourceLineNo">888</span><a name="line.888"></a>
+<span class="sourceLineNo">889</span>  // Holder singleton idiom. JVM spec ensures this will be run at most once per Classloader, and<a name="line.889"></a>
+<span class="sourceLineNo">890</span>  // not until we attempt to reference it.<a name="line.890"></a>
+<span class="sourceLineNo">891</span>  private static class StreamCapabilities {<a name="line.891"></a>
+<span class="sourceLineNo">892</span>    public static final boolean PRESENT;<a name="line.892"></a>
+<span class="sourceLineNo">893</span>    public static final Class&lt;?&gt; CLASS;<a name="line.893"></a>
+<span class="sourceLineNo">894</span>    public static final Method METHOD;<a name="line.894"></a>
+<span class="sourceLineNo">895</span>    static {<a name="line.895"></a>
+<span class="sourceLineNo">896</span>      boolean tmp = false;<a name="line.896"></a>
+<span class="sourceLineNo">897</span>      Class&lt;?&gt; clazz = null;<a name="line.897"></a>
+<span class="sourceLineNo">898</span>      Method method = null;<a name="line.898"></a>
+<span class="sourceLineNo">899</span>      try {<a name="line.899"></a>
+<span class="sourceLineNo">900</span>        clazz = Class.forName("org.apache.hadoop.fs.StreamCapabilities");<a name="line.900"></a>
+<span class="sourceLineNo">901</span>        method = clazz.getMethod("hasCapability", String.class);<a name="line.901"></a>
+<span class="sourceLineNo">902</span>        tmp = true;<a name="line.902"></a>
+<span class="sourceLineNo">903</span>      } catch(ClassNotFoundException|NoSuchMethodException|SecurityException exception) {<a name="line.903"></a>
+<span class="sourceLineNo">904</span>        LOG.warn("Your Hadoop installation does not include the StreamCapabilities class from " +<a name="line.904"></a>
+<span class="sourceLineNo">905</span>                 "HDFS-11644, so we will skip checking if any FSDataOutputStreams actually " +<a name="line.905"></a>
+<span class="sourceLineNo">906</span>                 "support hflush/hsync. If you are running on top of HDFS this probably just " +<a name="line.906"></a>
+<span class="sourceLineNo">907</span>                 "means you have an older version and this can be ignored. If you are running on " +<a name="line.907"></a>
+<span class="sourceLineNo">908</span>                 "top of an alternate FileSystem implementation you should manually verify that " +<a name="line.908"></a>
+<span class="sourceLineNo">909</span>                 "hflush and hsync are implemented; otherwise you risk data loss and hard to " +<a name="line.909"></a>
+<span class="sourceLineNo">910</span>                 "diagnose errors when our assumptions are violated.");<a name="line.910"></a>
+<span class="sourceLineNo">911</span>        LOG.debug("The first request to check for StreamCapabilities came from this stacktrace.",<a name="line.911"></a>
+<span class="sourceLineNo">912</span>            exception);<a name="line.912"></a>
+<span class="sourceLineNo">913</span>      } finally {<a name="line.913"></a>
+<span class="sourceLineNo">914</span>        PRESENT = tmp;<a name="line.914"></a>
+<span class="sourceLineNo">915</span>        CLASS = clazz;<a name="line.915"></a>
+<span class="sourceLineNo">916</span>        METHOD = method;<a name="line.916"></a>
+<span class="sourceLineNo">917</span>      }<a name="line.917"></a>
 <span class="sourceLineNo">918</span>    }<a name="line.918"></a>
-<span class="sourceLineNo">919</span><a name="line.919"></a>
-<span class="sourceLineNo">920</span>    /**<a name="line.920"></a>
-<span class="sourceLineNo">921</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.921"></a>
-<span class="sourceLineNo">922</span>     * replication enabled.<a name="line.922"></a>
-<span class="sourceLineNo">923</span>     */<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable)<a name="line.924"></a>
-<span class="sourceLineNo">925</span>        throws IOException {<a name="line.925"></a>
-<span class="sourceLineNo">926</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.926"></a>
-<span class="sourceLineNo">927</span>        try {<a name="line.927"></a>
-<span class="sourceLineNo">928</span>          Object builder;<a name="line.928"></a>
-<span class="sourceLineNo">929</span><a name="line.929"></a>
-<span class="sourceLineNo">930</span>          builder = createMethod.invoke(fs, path);<a name="line.930"></a>
-<span class="sourceLineNo">931</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.931"></a>
-<span class="sourceLineNo">932</span>          builder = replicateMethod.invoke(builder);<a name="line.932"></a>
-<span class="sourceLineNo">933</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.933"></a>
-<span class="sourceLineNo">934</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.934"></a>
-<span class="sourceLineNo">935</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.935"></a>
-<span class="sourceLineNo">936</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.936"></a>
-<span class="sourceLineNo">937</span>        }<a name="line.937"></a>
-<span class="sourceLineNo">938</span>      }<a name="line.938"></a>
-<span class="sourceLineNo">939</span><a name="line.939"></a>
-<span class="sourceLineNo">940</span>      return fs.create(path, overwritable);<a name="line.940"></a>
-<span class="sourceLineNo">941</span>    }<a name="line.941"></a>
-<span class="sourceLineNo">942</span>  }<a name="line.942"></a>
-<span class="sourceLineNo">943</span><a name="line.943"></a>
-<span class="sourceLineNo">944</span>  /**<a name="line.944"></a>
-<span class="sourceLineNo">945</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.945"></a>
-<span class="sourceLineNo">946</span>   * replication enabled.<a name="line.946"></a>
-<span class="sourceLineNo">947</span>   * &lt;p&gt;<a name="line.947"></a>
-<span class="sourceLineNo">948</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.948"></a>
-<span class="sourceLineNo">949</span>   */<a name="line.949"></a>
-<span class="sourceLineNo">950</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable)<a name="line.950"></a>
-<span class="sourceLineNo">951</span>      throws IOException {<a name="line.951"></a>
-<span class="sourceLineNo">952</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable);<a name="line.952"></a>
-<span class="sourceLineNo">953</span>  }<a name="line.953"></a>
-<span class="sourceLineNo">954</span><a name="line.954"></a>
-<span class="sourceLineNo">955</span>  /**<a name="line.955"></a>
-<span class="sourceLineNo">956</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.956"></a>
-<span class="sourceLineNo">957</span>   * replication enabled.<a name="line.957"></a>
-<span class="sourceLineNo">958</span>   * &lt;p&gt;<a name="line.958"></a>
-<span class="sourceLineNo">959</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.959"></a>
-<span class="sourceLineNo">960</span>   */<a name="line.960"></a>
-<span class="sourceLineNo">961</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable,<a name="line.961"></a>
-<span class="sourceLineNo">962</span>      int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.962"></a>
-<span class="sourceLineNo">963</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable, bufferSize, replication,<a name="line.963"></a>
-<span class="sourceLineNo">964</span>        blockSize, isRecursive);<a name="line.964"></a>
-<span class="sourceLineNo">965</span>  }<a name="line.965"></a>
-<span class="sourceLineNo">966</span><a name="line.966"></a>
-<span class="sourceLineNo">967</span>  // Holder singleton idiom. JVM spec ensures this will be run at most once per Classloader, and<a name="line.967"></a>
-<span class="sourceLineNo">968</span>  // not until we attempt to reference it.<a name="line.968"></a>
-<span class="sourceLineNo">969</span>  private static class StreamCapabilities {<a name="line.969"></a>
-<span class="sourceLineNo">970</span>    public static final boolean PRESENT;<a name="line.970"></a>
-<span class="sourceLineNo">971</span>    public static final Class&lt;?&gt; CLASS;<a name="line.971"></a>
-<span class="sourceLineNo">972</span>    public static final Method METHOD;<a name="line.972"></a>
-<span class="sourceLineNo">973</span>    static {<a name="line.973"></a>
-<span class="sourceLineNo">974</span>      boolean tmp = false;<a name="line.974"></a>
-<span class="sourceLineNo">975</span>      Class&lt;?&gt; clazz = null;<a name="line.975"></a>
-<span class="sourceLineNo">976</span>      Method method = null;<a name="line.976"></a>
-<span class="sourceLineNo">977</span>      try {<a name="line.977"></a>
-<span class="sourceLineNo">978</span>        clazz = Class.forName("org.apache.hadoop.fs.StreamCapabilities");<a name="line.978"></a>
-<span class="sourceLineNo">979</span>        method = clazz.getMethod("hasCapability", String.class);<a name="line.979"></a>
-<span class="sourceLineNo">980</span>        tmp = true;<a name="line.980"></a>
-<span class="sourceLineNo">981</span>      } catch(ClassNotFoundException|NoSuchMethodException|SecurityException exception) {<a name="line.981"></a>
-<span class="sourceLineNo">982</span>        LOG.warn("Your Hadoop installation does not include the StreamCapabilities class from " +<a name="line.982"></a>
-<span class="sourceLineNo">983</span>                 "HDFS-11644, so we will skip checking if any FSDataOutputStreams actually " +<a name="line.983"></a>
-<span class="sourceLineNo">984</span>                 "support hflush/hsync. If you are running on top of HDFS this probably just " +<a name="line.984"></a>
-<span class="sourceLineNo">985</span>                 "means you have an older version and this can be ignored. If you are running on " +<a name="line.985"></a>
-<span class="sourceLineNo">986</span>                 "top of an alternate FileSystem implementation you should manually verify that " +<a name="line.986"></a>
-<span class="sourceLineNo">987</span>                 "hflush and hsync are implemented; otherwise you risk data loss and hard to " +<a name="line.987"></a>
-<span class="sourceLineNo">988</span>                 "diagnose errors when our assumptions are violated.");<a name="line.988"></a>
-<span class="sourceLineNo">989</span>        LOG.debug("The first request to check for StreamCapabilities came from this stacktrace.",<a name="line.989"></a>
-<span class="sourceLineNo">990</span>            exception);<a name="line.990"></a>
-<span class="sourceLineNo">991</span>      } finally {<a name="line.991"></a>
-<span class="sourceLineNo">992</span>        PRESENT = tmp;<a name="line.992"></a>
-<span class="sourceLineNo">993</span>        CLASS = clazz;<a name="line.993"></a>
-<span class="sourceLineNo">994</span>        METHOD = method;<a name="line.994"></a>
-<span class="sourceLineNo">995</span>      }<a name="line.995"></a>
-<span class="sourceLineNo">996</span>    }<a name="line.996"></a>
-<span class="sourceLineNo">997</span>  }<a name="line.997"></a>
-<span class="sourceLineNo">998</span><a name="line.998"></a>
-<span class="sourceLineNo">999</span>  /**<a name="line.999"></a>
-<span class="sourceLineNo">1000</span>   * If our FileSystem version includes the StreamCapabilities class, check if the given stream has<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>   * a particular capability.<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>   * @param stream capabilities are per-stream instance, so check this one specifically. must not be<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>   *          null<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>   * @param capability what to look for, per Hadoop Common's FileSystem docs<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>   * @return true if there are no StreamCapabilities. false if there are, but this stream doesn't<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>   *         implement it. return result of asking the stream otherwise.<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>   * @throws NullPointerException if {@code stream} is {@code null}<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>   */<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>  public static boolean hasCapability(FSDataOutputStream stream, String capability) {<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>    // be consistent whether or not StreamCapabilities is present<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>    Objects.requireNonNull(stream, "stream cannot be null");<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>    // If o.a.h.fs.StreamCapabilities doesn't exist, assume everyone does everything<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>    // otherwise old versions of Hadoop will break.<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>    boolean result = true;<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>    if (StreamCapabilities.PRESENT) {<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>      // if StreamCapabilities is present, but the stream doesn't implement it<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>      // or we run into a problem invoking the method,<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>      // we treat that as equivalent to not declaring anything<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>      result = false;<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>      if (StreamCapabilities.CLASS.isAssignableFrom(stream.getClass())) {<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>        try {<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>          result = ((Boolean)StreamCapabilities.METHOD.invoke(stream, capability)).booleanValue();<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>            exception) {<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>          LOG.warn("Your Hadoop installation's StreamCapabilities implementation doesn't match " +<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>              "our understanding of how it's supposed to work. Please file a JIRA and include " +<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>              "the following stack trace. In the mean time we're interpreting this behavior " +<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span>              "difference as a lack of capability support, which will probably cause a failure.",<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>              exception);<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>        }<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span>      }<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>    }<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>    return result;<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>  }<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span><a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>  /**<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>   * Helper exception for those cases where the place where we need to check a stream capability<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>   * is not where we have the needed context to explain the impact and mitigation for a lack.<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>   */<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>  public static class StreamLacksCapabilityException extends Exception {<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>    public StreamLacksCapabilityException(String message, Throwable cause) {<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>      super(message, cause);<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>    }<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>    public StreamLacksCapabilityException(String message) {<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>      super(message);<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>    }<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>  }<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>}<a name="line.1048"></a>
+<span class="sourceLineNo">919</span>  }<a name="line.919"></a>
+<span class="sourceLineNo">920</span><a name="line.920"></a>
+<span class="sourceLineNo">921</span>  /**<a name="line.921"></a>
+<span class="sourceLineNo">922</span>   * If our FileSystem version includes the StreamCapabilities class, check if the given stream has<a name="line.922"></a>
+<span class="sourceLineNo">923</span>   * a particular capability.<a name="line.923"></a>
+<span class="sourceLineNo">924</span>   * @param stream capabilities are per-stream instance, so check this one specifically. must not be<a name="line.924"></a>
+<span class="sourceLineNo">925</span>   *          null<a name="line.925"></a>
+<span class="sourceLineNo">926</span>   * @param capability what to look for, per Hadoop Common's FileSystem docs<a name="line.926"></a>
+<span class="sourceLineNo">927</span>   * @return true if there are no StreamCapabilities. false if there are, but this stream doesn't<a name="line.927"></a>
+<span class="sourceLineNo">928</span>   *         implement it. return result of asking the stream otherwise.<a name="line.928"></a>
+<span class="sourceLineNo">929</span>   * @throws NullPointerException if {@code stream} is {@code null}<a name="line.929"></a>
+<span class="sourceLineNo">930</span>   */<a name="line.930"></a>
+<span class="sourceLineNo">931</span>  public static boolean hasCapability(FSDataOutputStream stream, String capability) {<a name="line.931"></a>
+<span class="sourceLineNo">932</span>    // be consistent whether or not StreamCapabilities is present<a name="line.932"></a>
+<span class="sourceLineNo">933</span>    Objects.requireNonNull(stream, "stream cannot be null");<a name="line.933"></a>
+<span class="sourceLineNo">934</span>    // If o.a.h.fs.StreamCapabilities doesn't exist, assume everyone does everything<a name="line.934"></a>
+<span class="sourceLineNo">935</span>    // otherwise old versions of Hadoop will break.<a name="line.935"></a>
+<span class="sourceLineNo">936</span>    boolean result = true;<a name="line.936"></a>
+<span class="sourceLineNo">937</span>    if (StreamCapabilities.PRESENT) {<a name="line.937"></a>
+<span class="sourceLineNo">938</span>      // if StreamCapabilities is present, but the stream doesn't implement it<a name="line.938"></a>
+<span class="sourceLineNo">939</span>      // or we run into a problem invoking the method,<a name="line.939"></a>
+<span class="sourceLineNo">940</span>      // we treat that as equivalent to not declaring anything<a name="line.940"></a>
+<span class="sourceLineNo">941</span>      result = false;<a name="line.941"></a>
+<span class="sourceLineNo">942</span>      if (StreamCapabilities.CLASS.isAssignableFrom(stream.getClass())) {<a name="line.942"></a>
+<span class="sourceLineNo">943</span>        try {<a name="line.943"></a>
+<span class="sourceLineNo">944</span>          result = ((Boolean)StreamCapabilities.METHOD.invoke(stream, capability)).booleanValue();<a name="line.944"></a>
+<span class="sourceLineNo">945</span>        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException<a name="line.945"></a>
+<span class="sourceLineNo">946</span>            exception) {<a name="line.946"></a>
+<span class="sourceLineNo">947</span>          LOG.warn("Your Hadoop installation's StreamCapabilities implementation doesn't match " +<a name="line.947"></a>
+<span class="sourceLineNo">948</span>              "our understanding of how it's supposed to work. Please file a JIRA and include " +<a name="line.948"></a>
+<span class="sourceLineNo">949</span>              "the following stack trace. In the mean time we're interpreting this behavior " +<a name="line.949"></a>
+<span class="sourceLineNo">950</span>              "difference as a lack of capability support, which will probably cause a failure.",<a name="line.950"></a>
+<span class="sourceLineNo">951</span>              exception);<a name="line.951"></a>
+<span class="sourceLineNo">952</span>        }<a name="line.952"></a>
+<span class="sourceLineNo">953</span>      }<a name="line.953"></a>
+<span class="sourceLineNo">954</span>    }<a name="line.954"></a>
+<span class="sourceLineNo">955</span>    return result;<a name="line.955"></a>
+<span class="sourceLineNo">956</span>  }<a name="line.956"></a>
+<span class="sourceLineNo">957</span><a name="line.957"></a>
+<span class="sourceLineNo">958</span>  /**<a name="line.958"></a>
+<span class="sourceLineNo">959</span>   * Helper exception for those cases where the place where we need to check a stream capability<a name="line.959"></a>
+<span class="sourceLineNo">960</span>   * is not where we have the needed context to explain the impact and mitigation for a lack.<a name="line.960"></a>
+<span class="sourceLineNo">961</span>   */<a name="line.961"></a>
+<span class="sourceLineNo">962</span>  public static class StreamLacksCapabilityException extends Exception {<a name="line.962"></a>
+<span class="sourceLineNo">963</span>    public StreamLacksCapabilityException(String message, Throwable cause) {<a name="line.963"></a>
+<span class="sourceLineNo">964</span>      super(message, cause);<a name="line.964"></a>
+<span class="sourceLineNo">965</span>    }<a name="line.965"></a>
+<span class="sourceLineNo">966</span>    public StreamLacksCapabilityException(String message) {<a name="line.966"></a>
+<span class="sourceLineNo">967</span>      super(message);<a name="line.967"></a>
+<span class="sourceLineNo">968</span>    }<a name="line.968"></a>
+<span class="sourceLineNo">969</span>  }<a name="line.969"></a>
+<span class="sourceLineNo">970</span>}<a name="line.970"></a>
 
 
 
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html b/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html
index a739df0..fb9defa 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamCapabilities.html
@@ -157,903 +157,825 @@
 <span class="sourceLineNo">149</span>   * Return the number of bytes that large input files should be optimally<a name="line.149"></a>
 <span class="sourceLineNo">150</span>   * be split into to minimize i/o time.<a name="line.150"></a>
 <span class="sourceLineNo">151</span>   *<a name="line.151"></a>
-<span class="sourceLineNo">152</span>   * use reflection to search for getDefaultBlockSize(Path f)<a name="line.152"></a>
-<span class="sourceLineNo">153</span>   * if the method doesn't exist, fall back to using getDefaultBlockSize()<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   *<a name="line.154"></a>
-<span class="sourceLineNo">155</span>   * @param fs filesystem object<a name="line.155"></a>
-<span class="sourceLineNo">156</span>   * @return the default block size for the path's filesystem<a name="line.156"></a>
-<span class="sourceLineNo">157</span>   * @throws IOException e<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   */<a name="line.158"></a>
-<span class="sourceLineNo">159</span>  public static long getDefaultBlockSize(final FileSystem fs, final Path path) throws IOException {<a name="line.159"></a>
-<span class="sourceLineNo">160</span>    Method m = null;<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    Class&lt;? extends FileSystem&gt; cls = fs.getClass();<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    try {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>      m = cls.getMethod("getDefaultBlockSize", Path.class);<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    } catch (NoSuchMethodException e) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>      LOG.info("FileSystem doesn't support getDefaultBlockSize");<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    } catch (SecurityException e) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>      LOG.info("Doesn't have access to getDefaultBlockSize on FileSystems", e);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      m = null; // could happen on setAccessible()<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    }<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    if (m == null) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      return fs.getDefaultBlockSize(path);<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    } else {<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      try {<a name="line.173"></a>
-<span class="sourceLineNo">174</span>        Object ret = m.invoke(fs, path);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        return ((Long)ret).longValue();<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      } catch (Exception e) {<a name="line.176"></a>
-<span class="sourceLineNo">177</span>        throw new IOException(e);<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      }<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    }<a name="line.179"></a>
-<span class="sourceLineNo">180</span>  }<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>  /*<a name="line.182"></a>
-<span class="sourceLineNo">183</span>   * Get the default replication.<a name="line.183"></a>
-<span class="sourceLineNo">184</span>   *<a name="line.184"></a>
-<span class="sourceLineNo">185</span>   * use reflection to search for getDefaultReplication(Path f)<a name="line.185"></a>
-<span class="sourceLineNo">186</span>   * if the method doesn't exist, fall back to using getDefaultReplication()<a name="line.186"></a>
-<span class="sourceLineNo">187</span>   *<a name="line.187"></a>
-<span class="sourceLineNo">188</span>   * @param fs filesystem object<a name="line.188"></a>
-<span class="sourceLineNo">189</span>   * @param f path of file<a name="line.189"></a>
-<span class="sourceLineNo">190</span>   * @return default replication for the path's filesystem<a name="line.190"></a>
-<span class="sourceLineNo">191</span>   * @throws IOException e<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   */<a name="line.192"></a>
-<span class="sourceLineNo">193</span>  public static short getDefaultReplication(final FileSystem fs, final Path path)<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      throws IOException {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    Method m = null;<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    Class&lt;? extends FileSystem&gt; cls = fs.getClass();<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    try {<a name="line.197"></a>
-<span class="sourceLineNo">198</span>      m = cls.getMethod("getDefaultReplication", Path.class);<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    } catch (NoSuchMethodException e) {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>      LOG.info("FileSystem doesn't support getDefaultReplication");<a name="line.200"></a>
-<span class="sourceLineNo">201</span>    } catch (SecurityException e) {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>      LOG.info("Doesn't have access to getDefaultReplication on FileSystems", e);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      m = null; // could happen on setAccessible()<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    }<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    if (m == null) {<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      return fs.getDefaultReplication(path);<a name="line.206"></a>
-<span class="sourceLineNo">207</span>    } else {<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      try {<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        Object ret = m.invoke(fs, path);<a name="line.209"></a>
-<span class="sourceLineNo">210</span>        return ((Number)ret).shortValue();<a name="line.210"></a>
-<span class="sourceLineNo">211</span>      } catch (Exception e) {<a name="line.211"></a>
-<span class="sourceLineNo">212</span>        throw new IOException(e);<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      }<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>  }<a name="line.215"></a>
-<span class="sourceLineNo">216</span><a name="line.216"></a>
-<span class="sourceLineNo">217</span>  /**<a name="line.217"></a>
-<span class="sourceLineNo">218</span>   * Returns the default buffer size to use during writes.<a name="line.218"></a>
-<span class="sourceLineNo">219</span>   *<a name="line.219"></a>
-<span class="sourceLineNo">220</span>   * The size of the buffer should probably be a multiple of hardware<a name="line.220"></a>
-<span class="sourceLineNo">221</span>   * page size (4096 on Intel x86), and it determines how much data is<a name="line.221"></a>
-<span class="sourceLineNo">222</span>   * buffered during read and write operations.<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   *<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   * @param fs filesystem object<a name="line.224"></a>
-<span class="sourceLineNo">225</span>   * @return default buffer size to use during writes<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>  public static int getDefaultBufferSize(final FileSystem fs) {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    return fs.getConf().getInt("io.file.buffer.size", 4096);<a name="line.228"></a>
-<span class="sourceLineNo">229</span>  }<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>  /**<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   * Create the specified file on the filesystem. By default, this will:<a name="line.232"></a>
-<span class="sourceLineNo">233</span>   * &lt;ol&gt;<a name="line.233"></a>
-<span class="sourceLineNo">234</span>   * &lt;li&gt;apply the umask in the configuration (if it is enabled)&lt;/li&gt;<a name="line.234"></a>
-<span class="sourceLineNo">235</span>   * &lt;li&gt;use the fs configured buffer size (or 4096 if not set)&lt;/li&gt;<a name="line.235"></a>
-<span class="sourceLineNo">236</span>   * &lt;li&gt;use the default replication&lt;/li&gt;<a name="line.236"></a>
-<span class="sourceLineNo">237</span>   * &lt;li&gt;use the default block size&lt;/li&gt;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>   * &lt;li&gt;not track progress&lt;/li&gt;<a name="line.238"></a>
-<span class="sourceLineNo">239</span>   * &lt;/ol&gt;<a name="line.239"></a>
-<span class="sourceLineNo">240</span>   *<a name="line.240"></a>
-<span class="sourceLineNo">241</span>   * @param fs {@link FileSystem} on which to write the file<a name="line.241"></a>
-<span class="sourceLineNo">242</span>   * @param path {@link Path} to the file to write<a name="line.242"></a>
-<span class="sourceLineNo">243</span>   * @param perm intial permissions<a name="line.243"></a>
-<span class="sourceLineNo">244</span>   * @param overwrite Whether or not the created file should be overwritten.<a name="line.244"></a>
-<span class="sourceLineNo">245</span>   * @return output stream to the created file<a name="line.245"></a>
-<span class="sourceLineNo">246</span>   * @throws IOException if the file cannot be created<a name="line.246"></a>
-<span class="sourceLineNo">247</span>   */<a name="line.247"></a>
-<span class="sourceLineNo">248</span>  public static FSDataOutputStream create(FileSystem fs, Path path,<a name="line.248"></a>
-<span class="sourceLineNo">249</span>      FsPermission perm, boolean overwrite) throws IOException {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    if (LOG.isTraceEnabled()) {<a name="line.250"></a>
-<span class="sourceLineNo">251</span>      LOG.trace("Creating file={} with permission={}, overwrite={}", path, perm, overwrite);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    }<a name="line.252"></a>
-<span class="sourceLineNo">253</span>    return fs.create(path, perm, overwrite, getDefaultBufferSize(fs),<a name="line.253"></a>
-<span class="sourceLineNo">254</span>        getDefaultReplication(fs, path), getDefaultBlockSize(fs, path), null);<a name="line.254"></a>
-<span class="sourceLineNo">255</span>  }<a name="line.255"></a>
-<span class="sourceLineNo">256</span><a name="line.256"></a>
-<span class="sourceLineNo">257</span>  /**<a name="line.257"></a>
-<span class="sourceLineNo">258</span>   * Get the file permissions specified in the configuration, if they are<a name="line.258"></a>
-<span class="sourceLineNo">259</span>   * enabled.<a name="line.259"></a>
-<span class="sourceLineNo">260</span>   *<a name="line.260"></a>
-<span class="sourceLineNo">261</span>   * @param fs filesystem that the file will be created on.<a name="line.261"></a>
-<span class="sourceLineNo">262</span>   * @param conf configuration to read for determining if permissions are<a name="line.262"></a>
-<span class="sourceLineNo">263</span>   *          enabled and which to use<a name="line.263"></a>
-<span class="sourceLineNo">264</span>   * @param permssionConfKey property key in the configuration to use when<a name="line.264"></a>
-<span class="sourceLineNo">265</span>   *          finding the permission<a name="line.265"></a>
-<span class="sourceLineNo">266</span>   * @return the permission to use when creating a new file on the fs. If<a name="line.266"></a>
-<span class="sourceLineNo">267</span>   *         special permissions are not specified in the configuration, then<a name="line.267"></a>
-<span class="sourceLineNo">268</span>   *         the default permissions on the the fs will be returned.<a name="line.268"></a>
-<span class="sourceLineNo">269</span>   */<a name="line.269"></a>
-<span class="sourceLineNo">270</span>  public static FsPermission getFilePermissions(final FileSystem fs,<a name="line.270"></a>
-<span class="sourceLineNo">271</span>      final Configuration conf, final String permssionConfKey) {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    boolean enablePermissions = conf.getBoolean(<a name="line.272"></a>
-<span class="sourceLineNo">273</span>        HConstants.ENABLE_DATA_FILE_UMASK, false);<a name="line.273"></a>
-<span class="sourceLineNo">274</span><a name="line.274"></a>
-<span class="sourceLineNo">275</span>    if (enablePermissions) {<a name="line.275"></a>
-<span class="sourceLineNo">276</span>      try {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>        // make sure that we have a mask, if not, go default.<a name="line.278"></a>
-<span class="sourceLineNo">279</span>        String mask = conf.get(permssionConfKey);<a name="line.279"></a>
-<span class="sourceLineNo">280</span>        if (mask == null) {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>          return FsPermission.getFileDefault();<a name="line.281"></a>
-<span class="sourceLineNo">282</span>        }<a name="line.282"></a>
-<span class="sourceLineNo">283</span>        // appy the umask<a name="line.283"></a>
-<span class="sourceLineNo">284</span>        FsPermission umask = new FsPermission(mask);<a name="line.284"></a>
-<span class="sourceLineNo">285</span>        return perm.applyUMask(umask);<a name="line.285"></a>
-<span class="sourceLineNo">286</span>      } catch (IllegalArgumentException e) {<a name="line.286"></a>
-<span class="sourceLineNo">287</span>        LOG.warn(<a name="line.287"></a>
-<span class="sourceLineNo">288</span>            "Incorrect umask attempted to be created: "<a name="line.288"></a>
-<span class="sourceLineNo">289</span>                + conf.get(permssionConfKey)<a name="line.289"></a>
-<span class="sourceLineNo">290</span>                + ", using default file permissions.", e);<a name="line.290"></a>
-<span class="sourceLineNo">291</span>        return FsPermission.getFileDefault();<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      }<a name="line.292"></a>
-<span class="sourceLineNo">293</span>    }<a name="line.293"></a>
-<span class="sourceLineNo">294</span>    return FsPermission.getFileDefault();<a name="line.294"></a>
-<span class="sourceLineNo">295</span>  }<a name="line.295"></a>
-<span class="sourceLineNo">296</span><a name="line.296"></a>
-<span class="sourceLineNo">297</span>  /**<a name="line.297"></a>
-<span class="sourceLineNo">298</span>   * Verifies root directory path is a valid URI with a scheme<a name="line.298"></a>
-<span class="sourceLineNo">299</span>   *<a name="line.299"></a>
-<span class="sourceLineNo">300</span>   * @param root root directory path<a name="line.300"></a>
-<span class="sourceLineNo">301</span>   * @return Passed &lt;code&gt;root&lt;/code&gt; argument.<a name="line.301"></a>
-<span class="sourceLineNo">302</span>   * @throws IOException if not a valid URI with a scheme<a name="line.302"></a>
-<span class="sourceLineNo">303</span>   */<a name="line.303"></a>
-<span class="sourceLineNo">304</span>  public static Path validateRootPath(Path root) throws IOException {<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    try {<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      URI rootURI = new URI(root.toString());<a name="line.306"></a>
-<span class="sourceLineNo">307</span>      String scheme = rootURI.getScheme();<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      if (scheme == null) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>        throw new IOException("Root directory does not have a scheme");<a name="line.309"></a>
-<span class="sourceLineNo">310</span>      }<a name="line.310"></a>
-<span class="sourceLineNo">311</span>      return root;<a name="line.311"></a>
-<span class="sourceLineNo">312</span>    } catch (URISyntaxException e) {<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      throw new IOException("Root directory path is not a valid " +<a name="line.313"></a>
-<span class="sourceLineNo">314</span>        "URI -- check your " + HConstants.HBASE_DIR + " configuration", e);<a name="line.314"></a>
-<span class="sourceLineNo">315</span>    }<a name="line.315"></a>
-<span class="sourceLineNo">316</span>  }<a name="line.316"></a>
-<span class="sourceLineNo">317</span><a name="line.317"></a>
-<span class="sourceLineNo">318</span>  /**<a name="line.318"></a>
-<span class="sourceLineNo">319</span>   * Checks for the presence of the WAL log root path (using the provided conf object) in the given<a name="line.319"></a>
-<span class="sourceLineNo">320</span>   * path. If it exists, this method removes it and returns the String representation of remaining<a name="line.320"></a>
-<span class="sourceLineNo">321</span>   * relative path.<a name="line.321"></a>
-<span class="sourceLineNo">322</span>   * @param path must not be null<a name="line.322"></a>
-<span class="sourceLineNo">323</span>   * @param conf must not be null<a name="line.323"></a>
-<span class="sourceLineNo">324</span>   * @return String representation of the remaining relative path<a name="line.324"></a>
-<span class="sourceLineNo">325</span>   * @throws IOException from underlying filesystem<a name="line.325"></a>
-<span class="sourceLineNo">326</span>   */<a name="line.326"></a>
-<span class="sourceLineNo">327</span>  public static String removeWALRootPath(Path path, final Configuration conf) throws IOException {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    Path root = getWALRootDir(conf);<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    String pathStr = path.toString();<a name="line.329"></a>
-<span class="sourceLineNo">330</span>    // check that the path is absolute... it has the root path in it.<a name="line.330"></a>
-<span class="sourceLineNo">331</span>    if (!pathStr.startsWith(root.toString())) {<a name="line.331"></a>
-<span class="sourceLineNo">332</span>      return pathStr;<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    }<a name="line.333"></a>
-<span class="sourceLineNo">334</span>    // if not, return as it is.<a name="line.334"></a>
-<span class="sourceLineNo">335</span>    return pathStr.substring(root.toString().length() + 1);// remove the "/" too.<a name="line.335"></a>
-<span class="sourceLineNo">336</span>  }<a name="line.336"></a>
-<span class="sourceLineNo">337</span><a name="line.337"></a>
-<span class="sourceLineNo">338</span>  /**<a name="line.338"></a>
-<span class="sourceLineNo">339</span>   * Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This<a name="line.339"></a>
-<span class="sourceLineNo">340</span>   * method returns the 'path' component of a Path's URI: e.g. If a Path is<a name="line.340"></a>
-<span class="sourceLineNo">341</span>   * &lt;code&gt;hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;,<a name="line.341"></a>
-<span class="sourceLineNo">342</span>   * this method returns &lt;code&gt;/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;.<a name="line.342"></a>
-<span class="sourceLineNo">343</span>   * This method is useful if you want to print out a Path without qualifying<a name="line.343"></a>
-<span class="sourceLineNo">344</span>   * Filesystem instance.<a name="line.344"></a>
-<span class="sourceLineNo">345</span>   * @param p Filesystem Path whose 'path' component we are to return.<a name="line.345"></a>
-<span class="sourceLineNo">346</span>   * @return Path portion of the Filesystem<a name="line.346"></a>
-<span class="sourceLineNo">347</span>   */<a name="line.347"></a>
-<span class="sourceLineNo">348</span>  public static String getPath(Path p) {<a name="line.348"></a>
-<span class="sourceLineNo">349</span>    return p.toUri().getPath();<a name="line.349"></a>
-<span class="sourceLineNo">350</span>  }<a name="line.350"></a>
-<span class="sourceLineNo">351</span><a name="line.351"></a>
-<span class="sourceLineNo">352</span>  /**<a name="line.352"></a>
-<span class="sourceLineNo">353</span>   * @param c configuration<a name="line.353"></a>
-<span class="sourceLineNo">354</span>   * @return {@link Path} to hbase root directory from<a name="line.354"></a>
-<span class="sourceLineNo">355</span>   *     configuration as a qualified Path.<a name="line.355"></a>
-<span class="sourceLineNo">356</span>   * @throws IOException e<a name="line.356"></a>
-<span class="sourceLineNo">357</span>   */<a name="line.357"></a>
-<span class="sourceLineNo">358</span>  public static Path getRootDir(final Configuration c) throws IOException {<a name="line.358"></a>
-<span class="sourceLineNo">359</span>    Path p = new Path(c.get(HConstants.HBASE_DIR));<a name="line.359"></a>
-<span class="sourceLineNo">360</span>    FileSystem fs = p.getFileSystem(c);<a name="line.360"></a>
-<span class="sourceLineNo">361</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.361"></a>
-<span class="sourceLineNo">362</span>  }<a name="line.362"></a>
-<span class="sourceLineNo">363</span><a name="line.363"></a>
-<span class="sourceLineNo">364</span>  public static void setRootDir(final Configuration c, final Path root) {<a name="line.364"></a>
-<span class="sourceLineNo">365</span>    c.set(HConstants.HBASE_DIR, root.toString());<a name="line.365"></a>
-<span class="sourceLineNo">366</span>  }<a name="line.366"></a>
-<span class="sourceLineNo">367</span><a name="line.367"></a>
-<span class="sourceLineNo">368</span>  public static void setFsDefault(final Configuration c, final Path root) {<a name="line.368"></a>
-<span class="sourceLineNo">369</span>    c.set("fs.defaultFS", root.toString());    // for hadoop 0.21+<a name="line.369"></a>
-<span class="sourceLineNo">370</span>  }<a name="line.370"></a>
-<span class="sourceLineNo">371</span><a name="line.371"></a>
-<span class="sourceLineNo">372</span>  public static FileSystem getRootDirFileSystem(final Configuration c) throws IOException {<a name="line.372"></a>
-<span class="sourceLineNo">373</span>    Path p = getRootDir(c);<a name="line.373"></a>
-<span class="sourceLineNo">374</span>    return p.getFileSystem(c);<a name="line.374"></a>
-<span class="sourceLineNo">375</span>  }<a name="line.375"></a>
-<span class="sourceLineNo">376</span><a name="line.376"></a>
-<span class="sourceLineNo">377</span>  /**<a name="line.377"></a>
-<span class="sourceLineNo">378</span>   * @param c configuration<a name="line.378"></a>
-<span class="sourceLineNo">379</span>   * @return {@link Path} to hbase log root directory: e.g. {@value HBASE_WAL_DIR} from<a name="line.379"></a>
-<span class="sourceLineNo">380</span>   *     configuration as a qualified Path. Defaults to HBase root dir.<a name="line.380"></a>
-<span class="sourceLineNo">381</span>   * @throws IOException e<a name="line.381"></a>
-<span class="sourceLineNo">382</span>   */<a name="line.382"></a>
-<span class="sourceLineNo">383</span>  public static Path getWALRootDir(final Configuration c) throws IOException {<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    Path p = new Path(c.get(HBASE_WAL_DIR, c.get(HConstants.HBASE_DIR)));<a name="line.384"></a>
-<span class="sourceLineNo">385</span>    if (!isValidWALRootDir(p, c)) {<a name="line.385"></a>
-<span class="sourceLineNo">386</span>      return getRootDir(c);<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    }<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    FileSystem fs = p.getFileSystem(c);<a name="line.388"></a>
-<span class="sourceLineNo">389</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.389"></a>
-<span class="sourceLineNo">390</span>  }<a name="line.390"></a>
-<span class="sourceLineNo">391</span><a name="line.391"></a>
-<span class="sourceLineNo">392</span>  @VisibleForTesting<a name="line.392"></a>
-<span class="sourceLineNo">393</span>  public static void setWALRootDir(final Configuration c, final Path root) {<a name="line.393"></a>
-<span class="sourceLineNo">394</span>    c.set(HBASE_WAL_DIR, root.toString());<a name="line.394"></a>
-<span class="sourceLineNo">395</span>  }<a name="line.395"></a>
-<span class="sourceLineNo">396</span><a name="line.396"></a>
-<span class="sourceLineNo">397</span>  public static FileSystem getWALFileSystem(final Configuration c) throws IOException {<a name="line.397"></a>
-<span class="sourceLineNo">398</span>    Path p = getWALRootDir(c);<a name="line.398"></a>
-<span class="sourceLineNo">399</span>    FileSystem fs = p.getFileSystem(c);<a name="line.399"></a>
-<span class="sourceLineNo">400</span>    // hadoop-core does fs caching, so need to propogate this if set<a name="line.400"></a>
-<span class="sourceLineNo">401</span>    String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);<a name="line.401"></a>
-<span class="sourceLineNo">402</span>    if (enforceStreamCapability != null) {<a name="line.402"></a>
-<span class="sourceLineNo">403</span>      fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);<a name="line.403"></a>
-<span class="sourceLineNo">404</span>    }<a name="line.404"></a>
-<span class="sourceLineNo">405</span>    return fs;<a name="line.405"></a>
-<span class="sourceLineNo">406</span>  }<a name="line.406"></a>
-<span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>  private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {<a name="line.408"></a>
-<span class="sourceLineNo">409</span>    Path rootDir = getRootDir(c);<a name="line.409"></a>
-<span class="sourceLineNo">410</span>    FileSystem fs = walDir.getFileSystem(c);<a name="line.410"></a>
-<span class="sourceLineNo">411</span>    Path qualifiedWalDir = walDir.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.411"></a>
-<span class="sourceLineNo">412</span>    if (!qualifiedWalDir.equals(rootDir)) {<a name="line.412"></a>
-<span class="sourceLineNo">413</span>      if (qualifiedWalDir.toString().startsWith(rootDir.toString() + "/")) {<a name="line.413"></a>
-<span class="sourceLineNo">414</span>        throw new IllegalStateException("Illegal WAL directory specified. " +<a name="line.414"></a>
-<span class="sourceLineNo">415</span>            "WAL directories are not permitted to be under the root directory if set.");<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      }<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    }<a name="line.417"></a>
-<span class="sourceLineNo">418</span>    return true;<a name="line.418"></a>
-<span class="sourceLineNo">419</span>  }<a name="line.419"></a>
-<span class="sourceLineNo">420</span><a name="line.420"></a>
-<span class="sourceLineNo">421</span>  /**<a name="line.421"></a>
-<span class="sourceLineNo">422</span>   * Returns the WAL region directory based on the given table name and region name<a name="line.422"></a>
-<span class="sourceLineNo">423</span>   * @param conf configuration to determine WALRootDir<a name="line.423"></a>
-<span class="sourceLineNo">424</span>   * @param tableName Table that the region is under<a name="line.424"></a>
-<span class="sourceLineNo">425</span>   * @param encodedRegionName Region name used for creating the final region directory<a name="line.425"></a>
-<span class="sourceLineNo">426</span>   * @return the region directory used to store WALs under the WALRootDir<a name="line.426"></a>
-<span class="sourceLineNo">427</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.427"></a>
-<span class="sourceLineNo">428</span>   */<a name="line.428"></a>
-<span class="sourceLineNo">429</span>  public static Path getWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.429"></a>
-<span class="sourceLineNo">430</span>      final String encodedRegionName) throws IOException {<a name="line.430"></a>
-<span class="sourceLineNo">431</span>    return new Path(getWALTableDir(conf, tableName), encodedRegionName);<a name="line.431"></a>
-<span class="sourceLineNo">432</span>  }<a name="line.432"></a>
-<span class="sourceLineNo">433</span><a name="line.433"></a>
-<span class="sourceLineNo">434</span>  /**<a name="line.434"></a>
-<span class="sourceLineNo">435</span>   * Returns the Table directory under the WALRootDir for the specified table name<a name="line.435"></a>
-<span class="sourceLineNo">436</span>   * @param conf configuration used to get the WALRootDir<a name="line.436"></a>
-<span class="sourceLineNo">437</span>   * @param tableName Table to get the directory for<a name="line.437"></a>
-<span class="sourceLineNo">438</span>   * @return a path to the WAL table directory for the specified table<a name="line.438"></a>
-<span class="sourceLineNo">439</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.439"></a>
-<span class="sourceLineNo">440</span>   */<a name="line.440"></a>
-<span class="sourceLineNo">441</span>  public static Path getWALTableDir(final Configuration conf, final TableName tableName)<a name="line.441"></a>
-<span class="sourceLineNo">442</span>      throws IOException {<a name="line.442"></a>
-<span class="sourceLineNo">443</span>    Path baseDir = new Path(getWALRootDir(conf), HConstants.BASE_NAMESPACE_DIR);<a name="line.443"></a>
-<span class="sourceLineNo">444</span>    return new Path(new Path(baseDir, tableName.getNamespaceAsString()),<a name="line.444"></a>
-<span class="sourceLineNo">445</span>      tableName.getQualifierAsString());<a name="line.445"></a>
-<span class="sourceLineNo">446</span>  }<a name="line.446"></a>
-<span class="sourceLineNo">447</span><a name="line.447"></a>
-<span class="sourceLineNo">448</span>  /**<a name="line.448"></a>
-<span class="sourceLineNo">449</span>   * For backward compatibility with HBASE-20734, where we store recovered edits in a wrong<a name="line.449"></a>
-<span class="sourceLineNo">450</span>   * directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.<a name="line.450"></a>
-<span class="sourceLineNo">451</span>   * @deprecated For compatibility, will be removed in 4.0.0.<a name="line.451"></a>
-<span class="sourceLineNo">452</span>   */<a name="line.452"></a>
-<span class="sourceLineNo">453</span>  @Deprecated<a name="line.453"></a>
-<span class="sourceLineNo">454</span>  public static Path getWrongWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.454"></a>
-<span class="sourceLineNo">455</span>      final String encodedRegionName) throws IOException {<a name="line.455"></a>
-<span class="sourceLineNo">456</span>    Path wrongTableDir = new Path(new Path(getWALRootDir(conf), tableName.getNamespaceAsString()),<a name="line.456"></a>
-<span class="sourceLineNo">457</span>      tableName.getQualifierAsString());<a name="line.457"></a>
-<span class="sourceLineNo">458</span>    return new Path(wrongTableDir, encodedRegionName);<a name="line.458"></a>
-<span class="sourceLineNo">459</span>  }<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>  /**<a name="line.461"></a>
-<span class="sourceLineNo">462</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under<a name="line.462"></a>
-<span class="sourceLineNo">463</span>   * path rootdir<a name="line.463"></a>
+<span class="sourceLineNo">152</span>   * @param fs filesystem object<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   * @return the default block size for the path's filesystem<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   */<a name="line.154"></a>
+<span class="sourceLineNo">155</span>  public static long getDefaultBlockSize(final FileSystem fs, final Path path) {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    return fs.getDefaultBlockSize(path);<a name="line.156"></a>
+<span class="sourceLineNo">157</span>  }<a name="line.157"></a>
+<span class="sourceLineNo">158</span><a name="line.158"></a>
+<span class="sourceLineNo">159</span>  /*<a name="line.159"></a>
+<span class="sourceLineNo">160</span>   * Get the default replication.<a name="line.160"></a>
+<span class="sourceLineNo">161</span>   *<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   * @param fs filesystem object<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   * @param f path of file<a name="line.163"></a>
+<span class="sourceLineNo">164</span>   * @return default replication for the path's filesystem<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   */<a name="line.165"></a>
+<span class="sourceLineNo">166</span>  public static short getDefaultReplication(final FileSystem fs, final Path path) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    return fs.getDefaultReplication(path);<a name="line.167"></a>
+<span class="sourceLineNo">168</span>  }<a name="line.168"></a>
+<span class="sourceLineNo">169</span><a name="line.169"></a>
+<span class="sourceLineNo">170</span>  /**<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   * Returns the default buffer size to use during writes.<a name="line.171"></a>
+<span class="sourceLineNo">172</span>   *<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   * The size of the buffer should probably be a multiple of hardware<a name="line.173"></a>
+<span class="sourceLineNo">174</span>   * page size (4096 on Intel x86), and it determines how much data is<a name="line.174"></a>
+<span class="sourceLineNo">175</span>   * buffered during read and write operations.<a name="line.175"></a>
+<span class="sourceLineNo">176</span>   *<a name="line.176"></a>
+<span class="sourceLineNo">177</span>   * @param fs filesystem object<a name="line.177"></a>
+<span class="sourceLineNo">178</span>   * @return default buffer size to use during writes<a name="line.178"></a>
+<span class="sourceLineNo">179</span>   */<a name="line.179"></a>
+<span class="sourceLineNo">180</span>  public static int getDefaultBufferSize(final FileSystem fs) {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    return fs.getConf().getInt("io.file.buffer.size", 4096);<a name="line.181"></a>
+<span class="sourceLineNo">182</span>  }<a name="line.182"></a>
+<span class="sourceLineNo">183</span><a name="line.183"></a>
+<span class="sourceLineNo">184</span>  /**<a name="line.184"></a>
+<span class="sourceLineNo">185</span>   * Create the specified file on the filesystem. By default, this will:<a name="line.185"></a>
+<span class="sourceLineNo">186</span>   * &lt;ol&gt;<a name="line.186"></a>
+<span class="sourceLineNo">187</span>   * &lt;li&gt;apply the umask in the configuration (if it is enabled)&lt;/li&gt;<a name="line.187"></a>
+<span class="sourceLineNo">188</span>   * &lt;li&gt;use the fs configured buffer size (or 4096 if not set)&lt;/li&gt;<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   * &lt;li&gt;use the default replication&lt;/li&gt;<a name="line.189"></a>
+<span class="sourceLineNo">190</span>   * &lt;li&gt;use the default block size&lt;/li&gt;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>   * &lt;li&gt;not track progress&lt;/li&gt;<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   * &lt;/ol&gt;<a name="line.192"></a>
+<span class="sourceLineNo">193</span>   *<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   * @param fs {@link FileSystem} on which to write the file<a name="line.194"></a>
+<span class="sourceLineNo">195</span>   * @param path {@link Path} to the file to write<a name="line.195"></a>
+<span class="sourceLineNo">196</span>   * @param perm intial permissions<a name="line.196"></a>
+<span class="sourceLineNo">197</span>   * @param overwrite Whether or not the created file should be overwritten.<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   * @return output stream to the created file<a name="line.198"></a>
+<span class="sourceLineNo">199</span>   * @throws IOException if the file cannot be created<a name="line.199"></a>
+<span class="sourceLineNo">200</span>   */<a name="line.200"></a>
+<span class="sourceLineNo">201</span>  public static FSDataOutputStream create(FileSystem fs, Path path,<a name="line.201"></a>
+<span class="sourceLineNo">202</span>      FsPermission perm, boolean overwrite) throws IOException {<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    if (LOG.isTraceEnabled()) {<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      LOG.trace("Creating file={} with permission={}, overwrite={}", path, perm, overwrite);<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    return fs.create(path, perm, overwrite, getDefaultBufferSize(fs),<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        getDefaultReplication(fs, path), getDefaultBlockSize(fs, path), null);<a name="line.207"></a>
+<span class="sourceLineNo">208</span>  }<a name="line.208"></a>
+<span class="sourceLineNo">209</span><a name="line.209"></a>
+<span class="sourceLineNo">210</span>  /**<a name="line.210"></a>
+<span class="sourceLineNo">211</span>   * Get the file permissions specified in the configuration, if they are<a name="line.211"></a>
+<span class="sourceLineNo">212</span>   * enabled.<a name="line.212"></a>
+<span class="sourceLineNo">213</span>   *<a name="line.213"></a>
+<span class="sourceLineNo">214</span>   * @param fs filesystem that the file will be created on.<a name="line.214"></a>
+<span class="sourceLineNo">215</span>   * @param conf configuration to read for determining if permissions are<a name="line.215"></a>
+<span class="sourceLineNo">216</span>   *          enabled and which to use<a name="line.216"></a>
+<span class="sourceLineNo">217</span>   * @param permssionConfKey property key in the configuration to use when<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   *          finding the permission<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   * @return the permission to use when creating a new file on the fs. If<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   *         special permissions are not specified in the configuration, then<a name="line.220"></a>
+<span class="sourceLineNo">221</span>   *         the default permissions on the the fs will be returned.<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   */<a name="line.222"></a>
+<span class="sourceLineNo">223</span>  public static FsPermission getFilePermissions(final FileSystem fs,<a name="line.223"></a>
+<span class="sourceLineNo">224</span>      final Configuration conf, final String permssionConfKey) {<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    boolean enablePermissions = conf.getBoolean(<a name="line.225"></a>
+<span class="sourceLineNo">226</span>        HConstants.ENABLE_DATA_FILE_UMASK, false);<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>    if (enablePermissions) {<a name="line.228"></a>
+<span class="sourceLineNo">229</span>      try {<a name="line.229"></a>
+<span class="sourceLineNo">230</span>        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>        // make sure that we have a mask, if not, go default.<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        String mask = conf.get(permssionConfKey);<a name="line.232"></a>
+<span class="sourceLineNo">233</span>        if (mask == null) {<a name="line.233"></a>
+<span class="sourceLineNo">234</span>          return FsPermission.getFileDefault();<a name="line.234"></a>
+<span class="sourceLineNo">235</span>        }<a name="line.235"></a>
+<span class="sourceLineNo">236</span>        // appy the umask<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        FsPermission umask = new FsPermission(mask);<a name="line.237"></a>
+<span class="sourceLineNo">238</span>        return perm.applyUMask(umask);<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      } catch (IllegalArgumentException e) {<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        LOG.warn(<a name="line.240"></a>
+<span class="sourceLineNo">241</span>            "Incorrect umask attempted to be created: "<a name="line.241"></a>
+<span class="sourceLineNo">242</span>                + conf.get(permssionConfKey)<a name="line.242"></a>
+<span class="sourceLineNo">243</span>                + ", using default file permissions.", e);<a name="line.243"></a>
+<span class="sourceLineNo">244</span>        return FsPermission.getFileDefault();<a name="line.244"></a>
+<span class="sourceLineNo">245</span>      }<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    }<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    return FsPermission.getFileDefault();<a name="line.247"></a>
+<span class="sourceLineNo">248</span>  }<a name="line.248"></a>
+<span class="sourceLineNo">249</span><a name="line.249"></a>
+<span class="sourceLineNo">250</span>  /**<a name="line.250"></a>
+<span class="sourceLineNo">251</span>   * Verifies root directory path is a valid URI with a scheme<a name="line.251"></a>
+<span class="sourceLineNo">252</span>   *<a name="line.252"></a>
+<span class="sourceLineNo">253</span>   * @param root root directory path<a name="line.253"></a>
+<span class="sourceLineNo">254</span>   * @return Passed &lt;code&gt;root&lt;/code&gt; argument.<a name="line.254"></a>
+<span class="sourceLineNo">255</span>   * @throws IOException if not a valid URI with a scheme<a name="line.255"></a>
+<span class="sourceLineNo">256</span>   */<a name="line.256"></a>
+<span class="sourceLineNo">257</span>  public static Path validateRootPath(Path root) throws IOException {<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    try {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>      URI rootURI = new URI(root.toString());<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      String scheme = rootURI.getScheme();<a name="line.260"></a>
+<span class="sourceLineNo">261</span>      if (scheme == null) {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>        throw new IOException("Root directory does not have a scheme");<a name="line.262"></a>
+<span class="sourceLineNo">263</span>      }<a name="line.263"></a>
+<span class="sourceLineNo">264</span>      return root;<a name="line.264"></a>
+<span class="sourceLineNo">265</span>    } catch (URISyntaxException e) {<a name="line.265"></a>
+<span class="sourceLineNo">266</span>      throw new IOException("Root directory path is not a valid " +<a name="line.266"></a>
+<span class="sourceLineNo">267</span>        "URI -- check your " + HConstants.HBASE_DIR + " configuration", e);<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    }<a name="line.268"></a>
+<span class="sourceLineNo">269</span>  }<a name="line.269"></a>
+<span class="sourceLineNo">270</span><a name="line.270"></a>
+<span class="sourceLineNo">271</span>  /**<a name="line.271"></a>
+<span class="sourceLineNo">272</span>   * Checks for the presence of the WAL log root path (using the provided conf object) in the given<a name="line.272"></a>
+<span class="sourceLineNo">273</span>   * path. If it exists, this method removes it and returns the String representation of remaining<a name="line.273"></a>
+<span class="sourceLineNo">274</span>   * relative path.<a name="line.274"></a>
+<span class="sourceLineNo">275</span>   * @param path must not be null<a name="line.275"></a>
+<span class="sourceLineNo">276</span>   * @param conf must not be null<a name="line.276"></a>
+<span class="sourceLineNo">277</span>   * @return String representation of the remaining relative path<a name="line.277"></a>
+<span class="sourceLineNo">278</span>   * @throws IOException from underlying filesystem<a name="line.278"></a>
+<span class="sourceLineNo">279</span>   */<a name="line.279"></a>
+<span class="sourceLineNo">280</span>  public static String removeWALRootPath(Path path, final Configuration conf) throws IOException {<a name="line.280"></a>
+<span class="sourceLineNo">281</span>    Path root = getWALRootDir(conf);<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    String pathStr = path.toString();<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    // check that the path is absolute... it has the root path in it.<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    if (!pathStr.startsWith(root.toString())) {<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      return pathStr;<a name="line.285"></a>
+<span class="sourceLineNo">286</span>    }<a name="line.286"></a>
+<span class="sourceLineNo">287</span>    // if not, return as it is.<a name="line.287"></a>
+<span class="sourceLineNo">288</span>    return pathStr.substring(root.toString().length() + 1);// remove the "/" too.<a name="line.288"></a>
+<span class="sourceLineNo">289</span>  }<a name="line.289"></a>
+<span class="sourceLineNo">290</span><a name="line.290"></a>
+<span class="sourceLineNo">291</span>  /**<a name="line.291"></a>
+<span class="sourceLineNo">292</span>   * Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This<a name="line.292"></a>
+<span class="sourceLineNo">293</span>   * method returns the 'path' component of a Path's URI: e.g. If a Path is<a name="line.293"></a>
+<span class="sourceLineNo">294</span>   * &lt;code&gt;hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;,<a name="line.294"></a>
+<span class="sourceLineNo">295</span>   * this method returns &lt;code&gt;/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;.<a name="line.295"></a>
+<span class="sourceLineNo">296</span>   * This method is useful if you want to print out a Path without qualifying<a name="line.296"></a>
+<span class="sourceLineNo">297</span>   * Filesystem instance.<a name="line.297"></a>
+<span class="sourceLineNo">298</span>   * @param p Filesystem Path whose 'path' component we are to return.<a name="line.298"></a>
+<span class="sourceLineNo">299</span>   * @return Path portion of the Filesystem<a name="line.299"></a>
+<span class="sourceLineNo">300</span>   */<a name="line.300"></a>
+<span class="sourceLineNo">301</span>  public static String getPath(Path p) {<a name="line.301"></a>
+<span class="sourceLineNo">302</span>    return p.toUri().getPath();<a name="line.302"></a>
+<span class="sourceLineNo">303</span>  }<a name="line.303"></a>
+<span class="sourceLineNo">304</span><a name="line.304"></a>
+<span class="sourceLineNo">305</span>  /**<a name="line.305"></a>
+<span class="sourceLineNo">306</span>   * @param c configuration<a name="line.306"></a>
+<span class="sourceLineNo">307</span>   * @return {@link Path} to hbase root directory from<a name="line.307"></a>
+<span class="sourceLineNo">308</span>   *     configuration as a qualified Path.<a name="line.308"></a>
+<span class="sourceLineNo">309</span>   * @throws IOException e<a name="line.309"></a>
+<span class="sourceLineNo">310</span>   */<a name="line.310"></a>
+<span class="sourceLineNo">311</span>  public static Path getRootDir(final Configuration c) throws IOException {<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    Path p = new Path(c.get(HConstants.HBASE_DIR));<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    FileSystem fs = p.getFileSystem(c);<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.314"></a>
+<span class="sourceLineNo">315</span>  }<a name="line.315"></a>
+<span class="sourceLineNo">316</span><a name="line.316"></a>
+<span class="sourceLineNo">317</span>  public static void setRootDir(final Configuration c, final Path root) {<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    c.set(HConstants.HBASE_DIR, root.toString());<a name="line.318"></a>
+<span class="sourceLineNo">319</span>  }<a name="line.319"></a>
+<span class="sourceLineNo">320</span><a name="line.320"></a>
+<span class="sourceLineNo">321</span>  public static void setFsDefault(final Configuration c, final Path root) {<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    c.set("fs.defaultFS", root.toString());    // for hadoop 0.21+<a name="line.322"></a>
+<span class="sourceLineNo">323</span>  }<a name="line.323"></a>
+<span class="sourceLineNo">324</span><a name="line.324"></a>
+<span class="sourceLineNo">325</span>  public static FileSystem getRootDirFileSystem(final Configuration c) throws IOException {<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    Path p = getRootDir(c);<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    return p.getFileSystem(c);<a name="line.327"></a>
+<span class="sourceLineNo">328</span>  }<a name="line.328"></a>
+<span class="sourceLineNo">329</span><a name="line.329"></a>
+<span class="sourceLineNo">330</span>  /**<a name="line.330"></a>
+<span class="sourceLineNo">331</span>   * @param c configuration<a name="line.331"></a>
+<span class="sourceLineNo">332</span>   * @return {@link Path} to hbase log root directory: e.g. {@value HBASE_WAL_DIR} from<a name="line.332"></a>
+<span class="sourceLineNo">333</span>   *     configuration as a qualified Path. Defaults to HBase root dir.<a name="line.333"></a>
+<span class="sourceLineNo">334</span>   * @throws IOException e<a name="line.334"></a>
+<span class="sourceLineNo">335</span>   */<a name="line.335"></a>
+<span class="sourceLineNo">336</span>  public static Path getWALRootDir(final Configuration c) throws IOException {<a name="line.336"></a>
+<span class="sourceLineNo">337</span>    Path p = new Path(c.get(HBASE_WAL_DIR, c.get(HConstants.HBASE_DIR)));<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    if (!isValidWALRootDir(p, c)) {<a name="line.338"></a>
+<span class="sourceLineNo">339</span>      return getRootDir(c);<a name="line.339"></a>
+<span class="sourceLineNo">340</span>    }<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    FileSystem fs = p.getFileSystem(c);<a name="line.341"></a>
+<span class="sourceLineNo">342</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.342"></a>
+<span class="sourceLineNo">343</span>  }<a name="line.343"></a>
+<span class="sourceLineNo">344</span><a name="line.344"></a>
+<span class="sourceLineNo">345</span>  @VisibleForTesting<a name="line.345"></a>
+<span class="sourceLineNo">346</span>  public static void setWALRootDir(final Configuration c, final Path root) {<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    c.set(HBASE_WAL_DIR, root.toString());<a name="line.347"></a>
+<span class="sourceLineNo">348</span>  }<a name="line.348"></a>
+<span class="sourceLineNo">349</span><a name="line.349"></a>
+<span class="sourceLineNo">350</span>  public static FileSystem getWALFileSystem(final Configuration c) throws IOException {<a name="line.350"></a>
+<span class="sourceLineNo">351</span>    Path p = getWALRootDir(c);<a name="line.351"></a>
+<span class="sourceLineNo">352</span>    FileSystem fs = p.getFileSystem(c);<a name="line.352"></a>
+<span class="sourceLineNo">353</span>    // hadoop-core does fs caching, so need to propogate this if set<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);<a name="line.354"></a>
+<span class="sourceLineNo">355</span>    if (enforceStreamCapability != null) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>      fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    }<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    return fs;<a name="line.358"></a>
+<span class="sourceLineNo">359</span>  }<a name="line.359"></a>
+<span class="sourceLineNo">360</span><a name="line.360"></a>
+<span class="sourceLineNo">361</span>  private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {<a name="line.361"></a>
+<span class="sourceLineNo">362</span>    Path rootDir = getRootDir(c);<a name="line.362"></a>
+<span class="sourceLineNo">363</span>    FileSystem fs = walDir.getFileSystem(c);<a name="line.363"></a>
+<span class="sourceLineNo">364</span>    Path qualifiedWalDir = walDir.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.364"></a>
+<span class="sourceLineNo">365</span>    if (!qualifiedWalDir.equals(rootDir)) {<a name="line.365"></a>
+<span class="sourceLineNo">366</span>      if (qualifiedWalDir.toString().startsWith(rootDir.toString() + "/")) {<a name="line.366"></a>
+<span class="sourceLineNo">367</span>        throw new IllegalStateException("Illegal WAL directory specified. " +<a name="line.367"></a>
+<span class="sourceLineNo">368</span>            "WAL directories are not permitted to be under the root directory if set.");<a name="line.368"></a>
+<span class="sourceLineNo">369</span>      }<a name="line.369"></a>
+<span class="sourceLineNo">370</span>    }<a name="line.370"></a>
+<span class="sourceLineNo">371</span>    return true;<a name="line.371"></a>
+<span class="sourceLineNo">372</span>  }<a name="line.372"></a>
+<span class="sourceLineNo">373</span><a name="line.373"></a>
+<span class="sourceLineNo">374</span>  /**<a name="line.374"></a>
+<span class="sourceLineNo">375</span>   * Returns the WAL region directory based on the given table name and region name<a name="line.375"></a>
+<span class="sourceLineNo">376</span>   * @param conf configuration to determine WALRootDir<a name="line.376"></a>
+<span class="sourceLineNo">377</span>   * @param tableName Table that the region is under<a name="line.377"></a>
+<span class="sourceLineNo">378</span>   * @param encodedRegionName Region name used for creating the final region directory<a name="line.378"></a>
+<span class="sourceLineNo">379</span>   * @return the region directory used to store WALs under the WALRootDir<a name="line.379"></a>
+<span class="sourceLineNo">380</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.380"></a>
+<span class="sourceLineNo">381</span>   */<a name="line.381"></a>
+<span class="sourceLineNo">382</span>  public static Path getWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.382"></a>
+<span class="sourceLineNo">383</span>      final String encodedRegionName) throws IOException {<a name="line.383"></a>
+<span class="sourceLineNo">384</span>    return new Path(getWALTableDir(conf, tableName), encodedRegionName);<a name="line.384"></a>
+<span class="sourceLineNo">385</span>  }<a name="line.385"></a>
+<span class="sourceLineNo">386</span><a name="line.386"></a>
+<span class="sourceLineNo">387</span>  /**<a name="line.387"></a>
+<span class="sourceLineNo">388</span>   * Returns the Table directory under the WALRootDir for the specified table name<a name="line.388"></a>
+<span class="sourceLineNo">389</span>   * @param conf configuration used to get the WALRootDir<a name="line.389"></a>
+<span class="sourceLineNo">390</span>   * @param tableName Table to get the directory for<a name="line.390"></a>
+<span class="sourceLineNo">391</span>   * @return a path to the WAL table directory for the specified table<a name="line.391"></a>
+<span class="sourceLineNo">392</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.392"></a>
+<span class="sourceLineNo">393</span>   */<a name="line.393"></a>
+<span class="sourceLineNo">394</span>  public static Path getWALTableDir(final Configuration conf, final TableName tableName)<a name="line.394"></a>
+<span class="sourceLineNo">395</span>      throws IOException {<a name="line.395"></a>
+<span class="sourceLineNo">396</span>    Path baseDir = new Path(getWALRootDir(conf), HConstants.BASE_NAMESPACE_DIR);<a name="line.396"></a>
+<span class="sourceLineNo">397</span>    return new Path(new Path(baseDir, tableName.getNamespaceAsString()),<a name="line.397"></a>
+<span class="sourceLineNo">398</span>      tableName.getQualifierAsString());<a name="line.398"></a>
+<span class="sourceLineNo">399</span>  }<a name="line.399"></a>
+<span class="sourceLineNo">400</span><a name="line.400"></a>
+<span class="sourceLineNo">401</span>  /**<a name="line.401"></a>
+<span class="sourceLineNo">402</span>   * For backward compatibility with HBASE-20734, where we store recovered edits in a wrong<a name="line.402"></a>
+<span class="sourceLineNo">403</span>   * directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.<a name="line.403"></a>
+<span class="sourceLineNo">404</span>   * @deprecated For compatibility, will be removed in 4.0.0.<a name="line.404"></a>
+<span class="sourceLineNo">405</span>   */<a name="line.405"></a>
+<span class="sourceLineNo">406</span>  @Deprecated<a name="line.406"></a>
+<span class="sourceLineNo">407</span>  public static Path getWrongWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.407"></a>
+<span class="sourceLineNo">408</span>      final String encodedRegionName) throws IOException {<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    Path wrongTableDir = new Path(new Path(getWALRootDir(conf), tableName.getNamespaceAsString()),<a name="line.409"></a>
+<span class="sourceLineNo">410</span>      tableName.getQualifierAsString());<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    return new Path(wrongTableDir, encodedRegionName);<a name="line.411"></a>
+<span class="sourceLineNo">412</span>  }<a name="line.412"></a>
+<span class="sourceLineNo">413</span><a name="line.413"></a>
+<span class="sourceLineNo">414</span>  /**<a name="line.414"></a>
+<span class="sourceLineNo">415</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under<a name="line.415"></a>
+<span class="sourceLineNo">416</span>   * path rootdir<a name="line.416"></a>
+<span class="sourceLineNo">417</span>   *<a name="line.417"></a>
+<span class="sourceLineNo">418</span>   * @param rootdir qualified path of HBase root directory<a name="line.418"></a>
+<span class="sourceLineNo">419</span>   * @param tableName name of table<a name="line.419"></a>
+<span class="sourceLineNo">420</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.420"></a>
+<span class="sourceLineNo">421</span>   */<a name="line.421"></a>
+<span class="sourceLineNo">422</span>  public static Path getTableDir(Path rootdir, final TableName tableName) {<a name="line.422"></a>
+<span class="sourceLineNo">423</span>    return new Path(getNamespaceDir(rootdir, tableName.getNamespaceAsString()),<a name="line.423"></a>
+<span class="sourceLineNo">424</span>        tableName.getQualifierAsString());<a name="line.424"></a>
+<span class="sourceLineNo">425</span>  }<a name="line.425"></a>
+<span class="sourceLineNo">426</span><a name="line.426"></a>
+<span class="sourceLineNo">427</span>  /**<a name="line.427"></a>
+<span class="sourceLineNo">428</span>   * Returns the {@link org.apache.hadoop.hbase.TableName} object representing<a name="line.428"></a>
+<span class="sourceLineNo">429</span>   * the table directory under<a name="line.429"></a>
+<span class="sourceLineNo">430</span>   * path rootdir<a name="line.430"></a>
+<span class="sourceLineNo">431</span>   *<a name="line.431"></a>
+<span class="sourceLineNo">432</span>   * @param tablePath path of table<a name="line.432"></a>
+<span class="sourceLineNo">433</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.433"></a>
+<span class="sourceLineNo">434</span>   */<a name="line.434"></a>
+<span class="sourceLineNo">435</span>  public static TableName getTableName(Path tablePath) {<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());<a name="line.436"></a>
+<span class="sourceLineNo">437</span>  }<a name="line.437"></a>
+<span class="sourceLineNo">438</span><a name="line.438"></a>
+<span class="sourceLineNo">439</span>  /**<a name="line.439"></a>
+<span class="sourceLineNo">440</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing<a name="line.440"></a>
+<span class="sourceLineNo">441</span>   * the namespace directory under path rootdir<a name="line.441"></a>
+<span class="sourceLineNo">442</span>   *<a name="line.442"></a>
+<span class="sourceLineNo">443</span>   * @param rootdir qualified path of HBase root directory<a name="line.443"></a>
+<span class="sourceLineNo">444</span>   * @param namespace namespace name<a name="line.444"></a>
+<span class="sourceLineNo">445</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.445"></a>
+<span class="sourceLineNo">446</span>   */<a name="line.446"></a>
+<span class="sourceLineNo">447</span>  public static Path getNamespaceDir(Path rootdir, final String namespace) {<a name="line.447"></a>
+<span class="sourceLineNo">448</span>    return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,<a name="line.448"></a>
+<span class="sourceLineNo">449</span>        new Path(namespace)));<a name="line.449"></a>
+<span class="sourceLineNo">450</span>  }<a name="line.450"></a>
+<span class="sourceLineNo">451</span><a name="line.451"></a>
+<span class="sourceLineNo">452</span>  // this mapping means that under a federated FileSystem implementation, we'll<a name="line.452"></a>
+<span class="sourceLineNo">453</span>  // only log the first failure from any of the underlying FileSystems at WARN and all others<a name="line.453"></a>
+<span class="sourceLineNo">454</span>  // will be at DEBUG.<a name="line.454"></a>
+<span class="sourceLineNo">455</span>  private static final Map&lt;FileSystem, Boolean&gt; warningMap = new ConcurrentHashMap&lt;&gt;();<a name="line.455"></a>
+<span class="sourceLineNo">456</span><a name="line.456"></a>
+<span class="sourceLineNo">457</span>  /**<a name="line.457"></a>
+<span class="sourceLineNo">458</span>   * Sets storage policy for given path.<a name="line.458"></a>
+<span class="sourceLineNo">459</span>   * If the passed path is a directory, we'll set the storage policy for all files<a name="line.459"></a>
+<span class="sourceLineNo">460</span>   * created in the future in said directory. Note that this change in storage<a name="line.460"></a>
+<span class="sourceLineNo">461</span>   * policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle.<a name="line.461"></a>
+<span class="sourceLineNo">462</span>   * If we're running on a version of FileSystem that doesn't support the given storage policy<a name="line.462"></a>
+<span class="sourceLineNo">463</span>   * (or storage policies at all), then we'll issue a log message and continue.<a name="line.463"></a>
 <span class="sourceLineNo">464</span>   *<a name="line.464"></a>
-<span class="sourceLineNo">465</span>   * @param rootdir qualified path of HBase root directory<a name="line.465"></a>
-<span class="sourceLineNo">466</span>   * @param tableName name of table<a name="line.466"></a>
-<span class="sourceLineNo">467</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.467"></a>
-<span class="sourceLineNo">468</span>   */<a name="line.468"></a>
-<span class="sourceLineNo">469</span>  public static Path getTableDir(Path rootdir, final TableName tableName) {<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    return new Path(getNamespaceDir(rootdir, tableName.getNamespaceAsString()),<a name="line.470"></a>
-<span class="sourceLineNo">471</span>        tableName.getQualifierAsString());<a name="line.471"></a>
-<span class="sourceLineNo">472</span>  }<a name="line.472"></a>
-<span class="sourceLineNo">473</span><a name="line.473"></a>
-<span class="sourceLineNo">474</span>  /**<a name="line.474"></a>
-<span class="sourceLineNo">475</span>   * Returns the {@link org.apache.hadoop.hbase.TableName} object representing<a name="line.475"></a>
-<span class="sourceLineNo">476</span>   * the table directory under<a name="line.476"></a>
-<span class="sourceLineNo">477</span>   * path rootdir<a name="line.477"></a>
-<span class="sourceLineNo">478</span>   *<a name="line.478"></a>
-<span class="sourceLineNo">479</span>   * @param tablePath path of table<a name="line.479"></a>
-<span class="sourceLineNo">480</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.480"></a>
-<span class="sourceLineNo">481</span>   */<a name="line.481"></a>
-<span class="sourceLineNo">482</span>  public static TableName getTableName(Path tablePath) {<a name="line.482"></a>
-<span class="sourceLineNo">483</span>    return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());<a name="line.483"></a>
-<span class="sourceLineNo">484</span>  }<a name="line.484"></a>
-<span class="sourceLineNo">485</span><a name="line.485"></a>
-<span class="sourceLineNo">486</span>  /**<a name="line.486"></a>
-<span class="sourceLineNo">487</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing<a name="line.487"></a>
-<span class="sourceLineNo">488</span>   * the namespace directory under path rootdir<a name="line.488"></a>
-<span class="sourceLineNo">489</span>   *<a name="line.489"></a>
-<span class="sourceLineNo">490</span>   * @param rootdir qualified path of HBase root directory<a name="line.490"></a>
-<span class="sourceLineNo">491</span>   * @param namespace namespace name<a name="line.491"></a>
-<span class="sourceLineNo">492</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.492"></a>
-<span class="sourceLineNo">493</span>   */<a name="line.493"></a>
-<span class="sourceLineNo">494</span>  public static Path getNamespaceDir(Path rootdir, final String namespace) {<a name="line.494"></a>
-<span class="sourceLineNo">495</span>    return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,<a name="line.495"></a>
-<span class="sourceLineNo">496</span>        new Path(namespace)));<a name="line.496"></a>
-<span class="sourceLineNo">497</span>  }<a name="line.497"></a>
-<span class="sourceLineNo">498</span><a name="line.498"></a>
-<span class="sourceLineNo">499</span>  // this mapping means that under a federated FileSystem implementation, we'll<a name="line.499"></a>
-<span class="sourceLineNo">500</span>  // only log the first failure from any of the underlying FileSystems at WARN and all others<a name="line.500"></a>
-<span class="sourceLineNo">501</span>  // will be at DEBUG.<a name="line.501"></a>
-<span class="sourceLineNo">502</span>  private static final Map&lt;FileSystem, Boolean&gt; warningMap = new ConcurrentHashMap&lt;&gt;();<a name="line.502"></a>
-<span class="sourceLineNo">503</span><a name="line.503"></a>
-<span class="sourceLineNo">504</span>  /**<a name="line.504"></a>
-<span class="sourceLineNo">505</span>   * Sets storage policy for given path.<a name="line.505"></a>
-<span class="sourceLineNo">506</span>   * If the passed path is a directory, we'll set the storage policy for all files<a name="line.506"></a>
-<span class="sourceLineNo">507</span>   * created in the future in said directory. Note that this change in storage<a name="line.507"></a>
-<span class="sourceLineNo">508</span>   * policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle.<a name="line.508"></a>
-<span class="sourceLineNo">509</span>   * If we're running on a version of FileSystem that doesn't support the given storage policy<a name="line.509"></a>
-<span class="sourceLineNo">510</span>   * (or storage policies at all), then we'll issue a log message and continue.<a name="line.510"></a>
-<span class="sourceLineNo">511</span>   *<a name="line.511"></a>
-<span class="sourceLineNo">512</span>   * See http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html<a name="line.512"></a>
-<span class="sourceLineNo">513</span>   *<a name="line.513"></a>
-<span class="sourceLineNo">514</span>   * @param fs We only do anything it implements a setStoragePolicy method<a name="line.514"></a>
-<span class="sourceLineNo">515</span>   * @param path the Path whose storage policy is to be set<a name="line.515"></a>
-<span class="sourceLineNo">516</span>   * @param storagePolicy Policy to set on &lt;code&gt;path&lt;/code&gt;; see hadoop 2.6+<a name="line.516"></a>
-<span class="sourceLineNo">517</span>   *   org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g<a name="line.517"></a>
-<span class="sourceLineNo">518</span>   *   'COLD', 'WARM', 'HOT', 'ONE_SSD', 'ALL_SSD', 'LAZY_PERSIST'.<a name="line.518"></a>
-<span class="sourceLineNo">519</span>   */<a name="line.519"></a>
-<span class="sourceLineNo">520</span>  public static void setStoragePolicy(final FileSystem fs, final Path path,<a name="line.520"></a>
-<span class="sourceLineNo">521</span>      final String storagePolicy) {<a name="line.521"></a>
-<span class="sourceLineNo">522</span>    try {<a name="line.522"></a>
-<span class="sourceLineNo">523</span>      setStoragePolicy(fs, path, storagePolicy, false);<a name="line.523"></a>
-<span class="sourceLineNo">524</span>    } catch (IOException e) {<a name="line.524"></a>
-<span class="sourceLineNo">525</span>      // should never arrive here<a name="line.525"></a>
-<span class="sourceLineNo">526</span>      LOG.warn("We have chosen not to throw exception but some unexpectedly thrown out", e);<a name="line.526"></a>
-<span class="sourceLineNo">527</span>    }<a name="line.527"></a>
-<span class="sourceLineNo">528</span>  }<a name="line.528"></a>
-<span class="sourceLineNo">529</span><a name="line.529"></a>
-<span class="sourceLineNo">530</span>  static void setStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy,<a name="line.530"></a>
-<span class="sourceLineNo">531</span>      boolean throwException) throws IOException {<a name="line.531"></a>
-<span class="sourceLineNo">532</span>    if (storagePolicy == null) {<a name="line.532"></a>
-<span class="sourceLineNo">533</span>      if (LOG.isTraceEnabled()) {<a name="line.533"></a>
-<span class="sourceLineNo">534</span>        LOG.trace("We were passed a null storagePolicy, exiting early.");<a name="line.534"></a>
-<span class="sourceLineNo">535</span>      }<a name="line.535"></a>
-<span class="sourceLineNo">536</span>      return;<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    }<a name="line.537"></a>
-<span class="sourceLineNo">538</span>    String trimmedStoragePolicy = storagePolicy.trim();<a name="line.538"></a>
-<span class="sourceLineNo">539</span>    if (trimmedStoragePolicy.isEmpty()) {<a name="line.539"></a>
-<span class="sourceLineNo">540</span>      if (LOG.isTraceEnabled()) {<a name="line.540"></a>
-<span class="sourceLineNo">541</span>        LOG.trace("We were passed an empty storagePolicy, exiting early.");<a name="line.541"></a>
+<span class="sourceLineNo">465</span>   * See http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html<a name="line.465"></a>
+<span class="sourceLineNo">466</span>   *<a name="line.466"></a>
+<span class="sourceLineNo">467</span>   * @param fs We only do anything it implements a setStoragePolicy method<a name="line.467"></a>
+<span class="sourceLineNo">468</span>   * @param path the Path whose storage policy is to be set<a name="line.468"></a>
+<span class="sourceLineNo">469</span>   * @param storagePolicy Policy to set on &lt;code&gt;path&lt;/code&gt;; see hadoop 2.6+<a name="line.469"></a>
+<span class="sourceLineNo">470</span>   *   org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g<a name="line.470"></a>
+<span class="sourceLineNo">471</span>   *   'COLD', 'WARM', 'HOT', 'ONE_SSD', 'ALL_SSD', 'LAZY_PERSIST'.<a name="line.471"></a>
+<span class="sourceLineNo">472</span>   */<a name="line.472"></a>
+<span class="sourceLineNo">473</span>  public static void setStoragePolicy(final FileSystem fs, final Path path,<a name="line.473"></a>
+<span class="sourceLineNo">474</span>      final String storagePolicy) {<a name="line.474"></a>
+<span class="sourceLineNo">475</span>    try {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>      setStoragePolicy(fs, path, storagePolicy, false);<a name="line.476"></a>
+<span class="sourceLineNo">477</span>    } catch (IOException e) {<a name="line.477"></a>
+<span class="sourceLineNo">478</span>      // should never arrive here<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      LOG.warn("We have chosen not to throw exception but some unexpectedly thrown out", e);<a name="line.479"></a>
+<span class="sourceLineNo">480</span>    }<a name="line.480"></a>
+<span class="sourceLineNo">481</span>  }<a name="line.481"></a>
+<span class="sourceLineNo">482</span><a name="line.482"></a>
+<span class="sourceLineNo">483</span>  static void setStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy,<a name="line.483"></a>
+<span class="sourceLineNo">484</span>      boolean throwException) throws IOException {<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    if (storagePolicy == null) {<a name="line.485"></a>
+<span class="sourceLineNo">486</span>      if (LOG.isTraceEnabled()) {<a name="line.486"></a>
+<span class="sourceLineNo">487</span>        LOG.trace("We were passed a null storagePolicy, exiting early.");<a name="line.487"></a>
+<span class="sourceLineNo">488</span>      }<a name="line.488"></a>
+<span class="sourceLineNo">489</span>      return;<a name="line.489"></a>
+<span class="sourceLineNo">490</span>    }<a name="line.490"></a>
+<span class="sourceLineNo">491</span>    String trimmedStoragePolicy = storagePolicy.trim();<a name="line.491"></a>
+<span class="sourceLineNo">492</span>    if (trimmedStoragePolicy.isEmpty()) {<a name="line.492"></a>
+<span class="sourceLineNo">493</span>      if (LOG.isTraceEnabled()) {<a name="line.493"></a>
+<span class="sourceLineNo">494</span>        LOG.trace("We were passed an empty storagePolicy, exiting early.");<a name="line.494"></a>
+<span class="sourceLineNo">495</span>      }<a name="line.495"></a>
+<span class="sourceLineNo">496</span>      return;<a name="line.496"></a>
+<span class="sourceLineNo">497</span>    } else {<a name="line.497"></a>
+<span class="sourceLineNo">498</span>      trimmedStoragePolicy = trimmedStoragePolicy.toUpperCase(Locale.ROOT);<a name="line.498"></a>
+<span class="sourceLineNo">499</span>    }<a name="line.499"></a>
+<span class="sourceLineNo">500</span>    if (trimmedStoragePolicy.equals(HConstants.DEFER_TO_HDFS_STORAGE_POLICY)) {<a name="line.500"></a>
+<span class="sourceLineNo">501</span>      if (LOG.isTraceEnabled()) {<a name="line.501"></a>
+<span class="sourceLineNo">502</span>        LOG.trace("We were passed the defer-to-hdfs policy {}, exiting early.",<a name="line.502"></a>
+<span class="sourceLineNo">503</span>          trimmedStoragePolicy);<a name="line.503"></a>
+<span class="sourceLineNo">504</span>      }<a name="line.504"></a>
+<span class="sourceLineNo">505</span>      return;<a name="line.505"></a>
+<span class="sourceLineNo">506</span>    }<a name="line.506"></a>
+<span class="sourceLineNo">507</span>    try {<a name="line.507"></a>
+<span class="sourceLineNo">508</span>      invokeSetStoragePolicy(fs, path, trimmedStoragePolicy);<a name="line.508"></a>
+<span class="sourceLineNo">509</span>    } catch (IOException e) {<a name="line.509"></a>
+<span class="sourceLineNo">510</span>      if (LOG.isTraceEnabled()) {<a name="line.510"></a>
+<span class="sourceLineNo">511</span>        LOG.trace("Failed to invoke set storage policy API on FS", e);<a name="line.511"></a>
+<span class="sourceLineNo">512</span>      }<a name="line.512"></a>
+<span class="sourceLineNo">513</span>      if (throwException) {<a name="line.513"></a>
+<span class="sourceLineNo">514</span>        throw e;<a name="line.514"></a>
+<span class="sourceLineNo">515</span>      }<a name="line.515"></a>
+<span class="sourceLineNo">516</span>    }<a name="line.516"></a>
+<span class="sourceLineNo">517</span>  }<a name="line.517"></a>
+<span class="sourceLineNo">518</span><a name="line.518"></a>
+<span class="sourceLineNo">519</span>  /*<a name="line.519"></a>
+<span class="sourceLineNo">520</span>   * All args have been checked and are good. Run the setStoragePolicy invocation.<a name="line.520"></a>
+<span class="sourceLineNo">521</span>   */<a name="line.521"></a>
+<span class="sourceLineNo">522</span>  private static void invokeSetStoragePolicy(final FileSystem fs, final Path path,<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      final String storagePolicy) throws IOException {<a name="line.523"></a>
+<span class="sourceLineNo">524</span>    Exception toThrow = null;<a name="line.524"></a>
+<span class="sourceLineNo">525</span><a name="line.525"></a>
+<span class="sourceLineNo">526</span>    try {<a name="line.526"></a>
+<span class="sourceLineNo">527</span>      fs.setStoragePolicy(path, storagePolicy);<a name="line.527"></a>
+<span class="sourceLineNo">528</span><a name="line.528"></a>
+<span class="sourceLineNo">529</span>      if (LOG.isDebugEnabled()) {<a name="line.529"></a>
+<span class="sourceLineNo">530</span>        LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);<a name="line.530"></a>
+<span class="sourceLineNo">531</span>      }<a name="line.531"></a>
+<span class="sourceLineNo">532</span>    } catch (Exception e) {<a name="line.532"></a>
+<span class="sourceLineNo">533</span>      toThrow = e;<a name="line.533"></a>
+<span class="sourceLineNo">534</span>      // This swallows FNFE, should we be throwing it? seems more likely to indicate dev<a name="line.534"></a>
+<span class="sourceLineNo">535</span>      // misuse than a runtime problem with HDFS.<a name="line.535"></a>
+<span class="sourceLineNo">536</span>      if (!warningMap.containsKey(fs)) {<a name="line.536"></a>
+<span class="sourceLineNo">537</span>        warningMap.put(fs, true);<a name="line.537"></a>
+<span class="sourceLineNo">538</span>        LOG.warn("Unable to set storagePolicy=" + storagePolicy + " for path=" + path + ". " +<a name="line.538"></a>
+<span class="sourceLineNo">539</span>            "DEBUG log level might have more details.", e);<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      } else if (LOG.isDebugEnabled()) {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>        LOG.debug("Unable to set storagePolicy=" + storagePolicy + " for path=" + path, e);<a name="line.541"></a>
 <span class="sourceLineNo">542</span>      }<a name="line.542"></a>
-<span class="sourceLineNo">543</span>      return;<a name="line.543"></a>
-<span class="sourceLineNo">544</span>    } else {<a name="line.544"></a>
-<span class="sourceLineNo">545</span>      trimmedStoragePolicy = trimmedStoragePolicy.toUpperCase(Locale.ROOT);<a name="line.545"></a>
-<span class="sourceLineNo">546</span>    }<a name="line.546"></a>
-<span class="sourceLineNo">547</span>    if (trimmedStoragePolicy.equals(HConstants.DEFER_TO_HDFS_STORAGE_POLICY)) {<a name="line.547"></a>
-<span class="sourceLineNo">548</span>      if (LOG.isTraceEnabled()) {<a name="line.548"></a>
-<span class="sourceLineNo">549</span>        LOG.trace("We were passed the defer-to-hdfs policy {}, exiting early.",<a name="line.549"></a>
-<span class="sourceLineNo">550</span>          trimmedStoragePolicy);<a name="line.550"></a>
-<span class="sourceLineNo">551</span>      }<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      return;<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    }<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    try {<a name="line.554"></a>
-<span class="sourceLineNo">555</span>      invokeSetStoragePolicy(fs, path, trimmedStoragePolicy);<a name="line.555"></a>
-<span class="sourceLineNo">556</span>    } catch (IOException e) {<a name="line.556"></a>
-<span class="sourceLineNo">557</span>      if (LOG.isTraceEnabled()) {<a name="line.557"></a>
-<span class="sourceLineNo">558</span>        LOG.trace("Failed to invoke set storage policy API on FS", e);<a name="line.558"></a>
-<span class="sourceLineNo">559</span>      }<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      if (throwException) {<a name="line.560"></a>
-<span class="sourceLineNo">561</span>        throw e;<a name="line.561"></a>
-<span class="sourceLineNo">562</span>      }<a name="line.562"></a>
-<span class="sourceLineNo">563</span>    }<a name="line.563"></a>
-<span class="sourceLineNo">564</span>  }<a name="line.564"></a>
-<span class="sourceLineNo">565</span><a name="line.565"></a>
-<span class="sourceLineNo">566</span>  /*<a name="line.566"></a>
-<span class="sourceLineNo">567</span>   * All args have been checked and are good. Run the setStoragePolicy invocation.<a name="line.567"></a>
-<span class="sourceLineNo">568</span>   */<a name="line.568"></a>
-<span class="sourceLineNo">569</span>  private static void invokeSetStoragePolicy(final FileSystem fs, final Path path,<a name="line.569"></a>
-<span class="sourceLineNo">570</span>      final String storagePolicy) throws IOException {<a name="line.570"></a>
-<span class="sourceLineNo">571</span>    Method m = null;<a name="line.571"></a>
-<span class="sourceLineNo">572</span>    Exception toThrow = null;<a name="line.572"></a>
-<span class="sourceLineNo">573</span>    try {<a name="line.573"></a>
-<span class="sourceLineNo">574</span>      m = fs.getClass().getDeclaredMethod("setStoragePolicy", Path.class, String.class);<a name="line.574"></a>
-<span class="sourceLineNo">575</span>      m.setAccessible(true);<a name="line.575"></a>
-<span class="sourceLineNo">576</span>    } catch (NoSuchMethodException e) {<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      toThrow = e;<a name="line.577"></a>
-<span class="sourceLineNo">578</span>      final String msg = "FileSystem doesn't support setStoragePolicy; HDFS-6584, HDFS-9345 " +<a name="line.578"></a>
-<span class="sourceLineNo">579</span>          "not available. This is normal and expected on earlier Hadoop versions.";<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      if (!warningMap.containsKey(fs)) {<a name="line.580"></a>
-<span class="sourceLineNo">581</span>        warningMap.put(fs, true);<a name="line.581"></a>
-<span class="sourceLineNo">582</span>        LOG.warn(msg, e);<a name="line.582"></a>
-<span class="sourceLineNo">583</span>      } else if (LOG.isDebugEnabled()) {<a name="line.583"></a>
-<span class="sourceLineNo">584</span>        LOG.debug(msg, e);<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      }<a name="line.585"></a>
-<span class="sourceLineNo">586</span>      m = null;<a name="line.586"></a>
-<span class="sourceLineNo">587</span>    } catch (SecurityException e) {<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      toThrow = e;<a name="line.588"></a>
-<span class="sourceLineNo">589</span>      final String msg = "No access to setStoragePolicy on FileSystem from the SecurityManager; " +<a name="line.589"></a>
-<span class="sourceLineNo">590</span>          "HDFS-6584, HDFS-9345 not available. This is unusual and probably warrants an email " +<a name="line.590"></a>
-<span class="sourceLineNo">591</span>          "to the user@hbase mailing list. Please be sure to include a link to your configs, and " +<a name="line.591"></a>
-<span class="sourceLineNo">592</span>          "logs that include this message and period of time before it. Logs around service " +<a name="line.592"></a>
-<span class="sourceLineNo">593</span>          "start up will probably be useful as well.";<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      if (!warningMap.containsKey(fs)) {<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        warningMap.put(fs, true);<a name="line.595"></a>
-<span class="sourceLineNo">596</span>        LOG.warn(msg, e);<a name="line.596"></a>
-<span class="sourceLineNo">597</span>      } else if (LOG.isDebugEnabled()) {<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        LOG.debug(msg, e);<a name="line.598"></a>
-<span class="sourceLineNo">599</span>      }<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      m = null; // could happen on setAccessible() or getDeclaredMethod()<a name="line.600"></a>
-<span class="sourceLineNo">601</span>    }<a name="line.601"></a>
-<span class="sourceLineNo">602</span>    if (m != null) {<a name="line.602"></a>
-<span class="sourceLineNo">603</span>      try {<a name="line.603"></a>
-<span class="sourceLineNo">604</span>        m.invoke(fs, path, storagePolicy);<a name="line.604"></a>
-<span class="sourceLineNo">605</span>        if (LOG.isDebugEnabled()) {<a name="line.605"></a>
-<span class="sourceLineNo">606</span>          LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);<a name="line.606"></a>
-<span class="sourceLineNo">607</span>        }<a name="line.607"></a>
-<span class="sourceLineNo">608</span>      } catch (Exception e) {<a name="line.608"></a>
-<span class="sourceLineNo">609</span>        toThrow = e;<a name="line.609"></a>
-<span class="sourceLineNo">610</span>        // This swallows FNFE, should we be throwing it? seems more likely to indicate dev<a name="line.610"></a>
-<span class="sourceLineNo">611</span>        // misuse than a runtime problem with HDFS.<a name="line.611"></a>
-<span class="sourceLineNo">612</span>        if (!warningMap.containsKey(fs)) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>          warningMap.put(fs, true);<a name="line.613"></a>
-<span class="sourceLineNo">614</span>          LOG.warn("Unable to set storagePolicy=" + storagePolicy + " for path=" + path + ". " +<a name="line.614"></a>
-<span class="sourceLineNo">615</span>              "DEBUG log level might have more details.", e);<a name="line.615"></a>
-<span class="sourceLineNo">616</span>        } else if (LOG.isDebugEnabled()) {<a name="line.616"></a>
-<span class="sourceLineNo">617</span>          LOG.debug("Unable to set storagePolicy=" + storagePolicy + " for path=" + path, e);<a name="line.617"></a>
-<span class="sourceLineNo">618</span>        }<a name="line.618"></a>
-<span class="sourceLineNo">619</span>        // check for lack of HDFS-7228<a name="line.619"></a>
-<span class="sourceLineNo">620</span>        if (e instanceof InvocationTargetException) {<a name="line.620"></a>
-<span class="sourceLineNo">621</span>          final Throwable exception = e.getCause();<a name="line.621"></a>
-<span class="sourceLineNo">622</span>          if (exception instanceof RemoteException &amp;&amp;<a name="line.622"></a>
-<span class="sourceLineNo">623</span>              HadoopIllegalArgumentException.class.getName().equals(<a name="line.623"></a>
-<span class="sourceLineNo">624</span>                ((RemoteException)exception).getClassName())) {<a name="line.624"></a>
-<span class="sourceLineNo">625</span>            if (LOG.isDebugEnabled()) {<a name="line.625"></a>
-<span class="sourceLineNo">626</span>              LOG.debug("Given storage policy, '" +storagePolicy +"', was rejected and probably " +<a name="line.626"></a>
-<span class="sourceLineNo">627</span>                "isn't a valid policy for the version of Hadoop you're running. I.e. if you're " +<a name="line.627"></a>
-<span class="sourceLineNo">628</span>                "trying to use SSD related policies then you're likely missing HDFS-7228. For " +<a name="line.628"></a>
-<span class="sourceLineNo">629</span>                "more information see the 'ArchivalStorage' docs for your Hadoop release.");<a name="line.629"></a>
-<span class="sourceLineNo">630</span>            }<a name="line.630"></a>
-<span class="sourceLineNo">631</span>          // Hadoop 2.8+, 3.0-a1+ added FileSystem.setStoragePolicy with a default implementation<a name="line.631"></a>
-<span class="sourceLineNo">632</span>          // that throws UnsupportedOperationException<a name="line.632"></a>
-<span class="sourceLineNo">633</span>          } else if (exception instanceof UnsupportedOperationException) {<a name="line.633"></a>
-<span class="sourceLineNo">634</span>            if (LOG.isDebugEnabled()) {<a name="line.634"></a>
-<span class="sourceLineNo">635</span>              LOG.debug("The underlying FileSystem implementation doesn't support " +<a name="line.635"></a>
-<span class="sourceLineNo">636</span>                  "setStoragePolicy. This is probably intentional on their part, since HDFS-9345 " +<a name="line.636"></a>
-<span class="sourceLineNo">637</span>                  "appears to be present in your version of Hadoop. For more information check " +<a name="line.637"></a>
-<span class="sourceLineNo">638</span>                  "the Hadoop documentation on 'ArchivalStorage', the Hadoop FileSystem " +<a name="line.638"></a>
-<span class="sourceLineNo">639</span>                  "specification docs from HADOOP-11981, and/or related documentation from the " +<a name="line.639"></a>
-<span class="sourceLineNo">640</span>                  "provider of the underlying FileSystem (its name should appear in the " +<a name="line.640"></a>
-<span class="sourceLineNo">641</span>                  "stacktrace that accompanies this message). Note in particular that Hadoop's " +<a name="line.641"></a>
-<span class="sourceLineNo">642</span>                  "local filesystem implementation doesn't support storage policies.", exception);<a name="line.642"></a>
-<span class="sourceLineNo">643</span>            }<a name="line.643"></a>
-<span class="sourceLineNo">644</span>          }<a name="line.644"></a>
-<span class="sourceLineNo">645</span>        }<a name="line.645"></a>
-<span class="sourceLineNo">646</span>      }<a name="line.646"></a>
-<span class="sourceLineNo">647</span>    }<a name="line.647"></a>
-<span class="sourceLineNo">648</span>    if (toThrow != null) {<a name="line.648"></a>
-<span class="sourceLineNo">649</span>      throw new IOException(toThrow);<a name="line.649"></a>
-<span class="sourceLineNo">650</span>    }<a name="line.650"></a>
-<span class="sourceLineNo">651</span>  }<a name="line.651"></a>
-<span class="sourceLineNo">652</span><a name="line.652"></a>
-<span class="sourceLineNo">653</span>  /**<a name="line.653"></a>
-<span class="sourceLineNo">654</span>   * @param conf must not be null<a name="line.654"></a>
-<span class="sourceLineNo">655</span>   * @return True if this filesystem whose scheme is 'hdfs'.<a name="line.655"></a>
-<span class="sourceLineNo">656</span>   * @throws IOException from underlying FileSystem<a name="line.656"></a>
-<span class="sourceLineNo">657</span>   */<a name="line.657"></a>
-<span class="sourceLineNo">658</span>  public static boolean isHDFS(final Configuration conf) throws IOException {<a name="line.658"></a>
-<span class="sourceLineNo">659</span>    FileSystem fs = FileSystem.get(conf);<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    String scheme = fs.getUri().getScheme();<a name="line.660"></a>
-<span class="sourceLineNo">661</span>    return scheme.equalsIgnoreCase("hdfs");<a name="line.661"></a>
-<span class="sourceLineNo">662</span>  }<a name="line.662"></a>
-<span class="sourceLineNo">663</span><a name="line.663"></a>
-<span class="sourceLineNo">664</span>  /**<a name="line.664"></a>
-<span class="sourceLineNo">665</span>   * Checks if the given path is the one with 'recovered.edits' dir.<a name="line.665"></a>
-<span class="sourceLineNo">666</span>   * @param path must not be null<a name="line.666"></a>
-<span class="sourceLineNo">667</span>   * @return True if we recovered edits<a name="line.667"></a>
-<span class="sourceLineNo">668</span>   */<a name="line.668"></a>
-<span class="sourceLineNo">669</span>  public static boolean isRecoveredEdits(Path path) {<a name="line.669"></a>
-<span class="sourceLineNo">670</span>    return path.toString().contains(HConstants.RECOVERED_EDITS_DIR);<a name="line.670"></a>
-<span class="sourceLineNo">671</span>  }<a name="line.671"></a>
-<span class="sourceLineNo">672</span><a name="line.672"></a>
-<span class="sourceLineNo">673</span>  /**<a name="line.673"></a>
-<span class="sourceLineNo">674</span>   * @param conf must not be null<a name="line.674"></a>
-<span class="sourceLineNo">675</span>   * @return Returns the filesystem of the hbase rootdir.<a name="line.675"></a>
-<span class="sourceLineNo">676</span>   * @throws IOException from underlying FileSystem<a name="line.676"></a>
-<span class="sourceLineNo">677</span>   */<a name="line.677"></a>
-<span class="sourceLineNo">678</span>  public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {<a name="line.678"></a>
-<span class="sourceLineNo">679</span>    return getRootDir(conf).getFileSystem(conf);<a name="line.679"></a>
-<span class="sourceLineNo">680</span>  }<a name="line.680"></a>
-<span class="sourceLineNo">681</span><a name="line.681"></a>
-<span class="sourceLineNo">682</span>  /**<a name="line.682"></a>
-<span class="sourceLineNo">683</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.683"></a>
-<span class="sourceLineNo">684</span>   * This accommodates differences between hadoop versions, where hadoop 1<a name="line.684"></a>
-<span class="sourceLineNo">685</span>   * does not throw a FileNotFoundException, and return an empty FileStatus[]<a name="line.685"></a>
-<span class="sourceLineNo">686</span>   * while Hadoop 2 will throw FileNotFoundException.<a name="line.686"></a>
-<span class="sourceLineNo">687</span>   *<a name="line.687"></a>
-<span class="sourceLineNo">688</span>   * Where possible, prefer FSUtils#listStatusWithStatusFilter(FileSystem,<a name="line.688"></a>
-<span class="sourceLineNo">689</span>   * Path, FileStatusFilter) instead.<a name="line.689"></a>
-<span class="sourceLineNo">690</span>   *<a name="line.690"></a>
-<span class="sourceLineNo">691</span>   * @param fs file system<a name="line.691"></a>
-<span class="sourceLineNo">692</span>   * @param dir directory<a name="line.692"></a>
-<span class="sourceLineNo">693</span>   * @param filter path filter<a name="line.693"></a>
-<span class="sourceLineNo">694</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.694"></a>
-<span class="sourceLineNo">695</span>   */<a name="line.695"></a>
-<span class="sourceLineNo">696</span>  public static FileStatus[] listStatus(final FileSystem fs,<a name="line.696"></a>
-<span class="sourceLineNo">697</span>      final Path dir, final PathFilter filter) throws IOException {<a name="line.697"></a>
-<span class="sourceLineNo">698</span>    FileStatus [] status = null;<a name="line.698"></a>
-<span class="sourceLineNo">699</span>    try {<a name="line.699"></a>
-<span class="sourceLineNo">700</span>      status = filter == null ? fs.listStatus(dir) : fs.listStatus(dir, filter);<a name="line.700"></a>
-<span class="sourceLineNo">701</span>    } catch (FileNotFoundException fnfe) {<a name="line.701"></a>
-<span class="sourceLineNo">702</span>      // if directory doesn't exist, return null<a name="line.702"></a>
-<span class="sourceLineNo">703</span>      if (LOG.isTraceEnabled()) {<a name="line.703"></a>
-<span class="sourceLineNo">704</span>        LOG.trace("{} doesn't exist", dir);<a name="line.704"></a>
-<span class="sourceLineNo">705</span>      }<a name="line.705"></a>
-<span class="sourceLineNo">706</span>    }<a name="line.706"></a>
-<span class="sourceLineNo">707</span>    if (status == null || status.length &lt; 1) {<a name="line.707"></a>
-<span class="sourceLineNo">708</span>      return null;<a name="line.708"></a>
-<span class="sourceLineNo">709</span>    }<a name="line.709"></a>
-<span class="sourceLineNo">710</span>    return status;<a name="line.710"></a>
-<span class="sourceLineNo">711</span>  }<a name="line.711"></a>
-<span class="sourceLineNo">712</span><a name="line.712"></a>
-<span class="sourceLineNo">713</span>  /**<a name="line.713"></a>
-<span class="sourceLineNo">714</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.714"></a>
-<span class="sourceLineNo">715</span>   * This would accommodates differences between hadoop versions<a name="line.715"></a>
+<span class="sourceLineNo">543</span><a name="line.543"></a>
+<span class="sourceLineNo">544</span>      // check for lack of HDFS-7228<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      if (e instanceof RemoteException &amp;&amp;<a name="line.545"></a>
+<span class="sourceLineNo">546</span>          HadoopIllegalArgumentException.class.getName().equals(<a name="line.546"></a>
+<span class="sourceLineNo">547</span>            ((RemoteException)e).getClassName())) {<a name="line.547"></a>
+<span class="sourceLineNo">548</span>        if (LOG.isDebugEnabled()) {<a name="line.548"></a>
+<span class="sourceLineNo">549</span>          LOG.debug("Given storage policy, '" +storagePolicy +"', was rejected and probably " +<a name="line.549"></a>
+<span class="sourceLineNo">550</span>            "isn't a valid policy for the version of Hadoop you're running. I.e. if you're " +<a name="line.550"></a>
+<span class="sourceLineNo">551</span>            "trying to use SSD related policies then you're likely missing HDFS-7228. For " +<a name="line.551"></a>
+<span class="sourceLineNo">552</span>            "more information see the 'ArchivalStorage' docs for your Hadoop release.");<a name="line.552"></a>
+<span class="sourceLineNo">553</span>        }<a name="line.553"></a>
+<span class="sourceLineNo">554</span>      // Hadoop 2.8+, 3.0-a1+ added FileSystem.setStoragePolicy with a default implementation<a name="line.554"></a>
+<span class="sourceLineNo">555</span>      // that throws UnsupportedOperationException<a name="line.555"></a>
+<span class="sourceLineNo">556</span>      } else if (e instanceof UnsupportedOperationException) {<a name="line.556"></a>
+<span class="sourceLineNo">557</span>        if (LOG.isDebugEnabled()) {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>          LOG.debug("The underlying FileSystem implementation doesn't support " +<a name="line.558"></a>
+<span class="sourceLineNo">559</span>              "setStoragePolicy. This is probably intentional on their part, since HDFS-9345 " +<a name="line.559"></a>
+<span class="sourceLineNo">560</span>              "appears to be present in your version of Hadoop. For more information check " +<a name="line.560"></a>
+<span class="sourceLineNo">561</span>              "the Hadoop documentation on 'ArchivalStorage', the Hadoop FileSystem " +<a name="line.561"></a>
+<span class="sourceLineNo">562</span>              "specification docs from HADOOP-11981, and/or related documentation from the " +<a name="line.562"></a>
+<span class="sourceLineNo">563</span>              "provider of the underlying FileSystem (its name should appear in the " +<a name="line.563"></a>
+<span class="sourceLineNo">564</span>              "stacktrace that accompanies this message). Note in particular that Hadoop's " +<a name="line.564"></a>
+<span class="sourceLineNo">565</span>              "local filesystem implementation doesn't support storage policies.", e);<a name="line.565"></a>
+<span class="sourceLineNo">566</span>        }<a name="line.566"></a>
+<span class="sourceLineNo">567</span>      }<a name="line.567"></a>
+<span class="sourceLineNo">568</span>    }<a name="line.568"></a>
+<span class="sourceLineNo">569</span><a name="line.569"></a>
+<span class="sourceLineNo">570</span>    if (toThrow != null) {<a name="line.570"></a>
+<span class="sourceLineNo">571</span>      throw new IOException(toThrow);<a name="line.571"></a>
+<span class="sourceLineNo">572</span>    }<a name="line.572"></a>
+<span class="sourceLineNo">573</span>  }<a name="line.573"></a>
+<span class="sourceLineNo">574</span><a name="line.574"></a>
+<span class="sourceLineNo">575</span>  /**<a name="line.575"></a>
+<span class="sourceLineNo">576</span>   * @param conf must not be null<a name="line.576"></a>
+<span class="sourceLineNo">577</span>   * @return True if this filesystem whose scheme is 'hdfs'.<a name="line.577"></a>
+<span class="sourceLineNo">578</span>   * @throws IOException from underlying FileSystem<a name="line.578"></a>
+<span class="sourceLineNo">579</span>   */<a name="line.579"></a>
+<span class="sourceLineNo">580</span>  public static boolean isHDFS(final Configuration conf) throws IOException {<a name="line.580"></a>
+<span class="sourceLineNo">581</span>    FileSystem fs = FileSystem.get(conf);<a name="line.581"></a>
+<span class="sourceLineNo">582</span>    String scheme = fs.getUri().getScheme();<a name="line.582"></a>
+<span class="sourceLineNo">583</span>    return scheme.equalsIgnoreCase("hdfs");<a name="line.583"></a>
+<span class="sourceLineNo">584</span>  }<a name="line.584"></a>
+<span class="sourceLineNo">585</span><a name="line.585"></a>
+<span class="sourceLineNo">586</span>  /**<a name="line.586"></a>
+<span class="sourceLineNo">587</span>   * Checks if the given path is the one with 'recovered.edits' dir.<a name="line.587"></a>
+<span class="sourceLineNo">588</span>   * @param path must not be null<a name="line.588"></a>
+<span class="sourceLineNo">589</span>   * @return True if we recovered edits<a name="line.589"></a>
+<span class="sourceLineNo">590</span>   */<a name="line.590"></a>
+<span class="sourceLineNo">591</span>  public static boolean isRecoveredEdits(Path path) {<a name="line.591"></a>
+<span class="sourceLineNo">592</span>    return path.toString().contains(HConstants.RECOVERED_EDITS_DIR);<a name="line.592"></a>
+<span class="sourceLineNo">593</span>  }<a name="line.593"></a>
+<span class="sourceLineNo">594</span><a name="line.594"></a>
+<span class="sourceLineNo">595</span>  /**<a name="line.595"></a>
+<span class="sourceLineNo">596</span>   * @param conf must not be null<a name="line.596"></a>
+<span class="sourceLineNo">597</span>   * @return Returns the filesystem of the hbase rootdir.<a name="line.597"></a>
+<span class="sourceLineNo">598</span>   * @throws IOException from underlying FileSystem<a name="line.598"></a>
+<span class="sourceLineNo">599</span>   */<a name="line.599"></a>
+<span class="sourceLineNo">600</span>  public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {<a name="line.600"></a>
+<span class="sourceLineNo">601</span>    return getRootDir(conf).getFileSystem(conf);<a name="line.601"></a>
+<span class="sourceLineNo">602</span>  }<a name="line.602"></a>
+<span class="sourceLineNo">603</span><a name="line.603"></a>
+<span class="sourceLineNo">604</span>  /**<a name="line.604"></a>
+<span class="sourceLineNo">605</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.605"></a>
+<span class="sourceLineNo">606</span>   * This accommodates differences between hadoop versions, where hadoop 1<a name="line.606"></a>
+<span class="sourceLineNo">607</span>   * does not throw a FileNotFoundException, and return an empty FileStatus[]<a name="line.607"></a>
+<span class="sourceLineNo">608</span>   * while Hadoop 2 will throw FileNotFoundException.<a name="line.608"></a>
+<span class="sourceLineNo">609</span>   *<a name="line.609"></a>
+<span class="sourceLineNo">610</span>   * Where possible, prefer FSUtils#listStatusWithStatusFilter(FileSystem,<a name="line.610"></a>
+<span class="sourceLineNo">611</span>   * Path, FileStatusFilter) instead.<a name="line.611"></a>
+<span class="sourceLineNo">612</span>   *<a name="line.612"></a>
+<span class="sourceLineNo">613</span>   * @param fs file system<a name="line.613"></a>
+<span class="sourceLineNo">614</span>   * @param dir directory<a name="line.614"></a>
+<span class="sourceLineNo">615</span>   * @param filter path filter<a name="line.615"></a>
+<span class="sourceLineNo">616</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.616"></a>
+<span class="sourceLineNo">617</span>   */<a name="line.617"></a>
+<span class="sourceLineNo">618</span>  public static FileStatus[] listStatus(final FileSystem fs,<a name="line.618"></a>
+<span class="sourceLineNo">619</span>      final Path dir, final PathFilter filter) throws IOException {<a name="line.619"></a>
+<span class="sourceLineNo">620</span>    FileStatus [] status = null;<a name="line.620"></a>
+<span class="sourceLineNo">621</span>    try {<a name="line.621"></a>
+<span class="sourceLineNo">622</span>      status = filter == null ? fs.listStatus(dir) : fs.listStatus(dir, filter);<a name="line.622"></a>
+<span class="sourceLineNo">623</span>    } catch (FileNotFoundException fnfe) {<a name="line.623"></a>
+<span class="sourceLineNo">624</span>      // if directory doesn't exist, return null<a name="line.624"></a>
+<span class="sourceLineNo">625</span>      if (LOG.isTraceEnabled()) {<a name="line.625"></a>
+<span class="sourceLineNo">626</span>        LOG.trace("{} doesn't exist", dir);<a name="line.626"></a>
+<span class="sourceLineNo">627</span>      }<a name="line.627"></a>
+<span class="sourceLineNo">628</span>    }<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    if (status == null || status.length &lt; 1) {<a name="line.629"></a>
+<span class="sourceLineNo">630</span>      return null;<a name="line.630"></a>
+<span class="sourceLineNo">631</span>    }<a name="line.631"></a>
+<span class="sourceLineNo">632</span>    return status;<a name="line.632"></a>
+<span class="sourceLineNo">633</span>  }<a name="line.633"></a>
+<span class="sourceLineNo">634</span><a name="line.634"></a>
+<span class="sourceLineNo">635</span>  /**<a name="line.635"></a>
+<span class="sourceLineNo">636</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.636"></a>
+<span class="sourceLineNo">637</span>   * This would accommodates differences between hadoop versions<a name="line.637"></a>
+<span class="sourceLineNo">638</span>   *<a name="line.638"></a>
+<span class="sourceLineNo">639</span>   * @param fs file system<a name="line.639"></a>
+<span class="sourceLineNo">640</span>   * @param dir directory<a name="line.640"></a>
+<span class="sourceLineNo">641</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.641"></a>
+<span class="sourceLineNo">642</span>   */<a name="line.642"></a>
+<span class="sourceLineNo">643</span>  public static FileStatus[] listStatus(final FileSystem fs, final Path dir) throws IOException {<a name="line.643"></a>
+<span class="sourceLineNo">644</span>    return listStatus(fs, dir, null);<a name="line.644"></a>
+<span class="sourceLineNo">645</span>  }<a name="line.645"></a>
+<span class="sourceLineNo">646</span><a name="line.646"></a>
+<span class="sourceLineNo">647</span>  /**<a name="line.647"></a>
+<span class="sourceLineNo">648</span>   * Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call<a name="line.648"></a>
+<span class="sourceLineNo">649</span>   *<a name="line.649"></a>
+<span class="sourceLineNo">650</span>   * @param fs file system<a name="line.650"></a>
+<span class="sourceLineNo">651</span>   * @param dir directory<a name="line.651"></a>
+<span class="sourceLineNo">652</span>   * @return LocatedFileStatus list<a name="line.652"></a>
+<span class="sourceLineNo">653</span>   */<a name="line.653"></a>
+<span class="sourceLineNo">654</span>  public static List&lt;LocatedFileStatus&gt; listLocatedStatus(final FileSystem fs,<a name="line.654"></a>
+<span class="sourceLineNo">655</span>      final Path dir) throws IOException {<a name="line.655"></a>
+<span class="sourceLineNo">656</span>    List&lt;LocatedFileStatus&gt; status = null;<a name="line.656"></a>
+<span class="sourceLineNo">657</span>    try {<a name="line.657"></a>
+<span class="sourceLineNo">658</span>      RemoteIterator&lt;LocatedFileStatus&gt; locatedFileStatusRemoteIterator = fs<a name="line.658"></a>
+<span class="sourceLineNo">659</span>          .listFiles(dir, false);<a name="line.659"></a>
+<span class="sourceLineNo">660</span>      while (locatedFileStatusRemoteIterator.hasNext()) {<a name="line.660"></a>
+<span class="sourceLineNo">661</span>        if (status == null) {<a name="line.661"></a>
+<span class="sourceLineNo">662</span>          status = Lists.newArrayList();<a name="line.662"></a>
+<span class="sourceLineNo">663</span>        }<a name="line.663"></a>
+<span class="sourceLineNo">664</span>        status.add(locatedFileStatusRemoteIterator.next());<a name="line.664"></a>
+<span class="sourceLineNo">665</span>      }<a name="line.665"></a>
+<span class="sourceLineNo">666</span>    } catch (FileNotFoundException fnfe) {<a name="line.666"></a>
+<span class="sourceLineNo">667</span>      // if directory doesn't exist, return null<a name="line.667"></a>
+<span class="sourceLineNo">668</span>      if (LOG.isTraceEnabled()) {<a name="line.668"></a>
+<span class="sourceLineNo">669</span>        LOG.trace("{} doesn't exist", dir);<a name="line.669"></a>
+<span class="sourceLineNo">670</span>      }<a name="line.670"></a>
+<span class="sourceLineNo">671</span>    }<a name="line.671"></a>
+<span class="sourceLineNo">672</span>    return status;<a name="line.672"></a>
+<span class="sourceLineNo">673</span>  }<a name="line.673"></a>
+<span class="sourceLineNo">674</span><a name="line.674"></a>
+<span class="sourceLineNo">675</span>  /**<a name="line.675"></a>
+<span class="sourceLineNo">676</span>   * Calls fs.delete() and returns the value returned by the fs.delete()<a name="line.676"></a>
+<span class="sourceLineNo">677</span>   *<a name="line.677"></a>
+<span class="sourceLineNo">678</span>   * @param fs must not be null<a name="line.678"></a>
+<span class="sourceLineNo">679</span>   * @param path must not be null<a name="line.679"></a>
+<span class="sourceLineNo">680</span>   * @param recursive delete tree rooted at path<a name="line.680"></a>
+<span class="sourceLineNo">681</span>   * @return the value returned by the fs.delete()<a name="line.681"></a>
+<span class="sourceLineNo">682</span>   * @throws IOException from underlying FileSystem<a name="line.682"></a>
+<span class="sourceLineNo">683</span>   */<a name="line.683"></a>
+<span class="sourceLineNo">684</span>  public static boolean delete(final FileSystem fs, final Path path, final boolean recursive)<a name="line.684"></a>
+<span class="sourceLineNo">685</span>      throws IOException {<a name="line.685"></a>
+<span class="sourceLineNo">686</span>    return fs.delete(path, recursive);<a name="line.686"></a>
+<span class="sourceLineNo">687</span>  }<a name="line.687"></a>
+<span class="sourceLineNo">688</span><a name="line.688"></a>
+<span class="sourceLineNo">689</span>  /**<a name="line.689"></a>
+<span class="sourceLineNo">690</span>   * Calls fs.exists(). Checks if the specified path exists<a name="line.690"></a>
+<span class="sourceLineNo">691</span>   *<a name="line.691"></a>
+<span class="sourceLineNo">692</span>   * @param fs must not be null<a name="line.692"></a>
+<span class="sourceLineNo">693</span>   * @param path must not be null<a name="line.693"></a>
+<span class="sourceLineNo">694</span>   * @return the value returned by fs.exists()<a name="line.694"></a>
+<span class="sourceLineNo">695</span>   * @throws IOException from underlying FileSystem<a name="line.695"></a>
+<span class="sourceLineNo">696</span>   */<a name="line.696"></a>
+<span class="sourceLineNo">697</span>  public static boolean isExists(final FileSystem fs, final Path path) throws IOException {<a name="line.697"></a>
+<span class="sourceLineNo">698</span>    return fs.exists(path);<a name="line.698"></a>
+<span class="sourceLineNo">699</span>  }<a name="line.699"></a>
+<span class="sourceLineNo">700</span><a name="line.700"></a>
+<span class="sourceLineNo">701</span>  /**<a name="line.701"></a>
+<span class="sourceLineNo">702</span>   * Log the current state of the filesystem from a certain root directory<a name="line.702"></a>
+<span class="sourceLineNo">703</span>   * @param fs filesystem to investigate<a name="line.703"></a>
+<span class="sourceLineNo">704</span>   * @param root root file/directory to start logging from<a name="line.704"></a>
+<span class="sourceLineNo">705</span>   * @param log log to output information<a name="line.705"></a>
+<span class="sourceLineNo">706</span>   * @throws IOException if an unexpected exception occurs<a name="line.706"></a>
+<span class="sourceLineNo">707</span>   */<a name="line.707"></a>
+<span class="sourceLineNo">708</span>  public static void logFileSystemState(final FileSystem fs, final Path root, Logger log)<a name="line.708"></a>
+<span class="sourceLineNo">709</span>      throws IOException {<a name="line.709"></a>
+<span class="sourceLineNo">710</span>    log.debug("File system contents for path {}", root);<a name="line.710"></a>
+<span class="sourceLineNo">711</span>    logFSTree(log, fs, root, "|-");<a name="line.711"></a>
+<span class="sourceLineNo">712</span>  }<a name="line.712"></a>
+<span class="sourceLineNo">713</span><a name="line.713"></a>
+<span class="sourceLineNo">714</span>  /**<a name="line.714"></a>
+<span class="sourceLineNo">715</span>   * Recursive helper to log the state of the FS<a name="line.715"></a>
 <span class="sourceLineNo">716</span>   *<a name="line.716"></a>
-<span class="sourceLineNo">717</span>   * @param fs file system<a name="line.717"></a>
-<span class="sourceLineNo">718</span>   * @param dir directory<a name="line.718"></a>
-<span class="sourceLineNo">719</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.719"></a>
-<span class="sourceLineNo">720</span>   */<a name="line.720"></a>
-<span class="sourceLineNo">721</span>  public static FileStatus[] listStatus(final FileSystem fs, final Path dir) throws IOException {<a name="line.721"></a>
-<span class="sourceLineNo">722</span>    return listStatus(fs, dir, null);<a name="line.722"></a>
-<span class="sourceLineNo">723</span>  }<a name="line.723"></a>
-<span class="sourceLineNo">724</span><a name="line.724"></a>
-<span class="sourceLineNo">725</span>  /**<a name="line.725"></a>
-<span class="sourceLineNo">726</span>   * Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call<a name="line.726"></a>
-<span class="sourceLineNo">727</span>   *<a name="line.727"></a>
-<span class="sourceLineNo">728</span>   * @param fs file system<a name="line.728"></a>
-<span class="sourceLineNo">729</span>   * @param dir directory<a name="line.729"></a>
-<span class="sourceLineNo">730</span>   * @return LocatedFileStatus list<a name="line.730"></a>
-<span class="sourceLineNo">731</span>   */<a name="line.731"></a>
-<span class="sourceLineNo">732</span>  public static List&lt;LocatedFileStatus&gt; listLocatedStatus(final FileSystem fs,<a name="line.732"></a>
-<span class="sourceLineNo">733</span>      final Path dir) throws IOException {<a name="line.733"></a>
-<span class="sourceLineNo">734</span>    List&lt;LocatedFileStatus&gt; status = null;<a name="line.734"></a>
-<span class="sourceLineNo">735</span>    try {<a name="line.735"></a>
-<span class="sourceLineNo">736</span>      RemoteIterator&lt;LocatedFileStatus&gt; locatedFileStatusRemoteIterator = fs<a name="line.736"></a>
-<span class="sourceLineNo">737</span>          .listFiles(dir, false);<a name="line.737"></a>
-<span class="sourceLineNo">738</span>      while (locatedFileStatusRemoteIterator.hasNext()) {<a name="line.738"></a>
-<span class="sourceLineNo">739</span>        if (status == null) {<a name="line.739"></a>
-<span class="sourceLineNo">740</span>          status = Lists.newArrayList();<a name="line.740"></a>
-<span class="sourceLineNo">741</span>        }<a name="line.741"></a>
-<span class="sourceLineNo">742</span>        status.add(locatedFileStatusRemoteIterator.next());<a name="line.742"></a>
-<span class="sourceLineNo">743</span>      }<a name="line.743"></a>
-<span class="sourceLineNo">744</span>    } catch (FileNotFoundException fnfe) {<a name="line.744"></a>
-<span class="sourceLineNo">745</span>      // if directory doesn't exist, return null<a name="line.745"></a>
-<span class="sourceLineNo">746</span>      if (LOG.isTraceEnabled()) {<a name="line.746"></a>
-<span class="sourceLineNo">747</span>        LOG.trace("{} doesn't exist", dir);<a name="line.747"></a>
-<span class="sourceLineNo">748</span>      }<a name="line.748"></a>
-<span class="sourceLineNo">749</span>    }<a name="line.749"></a>
-<span class="sourceLineNo">750</span>    return status;<a name="line.750"></a>
-<span class="sourceLineNo">751</span>  }<a name="line.751"></a>
-<span class="sourceLineNo">752</span><a name="line.752"></a>
-<span class="sourceLineNo">753</span>  /**<a name="line.753"></a>
-<span class="sourceLineNo">754</span>   * Calls fs.delete() and returns the value returned by the fs.delete()<a name="line.754"></a>
-<span class="sourceLineNo">755</span>   *<a name="line.755"></a>
-<span class="sourceLineNo">756</span>   * @param fs must not be null<a name="line.756"></a>
-<span class="sourceLineNo">757</span>   * @param path must not be null<a name="line.757"></a>
-<span class="sourceLineNo">758</span>   * @param recursive delete tree rooted at path<a name="line.758"></a>
-<span class="sourceLineNo">759</span>   * @return the value returned by the fs.delete()<a name="line.759"></a>
-<span class="sourceLineNo">760</span>   * @throws IOException from underlying FileSystem<a name="line.760"></a>
-<span class="sourceLineNo">761</span>   */<a name="line.761"></a>
-<span class="sourceLineNo">762</span>  public static boolean delete(final FileSystem fs, final Path path, final boolean recursive)<a name="line.762"></a>
-<span class="sourceLineNo">763</span>      throws IOException {<a name="line.763"></a>
-<span class="sourceLineNo">764</span>    return fs.delete(path, recursive);<a name="line.764"></a>
-<span class="sourceLineNo">765</span>  }<a name="line.765"></a>
-<span class="sourceLineNo">766</span><a name="line.766"></a>
-<span class="sourceLineNo">767</span>  /**<a name="line.767"></a>
-<span class="sourceLineNo">768</span>   * Calls fs.exists(). Checks if the specified path exists<a name="line.768"></a>
-<span class="sourceLineNo">769</span>   *<a name="line.769"></a>
-<span class="sourceLineNo">770</span>   * @param fs must not be null<a name="line.770"></a>
-<span class="sourceLineNo">771</span>   * @param path must not be null<a name="line.771"></a>
-<span class="sourceLineNo">772</span>   * @return the value returned by fs.exists()<a name="line.772"></a>
-<span class="sourceLineNo">773</span>   * @throws IOException from underlying FileSystem<a name="line.773"></a>
-<span class="sourceLineNo">774</span>   */<a name="line.774"></a>
-<span class="sourceLineNo">775</span>  public static boolean isExists(final FileSystem fs, final Path path) throws IOException {<a name="line.775"></a>
-<span class="sourceLineNo">776</span>    return fs.exists(path);<a name="line.776"></a>
-<span class="sourceLineNo">777</span>  }<a name="line.777"></a>
+<span class="sourceLineNo">717</span>   * @see #logFileSystemState(FileSystem, Path, Logger)<a name="line.717"></a>
+<span class="sourceLineNo">718</span>   */<a name="line.718"></a>
+<span class="sourceLineNo">719</span>  private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)<a name="line.719"></a>
+<span class="sourceLineNo">720</span>      throws IOException {<a name="line.720"></a>
+<span class="sourceLineNo">721</span>    FileStatus[] files = listStatus(fs, root, null);<a name="line.721"></a>
+<span class="sourceLineNo">722</span>    if (files == null) {<a name="line.722"></a>
+<span class="sourceLineNo">723</span>      return;<a name="line.723"></a>
+<span class="sourceLineNo">724</span>    }<a name="line.724"></a>
+<span class="sourceLineNo">725</span><a name="line.725"></a>
+<span class="sourceLineNo">726</span>    for (FileStatus file : files) {<a name="line.726"></a>
+<span class="sourceLineNo">727</span>      if (file.isDirectory()) {<a name="line.727"></a>
+<span class="sourceLineNo">728</span>        log.debug(prefix + file.getPath().getName() + "/");<a name="line.728"></a>
+<span class="sourceLineNo">729</span>        logFSTree(log, fs, file.getPath(), prefix + "---");<a name="line.729"></a>
+<span class="sourceLineNo">730</span>      } else {<a name="line.730"></a>
+<span class="sourceLineNo">731</span>        log.debug(prefix + file.getPath().getName());<a name="line.731"></a>
+<span class="sourceLineNo">732</span>      }<a name="line.732"></a>
+<span class="sourceLineNo">733</span>    }<a name="line.733"></a>
+<span class="sourceLineNo">734</span>  }<a name="line.734"></a>
+<span class="sourceLineNo">735</span><a name="line.735"></a>
+<span class="sourceLineNo">736</span>  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest)<a name="line.736"></a>
+<span class="sourceLineNo">737</span>      throws IOException {<a name="line.737"></a>
+<span class="sourceLineNo">738</span>    // set the modify time for TimeToLive Cleaner<a name="line.738"></a>
+<span class="sourceLineNo">739</span>    fs.setTimes(src, EnvironmentEdgeManager.currentTime(), -1);<a name="line.739"></a>
+<span class="sourceLineNo">740</span>    return fs.rename(src, dest);<a name="line.740"></a>
+<span class="sourceLineNo">741</span>  }<a name="line.741"></a>
+<span class="sourceLineNo">742</span><a name="line.742"></a>
+<span class="sourceLineNo">743</span>  /**<a name="line.743"></a>
+<span class="sourceLineNo">744</span>   * Check if short circuit read buffer size is set and if not, set it to hbase value.<a name="line.744"></a>
+<span class="sourceLineNo">745</span>   * @param conf must not be null<a name="line.745"></a>
+<span class="sourceLineNo">746</span>   */<a name="line.746"></a>
+<span class="sourceLineNo">747</span>  public static void checkShortCircuitReadBufferSize(final Configuration conf) {<a name="line.747"></a>
+<span class="sourceLineNo">748</span>    final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;<a name="line.748"></a>
+<span class="sourceLineNo">749</span>    final int notSet = -1;<a name="line.749"></a>
+<span class="sourceLineNo">750</span>    // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2<a name="line.750"></a>
+<span class="sourceLineNo">751</span>    final String dfsKey = "dfs.client.read.shortcircuit.buffer.size";<a name="line.751"></a>
+<span class="sourceLineNo">752</span>    int size = conf.getInt(dfsKey, notSet);<a name="line.752"></a>
+<span class="sourceLineNo">753</span>    // If a size is set, return -- we will use it.<a name="line.753"></a>
+<span class="sourceLineNo">754</span>    if (size != notSet) {<a name="line.754"></a>
+<span class="sourceLineNo">755</span>      return;<a name="line.755"></a>
+<span class="sourceLineNo">756</span>    }<a name="line.756"></a>
+<span class="sourceLineNo">757</span>    // But short circuit buffer size is normally not set.  Put in place the hbase wanted size.<a name="line.757"></a>
+<span class="sourceLineNo">758</span>    int hbaseSize = conf.getInt("hbase." + dfsKey, defaultSize);<a name="line.758"></a>
+<span class="sourceLineNo">759</span>    conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));<a name="line.759"></a>
+<span class="sourceLineNo">760</span>  }<a name="line.760"></a>
+<span class="sourceLineNo">761</span><a name="line.761"></a>
+<span class="sourceLineNo">762</span>  private static class DfsBuilderUtility {<a name="line.762"></a>
+<span class="sourceLineNo">763</span>    static Class&lt;?&gt; dfsClass = null;<a name="line.763"></a>
+<span class="sourceLineNo">764</span>    static Method createMethod;<a name="line.764"></a>
+<span class="sourceLineNo">765</span>    static Method overwriteMethod;<a name="line.765"></a>
+<span class="sourceLineNo">766</span>    static Method bufferSizeMethod;<a name="line.766"></a>
+<span class="sourceLineNo">767</span>    static Method blockSizeMethod;<a name="line.767"></a>
+<span class="sourceLineNo">768</span>    static Method recursiveMethod;<a name="line.768"></a>
+<span class="sourceLineNo">769</span>    static Method replicateMethod;<a name="line.769"></a>
+<span class="sourceLineNo">770</span>    static Method replicationMethod;<a name="line.770"></a>
+<span class="sourceLineNo">771</span>    static Method buildMethod;<a name="line.771"></a>
+<span class="sourceLineNo">772</span>    static boolean allMethodsPresent = false;<a name="line.772"></a>
+<span class="sourceLineNo">773</span><a name="line.773"></a>
+<span class="sourceLineNo">774</span>    static {<a name="line.774"></a>
+<span class="sourceLineNo">775</span>      String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";<a name="line.775"></a>
+<span class="sourceLineNo">776</span>      String builderName = dfsName + "$HdfsDataOutputStreamBuilder";<a name="line.776"></a>
+<span class="sourceLineNo">777</span>      Class&lt;?&gt; builderClass = null;<a name="line.777"></a>
 <span class="sourceLineNo">778</span><a name="line.778"></a>
-<span class="sourceLineNo">779</span>  /**<a name="line.779"></a>
-<span class="sourceLineNo">780</span>   * Log the current state of the filesystem from a certain root directory<a name="line.780"></a>
-<span class="sourceLineNo">781</span>   * @param fs filesystem to investigate<a name="line.781"></a>
-<span class="sourceLineNo">782</span>   * @param root root file/directory to start logging from<a name="line.782"></a>
-<span class="sourceLineNo">783</span>   * @param log log to output information<a name="line.783"></a>
-<span class="sourceLineNo">784</span>   * @throws IOException if an unexpected exception occurs<a name="line.784"></a>
-<span class="sourceLineNo">785</span>   */<a name="line.785"></a>
-<span class="sourceLineNo">786</span>  public static void logFileSystemState(final FileSystem fs, final Path root, Logger log)<a name="line.786"></a>
-<span class="sourceLineNo">787</span>      throws IOException {<a name="line.787"></a>
-<span class="sourceLineNo">788</span>    log.debug("File system contents for path {}", root);<a name="line.788"></a>
-<span class="sourceLineNo">789</span>    logFSTree(log, fs, root, "|-");<a name="line.789"></a>
-<span class="sourceLineNo">790</span>  }<a name="line.790"></a>
-<span class="sourceLineNo">791</span><a name="line.791"></a>
-<span class="sourceLineNo">792</span>  /**<a name="line.792"></a>
-<span class="sourceLineNo">793</span>   * Recursive helper to log the state of the FS<a name="line.793"></a>
-<span class="sourceLineNo">794</span>   *<a name="line.794"></a>
-<span class="sourceLineNo">795</span>   * @see #logFileSystemState(FileSystem, Path, Logger)<a name="line.795"></a>
-<span class="sourceLineNo">796</span>   */<a name="line.796"></a>
-<span class="sourceLineNo">797</span>  private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)<a name="line.797"></a>
-<span class="sourceLineNo">798</span>      throws IOException {<a name="line.798"></a>
-<span class="sourceLineNo">799</span>    FileStatus[] files = listStatus(fs, root, null);<a name="line.799"></a>
-<span class="sourceLineNo">800</span>    if (files == null) {<a name="line.800"></a>
-<span class="sourceLineNo">801</span>      return;<a name="line.801"></a>
-<span class="sourceLineNo">802</span>    }<a name="line.802"></a>
-<span class="sourceLineNo">803</span><a name="line.803"></a>
-<span class="sourceLineNo">804</span>    for (FileStatus file : files) {<a name="line.804"></a>
-<span class="sourceLineNo">805</span>      if (file.isDirectory()) {<a name="line.805"></a>
-<span class="sourceLineNo">806</span>        log.debug(prefix + file.getPath().getName() + "/");<a name="line.806"></a>
-<span class="sourceLineNo">807</span>        logFSTree(log, fs, file.getPath(), prefix + "---");<a name="line.807"></a>
-<span class="sourceLineNo">808</span>      } else {<a name="line.808"></a>
-<span class="sourceLineNo">809</span>        log.debug(prefix + file.getPath().getName());<a name="line.809"></a>
-<span class="sourceLineNo">810</span>      }<a name="line.810"></a>
-<span class="sourceLineNo">811</span>    }<a name="line.811"></a>
-<span class="sourceLineNo">812</span>  }<a name="line.812"></a>
-<span class="sourceLineNo">813</span><a name="line.813"></a>
-<span class="sourceLineNo">814</span>  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest)<a name="line.814"></a>
-<span class="sourceLineNo">815</span>      throws IOException {<a name="line.815"></a>
-<span class="sourceLineNo">816</span>    // set the modify time for TimeToLive Cleaner<a name="line.816"></a>
-<span class="sourceLineNo">817</span>    fs.setTimes(src, EnvironmentEdgeManager.currentTime(), -1);<a name="line.817"></a>
-<span class="sourceLineNo">818</span>    return fs.rename(src, dest);<a name="line.818"></a>
-<span class="sourceLineNo">819</span>  }<a name="line.819"></a>
-<span class="sourceLineNo">820</span><a name="line.820"></a>
-<span class="sourceLineNo">821</span>  /**<a name="line.821"></a>
-<span class="sourceLineNo">822</span>   * Check if short circuit read buffer size is set and if not, set it to hbase value.<a name="line.822"></a>
-<span class="sourceLineNo">823</span>   * @param conf must not be null<a name="line.823"></a>
-<span class="sourceLineNo">824</span>   */<a name="line.824"></a>
-<span class="sourceLineNo">825</span>  public static void checkShortCircuitReadBufferSize(final Configuration conf) {<a name="line.825"></a>
-<span class="sourceLineNo">826</span>    final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;<a name="line.826"></a>
-<span class="sourceLineNo">827</span>    final int notSet = -1;<a name="line.827"></a>
-<span class="sourceLineNo">828</span>    // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2<a name="line.828"></a>
-<span class="sourceLineNo">829</span>    final String dfsKey = "dfs.client.read.shortcircuit.buffer.size";<a name="line.829"></a>
-<span class="sourceLineNo">830</span>    int size = conf.getInt(dfsKey, notSet);<a name="line.830"></a>
-<span class="sourceLineNo">831</span>    // If a size is set, return -- we will use it.<a name="line.831"></a>
-<span class="sourceLineNo">832</span>    if (size != notSet) {<a name="line.832"></a>
-<span class="sourceLineNo">833</span>      return;<a name="line.833"></a>
-<span class="sourceLineNo">834</span>    }<a name="line.834"></a>
-<span class="sourceLineNo">835</span>    // But short circuit buffer size is normally not set.  Put in place the hbase wanted size.<a name="line.835"></a>
-<span class="sourceLineNo">836</span>    int hbaseSize = conf.getInt("hbase." + dfsKey, defaultSize);<a name="line.836"></a>
-<span class="sourceLineNo">837</span>    conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));<a name="line.837"></a>
-<span class="sourceLineNo">838</span>  }<a name="line.838"></a>
-<span class="sourceLineNo">839</span><a name="line.839"></a>
-<span class="sourceLineNo">840</span>  private static class DfsBuilderUtility {<a name="line.840"></a>
-<span class="sourceLineNo">841</span>    static Class&lt;?&gt; dfsClass = null;<a name="line.841"></a>
-<span class="sourceLineNo">842</span>    static Method createMethod;<a name="line.842"></a>
-<span class="sourceLineNo">843</span>    static Method overwriteMethod;<a name="line.843"></a>
-<span class="sourceLineNo">844</span>    static Method bufferSizeMethod;<a name="line.844"></a>
-<span class="sourceLineNo">845</span>    static Method blockSizeMethod;<a name="line.845"></a>
-<span class="sourceLineNo">846</span>    static Method recursiveMethod;<a name="line.846"></a>
-<span class="sourceLineNo">847</span>    static Method replicateMethod;<a name="line.847"></a>
-<span class="sourceLineNo">848</span>    static Method replicationMethod;<a name="line.848"></a>
-<span class="sourceLineNo">849</span>    static Method buildMethod;<a name="line.849"></a>
-<span class="sourceLineNo">850</span>    static boolean allMethodsPresent = false;<a name="line.850"></a>
+<span class="sourceLineNo">779</span>      try {<a name="line.779"></a>
+<span class="sourceLineNo">780</span>        dfsClass = Class.forName(dfsName);<a name="line.780"></a>
+<span class="sourceLineNo">781</span>      } catch (ClassNotFoundException e) {<a name="line.781"></a>
+<span class="sourceLineNo">782</span>        LOG.debug("{} not available, will not use builder API for file creation.", dfsName);<a name="line.782"></a>
+<span class="sourceLineNo">783</span>      }<a name="line.783"></a>
+<span class="sourceLineNo">784</span>      try {<a name="line.784"></a>
+<span class="sourceLineNo">785</span>        builderClass = Class.forName(builderName);<a name="line.785"></a>
+<span class="sourceLineNo">786</span>      } catch (ClassNotFoundException e) {<a name="line.786"></a>
+<span class="sourceLineNo">787</span>        LOG.debug("{} not available, will not use builder API for file creation.", builderName);<a name="line.787"></a>
+<span class="sourceLineNo">788</span>      }<a name="line.788"></a>
+<span class="sourceLineNo">789</span><a name="line.789"></a>
+<span class="sourceLineNo">790</span>      if (dfsClass != null &amp;&amp; builderClass != null) {<a name="line.790"></a>
+<span class="sourceLineNo">791</span>        try {<a name="line.791"></a>
+<span class="sourceLineNo">792</span>          createMethod = dfsClass.getMethod("createFile", Path.class);<a name="line.792"></a>
+<span class="sourceLineNo">793</span>          overwriteMethod = builderClass.getMethod("overwrite", boolean.class);<a name="line.793"></a>
+<span class="sourceLineNo">794</span>          bufferSizeMethod = builderClass.getMethod("bufferSize", int.class);<a name="line.794"></a>
+<span class="sourceLineNo">795</span>          blockSizeMethod = builderClass.getMethod("blockSize", long.class);<a name="line.795"></a>
+<span class="sourceLineNo">796</span>          recursiveMethod = builderClass.getMethod("recursive");<a name="line.796"></a>
+<span class="sourceLineNo">797</span>          replicateMethod = builderClass.getMethod("replicate");<a name="line.797"></a>
+<span class="sourceLineNo">798</span>          replicationMethod = builderClass.getMethod("replication", short.class);<a name="line.798"></a>
+<span class="sourceLineNo">799</span>          buildMethod = builderClass.getMethod("build");<a name="line.799"></a>
+<span class="sourceLineNo">800</span><a name="line.800"></a>
+<span class="sourceLineNo">801</span>          allMethodsPresent = true;<a name="line.801"></a>
+<span class="sourceLineNo">802</span>          LOG.debug("Using builder API via reflection for DFS file creation.");<a name="line.802"></a>
+<span class="sourceLineNo">803</span>        } catch (NoSuchMethodException e) {<a name="line.803"></a>
+<span class="sourceLineNo">804</span>          LOG.debug("Could not find method on builder; will use old DFS API for file creation {}",<a name="line.804"></a>
+<span class="sourceLineNo">805</span>              e.getMessage());<a name="line.805"></a>
+<span class="sourceLineNo">806</span>        }<a name="line.806"></a>
+<span class="sourceLineNo">807</span>      }<a name="line.807"></a>
+<span class="sourceLineNo">808</span>    }<a name="line.808"></a>
+<span class="sourceLineNo">809</span><a name="line.809"></a>
+<span class="sourceLineNo">810</span>    /**<a name="line.810"></a>
+<span class="sourceLineNo">811</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.811"></a>
+<span class="sourceLineNo">812</span>     * replication enabled.<a name="line.812"></a>
+<span class="sourceLineNo">813</span>     */<a name="line.813"></a>
+<span class="sourceLineNo">814</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable,<a name="line.814"></a>
+<span class="sourceLineNo">815</span>        int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.815"></a>
+<span class="sourceLineNo">816</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.816"></a>
+<span class="sourceLineNo">817</span>        try {<a name="line.817"></a>
+<span class="sourceLineNo">818</span>          Object builder;<a name="line.818"></a>
+<span class="sourceLineNo">819</span><a name="line.819"></a>
+<span class="sourceLineNo">820</span>          builder = createMethod.invoke(fs, path);<a name="line.820"></a>
+<span class="sourceLineNo">821</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.821"></a>
+<span class="sourceLineNo">822</span>          builder = bufferSizeMethod.invoke(builder, bufferSize);<a name="line.822"></a>
+<span class="sourceLineNo">823</span>          builder = blockSizeMethod.invoke(builder, blockSize);<a name="line.823"></a>
+<span class="sourceLineNo">824</span>          if (isRecursive) {<a name="line.824"></a>
+<span class="sourceLineNo">825</span>            builder = recursiveMethod.invoke(builder);<a name="line.825"></a>
+<span class="sourceLineNo">826</span>          }<a name="line.826"></a>
+<span class="sourceLineNo">827</span>          builder = replicateMethod.invoke(builder);<a name="line.827"></a>
+<span class="sourceLineNo">828</span>          builder = replicationMethod.invoke(builder, replication);<a name="line.828"></a>
+<span class="sourceLineNo">829</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.829"></a>
+<span class="sourceLineNo">830</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.830"></a>
+<span class="sourceLineNo">831</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.831"></a>
+<span class="sourceLineNo">832</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.832"></a>
+<span class="sourceLineNo">833</span>        }<a name="line.833"></a>
+<span class="sourceLineNo">834</span>      }<a name="line.834"></a>
+<span class="sourceLineNo">835</span><a name="line.835"></a>
+<span class="sourceLineNo">836</span>      if (isRecursive) {<a name="line.836"></a>
+<span class="sourceLineNo">837</span>        return fs.create(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.837"></a>
+<span class="sourceLineNo">838</span>      }<a name="line.838"></a>
+<span class="sourceLineNo">839</span>      return fs.createNonRecursive(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.839"></a>
+<span class="sourceLineNo">840</span>    }<a name="line.840"></a>
+<span class="sourceLineNo">841</span><a name="line.841"></a>
+<span class="sourceLineNo">842</span>    /**<a name="line.842"></a>
+<span class="sourceLineNo">843</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.843"></a>
+<span class="sourceLineNo">844</span>     * replication enabled.<a name="line.844"></a>
+<span class="sourceLineNo">845</span>     */<a name="line.845"></a>
+<span class="sourceLineNo">846</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable)<a name="line.846"></a>
+<span class="sourceLineNo">847</span>        throws IOException {<a name="line.847"></a>
+<span class="sourceLineNo">848</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.848"></a>
+<span class="sourceLineNo">849</span>        try {<a name="line.849"></a>
+<span class="sourceLineNo">850</span>          Object builder;<a name="line.850"></a>
 <span class="sourceLineNo">851</span><a name="line.851"></a>
-<span class="sourceLineNo">852</span>    static {<a name="line.852"></a>
-<span class="sourceLineNo">853</span>      String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";<a name="line.853"></a>
-<span class="sourceLineNo">854</span>      String builderName = dfsName + "$HdfsDataOutputStreamBuilder";<a name="line.854"></a>
-<span class="sourceLineNo">855</span>      Class&lt;?&gt; builderClass = null;<a name="line.855"></a>
-<span class="sourceLineNo">856</span><a name="line.856"></a>
-<span class="sourceLineNo">857</span>      try {<a name="line.857"></a>
-<span class="sourceLineNo">858</span>        dfsClass = Class.forName(dfsName);<a name="line.858"></a>
-<span class="sourceLineNo">859</span>      } catch (ClassNotFoundException e) {<a name="line.859"></a>
-<span class="sourceLineNo">860</span>        LOG.debug("{} not available, will not use builder API for file creation.", dfsName);<a name="line.860"></a>
-<span class="sourceLineNo">861</span>      }<a name="line.861"></a>
-<span class="sourceLineNo">862</span>      try {<a name="line.862"></a>
-<span class="sourceLineNo">863</span>        builderClass = Class.forName(builderName);<a name="line.863"></a>
-<span class="sourceLineNo">864</span>      } catch (ClassNotFoundException e) {<a name="line.864"></a>
-<span class="sourceLineNo">865</span>        LOG.debug("{} not available, will not use builder API for file creation.", builderName);<a name="line.865"></a>
-<span class="sourceLineNo">866</span>      }<a name="line.866"></a>
-<span class="sourceLineNo">867</span><a name="line.867"></a>
-<span class="sourceLineNo">868</span>      if (dfsClass != null &amp;&amp; builderClass != null) {<a name="line.868"></a>
-<span class="sourceLineNo">869</span>        try {<a name="line.869"></a>
-<span class="sourceLineNo">870</span>          createMethod = dfsClass.getMethod("createFile", Path.class);<a name="line.870"></a>
-<span class="sourceLineNo">871</span>          overwriteMethod = builderClass.getMethod("overwrite", boolean.class);<a name="line.871"></a>
-<span class="sourceLineNo">872</span>          bufferSizeMethod = builderClass.getMethod("bufferSize", int.class);<a name="line.872"></a>
-<span class="sourceLineNo">873</span>          blockSizeMethod = builderClass.getMethod("blockSize", long.class);<a name="line.873"></a>
-<span class="sourceLineNo">874</span>          recursiveMethod = builderClass.getMethod("recursive");<a name="line.874"></a>
-<span class="sourceLineNo">875</span>          replicateMethod = builderClass.getMethod("replicate");<a name="line.875"></a>
-<span class="sourceLineNo">876</span>          replicationMethod = builderClass.getMethod("replication", short.class);<a name="line.876"></a>
-<span class="sourceLineNo">877</span>          buildMethod = builderClass.getMethod("build");<a name="line.877"></a>
-<span class="sourceLineNo">878</span><a name="line.878"></a>
-<span class="sourceLineNo">879</span>          allMethodsPresent = true;<a name="line.879"></a>
-<span class="sourceLineNo">880</span>          LOG.debug("Using builder API via reflection for DFS file creation.");<a name="line.880"></a>
-<span class="sourceLineNo">881</span>        } catch (NoSuchMethodException e) {<a name="line.881"></a>
-<span class="sourceLineNo">882</span>          LOG.debug("Could not find method on builder; will use old DFS API for file creation {}",<a name="line.882"></a>
-<span class="sourceLineNo">883</span>              e.getMessage());<a name="line.883"></a>
-<span class="sourceLineNo">884</span>        }<a name="line.884"></a>
-<span class="sourceLineNo">885</span>      }<a name="line.885"></a>
-<span class="sourceLineNo">886</span>    }<a name="line.886"></a>
-<span class="sourceLineNo">887</span><a name="line.887"></a>
-<span class="sourceLineNo">888</span>    /**<a name="line.888"></a>
-<span class="sourceLineNo">889</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.889"></a>
-<span class="sourceLineNo">890</span>     * replication enabled.<a name="line.890"></a>
-<span class="sourceLineNo">891</span>     */<a name="line.891"></a>
-<span class="sourceLineNo">892</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable,<a name="line.892"></a>
-<span class="sourceLineNo">893</span>        int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.893"></a>
-<span class="sourceLineNo">894</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.894"></a>
-<span class="sourceLineNo">895</span>        try {<a name="line.895"></a>
-<span class="sourceLineNo">896</span>          Object builder;<a name="line.896"></a>
-<span class="sourceLineNo">897</span><a name="line.897"></a>
-<span class="sourceLineNo">898</span>          builder = createMethod.invoke(fs, path);<a name="line.898"></a>
-<span class="sourceLineNo">899</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.899"></a>
-<span class="sourceLineNo">900</span>          builder = bufferSizeMethod.invoke(builder, bufferSize);<a name="line.900"></a>
-<span class="sourceLineNo">901</span>          builder = blockSizeMethod.invoke(builder, blockSize);<a name="line.901"></a>
-<span class="sourceLineNo">902</span>          if (isRecursive) {<a name="line.902"></a>
-<span class="sourceLineNo">903</span>            builder = recursiveMethod.invoke(builder);<a name="line.903"></a>
-<span class="sourceLineNo">904</span>          }<a name="line.904"></a>
-<span class="sourceLineNo">905</span>          builder = replicateMethod.invoke(builder);<a name="line.905"></a>
-<span class="sourceLineNo">906</span>          builder = replicationMethod.invoke(builder, replication);<a name="line.906"></a>
-<span class="sourceLineNo">907</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.907"></a>
-<span class="sourceLineNo">908</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.908"></a>
-<span class="sourceLineNo">909</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.909"></a>
-<span class="sourceLineNo">910</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.910"></a>
-<span class="sourceLineNo">911</span>        }<a name="line.911"></a>
-<span class="sourceLineNo">912</span>      }<a name="line.912"></a>
-<span class="sourceLineNo">913</span><a name="line.913"></a>
-<span class="sourceLineNo">914</span>      if (isRecursive) {<a name="line.914"></a>
-<span class="sourceLineNo">915</span>        return fs.create(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.915"></a>
-<span class="sourceLineNo">916</span>      }<a name="line.916"></a>
-<span class="sourceLineNo">917</span>      return fs.createNonRecursive(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.917"></a>
+<span class="sourceLineNo">852</span>          builder = createMethod.invoke(fs, path);<a name="line.852"></a>
+<span class="sourceLineNo">853</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.853"></a>
+<span class="sourceLineNo">854</span>          builder = replicateMethod.invoke(builder);<a name="line.854"></a>
+<span class="sourceLineNo">855</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.855"></a>
+<span class="sourceLineNo">856</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.856"></a>
+<span class="sourceLineNo">857</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.857"></a>
+<span class="sourceLineNo">858</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.858"></a>
+<span class="sourceLineNo">859</span>        }<a name="line.859"></a>
+<span class="sourceLineNo">860</span>      }<a name="line.860"></a>
+<span class="sourceLineNo">861</span><a name="line.861"></a>
+<span class="sourceLineNo">862</span>      return fs.create(path, overwritable);<a name="line.862"></a>
+<span class="sourceLineNo">863</span>    }<a name="line.863"></a>
+<span class="sourceLineNo">864</span>  }<a name="line.864"></a>
+<span class="sourceLineNo">865</span><a name="line.865"></a>
+<span class="sourceLineNo">866</span>  /**<a name="line.866"></a>
+<span class="sourceLineNo">867</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.867"></a>
+<span class="sourceLineNo">868</span>   * replication enabled.<a name="line.868"></a>
+<span class="sourceLineNo">869</span>   * &lt;p&gt;<a name="line.869"></a>
+<span class="sourceLineNo">870</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.870"></a>
+<span class="sourceLineNo">871</span>   */<a name="line.871"></a>
+<span class="sourceLineNo">872</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable)<a name="line.872"></a>
+<span class="sourceLineNo">873</span>      throws IOException {<a name="line.873"></a>
+<span class="sourceLineNo">874</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable);<a name="line.874"></a>
+<span class="sourceLineNo">875</span>  }<a name="line.875"></a>
+<span class="sourceLineNo">876</span><a name="line.876"></a>
+<span class="sourceLineNo">877</span>  /**<a name="line.877"></a>
+<span class="sourceLineNo">878</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.878"></a>
+<span class="sourceLineNo">879</span>   * replication enabled.<a name="line.879"></a>
+<span class="sourceLineNo">880</span>   * &lt;p&gt;<a name="line.880"></a>
+<span class="sourceLineNo">881</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.881"></a>
+<span class="sourceLineNo">882</span>   */<a name="line.882"></a>
+<span class="sourceLineNo">883</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable,<a name="line.883"></a>
+<span class="sourceLineNo">884</span>      int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.884"></a>
+<span class="sourceLineNo">885</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable, bufferSize, replication,<a name="line.885"></a>
+<span class="sourceLineNo">886</span>        blockSize, isRecursive);<a name="line.886"></a>
+<span class="sourceLineNo">887</span>  }<a name="line.887"></a>
+<span class="sourceLineNo">888</span><a name="line.888"></a>
+<span class="sourceLineNo">889</span>  // Holder singleton idiom. JVM spec ensures this will be run at most once per Classloader, and<a name="line.889"></a>
+<span class="sourceLineNo">890</span>  // not until we attempt to reference it.<a name="line.890"></a>
+<span class="sourceLineNo">891</span>  private static class StreamCapabilities {<a name="line.891"></a>
+<span class="sourceLineNo">892</span>    public static final boolean PRESENT;<a name="line.892"></a>
+<span class="sourceLineNo">893</span>    public static final Class&lt;?&gt; CLASS;<a name="line.893"></a>
+<span class="sourceLineNo">894</span>    public static final Method METHOD;<a name="line.894"></a>
+<span class="sourceLineNo">895</span>    static {<a name="line.895"></a>
+<span class="sourceLineNo">896</span>      boolean tmp = false;<a name="line.896"></a>
+<span class="sourceLineNo">897</span>      Class&lt;?&gt; clazz = null;<a name="line.897"></a>
+<span class="sourceLineNo">898</span>      Method method = null;<a name="line.898"></a>
+<span class="sourceLineNo">899</span>      try {<a name="line.899"></a>
+<span class="sourceLineNo">900</span>        clazz = Class.forName("org.apache.hadoop.fs.StreamCapabilities");<a name="line.900"></a>
+<span class="sourceLineNo">901</span>        method = clazz.getMethod("hasCapability", String.class);<a name="line.901"></a>
+<span class="sourceLineNo">902</span>        tmp = true;<a name="line.902"></a>
+<span class="sourceLineNo">903</span>      } catch(ClassNotFoundException|NoSuchMethodException|SecurityException exception) {<a name="line.903"></a>
+<span class="sourceLineNo">904</span>        LOG.warn("Your Hadoop installation does not include the StreamCapabilities class from " +<a name="line.904"></a>
+<span class="sourceLineNo">905</span>                 "HDFS-11644, so we will skip checking if any FSDataOutputStreams actually " +<a name="line.905"></a>
+<span class="sourceLineNo">906</span>                 "support hflush/hsync. If you are running on top of HDFS this probably just " +<a name="line.906"></a>
+<span class="sourceLineNo">907</span>                 "means you have an older version and this can be ignored. If you are running on " +<a name="line.907"></a>
+<span class="sourceLineNo">908</span>                 "top of an alternate FileSystem implementation you should manually verify that " +<a name="line.908"></a>
+<span class="sourceLineNo">909</span>                 "hflush and hsync are implemented; otherwise you risk data loss and hard to " +<a name="line.909"></a>
+<span class="sourceLineNo">910</span>                 "diagnose errors when our assumptions are violated.");<a name="line.910"></a>
+<span class="sourceLineNo">911</span>        LOG.debug("The first request to check for StreamCapabilities came from this stacktrace.",<a name="line.911"></a>
+<span class="sourceLineNo">912</span>            exception);<a name="line.912"></a>
+<span class="sourceLineNo">913</span>      } finally {<a name="line.913"></a>
+<span class="sourceLineNo">914</span>        PRESENT = tmp;<a name="line.914"></a>
+<span class="sourceLineNo">915</span>        CLASS = clazz;<a name="line.915"></a>
+<span class="sourceLineNo">916</span>        METHOD = method;<a name="line.916"></a>
+<span class="sourceLineNo">917</span>      }<a name="line.917"></a>
 <span class="sourceLineNo">918</span>    }<a name="line.918"></a>
-<span class="sourceLineNo">919</span><a name="line.919"></a>
-<span class="sourceLineNo">920</span>    /**<a name="line.920"></a>
-<span class="sourceLineNo">921</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.921"></a>
-<span class="sourceLineNo">922</span>     * replication enabled.<a name="line.922"></a>
-<span class="sourceLineNo">923</span>     */<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable)<a name="line.924"></a>
-<span class="sourceLineNo">925</span>        throws IOException {<a name="line.925"></a>
-<span class="sourceLineNo">926</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.926"></a>
-<span class="sourceLineNo">927</span>        try {<a name="line.927"></a>
-<span class="sourceLineNo">928</span>          Object builder;<a name="line.928"></a>
-<span class="sourceLineNo">929</span><a name="line.929"></a>
-<span class="sourceLineNo">930</span>          builder = createMethod.invoke(fs, path);<a name="line.930"></a>
-<span class="sourceLineNo">931</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.931"></a>
-<span class="sourceLineNo">932</span>          builder = replicateMethod.invoke(builder);<a name="line.932"></a>
-<span class="sourceLineNo">933</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.933"></a>
-<span class="sourceLineNo">934</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.934"></a>
-<span class="sourceLineNo">935</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.935"></a>
-<span class="sourceLineNo">936</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.936"></a>
-<span class="sourceLineNo">937</span>        }<a name="line.937"></a>
-<span class="sourceLineNo">938</span>      }<a name="line.938"></a>
-<span class="sourceLineNo">939</span><a name="line.939"></a>
-<span class="sourceLineNo">940</span>      return fs.create(path, overwritable);<a name="line.940"></a>
-<span class="sourceLineNo">941</span>    }<a name="line.941"></a>
-<span class="sourceLineNo">942</span>  }<a name="line.942"></a>
-<span class="sourceLineNo">943</span><a name="line.943"></a>
-<span class="sourceLineNo">944</span>  /**<a name="line.944"></a>
-<span class="sourceLineNo">945</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.945"></a>
-<span class="sourceLineNo">946</span>   * replication enabled.<a name="line.946"></a>
-<span class="sourceLineNo">947</span>   * &lt;p&gt;<a name="line.947"></a>
-<span class="sourceLineNo">948</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.948"></a>
-<span class="sourceLineNo">949</span>   */<a name="line.949"></a>
-<span class="sourceLineNo">950</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable)<a name="line.950"></a>
-<span class="sourceLineNo">951</span>      throws IOException {<a name="line.951"></a>
-<span class="sourceLineNo">952</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable);<a name="line.952"></a>
-<span class="sourceLineNo">953</span>  }<a name="line.953"></a>
-<span class="sourceLineNo">954</span><a name="line.954"></a>
-<span class="sourceLineNo">955</span>  /**<a name="line.955"></a>
-<span class="sourceLineNo">956</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.956"></a>
-<span class="sourceLineNo">957</span>   * replication enabled.<a name="line.957"></a>
-<span class="sourceLineNo">958</span>   * &lt;p&gt;<a name="line.958"></a>
-<span class="sourceLineNo">959</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.959"></a>
-<span class="sourceLineNo">960</span>   */<a name="line.960"></a>
-<span class="sourceLineNo">961</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable,<a name="line.961"></a>
-<span class="sourceLineNo">962</span>      int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.962"></a>
-<span class="sourceLineNo">963</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable, bufferSize, replication,<a name="line.963"></a>
-<span class="sourceLineNo">964</span>        blockSize, isRecursive);<a name="line.964"></a>
-<span class="sourceLineNo">965</span>  }<a name="line.965"></a>
-<span class="sourceLineNo">966</span><a name="line.966"></a>
-<span class="sourceLineNo">967</span>  // Holder singleton idiom. JVM spec ensures this will be run at most once per Classloader, and<a name="line.967"></a>
-<span class="sourceLineNo">968</span>  // not until we attempt to reference it.<a name="line.968"></a>
-<span class="sourceLineNo">969</span>  private static class StreamCapabilities {<a name="line.969"></a>
-<span class="sourceLineNo">970</span>    public static final boolean PRESENT;<a name="line.970"></a>
-<span class="sourceLineNo">971</span>    public static final Class&lt;?&gt; CLASS;<a name="line.971"></a>
-<span class="sourceLineNo">972</span>    public static final Method METHOD;<a name="line.972"></a>
-<span class="sourceLineNo">973</span>    static {<a name="line.973"></a>
-<span class="sourceLineNo">974</span>      boolean tmp = false;<a name="line.974"></a>
-<span class="sourceLineNo">975</span>      Class&lt;?&gt; clazz = null;<a name="line.975"></a>
-<span class="sourceLineNo">976</span>      Method method = null;<a name="line.976"></a>
-<span class="sourceLineNo">977</span>      try {<a name="line.977"></a>
-<span class="sourceLineNo">978</span>        clazz = Class.forName("org.apache.hadoop.fs.StreamCapabilities");<a name="line.978"></a>
-<span class="sourceLineNo">979</span>        method = clazz.getMethod("hasCapability", String.class);<a name="line.979"></a>
-<span class="sourceLineNo">980</span>        tmp = true;<a name="line.980"></a>
-<span class="sourceLineNo">981</span>      } catch(ClassNotFoundException|NoSuchMethodException|SecurityException exception) {<a name="line.981"></a>
-<span class="sourceLineNo">982</span>        LOG.warn("Your Hadoop installation does not include the StreamCapabilities class from " +<a name="line.982"></a>
-<span class="sourceLineNo">983</span>                 "HDFS-11644, so we will skip checking if any FSDataOutputStreams actually " +<a name="line.983"></a>
-<span class="sourceLineNo">984</span>                 "support hflush/hsync. If you are running on top of HDFS this probably just " +<a name="line.984"></a>
-<span class="sourceLineNo">985</span>                 "means you have an older version and this can be ignored. If you are running on " +<a name="line.985"></a>
-<span class="sourceLineNo">986</span>                 "top of an alternate FileSystem implementation you should manually verify that " +<a name="line.986"></a>
-<span class="sourceLineNo">987</span>                 "hflush and hsync are implemented; otherwise you risk data loss and hard to " +<a name="line.987"></a>
-<span class="sourceLineNo">988</span>                 "diagnose errors when our assumptions are violated.");<a name="line.988"></a>
-<span class="sourceLineNo">989</span>        LOG.debug("The first request to check for StreamCapabilities came from this stacktrace.",<a name="line.989"></a>
-<span class="sourceLineNo">990</span>            exception);<a name="line.990"></a>
-<span class="sourceLineNo">991</span>      } finally {<a name="line.991"></a>
-<span class="sourceLineNo">992</span>        PRESENT = tmp;<a name="line.992"></a>
-<span class="sourceLineNo">993</span>        CLASS = clazz;<a name="line.993"></a>
-<span class="sourceLineNo">994</span>        METHOD = method;<a name="line.994"></a>
-<span class="sourceLineNo">995</span>      }<a name="line.995"></a>
-<span class="sourceLineNo">996</span>    }<a name="line.996"></a>
-<span class="sourceLineNo">997</span>  }<a name="line.997"></a>
-<span class="sourceLineNo">998</span><a name="line.998"></a>
-<span class="sourceLineNo">999</span>  /**<a name="line.999"></a>
-<span class="sourceLineNo">1000</span>   * If our FileSystem version includes the StreamCapabilities class, check if the given stream has<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>   * a particular capability.<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>   * @param stream capabilities are per-stream instance, so check this one specifically. must not be<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>   *          null<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>   * @param capability what to look for, per Hadoop Common's FileSystem docs<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>   * @return true if there are no StreamCapabilities. false if there are, but this stream doesn't<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>   *         implement it. return result of asking the stream otherwise.<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>   * @throws NullPointerException if {@code stream} is {@code null}<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>   */<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>  public static boolean hasCapability(FSDataOutputStream stream, String capability) {<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>    // be consistent whether or not StreamCapabilities is present<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>    Objects.requireNonNull(stream, "stream cannot be null");<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>    // If o.a.h.fs.StreamCapabilities doesn't exist, assume everyone does everything<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>    // otherwise old versions of Hadoop will break.<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>    boolean result = true;<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>    if (StreamCapabilities.PRESENT) {<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>      // if StreamCapabilities is present, but the stream doesn't implement it<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>      // or we run into a problem invoking the method,<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>      // we treat that as equivalent to not declaring anything<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>      result = false;<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>      if (StreamCapabilities.CLASS.isAssignableFrom(stream.getClass())) {<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>        try {<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>          result = ((Boolean)StreamCapabilities.METHOD.invoke(stream, capability)).booleanValue();<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>            exception) {<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>          LOG.warn("Your Hadoop installation's StreamCapabilities implementation doesn't match " +<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>              "our understanding of how it's supposed to work. Please file a JIRA and include " +<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>              "the following stack trace. In the mean time we're interpreting this behavior " +<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span>              "difference as a lack of capability support, which will probably cause a failure.",<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>              exception);<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>        }<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span>      }<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>    }<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>    return result;<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>  }<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span><a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>  /**<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>   * Helper exception for those cases where the place where we need to check a stream capability<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>   * is not where we have the needed context to explain the impact and mitigation for a lack.<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>   */<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>  public static class StreamLacksCapabilityException extends Exception {<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>    public StreamLacksCapabilityException(String message, Throwable cause) {<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>      super(message, cause);<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>    }<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>    public StreamLacksCapabilityException(String message) {<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>      super(message);<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>    }<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>  }<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>}<a name="line.1048"></a>
+<span class="sourceLineNo">919</span>  }<a name="line.919"></a>
+<span class="sourceLineNo">920</span><a name="line.920"></a>
+<span class="sourceLineNo">921</span>  /**<a name="line.921"></a>
+<span class="sourceLineNo">922</span>   * If our FileSystem version includes the StreamCapabilities class, check if the given stream has<a name="line.922"></a>
+<span class="sourceLineNo">923</span>   * a particular capability.<a name="line.923"></a>
+<span class="sourceLineNo">924</span>   * @param stream capabilities are per-stream instance, so check this one specifically. must not be<a name="line.924"></a>
+<span class="sourceLineNo">925</span>   *          null<a name="line.925"></a>
+<span class="sourceLineNo">926</span>   * @param capability what to look for, per Hadoop Common's FileSystem docs<a name="line.926"></a>
+<span class="sourceLineNo">927</span>   * @return true if there are no StreamCapabilities. false if there are, but this stream doesn't<a name="line.927"></a>
+<span class="sourceLineNo">928</span>   *         implement it. return result of asking the stream otherwise.<a name="line.928"></a>
+<span class="sourceLineNo">929</span>   * @throws NullPointerException if {@code stream} is {@code null}<a name="line.929"></a>
+<span class="sourceLineNo">930</span>   */<a name="line.930"></a>
+<span class="sourceLineNo">931</span>  public static boolean hasCapability(FSDataOutputStream stream, String capability) {<a name="line.931"></a>
+<span class="sourceLineNo">932</span>    // be consistent whether or not StreamCapabilities is present<a name="line.932"></a>
+<span class="sourceLineNo">933</span>    Objects.requireNonNull(stream, "stream cannot be null");<a name="line.933"></a>
+<span class="sourceLineNo">934</span>    // If o.a.h.fs.StreamCapabilities doesn't exist, assume everyone does everything<a name="line.934"></a>
+<span class="sourceLineNo">935</span>    // otherwise old versions of Hadoop will break.<a name="line.935"></a>
+<span class="sourceLineNo">936</span>    boolean result = true;<a name="line.936"></a>
+<span class="sourceLineNo">937</span>    if (StreamCapabilities.PRESENT) {<a name="line.937"></a>
+<span class="sourceLineNo">938</span>      // if StreamCapabilities is present, but the stream doesn't implement it<a name="line.938"></a>
+<span class="sourceLineNo">939</span>      // or we run into a problem invoking the method,<a name="line.939"></a>
+<span class="sourceLineNo">940</span>      // we treat that as equivalent to not declaring anything<a name="line.940"></a>
+<span class="sourceLineNo">941</span>      result = false;<a name="line.941"></a>
+<span class="sourceLineNo">942</span>      if (StreamCapabilities.CLASS.isAssignableFrom(stream.getClass())) {<a name="line.942"></a>
+<span class="sourceLineNo">943</span>        try {<a name="line.943"></a>
+<span class="sourceLineNo">944</span>          result = ((Boolean)StreamCapabilities.METHOD.invoke(stream, capability)).booleanValue();<a name="line.944"></a>
+<span class="sourceLineNo">945</span>        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException<a name="line.945"></a>
+<span class="sourceLineNo">946</span>            exception) {<a name="line.946"></a>
+<span class="sourceLineNo">947</span>          LOG.warn("Your Hadoop installation's StreamCapabilities implementation doesn't match " +<a name="line.947"></a>
+<span class="sourceLineNo">948</span>              "our understanding of how it's supposed to work. Please file a JIRA and include " +<a name="line.948"></a>
+<span class="sourceLineNo">949</span>              "the following stack trace. In the mean time we're interpreting this behavior " +<a name="line.949"></a>
+<span class="sourceLineNo">950</span>              "difference as a lack of capability support, which will probably cause a failure.",<a name="line.950"></a>
+<span class="sourceLineNo">951</span>              exception);<a name="line.951"></a>
+<span class="sourceLineNo">952</span>        }<a name="line.952"></a>
+<span class="sourceLineNo">953</span>      }<a name="line.953"></a>
+<span class="sourceLineNo">954</span>    }<a name="line.954"></a>
+<span class="sourceLineNo">955</span>    return result;<a name="line.955"></a>
+<span class="sourceLineNo">956</span>  }<a name="line.956"></a>
+<span class="sourceLineNo">957</span><a name="line.957"></a>
+<span class="sourceLineNo">958</span>  /**<a name="line.958"></a>
+<span class="sourceLineNo">959</span>   * Helper exception for those cases where the place where we need to check a stream capability<a name="line.959"></a>
+<span class="sourceLineNo">960</span>   * is not where we have the needed context to explain the impact and mitigation for a lack.<a name="line.960"></a>
+<span class="sourceLineNo">961</span>   */<a name="line.961"></a>
+<span class="sourceLineNo">962</span>  public static class StreamLacksCapabilityException extends Exception {<a name="line.962"></a>
+<span class="sourceLineNo">963</span>    public StreamLacksCapabilityException(String message, Throwable cause) {<a name="line.963"></a>
+<span class="sourceLineNo">964</span>      super(message, cause);<a name="line.964"></a>
+<span class="sourceLineNo">965</span>    }<a name="line.965"></a>
+<span class="sourceLineNo">966</span>    public StreamLacksCapabilityException(String message) {<a name="line.966"></a>
+<span class="sourceLineNo">967</span>      super(message);<a name="line.967"></a>
+<span class="sourceLineNo">968</span>    }<a name="line.968"></a>
+<span class="sourceLineNo">969</span>  }<a name="line.969"></a>
+<span class="sourceLineNo">970</span>}<a name="line.970"></a>
 
 
 
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html b/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html
index a739df0..fb9defa 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.StreamLacksCapabilityException.html
@@ -157,903 +157,825 @@
 <span class="sourceLineNo">149</span>   * Return the number of bytes that large input files should be optimally<a name="line.149"></a>
 <span class="sourceLineNo">150</span>   * be split into to minimize i/o time.<a name="line.150"></a>
 <span class="sourceLineNo">151</span>   *<a name="line.151"></a>
-<span class="sourceLineNo">152</span>   * use reflection to search for getDefaultBlockSize(Path f)<a name="line.152"></a>
-<span class="sourceLineNo">153</span>   * if the method doesn't exist, fall back to using getDefaultBlockSize()<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   *<a name="line.154"></a>
-<span class="sourceLineNo">155</span>   * @param fs filesystem object<a name="line.155"></a>
-<span class="sourceLineNo">156</span>   * @return the default block size for the path's filesystem<a name="line.156"></a>
-<span class="sourceLineNo">157</span>   * @throws IOException e<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   */<a name="line.158"></a>
-<span class="sourceLineNo">159</span>  public static long getDefaultBlockSize(final FileSystem fs, final Path path) throws IOException {<a name="line.159"></a>
-<span class="sourceLineNo">160</span>    Method m = null;<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    Class&lt;? extends FileSystem&gt; cls = fs.getClass();<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    try {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>      m = cls.getMethod("getDefaultBlockSize", Path.class);<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    } catch (NoSuchMethodException e) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>      LOG.info("FileSystem doesn't support getDefaultBlockSize");<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    } catch (SecurityException e) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>      LOG.info("Doesn't have access to getDefaultBlockSize on FileSystems", e);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      m = null; // could happen on setAccessible()<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    }<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    if (m == null) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      return fs.getDefaultBlockSize(path);<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    } else {<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      try {<a name="line.173"></a>
-<span class="sourceLineNo">174</span>        Object ret = m.invoke(fs, path);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        return ((Long)ret).longValue();<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      } catch (Exception e) {<a name="line.176"></a>
-<span class="sourceLineNo">177</span>        throw new IOException(e);<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      }<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    }<a name="line.179"></a>
-<span class="sourceLineNo">180</span>  }<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>  /*<a name="line.182"></a>
-<span class="sourceLineNo">183</span>   * Get the default replication.<a name="line.183"></a>
-<span class="sourceLineNo">184</span>   *<a name="line.184"></a>
-<span class="sourceLineNo">185</span>   * use reflection to search for getDefaultReplication(Path f)<a name="line.185"></a>
-<span class="sourceLineNo">186</span>   * if the method doesn't exist, fall back to using getDefaultReplication()<a name="line.186"></a>
-<span class="sourceLineNo">187</span>   *<a name="line.187"></a>
-<span class="sourceLineNo">188</span>   * @param fs filesystem object<a name="line.188"></a>
-<span class="sourceLineNo">189</span>   * @param f path of file<a name="line.189"></a>
-<span class="sourceLineNo">190</span>   * @return default replication for the path's filesystem<a name="line.190"></a>
-<span class="sourceLineNo">191</span>   * @throws IOException e<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   */<a name="line.192"></a>
-<span class="sourceLineNo">193</span>  public static short getDefaultReplication(final FileSystem fs, final Path path)<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      throws IOException {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    Method m = null;<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    Class&lt;? extends FileSystem&gt; cls = fs.getClass();<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    try {<a name="line.197"></a>
-<span class="sourceLineNo">198</span>      m = cls.getMethod("getDefaultReplication", Path.class);<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    } catch (NoSuchMethodException e) {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>      LOG.info("FileSystem doesn't support getDefaultReplication");<a name="line.200"></a>
-<span class="sourceLineNo">201</span>    } catch (SecurityException e) {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>      LOG.info("Doesn't have access to getDefaultReplication on FileSystems", e);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      m = null; // could happen on setAccessible()<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    }<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    if (m == null) {<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      return fs.getDefaultReplication(path);<a name="line.206"></a>
-<span class="sourceLineNo">207</span>    } else {<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      try {<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        Object ret = m.invoke(fs, path);<a name="line.209"></a>
-<span class="sourceLineNo">210</span>        return ((Number)ret).shortValue();<a name="line.210"></a>
-<span class="sourceLineNo">211</span>      } catch (Exception e) {<a name="line.211"></a>
-<span class="sourceLineNo">212</span>        throw new IOException(e);<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      }<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>  }<a name="line.215"></a>
-<span class="sourceLineNo">216</span><a name="line.216"></a>
-<span class="sourceLineNo">217</span>  /**<a name="line.217"></a>
-<span class="sourceLineNo">218</span>   * Returns the default buffer size to use during writes.<a name="line.218"></a>
-<span class="sourceLineNo">219</span>   *<a name="line.219"></a>
-<span class="sourceLineNo">220</span>   * The size of the buffer should probably be a multiple of hardware<a name="line.220"></a>
-<span class="sourceLineNo">221</span>   * page size (4096 on Intel x86), and it determines how much data is<a name="line.221"></a>
-<span class="sourceLineNo">222</span>   * buffered during read and write operations.<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   *<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   * @param fs filesystem object<a name="line.224"></a>
-<span class="sourceLineNo">225</span>   * @return default buffer size to use during writes<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>  public static int getDefaultBufferSize(final FileSystem fs) {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    return fs.getConf().getInt("io.file.buffer.size", 4096);<a name="line.228"></a>
-<span class="sourceLineNo">229</span>  }<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>  /**<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   * Create the specified file on the filesystem. By default, this will:<a name="line.232"></a>
-<span class="sourceLineNo">233</span>   * &lt;ol&gt;<a name="line.233"></a>
-<span class="sourceLineNo">234</span>   * &lt;li&gt;apply the umask in the configuration (if it is enabled)&lt;/li&gt;<a name="line.234"></a>
-<span class="sourceLineNo">235</span>   * &lt;li&gt;use the fs configured buffer size (or 4096 if not set)&lt;/li&gt;<a name="line.235"></a>
-<span class="sourceLineNo">236</span>   * &lt;li&gt;use the default replication&lt;/li&gt;<a name="line.236"></a>
-<span class="sourceLineNo">237</span>   * &lt;li&gt;use the default block size&lt;/li&gt;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>   * &lt;li&gt;not track progress&lt;/li&gt;<a name="line.238"></a>
-<span class="sourceLineNo">239</span>   * &lt;/ol&gt;<a name="line.239"></a>
-<span class="sourceLineNo">240</span>   *<a name="line.240"></a>
-<span class="sourceLineNo">241</span>   * @param fs {@link FileSystem} on which to write the file<a name="line.241"></a>
-<span class="sourceLineNo">242</span>   * @param path {@link Path} to the file to write<a name="line.242"></a>
-<span class="sourceLineNo">243</span>   * @param perm intial permissions<a name="line.243"></a>
-<span class="sourceLineNo">244</span>   * @param overwrite Whether or not the created file should be overwritten.<a name="line.244"></a>
-<span class="sourceLineNo">245</span>   * @return output stream to the created file<a name="line.245"></a>
-<span class="sourceLineNo">246</span>   * @throws IOException if the file cannot be created<a name="line.246"></a>
-<span class="sourceLineNo">247</span>   */<a name="line.247"></a>
-<span class="sourceLineNo">248</span>  public static FSDataOutputStream create(FileSystem fs, Path path,<a name="line.248"></a>
-<span class="sourceLineNo">249</span>      FsPermission perm, boolean overwrite) throws IOException {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    if (LOG.isTraceEnabled()) {<a name="line.250"></a>
-<span class="sourceLineNo">251</span>      LOG.trace("Creating file={} with permission={}, overwrite={}", path, perm, overwrite);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    }<a name="line.252"></a>
-<span class="sourceLineNo">253</span>    return fs.create(path, perm, overwrite, getDefaultBufferSize(fs),<a name="line.253"></a>
-<span class="sourceLineNo">254</span>        getDefaultReplication(fs, path), getDefaultBlockSize(fs, path), null);<a name="line.254"></a>
-<span class="sourceLineNo">255</span>  }<a name="line.255"></a>
-<span class="sourceLineNo">256</span><a name="line.256"></a>
-<span class="sourceLineNo">257</span>  /**<a name="line.257"></a>
-<span class="sourceLineNo">258</span>   * Get the file permissions specified in the configuration, if they are<a name="line.258"></a>
-<span class="sourceLineNo">259</span>   * enabled.<a name="line.259"></a>
-<span class="sourceLineNo">260</span>   *<a name="line.260"></a>
-<span class="sourceLineNo">261</span>   * @param fs filesystem that the file will be created on.<a name="line.261"></a>
-<span class="sourceLineNo">262</span>   * @param conf configuration to read for determining if permissions are<a name="line.262"></a>
-<span class="sourceLineNo">263</span>   *          enabled and which to use<a name="line.263"></a>
-<span class="sourceLineNo">264</span>   * @param permssionConfKey property key in the configuration to use when<a name="line.264"></a>
-<span class="sourceLineNo">265</span>   *          finding the permission<a name="line.265"></a>
-<span class="sourceLineNo">266</span>   * @return the permission to use when creating a new file on the fs. If<a name="line.266"></a>
-<span class="sourceLineNo">267</span>   *         special permissions are not specified in the configuration, then<a name="line.267"></a>
-<span class="sourceLineNo">268</span>   *         the default permissions on the the fs will be returned.<a name="line.268"></a>
-<span class="sourceLineNo">269</span>   */<a name="line.269"></a>
-<span class="sourceLineNo">270</span>  public static FsPermission getFilePermissions(final FileSystem fs,<a name="line.270"></a>
-<span class="sourceLineNo">271</span>      final Configuration conf, final String permssionConfKey) {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    boolean enablePermissions = conf.getBoolean(<a name="line.272"></a>
-<span class="sourceLineNo">273</span>        HConstants.ENABLE_DATA_FILE_UMASK, false);<a name="line.273"></a>
-<span class="sourceLineNo">274</span><a name="line.274"></a>
-<span class="sourceLineNo">275</span>    if (enablePermissions) {<a name="line.275"></a>
-<span class="sourceLineNo">276</span>      try {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>        // make sure that we have a mask, if not, go default.<a name="line.278"></a>
-<span class="sourceLineNo">279</span>        String mask = conf.get(permssionConfKey);<a name="line.279"></a>
-<span class="sourceLineNo">280</span>        if (mask == null) {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>          return FsPermission.getFileDefault();<a name="line.281"></a>
-<span class="sourceLineNo">282</span>        }<a name="line.282"></a>
-<span class="sourceLineNo">283</span>        // appy the umask<a name="line.283"></a>
-<span class="sourceLineNo">284</span>        FsPermission umask = new FsPermission(mask);<a name="line.284"></a>
-<span class="sourceLineNo">285</span>        return perm.applyUMask(umask);<a name="line.285"></a>
-<span class="sourceLineNo">286</span>      } catch (IllegalArgumentException e) {<a name="line.286"></a>
-<span class="sourceLineNo">287</span>        LOG.warn(<a name="line.287"></a>
-<span class="sourceLineNo">288</span>            "Incorrect umask attempted to be created: "<a name="line.288"></a>
-<span class="sourceLineNo">289</span>                + conf.get(permssionConfKey)<a name="line.289"></a>
-<span class="sourceLineNo">290</span>                + ", using default file permissions.", e);<a name="line.290"></a>
-<span class="sourceLineNo">291</span>        return FsPermission.getFileDefault();<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      }<a name="line.292"></a>
-<span class="sourceLineNo">293</span>    }<a name="line.293"></a>
-<span class="sourceLineNo">294</span>    return FsPermission.getFileDefault();<a name="line.294"></a>
-<span class="sourceLineNo">295</span>  }<a name="line.295"></a>
-<span class="sourceLineNo">296</span><a name="line.296"></a>
-<span class="sourceLineNo">297</span>  /**<a name="line.297"></a>
-<span class="sourceLineNo">298</span>   * Verifies root directory path is a valid URI with a scheme<a name="line.298"></a>
-<span class="sourceLineNo">299</span>   *<a name="line.299"></a>
-<span class="sourceLineNo">300</span>   * @param root root directory path<a name="line.300"></a>
-<span class="sourceLineNo">301</span>   * @return Passed &lt;code&gt;root&lt;/code&gt; argument.<a name="line.301"></a>
-<span class="sourceLineNo">302</span>   * @throws IOException if not a valid URI with a scheme<a name="line.302"></a>
-<span class="sourceLineNo">303</span>   */<a name="line.303"></a>
-<span class="sourceLineNo">304</span>  public static Path validateRootPath(Path root) throws IOException {<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    try {<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      URI rootURI = new URI(root.toString());<a name="line.306"></a>
-<span class="sourceLineNo">307</span>      String scheme = rootURI.getScheme();<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      if (scheme == null) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>        throw new IOException("Root directory does not have a scheme");<a name="line.309"></a>
-<span class="sourceLineNo">310</span>      }<a name="line.310"></a>
-<span class="sourceLineNo">311</span>      return root;<a name="line.311"></a>
-<span class="sourceLineNo">312</span>    } catch (URISyntaxException e) {<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      throw new IOException("Root directory path is not a valid " +<a name="line.313"></a>
-<span class="sourceLineNo">314</span>        "URI -- check your " + HConstants.HBASE_DIR + " configuration", e);<a name="line.314"></a>
-<span class="sourceLineNo">315</span>    }<a name="line.315"></a>
-<span class="sourceLineNo">316</span>  }<a name="line.316"></a>
-<span class="sourceLineNo">317</span><a name="line.317"></a>
-<span class="sourceLineNo">318</span>  /**<a name="line.318"></a>
-<span class="sourceLineNo">319</span>   * Checks for the presence of the WAL log root path (using the provided conf object) in the given<a name="line.319"></a>
-<span class="sourceLineNo">320</span>   * path. If it exists, this method removes it and returns the String representation of remaining<a name="line.320"></a>
-<span class="sourceLineNo">321</span>   * relative path.<a name="line.321"></a>
-<span class="sourceLineNo">322</span>   * @param path must not be null<a name="line.322"></a>
-<span class="sourceLineNo">323</span>   * @param conf must not be null<a name="line.323"></a>
-<span class="sourceLineNo">324</span>   * @return String representation of the remaining relative path<a name="line.324"></a>
-<span class="sourceLineNo">325</span>   * @throws IOException from underlying filesystem<a name="line.325"></a>
-<span class="sourceLineNo">326</span>   */<a name="line.326"></a>
-<span class="sourceLineNo">327</span>  public static String removeWALRootPath(Path path, final Configuration conf) throws IOException {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    Path root = getWALRootDir(conf);<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    String pathStr = path.toString();<a name="line.329"></a>
-<span class="sourceLineNo">330</span>    // check that the path is absolute... it has the root path in it.<a name="line.330"></a>
-<span class="sourceLineNo">331</span>    if (!pathStr.startsWith(root.toString())) {<a name="line.331"></a>
-<span class="sourceLineNo">332</span>      return pathStr;<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    }<a name="line.333"></a>
-<span class="sourceLineNo">334</span>    // if not, return as it is.<a name="line.334"></a>
-<span class="sourceLineNo">335</span>    return pathStr.substring(root.toString().length() + 1);// remove the "/" too.<a name="line.335"></a>
-<span class="sourceLineNo">336</span>  }<a name="line.336"></a>
-<span class="sourceLineNo">337</span><a name="line.337"></a>
-<span class="sourceLineNo">338</span>  /**<a name="line.338"></a>
-<span class="sourceLineNo">339</span>   * Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This<a name="line.339"></a>
-<span class="sourceLineNo">340</span>   * method returns the 'path' component of a Path's URI: e.g. If a Path is<a name="line.340"></a>
-<span class="sourceLineNo">341</span>   * &lt;code&gt;hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;,<a name="line.341"></a>
-<span class="sourceLineNo">342</span>   * this method returns &lt;code&gt;/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;.<a name="line.342"></a>
-<span class="sourceLineNo">343</span>   * This method is useful if you want to print out a Path without qualifying<a name="line.343"></a>
-<span class="sourceLineNo">344</span>   * Filesystem instance.<a name="line.344"></a>
-<span class="sourceLineNo">345</span>   * @param p Filesystem Path whose 'path' component we are to return.<a name="line.345"></a>
-<span class="sourceLineNo">346</span>   * @return Path portion of the Filesystem<a name="line.346"></a>
-<span class="sourceLineNo">347</span>   */<a name="line.347"></a>
-<span class="sourceLineNo">348</span>  public static String getPath(Path p) {<a name="line.348"></a>
-<span class="sourceLineNo">349</span>    return p.toUri().getPath();<a name="line.349"></a>
-<span class="sourceLineNo">350</span>  }<a name="line.350"></a>
-<span class="sourceLineNo">351</span><a name="line.351"></a>
-<span class="sourceLineNo">352</span>  /**<a name="line.352"></a>
-<span class="sourceLineNo">353</span>   * @param c configuration<a name="line.353"></a>
-<span class="sourceLineNo">354</span>   * @return {@link Path} to hbase root directory from<a name="line.354"></a>
-<span class="sourceLineNo">355</span>   *     configuration as a qualified Path.<a name="line.355"></a>
-<span class="sourceLineNo">356</span>   * @throws IOException e<a name="line.356"></a>
-<span class="sourceLineNo">357</span>   */<a name="line.357"></a>
-<span class="sourceLineNo">358</span>  public static Path getRootDir(final Configuration c) throws IOException {<a name="line.358"></a>
-<span class="sourceLineNo">359</span>    Path p = new Path(c.get(HConstants.HBASE_DIR));<a name="line.359"></a>
-<span class="sourceLineNo">360</span>    FileSystem fs = p.getFileSystem(c);<a name="line.360"></a>
-<span class="sourceLineNo">361</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.361"></a>
-<span class="sourceLineNo">362</span>  }<a name="line.362"></a>
-<span class="sourceLineNo">363</span><a name="line.363"></a>
-<span class="sourceLineNo">364</span>  public static void setRootDir(final Configuration c, final Path root) {<a name="line.364"></a>
-<span class="sourceLineNo">365</span>    c.set(HConstants.HBASE_DIR, root.toString());<a name="line.365"></a>
-<span class="sourceLineNo">366</span>  }<a name="line.366"></a>
-<span class="sourceLineNo">367</span><a name="line.367"></a>
-<span class="sourceLineNo">368</span>  public static void setFsDefault(final Configuration c, final Path root) {<a name="line.368"></a>
-<span class="sourceLineNo">369</span>    c.set("fs.defaultFS", root.toString());    // for hadoop 0.21+<a name="line.369"></a>
-<span class="sourceLineNo">370</span>  }<a name="line.370"></a>
-<span class="sourceLineNo">371</span><a name="line.371"></a>
-<span class="sourceLineNo">372</span>  public static FileSystem getRootDirFileSystem(final Configuration c) throws IOException {<a name="line.372"></a>
-<span class="sourceLineNo">373</span>    Path p = getRootDir(c);<a name="line.373"></a>
-<span class="sourceLineNo">374</span>    return p.getFileSystem(c);<a name="line.374"></a>
-<span class="sourceLineNo">375</span>  }<a name="line.375"></a>
-<span class="sourceLineNo">376</span><a name="line.376"></a>
-<span class="sourceLineNo">377</span>  /**<a name="line.377"></a>
-<span class="sourceLineNo">378</span>   * @param c configuration<a name="line.378"></a>
-<span class="sourceLineNo">379</span>   * @return {@link Path} to hbase log root directory: e.g. {@value HBASE_WAL_DIR} from<a name="line.379"></a>
-<span class="sourceLineNo">380</span>   *     configuration as a qualified Path. Defaults to HBase root dir.<a name="line.380"></a>
-<span class="sourceLineNo">381</span>   * @throws IOException e<a name="line.381"></a>
-<span class="sourceLineNo">382</span>   */<a name="line.382"></a>
-<span class="sourceLineNo">383</span>  public static Path getWALRootDir(final Configuration c) throws IOException {<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    Path p = new Path(c.get(HBASE_WAL_DIR, c.get(HConstants.HBASE_DIR)));<a name="line.384"></a>
-<span class="sourceLineNo">385</span>    if (!isValidWALRootDir(p, c)) {<a name="line.385"></a>
-<span class="sourceLineNo">386</span>      return getRootDir(c);<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    }<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    FileSystem fs = p.getFileSystem(c);<a name="line.388"></a>
-<span class="sourceLineNo">389</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.389"></a>
-<span class="sourceLineNo">390</span>  }<a name="line.390"></a>
-<span class="sourceLineNo">391</span><a name="line.391"></a>
-<span class="sourceLineNo">392</span>  @VisibleForTesting<a name="line.392"></a>
-<span class="sourceLineNo">393</span>  public static void setWALRootDir(final Configuration c, final Path root) {<a name="line.393"></a>
-<span class="sourceLineNo">394</span>    c.set(HBASE_WAL_DIR, root.toString());<a name="line.394"></a>
-<span class="sourceLineNo">395</span>  }<a name="line.395"></a>
-<span class="sourceLineNo">396</span><a name="line.396"></a>
-<span class="sourceLineNo">397</span>  public static FileSystem getWALFileSystem(final Configuration c) throws IOException {<a name="line.397"></a>
-<span class="sourceLineNo">398</span>    Path p = getWALRootDir(c);<a name="line.398"></a>
-<span class="sourceLineNo">399</span>    FileSystem fs = p.getFileSystem(c);<a name="line.399"></a>
-<span class="sourceLineNo">400</span>    // hadoop-core does fs caching, so need to propogate this if set<a name="line.400"></a>
-<span class="sourceLineNo">401</span>    String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);<a name="line.401"></a>
-<span class="sourceLineNo">402</span>    if (enforceStreamCapability != null) {<a name="line.402"></a>
-<span class="sourceLineNo">403</span>      fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);<a name="line.403"></a>
-<span class="sourceLineNo">404</span>    }<a name="line.404"></a>
-<span class="sourceLineNo">405</span>    return fs;<a name="line.405"></a>
-<span class="sourceLineNo">406</span>  }<a name="line.406"></a>
-<span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>  private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {<a name="line.408"></a>
-<span class="sourceLineNo">409</span>    Path rootDir = getRootDir(c);<a name="line.409"></a>
-<span class="sourceLineNo">410</span>    FileSystem fs = walDir.getFileSystem(c);<a name="line.410"></a>
-<span class="sourceLineNo">411</span>    Path qualifiedWalDir = walDir.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.411"></a>
-<span class="sourceLineNo">412</span>    if (!qualifiedWalDir.equals(rootDir)) {<a name="line.412"></a>
-<span class="sourceLineNo">413</span>      if (qualifiedWalDir.toString().startsWith(rootDir.toString() + "/")) {<a name="line.413"></a>
-<span class="sourceLineNo">414</span>        throw new IllegalStateException("Illegal WAL directory specified. " +<a name="line.414"></a>
-<span class="sourceLineNo">415</span>            "WAL directories are not permitted to be under the root directory if set.");<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      }<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    }<a name="line.417"></a>
-<span class="sourceLineNo">418</span>    return true;<a name="line.418"></a>
-<span class="sourceLineNo">419</span>  }<a name="line.419"></a>
-<span class="sourceLineNo">420</span><a name="line.420"></a>
-<span class="sourceLineNo">421</span>  /**<a name="line.421"></a>
-<span class="sourceLineNo">422</span>   * Returns the WAL region directory based on the given table name and region name<a name="line.422"></a>
-<span class="sourceLineNo">423</span>   * @param conf configuration to determine WALRootDir<a name="line.423"></a>
-<span class="sourceLineNo">424</span>   * @param tableName Table that the region is under<a name="line.424"></a>
-<span class="sourceLineNo">425</span>   * @param encodedRegionName Region name used for creating the final region directory<a name="line.425"></a>
-<span class="sourceLineNo">426</span>   * @return the region directory used to store WALs under the WALRootDir<a name="line.426"></a>
-<span class="sourceLineNo">427</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.427"></a>
-<span class="sourceLineNo">428</span>   */<a name="line.428"></a>
-<span class="sourceLineNo">429</span>  public static Path getWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.429"></a>
-<span class="sourceLineNo">430</span>      final String encodedRegionName) throws IOException {<a name="line.430"></a>
-<span class="sourceLineNo">431</span>    return new Path(getWALTableDir(conf, tableName), encodedRegionName);<a name="line.431"></a>
-<span class="sourceLineNo">432</span>  }<a name="line.432"></a>
-<span class="sourceLineNo">433</span><a name="line.433"></a>
-<span class="sourceLineNo">434</span>  /**<a name="line.434"></a>
-<span class="sourceLineNo">435</span>   * Returns the Table directory under the WALRootDir for the specified table name<a name="line.435"></a>
-<span class="sourceLineNo">436</span>   * @param conf configuration used to get the WALRootDir<a name="line.436"></a>
-<span class="sourceLineNo">437</span>   * @param tableName Table to get the directory for<a name="line.437"></a>
-<span class="sourceLineNo">438</span>   * @return a path to the WAL table directory for the specified table<a name="line.438"></a>
-<span class="sourceLineNo">439</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.439"></a>
-<span class="sourceLineNo">440</span>   */<a name="line.440"></a>
-<span class="sourceLineNo">441</span>  public static Path getWALTableDir(final Configuration conf, final TableName tableName)<a name="line.441"></a>
-<span class="sourceLineNo">442</span>      throws IOException {<a name="line.442"></a>
-<span class="sourceLineNo">443</span>    Path baseDir = new Path(getWALRootDir(conf), HConstants.BASE_NAMESPACE_DIR);<a name="line.443"></a>
-<span class="sourceLineNo">444</span>    return new Path(new Path(baseDir, tableName.getNamespaceAsString()),<a name="line.444"></a>
-<span class="sourceLineNo">445</span>      tableName.getQualifierAsString());<a name="line.445"></a>
-<span class="sourceLineNo">446</span>  }<a name="line.446"></a>
-<span class="sourceLineNo">447</span><a name="line.447"></a>
-<span class="sourceLineNo">448</span>  /**<a name="line.448"></a>
-<span class="sourceLineNo">449</span>   * For backward compatibility with HBASE-20734, where we store recovered edits in a wrong<a name="line.449"></a>
-<span class="sourceLineNo">450</span>   * directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.<a name="line.450"></a>
-<span class="sourceLineNo">451</span>   * @deprecated For compatibility, will be removed in 4.0.0.<a name="line.451"></a>
-<span class="sourceLineNo">452</span>   */<a name="line.452"></a>
-<span class="sourceLineNo">453</span>  @Deprecated<a name="line.453"></a>
-<span class="sourceLineNo">454</span>  public static Path getWrongWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.454"></a>
-<span class="sourceLineNo">455</span>      final String encodedRegionName) throws IOException {<a name="line.455"></a>
-<span class="sourceLineNo">456</span>    Path wrongTableDir = new Path(new Path(getWALRootDir(conf), tableName.getNamespaceAsString()),<a name="line.456"></a>
-<span class="sourceLineNo">457</span>      tableName.getQualifierAsString());<a name="line.457"></a>
-<span class="sourceLineNo">458</span>    return new Path(wrongTableDir, encodedRegionName);<a name="line.458"></a>
-<span class="sourceLineNo">459</span>  }<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>  /**<a name="line.461"></a>
-<span class="sourceLineNo">462</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under<a name="line.462"></a>
-<span class="sourceLineNo">463</span>   * path rootdir<a name="line.463"></a>
+<span class="sourceLineNo">152</span>   * @param fs filesystem object<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   * @return the default block size for the path's filesystem<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   */<a name="line.154"></a>
+<span class="sourceLineNo">155</span>  public static long getDefaultBlockSize(final FileSystem fs, final Path path) {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    return fs.getDefaultBlockSize(path);<a name="line.156"></a>
+<span class="sourceLineNo">157</span>  }<a name="line.157"></a>
+<span class="sourceLineNo">158</span><a name="line.158"></a>
+<span class="sourceLineNo">159</span>  /*<a name="line.159"></a>
+<span class="sourceLineNo">160</span>   * Get the default replication.<a name="line.160"></a>
+<span class="sourceLineNo">161</span>   *<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   * @param fs filesystem object<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   * @param f path of file<a name="line.163"></a>
+<span class="sourceLineNo">164</span>   * @return default replication for the path's filesystem<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   */<a name="line.165"></a>
+<span class="sourceLineNo">166</span>  public static short getDefaultReplication(final FileSystem fs, final Path path) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    return fs.getDefaultReplication(path);<a name="line.167"></a>
+<span class="sourceLineNo">168</span>  }<a name="line.168"></a>
+<span class="sourceLineNo">169</span><a name="line.169"></a>
+<span class="sourceLineNo">170</span>  /**<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   * Returns the default buffer size to use during writes.<a name="line.171"></a>
+<span class="sourceLineNo">172</span>   *<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   * The size of the buffer should probably be a multiple of hardware<a name="line.173"></a>
+<span class="sourceLineNo">174</span>   * page size (4096 on Intel x86), and it determines how much data is<a name="line.174"></a>
+<span class="sourceLineNo">175</span>   * buffered during read and write operations.<a name="line.175"></a>
+<span class="sourceLineNo">176</span>   *<a name="line.176"></a>
+<span class="sourceLineNo">177</span>   * @param fs filesystem object<a name="line.177"></a>
+<span class="sourceLineNo">178</span>   * @return default buffer size to use during writes<a name="line.178"></a>
+<span class="sourceLineNo">179</span>   */<a name="line.179"></a>
+<span class="sourceLineNo">180</span>  public static int getDefaultBufferSize(final FileSystem fs) {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    return fs.getConf().getInt("io.file.buffer.size", 4096);<a name="line.181"></a>
+<span class="sourceLineNo">182</span>  }<a name="line.182"></a>
+<span class="sourceLineNo">183</span><a name="line.183"></a>
+<span class="sourceLineNo">184</span>  /**<a name="line.184"></a>
+<span class="sourceLineNo">185</span>   * Create the specified file on the filesystem. By default, this will:<a name="line.185"></a>
+<span class="sourceLineNo">186</span>   * &lt;ol&gt;<a name="line.186"></a>
+<span class="sourceLineNo">187</span>   * &lt;li&gt;apply the umask in the configuration (if it is enabled)&lt;/li&gt;<a name="line.187"></a>
+<span class="sourceLineNo">188</span>   * &lt;li&gt;use the fs configured buffer size (or 4096 if not set)&lt;/li&gt;<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   * &lt;li&gt;use the default replication&lt;/li&gt;<a name="line.189"></a>
+<span class="sourceLineNo">190</span>   * &lt;li&gt;use the default block size&lt;/li&gt;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>   * &lt;li&gt;not track progress&lt;/li&gt;<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   * &lt;/ol&gt;<a name="line.192"></a>
+<span class="sourceLineNo">193</span>   *<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   * @param fs {@link FileSystem} on which to write the file<a name="line.194"></a>
+<span class="sourceLineNo">195</span>   * @param path {@link Path} to the file to write<a name="line.195"></a>
+<span class="sourceLineNo">196</span>   * @param perm intial permissions<a name="line.196"></a>
+<span class="sourceLineNo">197</span>   * @param overwrite Whether or not the created file should be overwritten.<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   * @return output stream to the created file<a name="line.198"></a>
+<span class="sourceLineNo">199</span>   * @throws IOException if the file cannot be created<a name="line.199"></a>
+<span class="sourceLineNo">200</span>   */<a name="line.200"></a>
+<span class="sourceLineNo">201</span>  public static FSDataOutputStream create(FileSystem fs, Path path,<a name="line.201"></a>
+<span class="sourceLineNo">202</span>      FsPermission perm, boolean overwrite) throws IOException {<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    if (LOG.isTraceEnabled()) {<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      LOG.trace("Creating file={} with permission={}, overwrite={}", path, perm, overwrite);<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    return fs.create(path, perm, overwrite, getDefaultBufferSize(fs),<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        getDefaultReplication(fs, path), getDefaultBlockSize(fs, path), null);<a name="line.207"></a>
+<span class="sourceLineNo">208</span>  }<a name="line.208"></a>
+<span class="sourceLineNo">209</span><a name="line.209"></a>
+<span class="sourceLineNo">210</span>  /**<a name="line.210"></a>
+<span class="sourceLineNo">211</span>   * Get the file permissions specified in the configuration, if they are<a name="line.211"></a>
+<span class="sourceLineNo">212</span>   * enabled.<a name="line.212"></a>
+<span class="sourceLineNo">213</span>   *<a name="line.213"></a>
+<span class="sourceLineNo">214</span>   * @param fs filesystem that the file will be created on.<a name="line.214"></a>
+<span class="sourceLineNo">215</span>   * @param conf configuration to read for determining if permissions are<a name="line.215"></a>
+<span class="sourceLineNo">216</span>   *          enabled and which to use<a name="line.216"></a>
+<span class="sourceLineNo">217</span>   * @param permssionConfKey property key in the configuration to use when<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   *          finding the permission<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   * @return the permission to use when creating a new file on the fs. If<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   *         special permissions are not specified in the configuration, then<a name="line.220"></a>
+<span class="sourceLineNo">221</span>   *         the default permissions on the the fs will be returned.<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   */<a name="line.222"></a>
+<span class="sourceLineNo">223</span>  public static FsPermission getFilePermissions(final FileSystem fs,<a name="line.223"></a>
+<span class="sourceLineNo">224</span>      final Configuration conf, final String permssionConfKey) {<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    boolean enablePermissions = conf.getBoolean(<a name="line.225"></a>
+<span class="sourceLineNo">226</span>        HConstants.ENABLE_DATA_FILE_UMASK, false);<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>    if (enablePermissions) {<a name="line.228"></a>
+<span class="sourceLineNo">229</span>      try {<a name="line.229"></a>
+<span class="sourceLineNo">230</span>        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>        // make sure that we have a mask, if not, go default.<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        String mask = conf.get(permssionConfKey);<a name="line.232"></a>
+<span class="sourceLineNo">233</span>        if (mask == null) {<a name="line.233"></a>
+<span class="sourceLineNo">234</span>          return FsPermission.getFileDefault();<a name="line.234"></a>
+<span class="sourceLineNo">235</span>        }<a name="line.235"></a>
+<span class="sourceLineNo">236</span>        // appy the umask<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        FsPermission umask = new FsPermission(mask);<a name="line.237"></a>
+<span class="sourceLineNo">238</span>        return perm.applyUMask(umask);<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      } catch (IllegalArgumentException e) {<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        LOG.warn(<a name="line.240"></a>
+<span class="sourceLineNo">241</span>            "Incorrect umask attempted to be created: "<a name="line.241"></a>
+<span class="sourceLineNo">242</span>                + conf.get(permssionConfKey)<a name="line.242"></a>
+<span class="sourceLineNo">243</span>                + ", using default file permissions.", e);<a name="line.243"></a>
+<span class="sourceLineNo">244</span>        return FsPermission.getFileDefault();<a name="line.244"></a>
+<span class="sourceLineNo">245</span>      }<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    }<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    return FsPermission.getFileDefault();<a name="line.247"></a>
+<span class="sourceLineNo">248</span>  }<a name="line.248"></a>
+<span class="sourceLineNo">249</span><a name="line.249"></a>
+<span class="sourceLineNo">250</span>  /**<a name="line.250"></a>
+<span class="sourceLineNo">251</span>   * Verifies root directory path is a valid URI with a scheme<a name="line.251"></a>
+<span class="sourceLineNo">252</span>   *<a name="line.252"></a>
+<span class="sourceLineNo">253</span>   * @param root root directory path<a name="line.253"></a>
+<span class="sourceLineNo">254</span>   * @return Passed &lt;code&gt;root&lt;/code&gt; argument.<a name="line.254"></a>
+<span class="sourceLineNo">255</span>   * @throws IOException if not a valid URI with a scheme<a name="line.255"></a>
+<span class="sourceLineNo">256</span>   */<a name="line.256"></a>
+<span class="sourceLineNo">257</span>  public static Path validateRootPath(Path root) throws IOException {<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    try {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>      URI rootURI = new URI(root.toString());<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      String scheme = rootURI.getScheme();<a name="line.260"></a>
+<span class="sourceLineNo">261</span>      if (scheme == null) {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>        throw new IOException("Root directory does not have a scheme");<a name="line.262"></a>
+<span class="sourceLineNo">263</span>      }<a name="line.263"></a>
+<span class="sourceLineNo">264</span>      return root;<a name="line.264"></a>
+<span class="sourceLineNo">265</span>    } catch (URISyntaxException e) {<a name="line.265"></a>
+<span class="sourceLineNo">266</span>      throw new IOException("Root directory path is not a valid " +<a name="line.266"></a>
+<span class="sourceLineNo">267</span>        "URI -- check your " + HConstants.HBASE_DIR + " configuration", e);<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    }<a name="line.268"></a>
+<span class="sourceLineNo">269</span>  }<a name="line.269"></a>
+<span class="sourceLineNo">270</span><a name="line.270"></a>
+<span class="sourceLineNo">271</span>  /**<a name="line.271"></a>
+<span class="sourceLineNo">272</span>   * Checks for the presence of the WAL log root path (using the provided conf object) in the given<a name="line.272"></a>
+<span class="sourceLineNo">273</span>   * path. If it exists, this method removes it and returns the String representation of remaining<a name="line.273"></a>
+<span class="sourceLineNo">274</span>   * relative path.<a name="line.274"></a>
+<span class="sourceLineNo">275</span>   * @param path must not be null<a name="line.275"></a>
+<span class="sourceLineNo">276</span>   * @param conf must not be null<a name="line.276"></a>
+<span class="sourceLineNo">277</span>   * @return String representation of the remaining relative path<a name="line.277"></a>
+<span class="sourceLineNo">278</span>   * @throws IOException from underlying filesystem<a name="line.278"></a>
+<span class="sourceLineNo">279</span>   */<a name="line.279"></a>
+<span class="sourceLineNo">280</span>  public static String removeWALRootPath(Path path, final Configuration conf) throws IOException {<a name="line.280"></a>
+<span class="sourceLineNo">281</span>    Path root = getWALRootDir(conf);<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    String pathStr = path.toString();<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    // check that the path is absolute... it has the root path in it.<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    if (!pathStr.startsWith(root.toString())) {<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      return pathStr;<a name="line.285"></a>
+<span class="sourceLineNo">286</span>    }<a name="line.286"></a>
+<span class="sourceLineNo">287</span>    // if not, return as it is.<a name="line.287"></a>
+<span class="sourceLineNo">288</span>    return pathStr.substring(root.toString().length() + 1);// remove the "/" too.<a name="line.288"></a>
+<span class="sourceLineNo">289</span>  }<a name="line.289"></a>
+<span class="sourceLineNo">290</span><a name="line.290"></a>
+<span class="sourceLineNo">291</span>  /**<a name="line.291"></a>
+<span class="sourceLineNo">292</span>   * Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This<a name="line.292"></a>
+<span class="sourceLineNo">293</span>   * method returns the 'path' component of a Path's URI: e.g. If a Path is<a name="line.293"></a>
+<span class="sourceLineNo">294</span>   * &lt;code&gt;hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;,<a name="line.294"></a>
+<span class="sourceLineNo">295</span>   * this method returns &lt;code&gt;/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;.<a name="line.295"></a>
+<span class="sourceLineNo">296</span>   * This method is useful if you want to print out a Path without qualifying<a name="line.296"></a>
+<span class="sourceLineNo">297</span>   * Filesystem instance.<a name="line.297"></a>
+<span class="sourceLineNo">298</span>   * @param p Filesystem Path whose 'path' component we are to return.<a name="line.298"></a>
+<span class="sourceLineNo">299</span>   * @return Path portion of the Filesystem<a name="line.299"></a>
+<span class="sourceLineNo">300</span>   */<a name="line.300"></a>
+<span class="sourceLineNo">301</span>  public static String getPath(Path p) {<a name="line.301"></a>
+<span class="sourceLineNo">302</span>    return p.toUri().getPath();<a name="line.302"></a>
+<span class="sourceLineNo">303</span>  }<a name="line.303"></a>
+<span class="sourceLineNo">304</span><a name="line.304"></a>
+<span class="sourceLineNo">305</span>  /**<a name="line.305"></a>
+<span class="sourceLineNo">306</span>   * @param c configuration<a name="line.306"></a>
+<span class="sourceLineNo">307</span>   * @return {@link Path} to hbase root directory from<a name="line.307"></a>
+<span class="sourceLineNo">308</span>   *     configuration as a qualified Path.<a name="line.308"></a>
+<span class="sourceLineNo">309</span>   * @throws IOException e<a name="line.309"></a>
+<span class="sourceLineNo">310</span>   */<a name="line.310"></a>
+<span class="sourceLineNo">311</span>  public static Path getRootDir(final Configuration c) throws IOException {<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    Path p = new Path(c.get(HConstants.HBASE_DIR));<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    FileSystem fs = p.getFileSystem(c);<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.314"></a>
+<span class="sourceLineNo">315</span>  }<a name="line.315"></a>
+<span class="sourceLineNo">316</span><a name="line.316"></a>
+<span class="sourceLineNo">317</span>  public static void setRootDir(final Configuration c, final Path root) {<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    c.set(HConstants.HBASE_DIR, root.toString());<a name="line.318"></a>
+<span class="sourceLineNo">319</span>  }<a name="line.319"></a>
+<span class="sourceLineNo">320</span><a name="line.320"></a>
+<span class="sourceLineNo">321</span>  public static void setFsDefault(final Configuration c, final Path root) {<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    c.set("fs.defaultFS", root.toString());    // for hadoop 0.21+<a name="line.322"></a>
+<span class="sourceLineNo">323</span>  }<a name="line.323"></a>
+<span class="sourceLineNo">324</span><a name="line.324"></a>
+<span class="sourceLineNo">325</span>  public static FileSystem getRootDirFileSystem(final Configuration c) throws IOException {<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    Path p = getRootDir(c);<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    return p.getFileSystem(c);<a name="line.327"></a>
+<span class="sourceLineNo">328</span>  }<a name="line.328"></a>
+<span class="sourceLineNo">329</span><a name="line.329"></a>
+<span class="sourceLineNo">330</span>  /**<a name="line.330"></a>
+<span class="sourceLineNo">331</span>   * @param c configuration<a name="line.331"></a>
+<span class="sourceLineNo">332</span>   * @return {@link Path} to hbase log root directory: e.g. {@value HBASE_WAL_DIR} from<a name="line.332"></a>
+<span class="sourceLineNo">333</span>   *     configuration as a qualified Path. Defaults to HBase root dir.<a name="line.333"></a>
+<span class="sourceLineNo">334</span>   * @throws IOException e<a name="line.334"></a>
+<span class="sourceLineNo">335</span>   */<a name="line.335"></a>
+<span class="sourceLineNo">336</span>  public static Path getWALRootDir(final Configuration c) throws IOException {<a name="line.336"></a>
+<span class="sourceLineNo">337</span>    Path p = new Path(c.get(HBASE_WAL_DIR, c.get(HConstants.HBASE_DIR)));<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    if (!isValidWALRootDir(p, c)) {<a name="line.338"></a>
+<span class="sourceLineNo">339</span>      return getRootDir(c);<a name="line.339"></a>
+<span class="sourceLineNo">340</span>    }<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    FileSystem fs = p.getFileSystem(c);<a name="line.341"></a>
+<span class="sourceLineNo">342</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.342"></a>
+<span class="sourceLineNo">343</span>  }<a name="line.343"></a>
+<span class="sourceLineNo">344</span><a name="line.344"></a>
+<span class="sourceLineNo">345</span>  @VisibleForTesting<a name="line.345"></a>
+<span class="sourceLineNo">346</span>  public static void setWALRootDir(final Configuration c, final Path root) {<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    c.set(HBASE_WAL_DIR, root.toString());<a name="line.347"></a>
+<span class="sourceLineNo">348</span>  }<a name="line.348"></a>
+<span class="sourceLineNo">349</span><a name="line.349"></a>
+<span class="sourceLineNo">350</span>  public static FileSystem getWALFileSystem(final Configuration c) throws IOException {<a name="line.350"></a>
+<span class="sourceLineNo">351</span>    Path p = getWALRootDir(c);<a name="line.351"></a>
+<span class="sourceLineNo">352</span>    FileSystem fs = p.getFileSystem(c);<a name="line.352"></a>
+<span class="sourceLineNo">353</span>    // hadoop-core does fs caching, so need to propogate this if set<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);<a name="line.354"></a>
+<span class="sourceLineNo">355</span>    if (enforceStreamCapability != null) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>      fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    }<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    return fs;<a name="line.358"></a>
+<span class="sourceLineNo">359</span>  }<a name="line.359"></a>
+<span class="sourceLineNo">360</span><a name="line.360"></a>
+<span class="sourceLineNo">361</span>  private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {<a name="line.361"></a>
+<span class="sourceLineNo">362</span>    Path rootDir = getRootDir(c);<a name="line.362"></a>
+<span class="sourceLineNo">363</span>    FileSystem fs = walDir.getFileSystem(c);<a name="line.363"></a>
+<span class="sourceLineNo">364</span>    Path qualifiedWalDir = walDir.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.364"></a>
+<span class="sourceLineNo">365</span>    if (!qualifiedWalDir.equals(rootDir)) {<a name="line.365"></a>
+<span class="sourceLineNo">366</span>      if (qualifiedWalDir.toString().startsWith(rootDir.toString() + "/")) {<a name="line.366"></a>
+<span class="sourceLineNo">367</span>        throw new IllegalStateException("Illegal WAL directory specified. " +<a name="line.367"></a>
+<span class="sourceLineNo">368</span>            "WAL directories are not permitted to be under the root directory if set.");<a name="line.368"></a>
+<span class="sourceLineNo">369</span>      }<a name="line.369"></a>
+<span class="sourceLineNo">370</span>    }<a name="line.370"></a>
+<span class="sourceLineNo">371</span>    return true;<a name="line.371"></a>
+<span class="sourceLineNo">372</span>  }<a name="line.372"></a>
+<span class="sourceLineNo">373</span><a name="line.373"></a>
+<span class="sourceLineNo">374</span>  /**<a name="line.374"></a>
+<span class="sourceLineNo">375</span>   * Returns the WAL region directory based on the given table name and region name<a name="line.375"></a>
+<span class="sourceLineNo">376</span>   * @param conf configuration to determine WALRootDir<a name="line.376"></a>
+<span class="sourceLineNo">377</span>   * @param tableName Table that the region is under<a name="line.377"></a>
+<span class="sourceLineNo">378</span>   * @param encodedRegionName Region name used for creating the final region directory<a name="line.378"></a>
+<span class="sourceLineNo">379</span>   * @return the region directory used to store WALs under the WALRootDir<a name="line.379"></a>
+<span class="sourceLineNo">380</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.380"></a>
+<span class="sourceLineNo">381</span>   */<a name="line.381"></a>
+<span class="sourceLineNo">382</span>  public static Path getWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.382"></a>
+<span class="sourceLineNo">383</span>      final String encodedRegionName) throws IOException {<a name="line.383"></a>
+<span class="sourceLineNo">384</span>    return new Path(getWALTableDir(conf, tableName), encodedRegionName);<a name="line.384"></a>
+<span class="sourceLineNo">385</span>  }<a name="line.385"></a>
+<span class="sourceLineNo">386</span><a name="line.386"></a>
+<span class="sourceLineNo">387</span>  /**<a name="line.387"></a>
+<span class="sourceLineNo">388</span>   * Returns the Table directory under the WALRootDir for the specified table name<a name="line.388"></a>
+<span class="sourceLineNo">389</span>   * @param conf configuration used to get the WALRootDir<a name="line.389"></a>
+<span class="sourceLineNo">390</span>   * @param tableName Table to get the directory for<a name="line.390"></a>
+<span class="sourceLineNo">391</span>   * @return a path to the WAL table directory for the specified table<a name="line.391"></a>
+<span class="sourceLineNo">392</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.392"></a>
+<span class="sourceLineNo">393</span>   */<a name="line.393"></a>
+<span class="sourceLineNo">394</span>  public static Path getWALTableDir(final Configuration conf, final TableName tableName)<a name="line.394"></a>
+<span class="sourceLineNo">395</span>      throws IOException {<a name="line.395"></a>
+<span class="sourceLineNo">396</span>    Path baseDir = new Path(getWALRootDir(conf), HConstants.BASE_NAMESPACE_DIR);<a name="line.396"></a>
+<span class="sourceLineNo">397</span>    return new Path(new Path(baseDir, tableName.getNamespaceAsString()),<a name="line.397"></a>
+<span class="sourceLineNo">398</span>      tableName.getQualifierAsString());<a name="line.398"></a>
+<span class="sourceLineNo">399</span>  }<a name="line.399"></a>
+<span class="sourceLineNo">400</span><a name="line.400"></a>
+<span class="sourceLineNo">401</span>  /**<a name="line.401"></a>
+<span class="sourceLineNo">402</span>   * For backward compatibility with HBASE-20734, where we store recovered edits in a wrong<a name="line.402"></a>
+<span class="sourceLineNo">403</span>   * directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.<a name="line.403"></a>
+<span class="sourceLineNo">404</span>   * @deprecated For compatibility, will be removed in 4.0.0.<a name="line.404"></a>
+<span class="sourceLineNo">405</span>   */<a name="line.405"></a>
+<span class="sourceLineNo">406</span>  @Deprecated<a name="line.406"></a>
+<span class="sourceLineNo">407</span>  public static Path getWrongWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.407"></a>
+<span class="sourceLineNo">408</span>      final String encodedRegionName) throws IOException {<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    Path wrongTableDir = new Path(new Path(getWALRootDir(conf), tableName.getNamespaceAsString()),<a name="line.409"></a>
+<span class="sourceLineNo">410</span>      tableName.getQualifierAsString());<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    return new Path(wrongTableDir, encodedRegionName);<a name="line.411"></a>
+<span class="sourceLineNo">412</span>  }<a name="line.412"></a>
+<span class="sourceLineNo">413</span><a name="line.413"></a>
+<span class="sourceLineNo">414</span>  /**<a name="line.414"></a>
+<span class="sourceLineNo">415</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under<a name="line.415"></a>
+<span class="sourceLineNo">416</span>   * path rootdir<a name="line.416"></a>
+<span class="sourceLineNo">417</span>   *<a name="line.417"></a>
+<span class="sourceLineNo">418</span>   * @param rootdir qualified path of HBase root directory<a name="line.418"></a>
+<span class="sourceLineNo">419</span>   * @param tableName name of table<a name="line.419"></a>
+<span class="sourceLineNo">420</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.420"></a>
+<span class="sourceLineNo">421</span>   */<a name="line.421"></a>
+<span class="sourceLineNo">422</span>  public static Path getTableDir(Path rootdir, final TableName tableName) {<a name="line.422"></a>
+<span class="sourceLineNo">423</span>    return new Path(getNamespaceDir(rootdir, tableName.getNamespaceAsString()),<a name="line.423"></a>
+<span class="sourceLineNo">424</span>        tableName.getQualifierAsString());<a name="line.424"></a>
+<span class="sourceLineNo">425</span>  }<a name="line.425"></a>
+<span class="sourceLineNo">426</span><a name="line.426"></a>
+<span class="sourceLineNo">427</span>  /**<a name="line.427"></a>
+<span class="sourceLineNo">428</span>   * Returns the {@link org.apache.hadoop.hbase.TableName} object representing<a name="line.428"></a>
+<span class="sourceLineNo">429</span>   * the table directory under<a name="line.429"></a>
+<span class="sourceLineNo">430</span>   * path rootdir<a name="line.430"></a>
+<span class="sourceLineNo">431</span>   *<a name="line.431"></a>
+<span class="sourceLineNo">432</span>   * @param tablePath path of table<a name="line.432"></a>
+<span class="sourceLineNo">433</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.433"></a>
+<span class="sourceLineNo">434</span>   */<a name="line.434"></a>
+<span class="sourceLineNo">435</span>  public static TableName getTableName(Path tablePath) {<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());<a name="line.436"></a>
+<span class="sourceLineNo">437</span>  }<a name="line.437"></a>
+<span class="sourceLineNo">438</span><a name="line.438"></a>
+<span class="sourceLineNo">439</span>  /**<a name="line.439"></a>
+<span class="sourceLineNo">440</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing<a name="line.440"></a>
+<span class="sourceLineNo">441</span>   * the namespace directory under path rootdir<a name="line.441"></a>
+<span class="sourceLineNo">442</span>   *<a name="line.442"></a>
+<span class="sourceLineNo">443</span>   * @param rootdir qualified path of HBase root directory<a name="line.443"></a>
+<span class="sourceLineNo">444</span>   * @param namespace namespace name<a name="line.444"></a>
+<span class="sourceLineNo">445</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.445"></a>
+<span class="sourceLineNo">446</span>   */<a name="line.446"></a>
+<span class="sourceLineNo">447</span>  public static Path getNamespaceDir(Path rootdir, final String namespace) {<a name="line.447"></a>
+<span class="sourceLineNo">448</span>    return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,<a name="line.448"></a>
+<span class="sourceLineNo">449</span>        new Path(namespace)));<a name="line.449"></a>
+<span class="sourceLineNo">450</span>  }<a name="line.450"></a>
+<span class="sourceLineNo">451</span><a name="line.451"></a>
+<span class="sourceLineNo">452</span>  // this mapping means that under a federated FileSystem implementation, we'll<a name="line.452"></a>
+<span class="sourceLineNo">453</span>  // only log the first failure from any of the underlying FileSystems at WARN and all others<a name="line.453"></a>
+<span class="sourceLineNo">454</span>  // will be at DEBUG.<a name="line.454"></a>
+<span class="sourceLineNo">455</span>  private static final Map&lt;FileSystem, Boolean&gt; warningMap = new ConcurrentHashMap&lt;&gt;();<a name="line.455"></a>
+<span class="sourceLineNo">456</span><a name="line.456"></a>
+<span class="sourceLineNo">457</span>  /**<a name="line.457"></a>
+<span class="sourceLineNo">458</span>   * Sets storage policy for given path.<a name="line.458"></a>
+<span class="sourceLineNo">459</span>   * If the passed path is a directory, we'll set the storage policy for all files<a name="line.459"></a>
+<span class="sourceLineNo">460</span>   * created in the future in said directory. Note that this change in storage<a name="line.460"></a>
+<span class="sourceLineNo">461</span>   * policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle.<a name="line.461"></a>
+<span class="sourceLineNo">462</span>   * If we're running on a version of FileSystem that doesn't support the given storage policy<a name="line.462"></a>
+<span class="sourceLineNo">463</span>   * (or storage policies at all), then we'll issue a log message and continue.<a name="line.463"></a>
 <span class="sourceLineNo">464</span>   *<a name="line.464"></a>
-<span class="sourceLineNo">465</span>   * @param rootdir qualified path of HBase root directory<a name="line.465"></a>
-<span class="sourceLineNo">466</span>   * @param tableName name of table<a name="line.466"></a>
-<span class="sourceLineNo">467</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.467"></a>
-<span class="sourceLineNo">468</span>   */<a name="line.468"></a>
-<span class="sourceLineNo">469</span>  public static Path getTableDir(Path rootdir, final TableName tableName) {<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    return new Path(getNamespaceDir(rootdir, tableName.getNamespaceAsString()),<a name="line.470"></a>
-<span class="sourceLineNo">471</span>        tableName.getQualifierAsString());<a name="line.471"></a>
-<span class="sourceLineNo">472</span>  }<a name="line.472"></a>
-<span class="sourceLineNo">473</span><a name="line.473"></a>
-<span class="sourceLineNo">474</span>  /**<a name="line.474"></a>
-<span class="sourceLineNo">475</span>   * Returns the {@link org.apache.hadoop.hbase.TableName} object representing<a name="line.475"></a>
-<span class="sourceLineNo">476</span>   * the table directory under<a name="line.476"></a>
-<span class="sourceLineNo">477</span>   * path rootdir<a name="line.477"></a>
-<span class="sourceLineNo">478</span>   *<a name="line.478"></a>
-<span class="sourceLineNo">479</span>   * @param tablePath path of table<a name="line.479"></a>
-<span class="sourceLineNo">480</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.480"></a>
-<span class="sourceLineNo">481</span>   */<a name="line.481"></a>
-<span class="sourceLineNo">482</span>  public static TableName getTableName(Path tablePath) {<a name="line.482"></a>
-<span class="sourceLineNo">483</span>    return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());<a name="line.483"></a>
-<span class="sourceLineNo">484</span>  }<a name="line.484"></a>
-<span class="sourceLineNo">485</span><a name="line.485"></a>
-<span class="sourceLineNo">486</span>  /**<a name="line.486"></a>
-<span class="sourceLineNo">487</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing<a name="line.487"></a>
-<span class="sourceLineNo">488</span>   * the namespace directory under path rootdir<a name="line.488"></a>
-<span class="sourceLineNo">489</span>   *<a name="line.489"></a>
-<span class="sourceLineNo">490</span>   * @param rootdir qualified path of HBase root directory<a name="line.490"></a>
-<span class="sourceLineNo">491</span>   * @param namespace namespace name<a name="line.491"></a>
-<span class="sourceLineNo">492</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.492"></a>
-<span class="sourceLineNo">493</span>   */<a name="line.493"></a>
-<span class="sourceLineNo">494</span>  public static Path getNamespaceDir(Path rootdir, final String namespace) {<a name="line.494"></a>
-<span class="sourceLineNo">495</span>    return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,<a name="line.495"></a>
-<span class="sourceLineNo">496</span>        new Path(namespace)));<a name="line.496"></a>
-<span class="sourceLineNo">497</span>  }<a name="line.497"></a>
-<span class="sourceLineNo">498</span><a name="line.498"></a>
-<span class="sourceLineNo">499</span>  // this mapping means that under a federated FileSystem implementation, we'll<a name="line.499"></a>
-<span class="sourceLineNo">500</span>  // only log the first failure from any of the underlying FileSystems at WARN and all others<a name="line.500"></a>
-<span class="sourceLineNo">501</span>  // will be at DEBUG.<a name="line.501"></a>
-<span class="sourceLineNo">502</span>  private static final Map&lt;FileSystem, Boolean&gt; warningMap = new ConcurrentHashMap&lt;&gt;();<a name="line.502"></a>
-<span class="sourceLineNo">503</span><a name="line.503"></a>
-<span class="sourceLineNo">504</span>  /**<a name="line.504"></a>
-<span class="sourceLineNo">505</span>   * Sets storage policy for given path.<a name="line.505"></a>
-<span class="sourceLineNo">506</span>   * If the passed path is a directory, we'll set the storage policy for all files<a name="line.506"></a>
-<span class="sourceLineNo">507</span>   * created in the future in said directory. Note that this change in storage<a name="line.507"></a>
-<span class="sourceLineNo">508</span>   * policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle.<a name="line.508"></a>
-<span class="sourceLineNo">509</span>   * If we're running on a version of FileSystem that doesn't support the given storage policy<a name="line.509"></a>
-<span class="sourceLineNo">510</span>   * (or storage policies at all), then we'll issue a log message and continue.<a name="line.510"></a>
-<span class="sourceLineNo">511</span>   *<a name="line.511"></a>
-<span class="sourceLineNo">512</span>   * See http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html<a name="line.512"></a>
-<span class="sourceLineNo">513</span>   *<a name="line.513"></a>
-<span class="sourceLineNo">514</span>   * @param fs We only do anything it implements a setStoragePolicy method<a name="line.514"></a>
-<span class="sourceLineNo">515</span>   * @param path the Path whose storage policy is to be set<a name="line.515"></a>
-<span class="sourceLineNo">516</span>   * @param storagePolicy Policy to set on &lt;code&gt;path&lt;/code&gt;; see hadoop 2.6+<a name="line.516"></a>
-<span class="sourceLineNo">517</span>   *   org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g<a name="line.517"></a>
-<span class="sourceLineNo">518</span>   *   'COLD', 'WARM', 'HOT', 'ONE_SSD', 'ALL_SSD', 'LAZY_PERSIST'.<a name="line.518"></a>
-<span class="sourceLineNo">519</span>   */<a name="line.519"></a>
-<span class="sourceLineNo">520</span>  public static void setStoragePolicy(final FileSystem fs, final Path path,<a name="line.520"></a>
-<span class="sourceLineNo">521</span>      final String storagePolicy) {<a name="line.521"></a>
-<span class="sourceLineNo">522</span>    try {<a name="line.522"></a>
-<span class="sourceLineNo">523</span>      setStoragePolicy(fs, path, storagePolicy, false);<a name="line.523"></a>
-<span class="sourceLineNo">524</span>    } catch (IOException e) {<a name="line.524"></a>
-<span class="sourceLineNo">525</span>      // should never arrive here<a name="line.525"></a>
-<span class="sourceLineNo">526</span>      LOG.warn("We have chosen not to throw exception but some unexpectedly thrown out", e);<a name="line.526"></a>
-<span class="sourceLineNo">527</span>    }<a name="line.527"></a>
-<span class="sourceLineNo">528</span>  }<a name="line.528"></a>
-<span class="sourceLineNo">529</span><a name="line.529"></a>
-<span class="sourceLineNo">530</span>  static void setStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy,<a name="line.530"></a>
-<span class="sourceLineNo">531</span>      boolean throwException) throws IOException {<a name="line.531"></a>
-<span class="sourceLineNo">532</span>    if (storagePolicy == null) {<a name="line.532"></a>
-<span class="sourceLineNo">533</span>      if (LOG.isTraceEnabled()) {<a name="line.533"></a>
-<span class="sourceLineNo">534</span>        LOG.trace("We were passed a null storagePolicy, exiting early.");<a name="line.534"></a>
-<span class="sourceLineNo">535</span>      }<a name="line.535"></a>
-<span class="sourceLineNo">536</span>      return;<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    }<a name="line.537"></a>
-<span class="sourceLineNo">538</span>    String trimmedStoragePolicy = storagePolicy.trim();<a name="line.538"></a>
-<span class="sourceLineNo">539</span>    if (trimmedStoragePolicy.isEmpty()) {<a name="line.539"></a>
-<span class="sourceLineNo">540</span>      if (LOG.isTraceEnabled()) {<a name="line.540"></a>
-<span class="sourceLineNo">541</span>        LOG.trace("We were passed an empty storagePolicy, exiting early.");<a name="line.541"></a>
+<span class="sourceLineNo">465</span>   * See http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html<a name="line.465"></a>
+<span class="sourceLineNo">466</span>   *<a name="line.466"></a>
+<span class="sourceLineNo">467</span>   * @param fs We only do anything it implements a setStoragePolicy method<a name="line.467"></a>
+<span class="sourceLineNo">468</span>   * @param path the Path whose storage policy is to be set<a name="line.468"></a>
+<span class="sourceLineNo">469</span>   * @param storagePolicy Policy to set on &lt;code&gt;path&lt;/code&gt;; see hadoop 2.6+<a name="line.469"></a>
+<span class="sourceLineNo">470</span>   *   org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g<a name="line.470"></a>
+<span class="sourceLineNo">471</span>   *   'COLD', 'WARM', 'HOT', 'ONE_SSD', 'ALL_SSD', 'LAZY_PERSIST'.<a name="line.471"></a>
+<span class="sourceLineNo">472</span>   */<a name="line.472"></a>
+<span class="sourceLineNo">473</span>  public static void setStoragePolicy(final FileSystem fs, final Path path,<a name="line.473"></a>
+<span class="sourceLineNo">474</span>      final String storagePolicy) {<a name="line.474"></a>
+<span class="sourceLineNo">475</span>    try {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>      setStoragePolicy(fs, path, storagePolicy, false);<a name="line.476"></a>
+<span class="sourceLineNo">477</span>    } catch (IOException e) {<a name="line.477"></a>
+<span class="sourceLineNo">478</span>      // should never arrive here<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      LOG.warn("We have chosen not to throw exception but some unexpectedly thrown out", e);<a name="line.479"></a>
+<span class="sourceLineNo">480</span>    }<a name="line.480"></a>
+<span class="sourceLineNo">481</span>  }<a name="line.481"></a>
+<span class="sourceLineNo">482</span><a name="line.482"></a>
+<span class="sourceLineNo">483</span>  static void setStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy,<a name="line.483"></a>
+<span class="sourceLineNo">484</span>      boolean throwException) throws IOException {<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    if (storagePolicy == null) {<a name="line.485"></a>
+<span class="sourceLineNo">486</span>      if (LOG.isTraceEnabled()) {<a name="line.486"></a>
+<span class="sourceLineNo">487</span>        LOG.trace("We were passed a null storagePolicy, exiting early.");<a name="line.487"></a>
+<span class="sourceLineNo">488</span>      }<a name="line.488"></a>
+<span class="sourceLineNo">489</span>      return;<a name="line.489"></a>
+<span class="sourceLineNo">490</span>    }<a name="line.490"></a>
+<span class="sourceLineNo">491</span>    String trimmedStoragePolicy = storagePolicy.trim();<a name="line.491"></a>
+<span class="sourceLineNo">492</span>    if (trimmedStoragePolicy.isEmpty()) {<a name="line.492"></a>
+<span class="sourceLineNo">493</span>      if (LOG.isTraceEnabled()) {<a name="line.493"></a>
+<span class="sourceLineNo">494</span>        LOG.trace("We were passed an empty storagePolicy, exiting early.");<a name="line.494"></a>
+<span class="sourceLineNo">495</span>      }<a name="line.495"></a>
+<span class="sourceLineNo">496</span>      return;<a name="line.496"></a>
+<span class="sourceLineNo">497</span>    } else {<a name="line.497"></a>
+<span class="sourceLineNo">498</span>      trimmedStoragePolicy = trimmedStoragePolicy.toUpperCase(Locale.ROOT);<a name="line.498"></a>
+<span class="sourceLineNo">499</span>    }<a name="line.499"></a>
+<span class="sourceLineNo">500</span>    if (trimmedStoragePolicy.equals(HConstants.DEFER_TO_HDFS_STORAGE_POLICY)) {<a name="line.500"></a>
+<span class="sourceLineNo">501</span>      if (LOG.isTraceEnabled()) {<a name="line.501"></a>
+<span class="sourceLineNo">502</span>        LOG.trace("We were passed the defer-to-hdfs policy {}, exiting early.",<a name="line.502"></a>
+<span class="sourceLineNo">503</span>          trimmedStoragePolicy);<a name="line.503"></a>
+<span class="sourceLineNo">504</span>      }<a name="line.504"></a>
+<span class="sourceLineNo">505</span>      return;<a name="line.505"></a>
+<span class="sourceLineNo">506</span>    }<a name="line.506"></a>
+<span class="sourceLineNo">507</span>    try {<a name="line.507"></a>
+<span class="sourceLineNo">508</span>      invokeSetStoragePolicy(fs, path, trimmedStoragePolicy);<a name="line.508"></a>
+<span class="sourceLineNo">509</span>    } catch (IOException e) {<a name="line.509"></a>
+<span class="sourceLineNo">510</span>      if (LOG.isTraceEnabled()) {<a name="line.510"></a>
+<span class="sourceLineNo">511</span>        LOG.trace("Failed to invoke set storage policy API on FS", e);<a name="line.511"></a>
+<span class="sourceLineNo">512</span>      }<a name="line.512"></a>
+<span class="sourceLineNo">513</span>      if (throwException) {<a name="line.513"></a>
+<span class="sourceLineNo">514</span>        throw e;<a name="line.514"></a>
+<span class="sourceLineNo">515</span>      }<a name="line.515"></a>
+<span class="sourceLineNo">516</span>    }<a name="line.516"></a>
+<span class="sourceLineNo">517</span>  }<a name="line.517"></a>
+<span class="sourceLineNo">518</span><a name="line.518"></a>
+<span class="sourceLineNo">519</span>  /*<a name="line.519"></a>
+<span class="sourceLineNo">520</span>   * All args have been checked and are good. Run the setStoragePolicy invocation.<a name="line.520"></a>
+<span class="sourceLineNo">521</span>   */<a name="line.521"></a>
+<span class="sourceLineNo">522</span>  private static void invokeSetStoragePolicy(final FileSystem fs, final Path path,<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      final String storagePolicy) throws IOException {<a name="line.523"></a>
+<span class="sourceLineNo">524</span>    Exception toThrow = null;<a name="line.524"></a>
+<span class="sourceLineNo">525</span><a name="line.525"></a>
+<span class="sourceLineNo">526</span>    try {<a name="line.526"></a>
+<span class="sourceLineNo">527</span>      fs.setStoragePolicy(path, storagePolicy);<a name="line.527"></a>
+<span class="sourceLineNo">528</span><a name="line.528"></a>
+<span class="sourceLineNo">529</span>      if (LOG.isDebugEnabled()) {<a name="line.529"></a>
+<span class="sourceLineNo">530</span>        LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);<a name="line.530"></a>
+<span class="sourceLineNo">531</span>      }<a name="line.531"></a>
+<span class="sourceLineNo">532</span>    } catch (Exception e) {<a name="line.532"></a>
+<span class="sourceLineNo">533</span>      toThrow = e;<a name="line.533"></a>
+<span class="sourceLineNo">534</span>      // This swallows FNFE, should we be throwing it? seems more likely to indicate dev<a name="line.534"></a>
+<span class="sourceLineNo">535</span>      // misuse than a runtime problem with HDFS.<a name="line.535"></a>
+<span class="sourceLineNo">536</span>      if (!warningMap.containsKey(fs)) {<a name="line.536"></a>
+<span class="sourceLineNo">537</span>        warningMap.put(fs, true);<a name="line.537"></a>
+<span class="sourceLineNo">538</span>        LOG.warn("Unable to set storagePolicy=" + storagePolicy + " for path=" + path + ". " +<a name="line.538"></a>
+<span class="sourceLineNo">539</span>            "DEBUG log level might have more details.", e);<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      } else if (LOG.isDebugEnabled()) {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>        LOG.debug("Unable to set storagePolicy=" + storagePolicy + " for path=" + path, e);<a name="line.541"></a>
 <span class="sourceLineNo">542</span>      }<a name="line.542"></a>
-<span class="sourceLineNo">543</span>      return;<a name="line.543"></a>
-<span class="sourceLineNo">544</span>    } else {<a name="line.544"></a>
-<span class="sourceLineNo">545</span>      trimmedStoragePolicy = trimmedStoragePolicy.toUpperCase(Locale.ROOT);<a name="line.545"></a>
-<span class="sourceLineNo">546</span>    }<a name="line.546"></a>
-<span class="sourceLineNo">547</span>    if (trimmedStoragePolicy.equals(HConstants.DEFER_TO_HDFS_STORAGE_POLICY)) {<a name="line.547"></a>
-<span class="sourceLineNo">548</span>      if (LOG.isTraceEnabled()) {<a name="line.548"></a>
-<span class="sourceLineNo">549</span>        LOG.trace("We were passed the defer-to-hdfs policy {}, exiting early.",<a name="line.549"></a>
-<span class="sourceLineNo">550</span>          trimmedStoragePolicy);<a name="line.550"></a>
-<span class="sourceLineNo">551</span>      }<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      return;<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    }<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    try {<a name="line.554"></a>
-<span class="sourceLineNo">555</span>      invokeSetStoragePolicy(fs, path, trimmedStoragePolicy);<a name="line.555"></a>
-<span class="sourceLineNo">556</span>    } catch (IOException e) {<a name="line.556"></a>
-<span class="sourceLineNo">557</span>      if (LOG.isTraceEnabled()) {<a name="line.557"></a>
-<span class="sourceLineNo">558</span>        LOG.trace("Failed to invoke set storage policy API on FS", e);<a name="line.558"></a>
-<span class="sourceLineNo">559</span>      }<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      if (throwException) {<a name="line.560"></a>
-<span class="sourceLineNo">561</span>        throw e;<a name="line.561"></a>
-<span class="sourceLineNo">562</span>      }<a name="line.562"></a>
-<span class="sourceLineNo">563</span>    }<a name="line.563"></a>
-<span class="sourceLineNo">564</span>  }<a name="line.564"></a>
-<span class="sourceLineNo">565</span><a name="line.565"></a>
-<span class="sourceLineNo">566</span>  /*<a name="line.566"></a>
-<span class="sourceLineNo">567</span>   * All args have been checked and are good. Run the setStoragePolicy invocation.<a name="line.567"></a>
-<span class="sourceLineNo">568</span>   */<a name="line.568"></a>
-<span class="sourceLineNo">569</span>  private static void invokeSetStoragePolicy(final FileSystem fs, final Path path,<a name="line.569"></a>
-<span class="sourceLineNo">570</span>      final String storagePolicy) throws IOException {<a name="line.570"></a>
-<span class="sourceLineNo">571</span>    Method m = null;<a name="line.571"></a>
-<span class="sourceLineNo">572</span>    Exception toThrow = null;<a name="line.572"></a>
-<span class="sourceLineNo">573</span>    try {<a name="line.573"></a>
-<span class="sourceLineNo">574</span>      m = fs.getClass().getDeclaredMethod("setStoragePolicy", Path.class, String.class);<a name="line.574"></a>
-<span class="sourceLineNo">575</span>      m.setAccessible(true);<a name="line.575"></a>
-<span class="sourceLineNo">576</span>    } catch (NoSuchMethodException e) {<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      toThrow = e;<a name="line.577"></a>
-<span class="sourceLineNo">578</span>      final String msg = "FileSystem doesn't support setStoragePolicy; HDFS-6584, HDFS-9345 " +<a name="line.578"></a>
-<span class="sourceLineNo">579</span>          "not available. This is normal and expected on earlier Hadoop versions.";<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      if (!warningMap.containsKey(fs)) {<a name="line.580"></a>
-<span class="sourceLineNo">581</span>        warningMap.put(fs, true);<a name="line.581"></a>
-<span class="sourceLineNo">582</span>        LOG.warn(msg, e);<a name="line.582"></a>
-<span class="sourceLineNo">583</span>      } else if (LOG.isDebugEnabled()) {<a name="line.583"></a>
-<span class="sourceLineNo">584</span>        LOG.debug(msg, e);<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      }<a name="line.585"></a>
-<span class="sourceLineNo">586</span>      m = null;<a name="line.586"></a>
-<span class="sourceLineNo">587</span>    } catch (SecurityException e) {<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      toThrow = e;<a name="line.588"></a>
-<span class="sourceLineNo">589</span>      final String msg = "No access to setStoragePolicy on FileSystem from the SecurityManager; " +<a name="line.589"></a>
-<span class="sourceLineNo">590</span>          "HDFS-6584, HDFS-9345 not available. This is unusual and probably warrants an email " +<a name="line.590"></a>
-<span class="sourceLineNo">591</span>          "to the user@hbase mailing list. Please be sure to include a link to your configs, and " +<a name="line.591"></a>
-<span class="sourceLineNo">592</span>          "logs that include this message and period of time before it. Logs around service " +<a name="line.592"></a>
-<span class="sourceLineNo">593</span>          "start up will probably be useful as well.";<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      if (!warningMap.containsKey(fs)) {<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        warningMap.put(fs, true);<a name="line.595"></a>
-<span class="sourceLineNo">596</span>        LOG.warn(msg, e);<a name="line.596"></a>
-<span class="sourceLineNo">597</span>      } else if (LOG.isDebugEnabled()) {<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        LOG.debug(msg, e);<a name="line.598"></a>
-<span class="sourceLineNo">599</span>      }<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      m = null; // could happen on setAccessible() or getDeclaredMethod()<a name="line.600"></a>
-<span class="sourceLineNo">601</span>    }<a name="line.601"></a>
-<span class="sourceLineNo">602</span>    if (m != null) {<a name="line.602"></a>
-<span class="sourceLineNo">603</span>      try {<a name="line.603"></a>
-<span class="sourceLineNo">604</span>        m.invoke(fs, path, storagePolicy);<a name="line.604"></a>
-<span class="sourceLineNo">605</span>        if (LOG.isDebugEnabled()) {<a name="line.605"></a>
-<span class="sourceLineNo">606</span>          LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);<a name="line.606"></a>
-<span class="sourceLineNo">607</span>        }<a name="line.607"></a>
-<span class="sourceLineNo">608</span>      } catch (Exception e) {<a name="line.608"></a>
-<span class="sourceLineNo">609</span>        toThrow = e;<a name="line.609"></a>
-<span class="sourceLineNo">610</span>        // This swallows FNFE, should we be throwing it? seems more likely to indicate dev<a name="line.610"></a>
-<span class="sourceLineNo">611</span>        // misuse than a runtime problem with HDFS.<a name="line.611"></a>
-<span class="sourceLineNo">612</span>        if (!warningMap.containsKey(fs)) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>          warningMap.put(fs, true);<a name="line.613"></a>
-<span class="sourceLineNo">614</span>          LOG.warn("Unable to set storagePolicy=" + storagePolicy + " for path=" + path + ". " +<a name="line.614"></a>
-<span class="sourceLineNo">615</span>              "DEBUG log level might have more details.", e);<a name="line.615"></a>
-<span class="sourceLineNo">616</span>        } else if (LOG.isDebugEnabled()) {<a name="line.616"></a>
-<span class="sourceLineNo">617</span>          LOG.debug("Unable to set storagePolicy=" + storagePolicy + " for path=" + path, e);<a name="line.617"></a>
-<span class="sourceLineNo">618</span>        }<a name="line.618"></a>
-<span class="sourceLineNo">619</span>        // check for lack of HDFS-7228<a name="line.619"></a>
-<span class="sourceLineNo">620</span>        if (e instanceof InvocationTargetException) {<a name="line.620"></a>
-<span class="sourceLineNo">621</span>          final Throwable exception = e.getCause();<a name="line.621"></a>
-<span class="sourceLineNo">622</span>          if (exception instanceof RemoteException &amp;&amp;<a name="line.622"></a>
-<span class="sourceLineNo">623</span>              HadoopIllegalArgumentException.class.getName().equals(<a name="line.623"></a>
-<span class="sourceLineNo">624</span>                ((RemoteException)exception).getClassName())) {<a name="line.624"></a>
-<span class="sourceLineNo">625</span>            if (LOG.isDebugEnabled()) {<a name="line.625"></a>
-<span class="sourceLineNo">626</span>              LOG.debug("Given storage policy, '" +storagePolicy +"', was rejected and probably " +<a name="line.626"></a>
-<span class="sourceLineNo">627</span>                "isn't a valid policy for the version of Hadoop you're running. I.e. if you're " +<a name="line.627"></a>
-<span class="sourceLineNo">628</span>                "trying to use SSD related policies then you're likely missing HDFS-7228. For " +<a name="line.628"></a>
-<span class="sourceLineNo">629</span>                "more information see the 'ArchivalStorage' docs for your Hadoop release.");<a name="line.629"></a>
-<span class="sourceLineNo">630</span>            }<a name="line.630"></a>
-<span class="sourceLineNo">631</span>          // Hadoop 2.8+, 3.0-a1+ added FileSystem.setStoragePolicy with a default implementation<a name="line.631"></a>
-<span class="sourceLineNo">632</span>          // that throws UnsupportedOperationException<a name="line.632"></a>
-<span class="sourceLineNo">633</span>          } else if (exception instanceof UnsupportedOperationException) {<a name="line.633"></a>
-<span class="sourceLineNo">634</span>            if (LOG.isDebugEnabled()) {<a name="line.634"></a>
-<span class="sourceLineNo">635</span>              LOG.debug("The underlying FileSystem implementation doesn't support " +<a name="line.635"></a>
-<span class="sourceLineNo">636</span>                  "setStoragePolicy. This is probably intentional on their part, since HDFS-9345 " +<a name="line.636"></a>
-<span class="sourceLineNo">637</span>                  "appears to be present in your version of Hadoop. For more information check " +<a name="line.637"></a>
-<span class="sourceLineNo">638</span>                  "the Hadoop documentation on 'ArchivalStorage', the Hadoop FileSystem " +<a name="line.638"></a>
-<span class="sourceLineNo">639</span>                  "specification docs from HADOOP-11981, and/or related documentation from the " +<a name="line.639"></a>
-<span class="sourceLineNo">640</span>                  "provider of the underlying FileSystem (its name should appear in the " +<a name="line.640"></a>
-<span class="sourceLineNo">641</span>                  "stacktrace that accompanies this message). Note in particular that Hadoop's " +<a name="line.641"></a>
-<span class="sourceLineNo">642</span>                  "local filesystem implementation doesn't support storage policies.", exception);<a name="line.642"></a>
-<span class="sourceLineNo">643</span>            }<a name="line.643"></a>
-<span class="sourceLineNo">644</span>          }<a name="line.644"></a>
-<span class="sourceLineNo">645</span>        }<a name="line.645"></a>
-<span class="sourceLineNo">646</span>      }<a name="line.646"></a>
-<span class="sourceLineNo">647</span>    }<a name="line.647"></a>
-<span class="sourceLineNo">648</span>    if (toThrow != null) {<a name="line.648"></a>
-<span class="sourceLineNo">649</span>      throw new IOException(toThrow);<a name="line.649"></a>
-<span class="sourceLineNo">650</span>    }<a name="line.650"></a>
-<span class="sourceLineNo">651</span>  }<a name="line.651"></a>
-<span class="sourceLineNo">652</span><a name="line.652"></a>
-<span class="sourceLineNo">653</span>  /**<a name="line.653"></a>
-<span class="sourceLineNo">654</span>   * @param conf must not be null<a name="line.654"></a>
-<span class="sourceLineNo">655</span>   * @return True if this filesystem whose scheme is 'hdfs'.<a name="line.655"></a>
-<span class="sourceLineNo">656</span>   * @throws IOException from underlying FileSystem<a name="line.656"></a>
-<span class="sourceLineNo">657</span>   */<a name="line.657"></a>
-<span class="sourceLineNo">658</span>  public static boolean isHDFS(final Configuration conf) throws IOException {<a name="line.658"></a>
-<span class="sourceLineNo">659</span>    FileSystem fs = FileSystem.get(conf);<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    String scheme = fs.getUri().getScheme();<a name="line.660"></a>
-<span class="sourceLineNo">661</span>    return scheme.equalsIgnoreCase("hdfs");<a name="line.661"></a>
-<span class="sourceLineNo">662</span>  }<a name="line.662"></a>
-<span class="sourceLineNo">663</span><a name="line.663"></a>
-<span class="sourceLineNo">664</span>  /**<a name="line.664"></a>
-<span class="sourceLineNo">665</span>   * Checks if the given path is the one with 'recovered.edits' dir.<a name="line.665"></a>
-<span class="sourceLineNo">666</span>   * @param path must not be null<a name="line.666"></a>
-<span class="sourceLineNo">667</span>   * @return True if we recovered edits<a name="line.667"></a>
-<span class="sourceLineNo">668</span>   */<a name="line.668"></a>
-<span class="sourceLineNo">669</span>  public static boolean isRecoveredEdits(Path path) {<a name="line.669"></a>
-<span class="sourceLineNo">670</span>    return path.toString().contains(HConstants.RECOVERED_EDITS_DIR);<a name="line.670"></a>
-<span class="sourceLineNo">671</span>  }<a name="line.671"></a>
-<span class="sourceLineNo">672</span><a name="line.672"></a>
-<span class="sourceLineNo">673</span>  /**<a name="line.673"></a>
-<span class="sourceLineNo">674</span>   * @param conf must not be null<a name="line.674"></a>
-<span class="sourceLineNo">675</span>   * @return Returns the filesystem of the hbase rootdir.<a name="line.675"></a>
-<span class="sourceLineNo">676</span>   * @throws IOException from underlying FileSystem<a name="line.676"></a>
-<span class="sourceLineNo">677</span>   */<a name="line.677"></a>
-<span class="sourceLineNo">678</span>  public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {<a name="line.678"></a>
-<span class="sourceLineNo">679</span>    return getRootDir(conf).getFileSystem(conf);<a name="line.679"></a>
-<span class="sourceLineNo">680</span>  }<a name="line.680"></a>
-<span class="sourceLineNo">681</span><a name="line.681"></a>
-<span class="sourceLineNo">682</span>  /**<a name="line.682"></a>
-<span class="sourceLineNo">683</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.683"></a>
-<span class="sourceLineNo">684</span>   * This accommodates differences between hadoop versions, where hadoop 1<a name="line.684"></a>
-<span class="sourceLineNo">685</span>   * does not throw a FileNotFoundException, and return an empty FileStatus[]<a name="line.685"></a>
-<span class="sourceLineNo">686</span>   * while Hadoop 2 will throw FileNotFoundException.<a name="line.686"></a>
-<span class="sourceLineNo">687</span>   *<a name="line.687"></a>
-<span class="sourceLineNo">688</span>   * Where possible, prefer FSUtils#listStatusWithStatusFilter(FileSystem,<a name="line.688"></a>
-<span class="sourceLineNo">689</span>   * Path, FileStatusFilter) instead.<a name="line.689"></a>
-<span class="sourceLineNo">690</span>   *<a name="line.690"></a>
-<span class="sourceLineNo">691</span>   * @param fs file system<a name="line.691"></a>
-<span class="sourceLineNo">692</span>   * @param dir directory<a name="line.692"></a>
-<span class="sourceLineNo">693</span>   * @param filter path filter<a name="line.693"></a>
-<span class="sourceLineNo">694</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.694"></a>
-<span class="sourceLineNo">695</span>   */<a name="line.695"></a>
-<span class="sourceLineNo">696</span>  public static FileStatus[] listStatus(final FileSystem fs,<a name="line.696"></a>
-<span class="sourceLineNo">697</span>      final Path dir, final PathFilter filter) throws IOException {<a name="line.697"></a>
-<span class="sourceLineNo">698</span>    FileStatus [] status = null;<a name="line.698"></a>
-<span class="sourceLineNo">699</span>    try {<a name="line.699"></a>
-<span class="sourceLineNo">700</span>      status = filter == null ? fs.listStatus(dir) : fs.listStatus(dir, filter);<a name="line.700"></a>
-<span class="sourceLineNo">701</span>    } catch (FileNotFoundException fnfe) {<a name="line.701"></a>
-<span class="sourceLineNo">702</span>      // if directory doesn't exist, return null<a name="line.702"></a>
-<span class="sourceLineNo">703</span>      if (LOG.isTraceEnabled()) {<a name="line.703"></a>
-<span class="sourceLineNo">704</span>        LOG.trace("{} doesn't exist", dir);<a name="line.704"></a>
-<span class="sourceLineNo">705</span>      }<a name="line.705"></a>
-<span class="sourceLineNo">706</span>    }<a name="line.706"></a>
-<span class="sourceLineNo">707</span>    if (status == null || status.length &lt; 1) {<a name="line.707"></a>
-<span class="sourceLineNo">708</span>      return null;<a name="line.708"></a>
-<span class="sourceLineNo">709</span>    }<a name="line.709"></a>
-<span class="sourceLineNo">710</span>    return status;<a name="line.710"></a>
-<span class="sourceLineNo">711</span>  }<a name="line.711"></a>
-<span class="sourceLineNo">712</span><a name="line.712"></a>
-<span class="sourceLineNo">713</span>  /**<a name="line.713"></a>
-<span class="sourceLineNo">714</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.714"></a>
-<span class="sourceLineNo">715</span>   * This would accommodates differences between hadoop versions<a name="line.715"></a>
+<span class="sourceLineNo">543</span><a name="line.543"></a>
+<span class="sourceLineNo">544</span>      // check for lack of HDFS-7228<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      if (e instanceof RemoteException &amp;&amp;<a name="line.545"></a>
+<span class="sourceLineNo">546</span>          HadoopIllegalArgumentException.class.getName().equals(<a name="line.546"></a>
+<span class="sourceLineNo">547</span>            ((RemoteException)e).getClassName())) {<a name="line.547"></a>
+<span class="sourceLineNo">548</span>        if (LOG.isDebugEnabled()) {<a name="line.548"></a>
+<span class="sourceLineNo">549</span>          LOG.debug("Given storage policy, '" +storagePolicy +"', was rejected and probably " +<a name="line.549"></a>
+<span class="sourceLineNo">550</span>            "isn't a valid policy for the version of Hadoop you're running. I.e. if you're " +<a name="line.550"></a>
+<span class="sourceLineNo">551</span>            "trying to use SSD related policies then you're likely missing HDFS-7228. For " +<a name="line.551"></a>
+<span class="sourceLineNo">552</span>            "more information see the 'ArchivalStorage' docs for your Hadoop release.");<a name="line.552"></a>
+<span class="sourceLineNo">553</span>        }<a name="line.553"></a>
+<span class="sourceLineNo">554</span>      // Hadoop 2.8+, 3.0-a1+ added FileSystem.setStoragePolicy with a default implementation<a name="line.554"></a>
+<span class="sourceLineNo">555</span>      // that throws UnsupportedOperationException<a name="line.555"></a>
+<span class="sourceLineNo">556</span>      } else if (e instanceof UnsupportedOperationException) {<a name="line.556"></a>
+<span class="sourceLineNo">557</span>        if (LOG.isDebugEnabled()) {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>          LOG.debug("The underlying FileSystem implementation doesn't support " +<a name="line.558"></a>
+<span class="sourceLineNo">559</span>              "setStoragePolicy. This is probably intentional on their part, since HDFS-9345 " +<a name="line.559"></a>
+<span class="sourceLineNo">560</span>              "appears to be present in your version of Hadoop. For more information check " +<a name="line.560"></a>
+<span class="sourceLineNo">561</span>              "the Hadoop documentation on 'ArchivalStorage', the Hadoop FileSystem " +<a name="line.561"></a>
+<span class="sourceLineNo">562</span>              "specification docs from HADOOP-11981, and/or related documentation from the " +<a name="line.562"></a>
+<span class="sourceLineNo">563</span>              "provider of the underlying FileSystem (its name should appear in the " +<a name="line.563"></a>
+<span class="sourceLineNo">564</span>              "stacktrace that accompanies this message). Note in particular that Hadoop's " +<a name="line.564"></a>
+<span class="sourceLineNo">565</span>              "local filesystem implementation doesn't support storage policies.", e);<a name="line.565"></a>
+<span class="sourceLineNo">566</span>        }<a name="line.566"></a>
+<span class="sourceLineNo">567</span>      }<a name="line.567"></a>
+<span class="sourceLineNo">568</span>    }<a name="line.568"></a>
+<span class="sourceLineNo">569</span><a name="line.569"></a>
+<span class="sourceLineNo">570</span>    if (toThrow != null) {<a name="line.570"></a>
+<span class="sourceLineNo">571</span>      throw new IOException(toThrow);<a name="line.571"></a>
+<span class="sourceLineNo">572</span>    }<a name="line.572"></a>
+<span class="sourceLineNo">573</span>  }<a name="line.573"></a>
+<span class="sourceLineNo">574</span><a name="line.574"></a>
+<span class="sourceLineNo">575</span>  /**<a name="line.575"></a>
+<span class="sourceLineNo">576</span>   * @param conf must not be null<a name="line.576"></a>
+<span class="sourceLineNo">577</span>   * @return True if this filesystem whose scheme is 'hdfs'.<a name="line.577"></a>
+<span class="sourceLineNo">578</span>   * @throws IOException from underlying FileSystem<a name="line.578"></a>
+<span class="sourceLineNo">579</span>   */<a name="line.579"></a>
+<span class="sourceLineNo">580</span>  public static boolean isHDFS(final Configuration conf) throws IOException {<a name="line.580"></a>
+<span class="sourceLineNo">581</span>    FileSystem fs = FileSystem.get(conf);<a name="line.581"></a>
+<span class="sourceLineNo">582</span>    String scheme = fs.getUri().getScheme();<a name="line.582"></a>
+<span class="sourceLineNo">583</span>    return scheme.equalsIgnoreCase("hdfs");<a name="line.583"></a>
+<span class="sourceLineNo">584</span>  }<a name="line.584"></a>
+<span class="sourceLineNo">585</span><a name="line.585"></a>
+<span class="sourceLineNo">586</span>  /**<a name="line.586"></a>
+<span class="sourceLineNo">587</span>   * Checks if the given path is the one with 'recovered.edits' dir.<a name="line.587"></a>
+<span class="sourceLineNo">588</span>   * @param path must not be null<a name="line.588"></a>
+<span class="sourceLineNo">589</span>   * @return True if we recovered edits<a name="line.589"></a>
+<span class="sourceLineNo">590</span>   */<a name="line.590"></a>
+<span class="sourceLineNo">591</span>  public static boolean isRecoveredEdits(Path path) {<a name="line.591"></a>
+<span class="sourceLineNo">592</span>    return path.toString().contains(HConstants.RECOVERED_EDITS_DIR);<a name="line.592"></a>
+<span class="sourceLineNo">593</span>  }<a name="line.593"></a>
+<span class="sourceLineNo">594</span><a name="line.594"></a>
+<span class="sourceLineNo">595</span>  /**<a name="line.595"></a>
+<span class="sourceLineNo">596</span>   * @param conf must not be null<a name="line.596"></a>
+<span class="sourceLineNo">597</span>   * @return Returns the filesystem of the hbase rootdir.<a name="line.597"></a>
+<span class="sourceLineNo">598</span>   * @throws IOException from underlying FileSystem<a name="line.598"></a>
+<span class="sourceLineNo">599</span>   */<a name="line.599"></a>
+<span class="sourceLineNo">600</span>  public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {<a name="line.600"></a>
+<span class="sourceLineNo">601</span>    return getRootDir(conf).getFileSystem(conf);<a name="line.601"></a>
+<span class="sourceLineNo">602</span>  }<a name="line.602"></a>
+<span class="sourceLineNo">603</span><a name="line.603"></a>
+<span class="sourceLineNo">604</span>  /**<a name="line.604"></a>
+<span class="sourceLineNo">605</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.605"></a>
+<span class="sourceLineNo">606</span>   * This accommodates differences between hadoop versions, where hadoop 1<a name="line.606"></a>
+<span class="sourceLineNo">607</span>   * does not throw a FileNotFoundException, and return an empty FileStatus[]<a name="line.607"></a>
+<span class="sourceLineNo">608</span>   * while Hadoop 2 will throw FileNotFoundException.<a name="line.608"></a>
+<span class="sourceLineNo">609</span>   *<a name="line.609"></a>
+<span class="sourceLineNo">610</span>   * Where possible, prefer FSUtils#listStatusWithStatusFilter(FileSystem,<a name="line.610"></a>
+<span class="sourceLineNo">611</span>   * Path, FileStatusFilter) instead.<a name="line.611"></a>
+<span class="sourceLineNo">612</span>   *<a name="line.612"></a>
+<span class="sourceLineNo">613</span>   * @param fs file system<a name="line.613"></a>
+<span class="sourceLineNo">614</span>   * @param dir directory<a name="line.614"></a>
+<span class="sourceLineNo">615</span>   * @param filter path filter<a name="line.615"></a>
+<span class="sourceLineNo">616</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.616"></a>
+<span class="sourceLineNo">617</span>   */<a name="line.617"></a>
+<span class="sourceLineNo">618</span>  public static FileStatus[] listStatus(final FileSystem fs,<a name="line.618"></a>
+<span class="sourceLineNo">619</span>      final Path dir, final PathFilter filter) throws IOException {<a name="line.619"></a>
+<span class="sourceLineNo">620</span>    FileStatus [] status = null;<a name="line.620"></a>
+<span class="sourceLineNo">621</span>    try {<a name="line.621"></a>
+<span class="sourceLineNo">622</span>      status = filter == null ? fs.listStatus(dir) : fs.listStatus(dir, filter);<a name="line.622"></a>
+<span class="sourceLineNo">623</span>    } catch (FileNotFoundException fnfe) {<a name="line.623"></a>
+<span class="sourceLineNo">624</span>      // if directory doesn't exist, return null<a name="line.624"></a>
+<span class="sourceLineNo">625</span>      if (LOG.isTraceEnabled()) {<a name="line.625"></a>
+<span class="sourceLineNo">626</span>        LOG.trace("{} doesn't exist", dir);<a name="line.626"></a>
+<span class="sourceLineNo">627</span>      }<a name="line.627"></a>
+<span class="sourceLineNo">628</span>    }<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    if (status == null || status.length &lt; 1) {<a name="line.629"></a>
+<span class="sourceLineNo">630</span>      return null;<a name="line.630"></a>
+<span class="sourceLineNo">631</span>    }<a name="line.631"></a>
+<span class="sourceLineNo">632</span>    return status;<a name="line.632"></a>
+<span class="sourceLineNo">633</span>  }<a name="line.633"></a>
+<span class="sourceLineNo">634</span><a name="line.634"></a>
+<span class="sourceLineNo">635</span>  /**<a name="line.635"></a>
+<span class="sourceLineNo">636</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.636"></a>
+<span class="sourceLineNo">637</span>   * This would accommodates differences between hadoop versions<a name="line.637"></a>
+<span class="sourceLineNo">638</span>   *<a name="line.638"></a>
+<span class="sourceLineNo">639</span>   * @param fs file system<a name="line.639"></a>
+<span class="sourceLineNo">640</span>   * @param dir directory<a name="line.640"></a>
+<span class="sourceLineNo">641</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.641"></a>
+<span class="sourceLineNo">642</span>   */<a name="line.642"></a>
+<span class="sourceLineNo">643</span>  public static FileStatus[] listStatus(final FileSystem fs, final Path dir) throws IOException {<a name="line.643"></a>
+<span class="sourceLineNo">644</span>    return listStatus(fs, dir, null);<a name="line.644"></a>
+<span class="sourceLineNo">645</span>  }<a name="line.645"></a>
+<span class="sourceLineNo">646</span><a name="line.646"></a>
+<span class="sourceLineNo">647</span>  /**<a name="line.647"></a>
+<span class="sourceLineNo">648</span>   * Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call<a name="line.648"></a>
+<span class="sourceLineNo">649</span>   *<a name="line.649"></a>
+<span class="sourceLineNo">650</span>   * @param fs file system<a name="line.650"></a>
+<span class="sourceLineNo">651</span>   * @param dir directory<a name="line.651"></a>
+<span class="sourceLineNo">652</span>   * @return LocatedFileStatus list<a name="line.652"></a>
+<span class="sourceLineNo">653</span>   */<a name="line.653"></a>
+<span class="sourceLineNo">654</span>  public static List&lt;LocatedFileStatus&gt; listLocatedStatus(final FileSystem fs,<a name="line.654"></a>
+<span class="sourceLineNo">655</span>      final Path dir) throws IOException {<a name="line.655"></a>
+<span class="sourceLineNo">656</span>    List&lt;LocatedFileStatus&gt; status = null;<a name="line.656"></a>
+<span class="sourceLineNo">657</span>    try {<a name="line.657"></a>
+<span class="sourceLineNo">658</span>      RemoteIterator&lt;LocatedFileStatus&gt; locatedFileStatusRemoteIterator = fs<a name="line.658"></a>
+<span class="sourceLineNo">659</span>          .listFiles(dir, false);<a name="line.659"></a>
+<span class="sourceLineNo">660</span>      while (locatedFileStatusRemoteIterator.hasNext()) {<a name="line.660"></a>
+<span class="sourceLineNo">661</span>        if (status == null) {<a name="line.661"></a>
+<span class="sourceLineNo">662</span>          status = Lists.newArrayList();<a name="line.662"></a>
+<span class="sourceLineNo">663</span>        }<a name="line.663"></a>
+<span class="sourceLineNo">664</span>        status.add(locatedFileStatusRemoteIterator.next());<a name="line.664"></a>
+<span class="sourceLineNo">665</span>      }<a name="line.665"></a>
+<span class="sourceLineNo">666</span>    } catch (FileNotFoundException fnfe) {<a name="line.666"></a>
+<span class="sourceLineNo">667</span>      // if directory doesn't exist, return null<a name="line.667"></a>
+<span class="sourceLineNo">668</span>      if (LOG.isTraceEnabled()) {<a name="line.668"></a>
+<span class="sourceLineNo">669</span>        LOG.trace("{} doesn't exist", dir);<a name="line.669"></a>
+<span class="sourceLineNo">670</span>      }<a name="line.670"></a>
+<span class="sourceLineNo">671</span>    }<a name="line.671"></a>
+<span class="sourceLineNo">672</span>    return status;<a name="line.672"></a>
+<span class="sourceLineNo">673</span>  }<a name="line.673"></a>
+<span class="sourceLineNo">674</span><a name="line.674"></a>
+<span class="sourceLineNo">675</span>  /**<a name="line.675"></a>
+<span class="sourceLineNo">676</span>   * Calls fs.delete() and returns the value returned by the fs.delete()<a name="line.676"></a>
+<span class="sourceLineNo">677</span>   *<a name="line.677"></a>
+<span class="sourceLineNo">678</span>   * @param fs must not be null<a name="line.678"></a>
+<span class="sourceLineNo">679</span>   * @param path must not be null<a name="line.679"></a>
+<span class="sourceLineNo">680</span>   * @param recursive delete tree rooted at path<a name="line.680"></a>
+<span class="sourceLineNo">681</span>   * @return the value returned by the fs.delete()<a name="line.681"></a>
+<span class="sourceLineNo">682</span>   * @throws IOException from underlying FileSystem<a name="line.682"></a>
+<span class="sourceLineNo">683</span>   */<a name="line.683"></a>
+<span class="sourceLineNo">684</span>  public static boolean delete(final FileSystem fs, final Path path, final boolean recursive)<a name="line.684"></a>
+<span class="sourceLineNo">685</span>      throws IOException {<a name="line.685"></a>
+<span class="sourceLineNo">686</span>    return fs.delete(path, recursive);<a name="line.686"></a>
+<span class="sourceLineNo">687</span>  }<a name="line.687"></a>
+<span class="sourceLineNo">688</span><a name="line.688"></a>
+<span class="sourceLineNo">689</span>  /**<a name="line.689"></a>
+<span class="sourceLineNo">690</span>   * Calls fs.exists(). Checks if the specified path exists<a name="line.690"></a>
+<span class="sourceLineNo">691</span>   *<a name="line.691"></a>
+<span class="sourceLineNo">692</span>   * @param fs must not be null<a name="line.692"></a>
+<span class="sourceLineNo">693</span>   * @param path must not be null<a name="line.693"></a>
+<span class="sourceLineNo">694</span>   * @return the value returned by fs.exists()<a name="line.694"></a>
+<span class="sourceLineNo">695</span>   * @throws IOException from underlying FileSystem<a name="line.695"></a>
+<span class="sourceLineNo">696</span>   */<a name="line.696"></a>
+<span class="sourceLineNo">697</span>  public static boolean isExists(final FileSystem fs, final Path path) throws IOException {<a name="line.697"></a>
+<span class="sourceLineNo">698</span>    return fs.exists(path);<a name="line.698"></a>
+<span class="sourceLineNo">699</span>  }<a name="line.699"></a>
+<span class="sourceLineNo">700</span><a name="line.700"></a>
+<span class="sourceLineNo">701</span>  /**<a name="line.701"></a>
+<span class="sourceLineNo">702</span>   * Log the current state of the filesystem from a certain root directory<a name="line.702"></a>
+<span class="sourceLineNo">703</span>   * @param fs filesystem to investigate<a name="line.703"></a>
+<span class="sourceLineNo">704</span>   * @param root root file/directory to start logging from<a name="line.704"></a>
+<span class="sourceLineNo">705</span>   * @param log log to output information<a name="line.705"></a>
+<span class="sourceLineNo">706</span>   * @throws IOException if an unexpected exception occurs<a name="line.706"></a>
+<span class="sourceLineNo">707</span>   */<a name="line.707"></a>
+<span class="sourceLineNo">708</span>  public static void logFileSystemState(final FileSystem fs, final Path root, Logger log)<a name="line.708"></a>
+<span class="sourceLineNo">709</span>      throws IOException {<a name="line.709"></a>
+<span class="sourceLineNo">710</span>    log.debug("File system contents for path {}", root);<a name="line.710"></a>
+<span class="sourceLineNo">711</span>    logFSTree(log, fs, root, "|-");<a name="line.711"></a>
+<span class="sourceLineNo">712</span>  }<a name="line.712"></a>
+<span class="sourceLineNo">713</span><a name="line.713"></a>
+<span class="sourceLineNo">714</span>  /**<a name="line.714"></a>
+<span class="sourceLineNo">715</span>   * Recursive helper to log the state of the FS<a name="line.715"></a>
 <span class="sourceLineNo">716</span>   *<a name="line.716"></a>
-<span class="sourceLineNo">717</span>   * @param fs file system<a name="line.717"></a>
-<span class="sourceLineNo">718</span>   * @param dir directory<a name="line.718"></a>
-<span class="sourceLineNo">719</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.719"></a>
-<span class="sourceLineNo">720</span>   */<a name="line.720"></a>
-<span class="sourceLineNo">721</span>  public static FileStatus[] listStatus(final FileSystem fs, final Path dir) throws IOException {<a name="line.721"></a>
-<span class="sourceLineNo">722</span>    return listStatus(fs, dir, null);<a name="line.722"></a>
-<span class="sourceLineNo">723</span>  }<a name="line.723"></a>
-<span class="sourceLineNo">724</span><a name="line.724"></a>
-<span class="sourceLineNo">725</span>  /**<a name="line.725"></a>
-<span class="sourceLineNo">726</span>   * Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call<a name="line.726"></a>
-<span class="sourceLineNo">727</span>   *<a name="line.727"></a>
-<span class="sourceLineNo">728</span>   * @param fs file system<a name="line.728"></a>
-<span class="sourceLineNo">729</span>   * @param dir directory<a name="line.729"></a>
-<span class="sourceLineNo">730</span>   * @return LocatedFileStatus list<a name="line.730"></a>
-<span class="sourceLineNo">731</span>   */<a name="line.731"></a>
-<span class="sourceLineNo">732</span>  public static List&lt;LocatedFileStatus&gt; listLocatedStatus(final FileSystem fs,<a name="line.732"></a>
-<span class="sourceLineNo">733</span>      final Path dir) throws IOException {<a name="line.733"></a>
-<span class="sourceLineNo">734</span>    List&lt;LocatedFileStatus&gt; status = null;<a name="line.734"></a>
-<span class="sourceLineNo">735</span>    try {<a name="line.735"></a>
-<span class="sourceLineNo">736</span>      RemoteIterator&lt;LocatedFileStatus&gt; locatedFileStatusRemoteIterator = fs<a name="line.736"></a>
-<span class="sourceLineNo">737</span>          .listFiles(dir, false);<a name="line.737"></a>
-<span class="sourceLineNo">738</span>      while (locatedFileStatusRemoteIterator.hasNext()) {<a name="line.738"></a>
-<span class="sourceLineNo">739</span>        if (status == null) {<a name="line.739"></a>
-<span class="sourceLineNo">740</span>          status = Lists.newArrayList();<a name="line.740"></a>
-<span class="sourceLineNo">741</span>        }<a name="line.741"></a>
-<span class="sourceLineNo">742</span>        status.add(locatedFileStatusRemoteIterator.next());<a name="line.742"></a>
-<span class="sourceLineNo">743</span>      }<a name="line.743"></a>
-<span class="sourceLineNo">744</span>    } catch (FileNotFoundException fnfe) {<a name="line.744"></a>
-<span class="sourceLineNo">745</span>      // if directory doesn't exist, return null<a name="line.745"></a>
-<span class="sourceLineNo">746</span>      if (LOG.isTraceEnabled()) {<a name="line.746"></a>
-<span class="sourceLineNo">747</span>        LOG.trace("{} doesn't exist", dir);<a name="line.747"></a>
-<span class="sourceLineNo">748</span>      }<a name="line.748"></a>
-<span class="sourceLineNo">749</span>    }<a name="line.749"></a>
-<span class="sourceLineNo">750</span>    return status;<a name="line.750"></a>
-<span class="sourceLineNo">751</span>  }<a name="line.751"></a>
-<span class="sourceLineNo">752</span><a name="line.752"></a>
-<span class="sourceLineNo">753</span>  /**<a name="line.753"></a>
-<span class="sourceLineNo">754</span>   * Calls fs.delete() and returns the value returned by the fs.delete()<a name="line.754"></a>
-<span class="sourceLineNo">755</span>   *<a name="line.755"></a>
-<span class="sourceLineNo">756</span>   * @param fs must not be null<a name="line.756"></a>
-<span class="sourceLineNo">757</span>   * @param path must not be null<a name="line.757"></a>
-<span class="sourceLineNo">758</span>   * @param recursive delete tree rooted at path<a name="line.758"></a>
-<span class="sourceLineNo">759</span>   * @return the value returned by the fs.delete()<a name="line.759"></a>
-<span class="sourceLineNo">760</span>   * @throws IOException from underlying FileSystem<a name="line.760"></a>
-<span class="sourceLineNo">761</span>   */<a name="line.761"></a>
-<span class="sourceLineNo">762</span>  public static boolean delete(final FileSystem fs, final Path path, final boolean recursive)<a name="line.762"></a>
-<span class="sourceLineNo">763</span>      throws IOException {<a name="line.763"></a>
-<span class="sourceLineNo">764</span>    return fs.delete(path, recursive);<a name="line.764"></a>
-<span class="sourceLineNo">765</span>  }<a name="line.765"></a>
-<span class="sourceLineNo">766</span><a name="line.766"></a>
-<span class="sourceLineNo">767</span>  /**<a name="line.767"></a>
-<span class="sourceLineNo">768</span>   * Calls fs.exists(). Checks if the specified path exists<a name="line.768"></a>
-<span class="sourceLineNo">769</span>   *<a name="line.769"></a>
-<span class="sourceLineNo">770</span>   * @param fs must not be null<a name="line.770"></a>
-<span class="sourceLineNo">771</span>   * @param path must not be null<a name="line.771"></a>
-<span class="sourceLineNo">772</span>   * @return the value returned by fs.exists()<a name="line.772"></a>
-<span class="sourceLineNo">773</span>   * @throws IOException from underlying FileSystem<a name="line.773"></a>
-<span class="sourceLineNo">774</span>   */<a name="line.774"></a>
-<span class="sourceLineNo">775</span>  public static boolean isExists(final FileSystem fs, final Path path) throws IOException {<a name="line.775"></a>
-<span class="sourceLineNo">776</span>    return fs.exists(path);<a name="line.776"></a>
-<span class="sourceLineNo">777</span>  }<a name="line.777"></a>
+<span class="sourceLineNo">717</span>   * @see #logFileSystemState(FileSystem, Path, Logger)<a name="line.717"></a>
+<span class="sourceLineNo">718</span>   */<a name="line.718"></a>
+<span class="sourceLineNo">719</span>  private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)<a name="line.719"></a>
+<span class="sourceLineNo">720</span>      throws IOException {<a name="line.720"></a>
+<span class="sourceLineNo">721</span>    FileStatus[] files = listStatus(fs, root, null);<a name="line.721"></a>
+<span class="sourceLineNo">722</span>    if (files == null) {<a name="line.722"></a>
+<span class="sourceLineNo">723</span>      return;<a name="line.723"></a>
+<span class="sourceLineNo">724</span>    }<a name="line.724"></a>
+<span class="sourceLineNo">725</span><a name="line.725"></a>
+<span class="sourceLineNo">726</span>    for (FileStatus file : files) {<a name="line.726"></a>
+<span class="sourceLineNo">727</span>      if (file.isDirectory()) {<a name="line.727"></a>
+<span class="sourceLineNo">728</span>        log.debug(prefix + file.getPath().getName() + "/");<a name="line.728"></a>
+<span class="sourceLineNo">729</span>        logFSTree(log, fs, file.getPath(), prefix + "---");<a name="line.729"></a>
+<span class="sourceLineNo">730</span>      } else {<a name="line.730"></a>
+<span class="sourceLineNo">731</span>        log.debug(prefix + file.getPath().getName());<a name="line.731"></a>
+<span class="sourceLineNo">732</span>      }<a name="line.732"></a>
+<span class="sourceLineNo">733</span>    }<a name="line.733"></a>
+<span class="sourceLineNo">734</span>  }<a name="line.734"></a>
+<span class="sourceLineNo">735</span><a name="line.735"></a>
+<span class="sourceLineNo">736</span>  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest)<a name="line.736"></a>
+<span class="sourceLineNo">737</span>      throws IOException {<a name="line.737"></a>
+<span class="sourceLineNo">738</span>    // set the modify time for TimeToLive Cleaner<a name="line.738"></a>
+<span class="sourceLineNo">739</span>    fs.setTimes(src, EnvironmentEdgeManager.currentTime(), -1);<a name="line.739"></a>
+<span class="sourceLineNo">740</span>    return fs.rename(src, dest);<a name="line.740"></a>
+<span class="sourceLineNo">741</span>  }<a name="line.741"></a>
+<span class="sourceLineNo">742</span><a name="line.742"></a>
+<span class="sourceLineNo">743</span>  /**<a name="line.743"></a>
+<span class="sourceLineNo">744</span>   * Check if short circuit read buffer size is set and if not, set it to hbase value.<a name="line.744"></a>
+<span class="sourceLineNo">745</span>   * @param conf must not be null<a name="line.745"></a>
+<span class="sourceLineNo">746</span>   */<a name="line.746"></a>
+<span class="sourceLineNo">747</span>  public static void checkShortCircuitReadBufferSize(final Configuration conf) {<a name="line.747"></a>
+<span class="sourceLineNo">748</span>    final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;<a name="line.748"></a>
+<span class="sourceLineNo">749</span>    final int notSet = -1;<a name="line.749"></a>
+<span class="sourceLineNo">750</span>    // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2<a name="line.750"></a>
+<span class="sourceLineNo">751</span>    final String dfsKey = "dfs.client.read.shortcircuit.buffer.size";<a name="line.751"></a>
+<span class="sourceLineNo">752</span>    int size = conf.getInt(dfsKey, notSet);<a name="line.752"></a>
+<span class="sourceLineNo">753</span>    // If a size is set, return -- we will use it.<a name="line.753"></a>
+<span class="sourceLineNo">754</span>    if (size != notSet) {<a name="line.754"></a>
+<span class="sourceLineNo">755</span>      return;<a name="line.755"></a>
+<span class="sourceLineNo">756</span>    }<a name="line.756"></a>
+<span class="sourceLineNo">757</span>    // But short circuit buffer size is normally not set.  Put in place the hbase wanted size.<a name="line.757"></a>
+<span class="sourceLineNo">758</span>    int hbaseSize = conf.getInt("hbase." + dfsKey, defaultSize);<a name="line.758"></a>
+<span class="sourceLineNo">759</span>    conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));<a name="line.759"></a>
+<span class="sourceLineNo">760</span>  }<a name="line.760"></a>
+<span class="sourceLineNo">761</span><a name="line.761"></a>
+<span class="sourceLineNo">762</span>  private static class DfsBuilderUtility {<a name="line.762"></a>
+<span class="sourceLineNo">763</span>    static Class&lt;?&gt; dfsClass = null;<a name="line.763"></a>
+<span class="sourceLineNo">764</span>    static Method createMethod;<a name="line.764"></a>
+<span class="sourceLineNo">765</span>    static Method overwriteMethod;<a name="line.765"></a>
+<span class="sourceLineNo">766</span>    static Method bufferSizeMethod;<a name="line.766"></a>
+<span class="sourceLineNo">767</span>    static Method blockSizeMethod;<a name="line.767"></a>
+<span class="sourceLineNo">768</span>    static Method recursiveMethod;<a name="line.768"></a>
+<span class="sourceLineNo">769</span>    static Method replicateMethod;<a name="line.769"></a>
+<span class="sourceLineNo">770</span>    static Method replicationMethod;<a name="line.770"></a>
+<span class="sourceLineNo">771</span>    static Method buildMethod;<a name="line.771"></a>
+<span class="sourceLineNo">772</span>    static boolean allMethodsPresent = false;<a name="line.772"></a>
+<span class="sourceLineNo">773</span><a name="line.773"></a>
+<span class="sourceLineNo">774</span>    static {<a name="line.774"></a>
+<span class="sourceLineNo">775</span>      String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";<a name="line.775"></a>
+<span class="sourceLineNo">776</span>      String builderName = dfsName + "$HdfsDataOutputStreamBuilder";<a name="line.776"></a>
+<span class="sourceLineNo">777</span>      Class&lt;?&gt; builderClass = null;<a name="line.777"></a>
 <span class="sourceLineNo">778</span><a name="line.778"></a>
-<span class="sourceLineNo">779</span>  /**<a name="line.779"></a>
-<span class="sourceLineNo">780</span>   * Log the current state of the filesystem from a certain root directory<a name="line.780"></a>
-<span class="sourceLineNo">781</span>   * @param fs filesystem to investigate<a name="line.781"></a>
-<span class="sourceLineNo">782</span>   * @param root root file/directory to start logging from<a name="line.782"></a>
-<span class="sourceLineNo">783</span>   * @param log log to output information<a name="line.783"></a>
-<span class="sourceLineNo">784</span>   * @throws IOException if an unexpected exception occurs<a name="line.784"></a>
-<span class="sourceLineNo">785</span>   */<a name="line.785"></a>
-<span class="sourceLineNo">786</span>  public static void logFileSystemState(final FileSystem fs, final Path root, Logger log)<a name="line.786"></a>
-<span class="sourceLineNo">787</span>      throws IOException {<a name="line.787"></a>
-<span class="sourceLineNo">788</span>    log.debug("File system contents for path {}", root);<a name="line.788"></a>
-<span class="sourceLineNo">789</span>    logFSTree(log, fs, root, "|-");<a name="line.789"></a>
-<span class="sourceLineNo">790</span>  }<a name="line.790"></a>
-<span class="sourceLineNo">791</span><a name="line.791"></a>
-<span class="sourceLineNo">792</span>  /**<a name="line.792"></a>
-<span class="sourceLineNo">793</span>   * Recursive helper to log the state of the FS<a name="line.793"></a>
-<span class="sourceLineNo">794</span>   *<a name="line.794"></a>
-<span class="sourceLineNo">795</span>   * @see #logFileSystemState(FileSystem, Path, Logger)<a name="line.795"></a>
-<span class="sourceLineNo">796</span>   */<a name="line.796"></a>
-<span class="sourceLineNo">797</span>  private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)<a name="line.797"></a>
-<span class="sourceLineNo">798</span>      throws IOException {<a name="line.798"></a>
-<span class="sourceLineNo">799</span>    FileStatus[] files = listStatus(fs, root, null);<a name="line.799"></a>
-<span class="sourceLineNo">800</span>    if (files == null) {<a name="line.800"></a>
-<span class="sourceLineNo">801</span>      return;<a name="line.801"></a>
-<span class="sourceLineNo">802</span>    }<a name="line.802"></a>
-<span class="sourceLineNo">803</span><a name="line.803"></a>
-<span class="sourceLineNo">804</span>    for (FileStatus file : files) {<a name="line.804"></a>
-<span class="sourceLineNo">805</span>      if (file.isDirectory()) {<a name="line.805"></a>
-<span class="sourceLineNo">806</span>        log.debug(prefix + file.getPath().getName() + "/");<a name="line.806"></a>
-<span class="sourceLineNo">807</span>        logFSTree(log, fs, file.getPath(), prefix + "---");<a name="line.807"></a>
-<span class="sourceLineNo">808</span>      } else {<a name="line.808"></a>
-<span class="sourceLineNo">809</span>        log.debug(prefix + file.getPath().getName());<a name="line.809"></a>
-<span class="sourceLineNo">810</span>      }<a name="line.810"></a>
-<span class="sourceLineNo">811</span>    }<a name="line.811"></a>
-<span class="sourceLineNo">812</span>  }<a name="line.812"></a>
-<span class="sourceLineNo">813</span><a name="line.813"></a>
-<span class="sourceLineNo">814</span>  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest)<a name="line.814"></a>
-<span class="sourceLineNo">815</span>      throws IOException {<a name="line.815"></a>
-<span class="sourceLineNo">816</span>    // set the modify time for TimeToLive Cleaner<a name="line.816"></a>
-<span class="sourceLineNo">817</span>    fs.setTimes(src, EnvironmentEdgeManager.currentTime(), -1);<a name="line.817"></a>
-<span class="sourceLineNo">818</span>    return fs.rename(src, dest);<a name="line.818"></a>
-<span class="sourceLineNo">819</span>  }<a name="line.819"></a>
-<span class="sourceLineNo">820</span><a name="line.820"></a>
-<span class="sourceLineNo">821</span>  /**<a name="line.821"></a>
-<span class="sourceLineNo">822</span>   * Check if short circuit read buffer size is set and if not, set it to hbase value.<a name="line.822"></a>
-<span class="sourceLineNo">823</span>   * @param conf must not be null<a name="line.823"></a>
-<span class="sourceLineNo">824</span>   */<a name="line.824"></a>
-<span class="sourceLineNo">825</span>  public static void checkShortCircuitReadBufferSize(final Configuration conf) {<a name="line.825"></a>
-<span class="sourceLineNo">826</span>    final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;<a name="line.826"></a>
-<span class="sourceLineNo">827</span>    final int notSet = -1;<a name="line.827"></a>
-<span class="sourceLineNo">828</span>    // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2<a name="line.828"></a>
-<span class="sourceLineNo">829</span>    final String dfsKey = "dfs.client.read.shortcircuit.buffer.size";<a name="line.829"></a>
-<span class="sourceLineNo">830</span>    int size = conf.getInt(dfsKey, notSet);<a name="line.830"></a>
-<span class="sourceLineNo">831</span>    // If a size is set, return -- we will use it.<a name="line.831"></a>
-<span class="sourceLineNo">832</span>    if (size != notSet) {<a name="line.832"></a>
-<span class="sourceLineNo">833</span>      return;<a name="line.833"></a>
-<span class="sourceLineNo">834</span>    }<a name="line.834"></a>
-<span class="sourceLineNo">835</span>    // But short circuit buffer size is normally not set.  Put in place the hbase wanted size.<a name="line.835"></a>
-<span class="sourceLineNo">836</span>    int hbaseSize = conf.getInt("hbase." + dfsKey, defaultSize);<a name="line.836"></a>
-<span class="sourceLineNo">837</span>    conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));<a name="line.837"></a>
-<span class="sourceLineNo">838</span>  }<a name="line.838"></a>
-<span class="sourceLineNo">839</span><a name="line.839"></a>
-<span class="sourceLineNo">840</span>  private static class DfsBuilderUtility {<a name="line.840"></a>
-<span class="sourceLineNo">841</span>    static Class&lt;?&gt; dfsClass = null;<a name="line.841"></a>
-<span class="sourceLineNo">842</span>    static Method createMethod;<a name="line.842"></a>
-<span class="sourceLineNo">843</span>    static Method overwriteMethod;<a name="line.843"></a>
-<span class="sourceLineNo">844</span>    static Method bufferSizeMethod;<a name="line.844"></a>
-<span class="sourceLineNo">845</span>    static Method blockSizeMethod;<a name="line.845"></a>
-<span class="sourceLineNo">846</span>    static Method recursiveMethod;<a name="line.846"></a>
-<span class="sourceLineNo">847</span>    static Method replicateMethod;<a name="line.847"></a>
-<span class="sourceLineNo">848</span>    static Method replicationMethod;<a name="line.848"></a>
-<span class="sourceLineNo">849</span>    static Method buildMethod;<a name="line.849"></a>
-<span class="sourceLineNo">850</span>    static boolean allMethodsPresent = false;<a name="line.850"></a>
+<span class="sourceLineNo">779</span>      try {<a name="line.779"></a>
+<span class="sourceLineNo">780</span>        dfsClass = Class.forName(dfsName);<a name="line.780"></a>
+<span class="sourceLineNo">781</span>      } catch (ClassNotFoundException e) {<a name="line.781"></a>
+<span class="sourceLineNo">782</span>        LOG.debug("{} not available, will not use builder API for file creation.", dfsName);<a name="line.782"></a>
+<span class="sourceLineNo">783</span>      }<a name="line.783"></a>
+<span class="sourceLineNo">784</span>      try {<a name="line.784"></a>
+<span class="sourceLineNo">785</span>        builderClass = Class.forName(builderName);<a name="line.785"></a>
+<span class="sourceLineNo">786</span>      } catch (ClassNotFoundException e) {<a name="line.786"></a>
+<span class="sourceLineNo">787</span>        LOG.debug("{} not available, will not use builder API for file creation.", builderName);<a name="line.787"></a>
+<span class="sourceLineNo">788</span>      }<a name="line.788"></a>
+<span class="sourceLineNo">789</span><a name="line.789"></a>
+<span class="sourceLineNo">790</span>      if (dfsClass != null &amp;&amp; builderClass != null) {<a name="line.790"></a>
+<span class="sourceLineNo">791</span>        try {<a name="line.791"></a>
+<span class="sourceLineNo">792</span>          createMethod = dfsClass.getMethod("createFile", Path.class);<a name="line.792"></a>
+<span class="sourceLineNo">793</span>          overwriteMethod = builderClass.getMethod("overwrite", boolean.class);<a name="line.793"></a>
+<span class="sourceLineNo">794</span>          bufferSizeMethod = builderClass.getMethod("bufferSize", int.class);<a name="line.794"></a>
+<span class="sourceLineNo">795</span>          blockSizeMethod = builderClass.getMethod("blockSize", long.class);<a name="line.795"></a>
+<span class="sourceLineNo">796</span>          recursiveMethod = builderClass.getMethod("recursive");<a name="line.796"></a>
+<span class="sourceLineNo">797</span>          replicateMethod = builderClass.getMethod("replicate");<a name="line.797"></a>
+<span class="sourceLineNo">798</span>          replicationMethod = builderClass.getMethod("replication", short.class);<a name="line.798"></a>
+<span class="sourceLineNo">799</span>          buildMethod = builderClass.getMethod("build");<a name="line.799"></a>
+<span class="sourceLineNo">800</span><a name="line.800"></a>
+<span class="sourceLineNo">801</span>          allMethodsPresent = true;<a name="line.801"></a>
+<span class="sourceLineNo">802</span>          LOG.debug("Using builder API via reflection for DFS file creation.");<a name="line.802"></a>
+<span class="sourceLineNo">803</span>        } catch (NoSuchMethodException e) {<a name="line.803"></a>
+<span class="sourceLineNo">804</span>          LOG.debug("Could not find method on builder; will use old DFS API for file creation {}",<a name="line.804"></a>
+<span class="sourceLineNo">805</span>              e.getMessage());<a name="line.805"></a>
+<span class="sourceLineNo">806</span>        }<a name="line.806"></a>
+<span class="sourceLineNo">807</span>      }<a name="line.807"></a>
+<span class="sourceLineNo">808</span>    }<a name="line.808"></a>
+<span class="sourceLineNo">809</span><a name="line.809"></a>
+<span class="sourceLineNo">810</span>    /**<a name="line.810"></a>
+<span class="sourceLineNo">811</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.811"></a>
+<span class="sourceLineNo">812</span>     * replication enabled.<a name="line.812"></a>
+<span class="sourceLineNo">813</span>     */<a name="line.813"></a>
+<span class="sourceLineNo">814</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable,<a name="line.814"></a>
+<span class="sourceLineNo">815</span>        int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.815"></a>
+<span class="sourceLineNo">816</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.816"></a>
+<span class="sourceLineNo">817</span>        try {<a name="line.817"></a>
+<span class="sourceLineNo">818</span>          Object builder;<a name="line.818"></a>
+<span class="sourceLineNo">819</span><a name="line.819"></a>
+<span class="sourceLineNo">820</span>          builder = createMethod.invoke(fs, path);<a name="line.820"></a>
+<span class="sourceLineNo">821</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.821"></a>
+<span class="sourceLineNo">822</span>          builder = bufferSizeMethod.invoke(builder, bufferSize);<a name="line.822"></a>
+<span class="sourceLineNo">823</span>          builder = blockSizeMethod.invoke(builder, blockSize);<a name="line.823"></a>
+<span class="sourceLineNo">824</span>          if (isRecursive) {<a name="line.824"></a>
+<span class="sourceLineNo">825</span>            builder = recursiveMethod.invoke(builder);<a name="line.825"></a>
+<span class="sourceLineNo">826</span>          }<a name="line.826"></a>
+<span class="sourceLineNo">827</span>          builder = replicateMethod.invoke(builder);<a name="line.827"></a>
+<span class="sourceLineNo">828</span>          builder = replicationMethod.invoke(builder, replication);<a name="line.828"></a>
+<span class="sourceLineNo">829</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.829"></a>
+<span class="sourceLineNo">830</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.830"></a>
+<span class="sourceLineNo">831</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.831"></a>
+<span class="sourceLineNo">832</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.832"></a>
+<span class="sourceLineNo">833</span>        }<a name="line.833"></a>
+<span class="sourceLineNo">834</span>      }<a name="line.834"></a>
+<span class="sourceLineNo">835</span><a name="line.835"></a>
+<span class="sourceLineNo">836</span>      if (isRecursive) {<a name="line.836"></a>
+<span class="sourceLineNo">837</span>        return fs.create(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.837"></a>
+<span class="sourceLineNo">838</span>      }<a name="line.838"></a>
+<span class="sourceLineNo">839</span>      return fs.createNonRecursive(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.839"></a>
+<span class="sourceLineNo">840</span>    }<a name="line.840"></a>
+<span class="sourceLineNo">841</span><a name="line.841"></a>
+<span class="sourceLineNo">842</span>    /**<a name="line.842"></a>
+<span class="sourceLineNo">843</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.843"></a>
+<span class="sourceLineNo">844</span>     * replication enabled.<a name="line.844"></a>
+<span class="sourceLineNo">845</span>     */<a name="line.845"></a>
+<span class="sourceLineNo">846</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable)<a name="line.846"></a>
+<span class="sourceLineNo">847</span>        throws IOException {<a name="line.847"></a>
+<span class="sourceLineNo">848</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.848"></a>
+<span class="sourceLineNo">849</span>        try {<a name="line.849"></a>
+<span class="sourceLineNo">850</span>          Object builder;<a name="line.850"></a>
 <span class="sourceLineNo">851</span><a name="line.851"></a>
-<span class="sourceLineNo">852</span>    static {<a name="line.852"></a>
-<span class="sourceLineNo">853</span>      String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";<a name="line.853"></a>
-<span class="sourceLineNo">854</span>      String builderName = dfsName + "$HdfsDataOutputStreamBuilder";<a name="line.854"></a>
-<span class="sourceLineNo">855</span>      Class&lt;?&gt; builderClass = null;<a name="line.855"></a>
-<span class="sourceLineNo">856</span><a name="line.856"></a>
-<span class="sourceLineNo">857</span>      try {<a name="line.857"></a>
-<span class="sourceLineNo">858</span>        dfsClass = Class.forName(dfsName);<a name="line.858"></a>
-<span class="sourceLineNo">859</span>      } catch (ClassNotFoundException e) {<a name="line.859"></a>
-<span class="sourceLineNo">860</span>        LOG.debug("{} not available, will not use builder API for file creation.", dfsName);<a name="line.860"></a>
-<span class="sourceLineNo">861</span>      }<a name="line.861"></a>
-<span class="sourceLineNo">862</span>      try {<a name="line.862"></a>
-<span class="sourceLineNo">863</span>        builderClass = Class.forName(builderName);<a name="line.863"></a>
-<span class="sourceLineNo">864</span>      } catch (ClassNotFoundException e) {<a name="line.864"></a>
-<span class="sourceLineNo">865</span>        LOG.debug("{} not available, will not use builder API for file creation.", builderName);<a name="line.865"></a>
-<span class="sourceLineNo">866</span>      }<a name="line.866"></a>
-<span class="sourceLineNo">867</span><a name="line.867"></a>
-<span class="sourceLineNo">868</span>      if (dfsClass != null &amp;&amp; builderClass != null) {<a name="line.868"></a>
-<span class="sourceLineNo">869</span>        try {<a name="line.869"></a>
-<span class="sourceLineNo">870</span>          createMethod = dfsClass.getMethod("createFile", Path.class);<a name="line.870"></a>
-<span class="sourceLineNo">871</span>          overwriteMethod = builderClass.getMethod("overwrite", boolean.class);<a name="line.871"></a>
-<span class="sourceLineNo">872</span>          bufferSizeMethod = builderClass.getMethod("bufferSize", int.class);<a name="line.872"></a>
-<span class="sourceLineNo">873</span>          blockSizeMethod = builderClass.getMethod("blockSize", long.class);<a name="line.873"></a>
-<span class="sourceLineNo">874</span>          recursiveMethod = builderClass.getMethod("recursive");<a name="line.874"></a>
-<span class="sourceLineNo">875</span>          replicateMethod = builderClass.getMethod("replicate");<a name="line.875"></a>
-<span class="sourceLineNo">876</span>          replicationMethod = builderClass.getMethod("replication", short.class);<a name="line.876"></a>
-<span class="sourceLineNo">877</span>          buildMethod = builderClass.getMethod("build");<a name="line.877"></a>
-<span class="sourceLineNo">878</span><a name="line.878"></a>
-<span class="sourceLineNo">879</span>          allMethodsPresent = true;<a name="line.879"></a>
-<span class="sourceLineNo">880</span>          LOG.debug("Using builder API via reflection for DFS file creation.");<a name="line.880"></a>
-<span class="sourceLineNo">881</span>        } catch (NoSuchMethodException e) {<a name="line.881"></a>
-<span class="sourceLineNo">882</span>          LOG.debug("Could not find method on builder; will use old DFS API for file creation {}",<a name="line.882"></a>
-<span class="sourceLineNo">883</span>              e.getMessage());<a name="line.883"></a>
-<span class="sourceLineNo">884</span>        }<a name="line.884"></a>
-<span class="sourceLineNo">885</span>      }<a name="line.885"></a>
-<span class="sourceLineNo">886</span>    }<a name="line.886"></a>
-<span class="sourceLineNo">887</span><a name="line.887"></a>
-<span class="sourceLineNo">888</span>    /**<a name="line.888"></a>
-<span class="sourceLineNo">889</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.889"></a>
-<span class="sourceLineNo">890</span>     * replication enabled.<a name="line.890"></a>
-<span class="sourceLineNo">891</span>     */<a name="line.891"></a>
-<span class="sourceLineNo">892</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable,<a name="line.892"></a>
-<span class="sourceLineNo">893</span>        int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.893"></a>
-<span class="sourceLineNo">894</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.894"></a>
-<span class="sourceLineNo">895</span>        try {<a name="line.895"></a>
-<span class="sourceLineNo">896</span>          Object builder;<a name="line.896"></a>
-<span class="sourceLineNo">897</span><a name="line.897"></a>
-<span class="sourceLineNo">898</span>          builder = createMethod.invoke(fs, path);<a name="line.898"></a>
-<span class="sourceLineNo">899</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.899"></a>
-<span class="sourceLineNo">900</span>          builder = bufferSizeMethod.invoke(builder, bufferSize);<a name="line.900"></a>
-<span class="sourceLineNo">901</span>          builder = blockSizeMethod.invoke(builder, blockSize);<a name="line.901"></a>
-<span class="sourceLineNo">902</span>          if (isRecursive) {<a name="line.902"></a>
-<span class="sourceLineNo">903</span>            builder = recursiveMethod.invoke(builder);<a name="line.903"></a>
-<span class="sourceLineNo">904</span>          }<a name="line.904"></a>
-<span class="sourceLineNo">905</span>          builder = replicateMethod.invoke(builder);<a name="line.905"></a>
-<span class="sourceLineNo">906</span>          builder = replicationMethod.invoke(builder, replication);<a name="line.906"></a>
-<span class="sourceLineNo">907</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.907"></a>
-<span class="sourceLineNo">908</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.908"></a>
-<span class="sourceLineNo">909</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.909"></a>
-<span class="sourceLineNo">910</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.910"></a>
-<span class="sourceLineNo">911</span>        }<a name="line.911"></a>
-<span class="sourceLineNo">912</span>      }<a name="line.912"></a>
-<span class="sourceLineNo">913</span><a name="line.913"></a>
-<span class="sourceLineNo">914</span>      if (isRecursive) {<a name="line.914"></a>
-<span class="sourceLineNo">915</span>        return fs.create(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.915"></a>
-<span class="sourceLineNo">916</span>      }<a name="line.916"></a>
-<span class="sourceLineNo">917</span>      return fs.createNonRecursive(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.917"></a>
+<span class="sourceLineNo">852</span>          builder = createMethod.invoke(fs, path);<a name="line.852"></a>
+<span class="sourceLineNo">853</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.853"></a>
+<span class="sourceLineNo">854</span>          builder = replicateMethod.invoke(builder);<a name="line.854"></a>
+<span class="sourceLineNo">855</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.855"></a>
+<span class="sourceLineNo">856</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.856"></a>
+<span class="sourceLineNo">857</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.857"></a>
+<span class="sourceLineNo">858</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.858"></a>
+<span class="sourceLineNo">859</span>        }<a name="line.859"></a>
+<span class="sourceLineNo">860</span>      }<a name="line.860"></a>
+<span class="sourceLineNo">861</span><a name="line.861"></a>
+<span class="sourceLineNo">862</span>      return fs.create(path, overwritable);<a name="line.862"></a>
+<span class="sourceLineNo">863</span>    }<a name="line.863"></a>
+<span class="sourceLineNo">864</span>  }<a name="line.864"></a>
+<span class="sourceLineNo">865</span><a name="line.865"></a>
+<span class="sourceLineNo">866</span>  /**<a name="line.866"></a>
+<span class="sourceLineNo">867</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.867"></a>
+<span class="sourceLineNo">868</span>   * replication enabled.<a name="line.868"></a>
+<span class="sourceLineNo">869</span>   * &lt;p&gt;<a name="line.869"></a>
+<span class="sourceLineNo">870</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.870"></a>
+<span class="sourceLineNo">871</span>   */<a name="line.871"></a>
+<span class="sourceLineNo">872</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable)<a name="line.872"></a>
+<span class="sourceLineNo">873</span>      throws IOException {<a name="line.873"></a>
+<span class="sourceLineNo">874</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable);<a name="line.874"></a>
+<span class="sourceLineNo">875</span>  }<a name="line.875"></a>
+<span class="sourceLineNo">876</span><a name="line.876"></a>
+<span class="sourceLineNo">877</span>  /**<a name="line.877"></a>
+<span class="sourceLineNo">878</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.878"></a>
+<span class="sourceLineNo">879</span>   * replication enabled.<a name="line.879"></a>
+<span class="sourceLineNo">880</span>   * &lt;p&gt;<a name="line.880"></a>
+<span class="sourceLineNo">881</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.881"></a>
+<span class="sourceLineNo">882</span>   */<a name="line.882"></a>
+<span class="sourceLineNo">883</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable,<a name="line.883"></a>
+<span class="sourceLineNo">884</span>      int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.884"></a>
+<span class="sourceLineNo">885</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable, bufferSize, replication,<a name="line.885"></a>
+<span class="sourceLineNo">886</span>        blockSize, isRecursive);<a name="line.886"></a>
+<span class="sourceLineNo">887</span>  }<a name="line.887"></a>
+<span class="sourceLineNo">888</span><a name="line.888"></a>
+<span class="sourceLineNo">889</span>  // Holder singleton idiom. JVM spec ensures this will be run at most once per Classloader, and<a name="line.889"></a>
+<span class="sourceLineNo">890</span>  // not until we attempt to reference it.<a name="line.890"></a>
+<span class="sourceLineNo">891</span>  private static class StreamCapabilities {<a name="line.891"></a>
+<span class="sourceLineNo">892</span>    public static final boolean PRESENT;<a name="line.892"></a>
+<span class="sourceLineNo">893</span>    public static final Class&lt;?&gt; CLASS;<a name="line.893"></a>
+<span class="sourceLineNo">894</span>    public static final Method METHOD;<a name="line.894"></a>
+<span class="sourceLineNo">895</span>    static {<a name="line.895"></a>
+<span class="sourceLineNo">896</span>      boolean tmp = false;<a name="line.896"></a>
+<span class="sourceLineNo">897</span>      Class&lt;?&gt; clazz = null;<a name="line.897"></a>
+<span class="sourceLineNo">898</span>      Method method = null;<a name="line.898"></a>
+<span class="sourceLineNo">899</span>      try {<a name="line.899"></a>
+<span class="sourceLineNo">900</span>        clazz = Class.forName("org.apache.hadoop.fs.StreamCapabilities");<a name="line.900"></a>
+<span class="sourceLineNo">901</span>        method = clazz.getMethod("hasCapability", String.class);<a name="line.901"></a>
+<span class="sourceLineNo">902</span>        tmp = true;<a name="line.902"></a>
+<span class="sourceLineNo">903</span>      } catch(ClassNotFoundException|NoSuchMethodException|SecurityException exception) {<a name="line.903"></a>
+<span class="sourceLineNo">904</span>        LOG.warn("Your Hadoop installation does not include the StreamCapabilities class from " +<a name="line.904"></a>
+<span class="sourceLineNo">905</span>                 "HDFS-11644, so we will skip checking if any FSDataOutputStreams actually " +<a name="line.905"></a>
+<span class="sourceLineNo">906</span>                 "support hflush/hsync. If you are running on top of HDFS this probably just " +<a name="line.906"></a>
+<span class="sourceLineNo">907</span>                 "means you have an older version and this can be ignored. If you are running on " +<a name="line.907"></a>
+<span class="sourceLineNo">908</span>                 "top of an alternate FileSystem implementation you should manually verify that " +<a name="line.908"></a>
+<span class="sourceLineNo">909</span>                 "hflush and hsync are implemented; otherwise you risk data loss and hard to " +<a name="line.909"></a>
+<span class="sourceLineNo">910</span>                 "diagnose errors when our assumptions are violated.");<a name="line.910"></a>
+<span class="sourceLineNo">911</span>        LOG.debug("The first request to check for StreamCapabilities came from this stacktrace.",<a name="line.911"></a>
+<span class="sourceLineNo">912</span>            exception);<a name="line.912"></a>
+<span class="sourceLineNo">913</span>      } finally {<a name="line.913"></a>
+<span class="sourceLineNo">914</span>        PRESENT = tmp;<a name="line.914"></a>
+<span class="sourceLineNo">915</span>        CLASS = clazz;<a name="line.915"></a>
+<span class="sourceLineNo">916</span>        METHOD = method;<a name="line.916"></a>
+<span class="sourceLineNo">917</span>      }<a name="line.917"></a>
 <span class="sourceLineNo">918</span>    }<a name="line.918"></a>
-<span class="sourceLineNo">919</span><a name="line.919"></a>
-<span class="sourceLineNo">920</span>    /**<a name="line.920"></a>
-<span class="sourceLineNo">921</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.921"></a>
-<span class="sourceLineNo">922</span>     * replication enabled.<a name="line.922"></a>
-<span class="sourceLineNo">923</span>     */<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable)<a name="line.924"></a>
-<span class="sourceLineNo">925</span>        throws IOException {<a name="line.925"></a>
-<span class="sourceLineNo">926</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.926"></a>
-<span class="sourceLineNo">927</span>        try {<a name="line.927"></a>
-<span class="sourceLineNo">928</span>          Object builder;<a name="line.928"></a>
-<span class="sourceLineNo">929</span><a name="line.929"></a>
-<span class="sourceLineNo">930</span>          builder = createMethod.invoke(fs, path);<a name="line.930"></a>
-<span class="sourceLineNo">931</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.931"></a>
-<span class="sourceLineNo">932</span>          builder = replicateMethod.invoke(builder);<a name="line.932"></a>
-<span class="sourceLineNo">933</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.933"></a>
-<span class="sourceLineNo">934</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.934"></a>
-<span class="sourceLineNo">935</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.935"></a>
-<span class="sourceLineNo">936</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.936"></a>
-<span class="sourceLineNo">937</span>        }<a name="line.937"></a>
-<span class="sourceLineNo">938</span>      }<a name="line.938"></a>
-<span class="sourceLineNo">939</span><a name="line.939"></a>
-<span class="sourceLineNo">940</span>      return fs.create(path, overwritable);<a name="line.940"></a>
-<span class="sourceLineNo">941</span>    }<a name="line.941"></a>
-<span class="sourceLineNo">942</span>  }<a name="line.942"></a>
-<span class="sourceLineNo">943</span><a name="line.943"></a>
-<span class="sourceLineNo">944</span>  /**<a name="line.944"></a>
-<span class="sourceLineNo">945</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.945"></a>
-<span class="sourceLineNo">946</span>   * replication enabled.<a name="line.946"></a>
-<span class="sourceLineNo">947</span>   * &lt;p&gt;<a name="line.947"></a>
-<span class="sourceLineNo">948</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.948"></a>
-<span class="sourceLineNo">949</span>   */<a name="line.949"></a>
-<span class="sourceLineNo">950</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable)<a name="line.950"></a>
-<span class="sourceLineNo">951</span>      throws IOException {<a name="line.951"></a>
-<span class="sourceLineNo">952</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable);<a name="line.952"></a>
-<span class="sourceLineNo">953</span>  }<a name="line.953"></a>
-<span class="sourceLineNo">954</span><a name="line.954"></a>
-<span class="sourceLineNo">955</span>  /**<a name="line.955"></a>
-<span class="sourceLineNo">956</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.956"></a>
-<span class="sourceLineNo">957</span>   * replication enabled.<a name="line.957"></a>
-<span class="sourceLineNo">958</span>   * &lt;p&gt;<a name="line.958"></a>
-<span class="sourceLineNo">959</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.959"></a>
-<span class="sourceLineNo">960</span>   */<a name="line.960"></a>
-<span class="sourceLineNo">961</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable,<a name="line.961"></a>
-<span class="sourceLineNo">962</span>      int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.962"></a>
-<span class="sourceLineNo">963</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable, bufferSize, replication,<a name="line.963"></a>
-<span class="sourceLineNo">964</span>        blockSize, isRecursive);<a name="line.964"></a>
-<span class="sourceLineNo">965</span>  }<a name="line.965"></a>
-<span class="sourceLineNo">966</span><a name="line.966"></a>
-<span class="sourceLineNo">967</span>  // Holder singleton idiom. JVM spec ensures this will be run at most once per Classloader, and<a name="line.967"></a>
-<span class="sourceLineNo">968</span>  // not until we attempt to reference it.<a name="line.968"></a>
-<span class="sourceLineNo">969</span>  private static class StreamCapabilities {<a name="line.969"></a>
-<span class="sourceLineNo">970</span>    public static final boolean PRESENT;<a name="line.970"></a>
-<span class="sourceLineNo">971</span>    public static final Class&lt;?&gt; CLASS;<a name="line.971"></a>
-<span class="sourceLineNo">972</span>    public static final Method METHOD;<a name="line.972"></a>
-<span class="sourceLineNo">973</span>    static {<a name="line.973"></a>
-<span class="sourceLineNo">974</span>      boolean tmp = false;<a name="line.974"></a>
-<span class="sourceLineNo">975</span>      Class&lt;?&gt; clazz = null;<a name="line.975"></a>
-<span class="sourceLineNo">976</span>      Method method = null;<a name="line.976"></a>
-<span class="sourceLineNo">977</span>      try {<a name="line.977"></a>
-<span class="sourceLineNo">978</span>        clazz = Class.forName("org.apache.hadoop.fs.StreamCapabilities");<a name="line.978"></a>
-<span class="sourceLineNo">979</span>        method = clazz.getMethod("hasCapability", String.class);<a name="line.979"></a>
-<span class="sourceLineNo">980</span>        tmp = true;<a name="line.980"></a>
-<span class="sourceLineNo">981</span>      } catch(ClassNotFoundException|NoSuchMethodException|SecurityException exception) {<a name="line.981"></a>
-<span class="sourceLineNo">982</span>        LOG.warn("Your Hadoop installation does not include the StreamCapabilities class from " +<a name="line.982"></a>
-<span class="sourceLineNo">983</span>                 "HDFS-11644, so we will skip checking if any FSDataOutputStreams actually " +<a name="line.983"></a>
-<span class="sourceLineNo">984</span>                 "support hflush/hsync. If you are running on top of HDFS this probably just " +<a name="line.984"></a>
-<span class="sourceLineNo">985</span>                 "means you have an older version and this can be ignored. If you are running on " +<a name="line.985"></a>
-<span class="sourceLineNo">986</span>                 "top of an alternate FileSystem implementation you should manually verify that " +<a name="line.986"></a>
-<span class="sourceLineNo">987</span>                 "hflush and hsync are implemented; otherwise you risk data loss and hard to " +<a name="line.987"></a>
-<span class="sourceLineNo">988</span>                 "diagnose errors when our assumptions are violated.");<a name="line.988"></a>
-<span class="sourceLineNo">989</span>        LOG.debug("The first request to check for StreamCapabilities came from this stacktrace.",<a name="line.989"></a>
-<span class="sourceLineNo">990</span>            exception);<a name="line.990"></a>
-<span class="sourceLineNo">991</span>      } finally {<a name="line.991"></a>
-<span class="sourceLineNo">992</span>        PRESENT = tmp;<a name="line.992"></a>
-<span class="sourceLineNo">993</span>        CLASS = clazz;<a name="line.993"></a>
-<span class="sourceLineNo">994</span>        METHOD = method;<a name="line.994"></a>
-<span class="sourceLineNo">995</span>      }<a name="line.995"></a>
-<span class="sourceLineNo">996</span>    }<a name="line.996"></a>
-<span class="sourceLineNo">997</span>  }<a name="line.997"></a>
-<span class="sourceLineNo">998</span><a name="line.998"></a>
-<span class="sourceLineNo">999</span>  /**<a name="line.999"></a>
-<span class="sourceLineNo">1000</span>   * If our FileSystem version includes the StreamCapabilities class, check if the given stream has<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>   * a particular capability.<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>   * @param stream capabilities are per-stream instance, so check this one specifically. must not be<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>   *          null<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>   * @param capability what to look for, per Hadoop Common's FileSystem docs<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>   * @return true if there are no StreamCapabilities. false if there are, but this stream doesn't<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>   *         implement it. return result of asking the stream otherwise.<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>   * @throws NullPointerException if {@code stream} is {@code null}<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>   */<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>  public static boolean hasCapability(FSDataOutputStream stream, String capability) {<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>    // be consistent whether or not StreamCapabilities is present<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>    Objects.requireNonNull(stream, "stream cannot be null");<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>    // If o.a.h.fs.StreamCapabilities doesn't exist, assume everyone does everything<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>    // otherwise old versions of Hadoop will break.<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>    boolean result = true;<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>    if (StreamCapabilities.PRESENT) {<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>      // if StreamCapabilities is present, but the stream doesn't implement it<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>      // or we run into a problem invoking the method,<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>      // we treat that as equivalent to not declaring anything<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>      result = false;<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>      if (StreamCapabilities.CLASS.isAssignableFrom(stream.getClass())) {<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>        try {<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>          result = ((Boolean)StreamCapabilities.METHOD.invoke(stream, capability)).booleanValue();<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>            exception) {<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>          LOG.warn("Your Hadoop installation's StreamCapabilities implementation doesn't match " +<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>              "our understanding of how it's supposed to work. Please file a JIRA and include " +<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>              "the following stack trace. In the mean time we're interpreting this behavior " +<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span>              "difference as a lack of capability support, which will probably cause a failure.",<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>              exception);<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>        }<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span>      }<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>    }<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>    return result;<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>  }<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span><a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>  /**<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>   * Helper exception for those cases where the place where we need to check a stream capability<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>   * is not where we have the needed context to explain the impact and mitigation for a lack.<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>   */<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>  public static class StreamLacksCapabilityException extends Exception {<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>    public StreamLacksCapabilityException(String message, Throwable cause) {<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>      super(message, cause);<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>    }<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>    public StreamLacksCapabilityException(String message) {<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>      super(message);<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>    }<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>  }<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>}<a name="line.1048"></a>
+<span class="sourceLineNo">919</span>  }<a name="line.919"></a>
+<span class="sourceLineNo">920</span><a name="line.920"></a>
+<span class="sourceLineNo">921</span>  /**<a name="line.921"></a>
+<span class="sourceLineNo">922</span>   * If our FileSystem version includes the StreamCapabilities class, check if the given stream has<a name="line.922"></a>
+<span class="sourceLineNo">923</span>   * a particular capability.<a name="line.923"></a>
+<span class="sourceLineNo">924</span>   * @param stream capabilities are per-stream instance, so check this one specifically. must not be<a name="line.924"></a>
+<span class="sourceLineNo">925</span>   *          null<a name="line.925"></a>
+<span class="sourceLineNo">926</span>   * @param capability what to look for, per Hadoop Common's FileSystem docs<a name="line.926"></a>
+<span class="sourceLineNo">927</span>   * @return true if there are no StreamCapabilities. false if there are, but this stream doesn't<a name="line.927"></a>
+<span class="sourceLineNo">928</span>   *         implement it. return result of asking the stream otherwise.<a name="line.928"></a>
+<span class="sourceLineNo">929</span>   * @throws NullPointerException if {@code stream} is {@code null}<a name="line.929"></a>
+<span class="sourceLineNo">930</span>   */<a name="line.930"></a>
+<span class="sourceLineNo">931</span>  public static boolean hasCapability(FSDataOutputStream stream, String capability) {<a name="line.931"></a>
+<span class="sourceLineNo">932</span>    // be consistent whether or not StreamCapabilities is present<a name="line.932"></a>
+<span class="sourceLineNo">933</span>    Objects.requireNonNull(stream, "stream cannot be null");<a name="line.933"></a>
+<span class="sourceLineNo">934</span>    // If o.a.h.fs.StreamCapabilities doesn't exist, assume everyone does everything<a name="line.934"></a>
+<span class="sourceLineNo">935</span>    // otherwise old versions of Hadoop will break.<a name="line.935"></a>
+<span class="sourceLineNo">936</span>    boolean result = true;<a name="line.936"></a>
+<span class="sourceLineNo">937</span>    if (StreamCapabilities.PRESENT) {<a name="line.937"></a>
+<span class="sourceLineNo">938</span>      // if StreamCapabilities is present, but the stream doesn't implement it<a name="line.938"></a>
+<span class="sourceLineNo">939</span>      // or we run into a problem invoking the method,<a name="line.939"></a>
+<span class="sourceLineNo">940</span>      // we treat that as equivalent to not declaring anything<a name="line.940"></a>
+<span class="sourceLineNo">941</span>      result = false;<a name="line.941"></a>
+<span class="sourceLineNo">942</span>      if (StreamCapabilities.CLASS.isAssignableFrom(stream.getClass())) {<a name="line.942"></a>
+<span class="sourceLineNo">943</span>        try {<a name="line.943"></a>
+<span class="sourceLineNo">944</span>          result = ((Boolean)StreamCapabilities.METHOD.invoke(stream, capability)).booleanValue();<a name="line.944"></a>
+<span class="sourceLineNo">945</span>        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException<a name="line.945"></a>
+<span class="sourceLineNo">946</span>            exception) {<a name="line.946"></a>
+<span class="sourceLineNo">947</span>          LOG.warn("Your Hadoop installation's StreamCapabilities implementation doesn't match " +<a name="line.947"></a>
+<span class="sourceLineNo">948</span>              "our understanding of how it's supposed to work. Please file a JIRA and include " +<a name="line.948"></a>
+<span class="sourceLineNo">949</span>              "the following stack trace. In the mean time we're interpreting this behavior " +<a name="line.949"></a>
+<span class="sourceLineNo">950</span>              "difference as a lack of capability support, which will probably cause a failure.",<a name="line.950"></a>
+<span class="sourceLineNo">951</span>              exception);<a name="line.951"></a>
+<span class="sourceLineNo">952</span>        }<a name="line.952"></a>
+<span class="sourceLineNo">953</span>      }<a name="line.953"></a>
+<span class="sourceLineNo">954</span>    }<a name="line.954"></a>
+<span class="sourceLineNo">955</span>    return result;<a name="line.955"></a>
+<span class="sourceLineNo">956</span>  }<a name="line.956"></a>
+<span class="sourceLineNo">957</span><a name="line.957"></a>
+<span class="sourceLineNo">958</span>  /**<a name="line.958"></a>
+<span class="sourceLineNo">959</span>   * Helper exception for those cases where the place where we need to check a stream capability<a name="line.959"></a>
+<span class="sourceLineNo">960</span>   * is not where we have the needed context to explain the impact and mitigation for a lack.<a name="line.960"></a>
+<span class="sourceLineNo">961</span>   */<a name="line.961"></a>
+<span class="sourceLineNo">962</span>  public static class StreamLacksCapabilityException extends Exception {<a name="line.962"></a>
+<span class="sourceLineNo">963</span>    public StreamLacksCapabilityException(String message, Throwable cause) {<a name="line.963"></a>
+<span class="sourceLineNo">964</span>      super(message, cause);<a name="line.964"></a>
+<span class="sourceLineNo">965</span>    }<a name="line.965"></a>
+<span class="sourceLineNo">966</span>    public StreamLacksCapabilityException(String message) {<a name="line.966"></a>
+<span class="sourceLineNo">967</span>      super(message);<a name="line.967"></a>
+<span class="sourceLineNo">968</span>    }<a name="line.968"></a>
+<span class="sourceLineNo">969</span>  }<a name="line.969"></a>
+<span class="sourceLineNo">970</span>}<a name="line.970"></a>
 
 
 
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html b/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html
index a739df0..fb9defa 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/util/CommonFSUtils.html
@@ -157,903 +157,825 @@
 <span class="sourceLineNo">149</span>   * Return the number of bytes that large input files should be optimally<a name="line.149"></a>
 <span class="sourceLineNo">150</span>   * be split into to minimize i/o time.<a name="line.150"></a>
 <span class="sourceLineNo">151</span>   *<a name="line.151"></a>
-<span class="sourceLineNo">152</span>   * use reflection to search for getDefaultBlockSize(Path f)<a name="line.152"></a>
-<span class="sourceLineNo">153</span>   * if the method doesn't exist, fall back to using getDefaultBlockSize()<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   *<a name="line.154"></a>
-<span class="sourceLineNo">155</span>   * @param fs filesystem object<a name="line.155"></a>
-<span class="sourceLineNo">156</span>   * @return the default block size for the path's filesystem<a name="line.156"></a>
-<span class="sourceLineNo">157</span>   * @throws IOException e<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   */<a name="line.158"></a>
-<span class="sourceLineNo">159</span>  public static long getDefaultBlockSize(final FileSystem fs, final Path path) throws IOException {<a name="line.159"></a>
-<span class="sourceLineNo">160</span>    Method m = null;<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    Class&lt;? extends FileSystem&gt; cls = fs.getClass();<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    try {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>      m = cls.getMethod("getDefaultBlockSize", Path.class);<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    } catch (NoSuchMethodException e) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>      LOG.info("FileSystem doesn't support getDefaultBlockSize");<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    } catch (SecurityException e) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>      LOG.info("Doesn't have access to getDefaultBlockSize on FileSystems", e);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      m = null; // could happen on setAccessible()<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    }<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    if (m == null) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      return fs.getDefaultBlockSize(path);<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    } else {<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      try {<a name="line.173"></a>
-<span class="sourceLineNo">174</span>        Object ret = m.invoke(fs, path);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        return ((Long)ret).longValue();<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      } catch (Exception e) {<a name="line.176"></a>
-<span class="sourceLineNo">177</span>        throw new IOException(e);<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      }<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    }<a name="line.179"></a>
-<span class="sourceLineNo">180</span>  }<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>  /*<a name="line.182"></a>
-<span class="sourceLineNo">183</span>   * Get the default replication.<a name="line.183"></a>
-<span class="sourceLineNo">184</span>   *<a name="line.184"></a>
-<span class="sourceLineNo">185</span>   * use reflection to search for getDefaultReplication(Path f)<a name="line.185"></a>
-<span class="sourceLineNo">186</span>   * if the method doesn't exist, fall back to using getDefaultReplication()<a name="line.186"></a>
-<span class="sourceLineNo">187</span>   *<a name="line.187"></a>
-<span class="sourceLineNo">188</span>   * @param fs filesystem object<a name="line.188"></a>
-<span class="sourceLineNo">189</span>   * @param f path of file<a name="line.189"></a>
-<span class="sourceLineNo">190</span>   * @return default replication for the path's filesystem<a name="line.190"></a>
-<span class="sourceLineNo">191</span>   * @throws IOException e<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   */<a name="line.192"></a>
-<span class="sourceLineNo">193</span>  public static short getDefaultReplication(final FileSystem fs, final Path path)<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      throws IOException {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    Method m = null;<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    Class&lt;? extends FileSystem&gt; cls = fs.getClass();<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    try {<a name="line.197"></a>
-<span class="sourceLineNo">198</span>      m = cls.getMethod("getDefaultReplication", Path.class);<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    } catch (NoSuchMethodException e) {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>      LOG.info("FileSystem doesn't support getDefaultReplication");<a name="line.200"></a>
-<span class="sourceLineNo">201</span>    } catch (SecurityException e) {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>      LOG.info("Doesn't have access to getDefaultReplication on FileSystems", e);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      m = null; // could happen on setAccessible()<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    }<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    if (m == null) {<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      return fs.getDefaultReplication(path);<a name="line.206"></a>
-<span class="sourceLineNo">207</span>    } else {<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      try {<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        Object ret = m.invoke(fs, path);<a name="line.209"></a>
-<span class="sourceLineNo">210</span>        return ((Number)ret).shortValue();<a name="line.210"></a>
-<span class="sourceLineNo">211</span>      } catch (Exception e) {<a name="line.211"></a>
-<span class="sourceLineNo">212</span>        throw new IOException(e);<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      }<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>  }<a name="line.215"></a>
-<span class="sourceLineNo">216</span><a name="line.216"></a>
-<span class="sourceLineNo">217</span>  /**<a name="line.217"></a>
-<span class="sourceLineNo">218</span>   * Returns the default buffer size to use during writes.<a name="line.218"></a>
-<span class="sourceLineNo">219</span>   *<a name="line.219"></a>
-<span class="sourceLineNo">220</span>   * The size of the buffer should probably be a multiple of hardware<a name="line.220"></a>
-<span class="sourceLineNo">221</span>   * page size (4096 on Intel x86), and it determines how much data is<a name="line.221"></a>
-<span class="sourceLineNo">222</span>   * buffered during read and write operations.<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   *<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   * @param fs filesystem object<a name="line.224"></a>
-<span class="sourceLineNo">225</span>   * @return default buffer size to use during writes<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>  public static int getDefaultBufferSize(final FileSystem fs) {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    return fs.getConf().getInt("io.file.buffer.size", 4096);<a name="line.228"></a>
-<span class="sourceLineNo">229</span>  }<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>  /**<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   * Create the specified file on the filesystem. By default, this will:<a name="line.232"></a>
-<span class="sourceLineNo">233</span>   * &lt;ol&gt;<a name="line.233"></a>
-<span class="sourceLineNo">234</span>   * &lt;li&gt;apply the umask in the configuration (if it is enabled)&lt;/li&gt;<a name="line.234"></a>
-<span class="sourceLineNo">235</span>   * &lt;li&gt;use the fs configured buffer size (or 4096 if not set)&lt;/li&gt;<a name="line.235"></a>
-<span class="sourceLineNo">236</span>   * &lt;li&gt;use the default replication&lt;/li&gt;<a name="line.236"></a>
-<span class="sourceLineNo">237</span>   * &lt;li&gt;use the default block size&lt;/li&gt;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>   * &lt;li&gt;not track progress&lt;/li&gt;<a name="line.238"></a>
-<span class="sourceLineNo">239</span>   * &lt;/ol&gt;<a name="line.239"></a>
-<span class="sourceLineNo">240</span>   *<a name="line.240"></a>
-<span class="sourceLineNo">241</span>   * @param fs {@link FileSystem} on which to write the file<a name="line.241"></a>
-<span class="sourceLineNo">242</span>   * @param path {@link Path} to the file to write<a name="line.242"></a>
-<span class="sourceLineNo">243</span>   * @param perm intial permissions<a name="line.243"></a>
-<span class="sourceLineNo">244</span>   * @param overwrite Whether or not the created file should be overwritten.<a name="line.244"></a>
-<span class="sourceLineNo">245</span>   * @return output stream to the created file<a name="line.245"></a>
-<span class="sourceLineNo">246</span>   * @throws IOException if the file cannot be created<a name="line.246"></a>
-<span class="sourceLineNo">247</span>   */<a name="line.247"></a>
-<span class="sourceLineNo">248</span>  public static FSDataOutputStream create(FileSystem fs, Path path,<a name="line.248"></a>
-<span class="sourceLineNo">249</span>      FsPermission perm, boolean overwrite) throws IOException {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    if (LOG.isTraceEnabled()) {<a name="line.250"></a>
-<span class="sourceLineNo">251</span>      LOG.trace("Creating file={} with permission={}, overwrite={}", path, perm, overwrite);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    }<a name="line.252"></a>
-<span class="sourceLineNo">253</span>    return fs.create(path, perm, overwrite, getDefaultBufferSize(fs),<a name="line.253"></a>
-<span class="sourceLineNo">254</span>        getDefaultReplication(fs, path), getDefaultBlockSize(fs, path), null);<a name="line.254"></a>
-<span class="sourceLineNo">255</span>  }<a name="line.255"></a>
-<span class="sourceLineNo">256</span><a name="line.256"></a>
-<span class="sourceLineNo">257</span>  /**<a name="line.257"></a>
-<span class="sourceLineNo">258</span>   * Get the file permissions specified in the configuration, if they are<a name="line.258"></a>
-<span class="sourceLineNo">259</span>   * enabled.<a name="line.259"></a>
-<span class="sourceLineNo">260</span>   *<a name="line.260"></a>
-<span class="sourceLineNo">261</span>   * @param fs filesystem that the file will be created on.<a name="line.261"></a>
-<span class="sourceLineNo">262</span>   * @param conf configuration to read for determining if permissions are<a name="line.262"></a>
-<span class="sourceLineNo">263</span>   *          enabled and which to use<a name="line.263"></a>
-<span class="sourceLineNo">264</span>   * @param permssionConfKey property key in the configuration to use when<a name="line.264"></a>
-<span class="sourceLineNo">265</span>   *          finding the permission<a name="line.265"></a>
-<span class="sourceLineNo">266</span>   * @return the permission to use when creating a new file on the fs. If<a name="line.266"></a>
-<span class="sourceLineNo">267</span>   *         special permissions are not specified in the configuration, then<a name="line.267"></a>
-<span class="sourceLineNo">268</span>   *         the default permissions on the the fs will be returned.<a name="line.268"></a>
-<span class="sourceLineNo">269</span>   */<a name="line.269"></a>
-<span class="sourceLineNo">270</span>  public static FsPermission getFilePermissions(final FileSystem fs,<a name="line.270"></a>
-<span class="sourceLineNo">271</span>      final Configuration conf, final String permssionConfKey) {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    boolean enablePermissions = conf.getBoolean(<a name="line.272"></a>
-<span class="sourceLineNo">273</span>        HConstants.ENABLE_DATA_FILE_UMASK, false);<a name="line.273"></a>
-<span class="sourceLineNo">274</span><a name="line.274"></a>
-<span class="sourceLineNo">275</span>    if (enablePermissions) {<a name="line.275"></a>
-<span class="sourceLineNo">276</span>      try {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>        // make sure that we have a mask, if not, go default.<a name="line.278"></a>
-<span class="sourceLineNo">279</span>        String mask = conf.get(permssionConfKey);<a name="line.279"></a>
-<span class="sourceLineNo">280</span>        if (mask == null) {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>          return FsPermission.getFileDefault();<a name="line.281"></a>
-<span class="sourceLineNo">282</span>        }<a name="line.282"></a>
-<span class="sourceLineNo">283</span>        // appy the umask<a name="line.283"></a>
-<span class="sourceLineNo">284</span>        FsPermission umask = new FsPermission(mask);<a name="line.284"></a>
-<span class="sourceLineNo">285</span>        return perm.applyUMask(umask);<a name="line.285"></a>
-<span class="sourceLineNo">286</span>      } catch (IllegalArgumentException e) {<a name="line.286"></a>
-<span class="sourceLineNo">287</span>        LOG.warn(<a name="line.287"></a>
-<span class="sourceLineNo">288</span>            "Incorrect umask attempted to be created: "<a name="line.288"></a>
-<span class="sourceLineNo">289</span>                + conf.get(permssionConfKey)<a name="line.289"></a>
-<span class="sourceLineNo">290</span>                + ", using default file permissions.", e);<a name="line.290"></a>
-<span class="sourceLineNo">291</span>        return FsPermission.getFileDefault();<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      }<a name="line.292"></a>
-<span class="sourceLineNo">293</span>    }<a name="line.293"></a>
-<span class="sourceLineNo">294</span>    return FsPermission.getFileDefault();<a name="line.294"></a>
-<span class="sourceLineNo">295</span>  }<a name="line.295"></a>
-<span class="sourceLineNo">296</span><a name="line.296"></a>
-<span class="sourceLineNo">297</span>  /**<a name="line.297"></a>
-<span class="sourceLineNo">298</span>   * Verifies root directory path is a valid URI with a scheme<a name="line.298"></a>
-<span class="sourceLineNo">299</span>   *<a name="line.299"></a>
-<span class="sourceLineNo">300</span>   * @param root root directory path<a name="line.300"></a>
-<span class="sourceLineNo">301</span>   * @return Passed &lt;code&gt;root&lt;/code&gt; argument.<a name="line.301"></a>
-<span class="sourceLineNo">302</span>   * @throws IOException if not a valid URI with a scheme<a name="line.302"></a>
-<span class="sourceLineNo">303</span>   */<a name="line.303"></a>
-<span class="sourceLineNo">304</span>  public static Path validateRootPath(Path root) throws IOException {<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    try {<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      URI rootURI = new URI(root.toString());<a name="line.306"></a>
-<span class="sourceLineNo">307</span>      String scheme = rootURI.getScheme();<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      if (scheme == null) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>        throw new IOException("Root directory does not have a scheme");<a name="line.309"></a>
-<span class="sourceLineNo">310</span>      }<a name="line.310"></a>
-<span class="sourceLineNo">311</span>      return root;<a name="line.311"></a>
-<span class="sourceLineNo">312</span>    } catch (URISyntaxException e) {<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      throw new IOException("Root directory path is not a valid " +<a name="line.313"></a>
-<span class="sourceLineNo">314</span>        "URI -- check your " + HConstants.HBASE_DIR + " configuration", e);<a name="line.314"></a>
-<span class="sourceLineNo">315</span>    }<a name="line.315"></a>
-<span class="sourceLineNo">316</span>  }<a name="line.316"></a>
-<span class="sourceLineNo">317</span><a name="line.317"></a>
-<span class="sourceLineNo">318</span>  /**<a name="line.318"></a>
-<span class="sourceLineNo">319</span>   * Checks for the presence of the WAL log root path (using the provided conf object) in the given<a name="line.319"></a>
-<span class="sourceLineNo">320</span>   * path. If it exists, this method removes it and returns the String representation of remaining<a name="line.320"></a>
-<span class="sourceLineNo">321</span>   * relative path.<a name="line.321"></a>
-<span class="sourceLineNo">322</span>   * @param path must not be null<a name="line.322"></a>
-<span class="sourceLineNo">323</span>   * @param conf must not be null<a name="line.323"></a>
-<span class="sourceLineNo">324</span>   * @return String representation of the remaining relative path<a name="line.324"></a>
-<span class="sourceLineNo">325</span>   * @throws IOException from underlying filesystem<a name="line.325"></a>
-<span class="sourceLineNo">326</span>   */<a name="line.326"></a>
-<span class="sourceLineNo">327</span>  public static String removeWALRootPath(Path path, final Configuration conf) throws IOException {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    Path root = getWALRootDir(conf);<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    String pathStr = path.toString();<a name="line.329"></a>
-<span class="sourceLineNo">330</span>    // check that the path is absolute... it has the root path in it.<a name="line.330"></a>
-<span class="sourceLineNo">331</span>    if (!pathStr.startsWith(root.toString())) {<a name="line.331"></a>
-<span class="sourceLineNo">332</span>      return pathStr;<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    }<a name="line.333"></a>
-<span class="sourceLineNo">334</span>    // if not, return as it is.<a name="line.334"></a>
-<span class="sourceLineNo">335</span>    return pathStr.substring(root.toString().length() + 1);// remove the "/" too.<a name="line.335"></a>
-<span class="sourceLineNo">336</span>  }<a name="line.336"></a>
-<span class="sourceLineNo">337</span><a name="line.337"></a>
-<span class="sourceLineNo">338</span>  /**<a name="line.338"></a>
-<span class="sourceLineNo">339</span>   * Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This<a name="line.339"></a>
-<span class="sourceLineNo">340</span>   * method returns the 'path' component of a Path's URI: e.g. If a Path is<a name="line.340"></a>
-<span class="sourceLineNo">341</span>   * &lt;code&gt;hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;,<a name="line.341"></a>
-<span class="sourceLineNo">342</span>   * this method returns &lt;code&gt;/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;.<a name="line.342"></a>
-<span class="sourceLineNo">343</span>   * This method is useful if you want to print out a Path without qualifying<a name="line.343"></a>
-<span class="sourceLineNo">344</span>   * Filesystem instance.<a name="line.344"></a>
-<span class="sourceLineNo">345</span>   * @param p Filesystem Path whose 'path' component we are to return.<a name="line.345"></a>
-<span class="sourceLineNo">346</span>   * @return Path portion of the Filesystem<a name="line.346"></a>
-<span class="sourceLineNo">347</span>   */<a name="line.347"></a>
-<span class="sourceLineNo">348</span>  public static String getPath(Path p) {<a name="line.348"></a>
-<span class="sourceLineNo">349</span>    return p.toUri().getPath();<a name="line.349"></a>
-<span class="sourceLineNo">350</span>  }<a name="line.350"></a>
-<span class="sourceLineNo">351</span><a name="line.351"></a>
-<span class="sourceLineNo">352</span>  /**<a name="line.352"></a>
-<span class="sourceLineNo">353</span>   * @param c configuration<a name="line.353"></a>
-<span class="sourceLineNo">354</span>   * @return {@link Path} to hbase root directory from<a name="line.354"></a>
-<span class="sourceLineNo">355</span>   *     configuration as a qualified Path.<a name="line.355"></a>
-<span class="sourceLineNo">356</span>   * @throws IOException e<a name="line.356"></a>
-<span class="sourceLineNo">357</span>   */<a name="line.357"></a>
-<span class="sourceLineNo">358</span>  public static Path getRootDir(final Configuration c) throws IOException {<a name="line.358"></a>
-<span class="sourceLineNo">359</span>    Path p = new Path(c.get(HConstants.HBASE_DIR));<a name="line.359"></a>
-<span class="sourceLineNo">360</span>    FileSystem fs = p.getFileSystem(c);<a name="line.360"></a>
-<span class="sourceLineNo">361</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.361"></a>
-<span class="sourceLineNo">362</span>  }<a name="line.362"></a>
-<span class="sourceLineNo">363</span><a name="line.363"></a>
-<span class="sourceLineNo">364</span>  public static void setRootDir(final Configuration c, final Path root) {<a name="line.364"></a>
-<span class="sourceLineNo">365</span>    c.set(HConstants.HBASE_DIR, root.toString());<a name="line.365"></a>
-<span class="sourceLineNo">366</span>  }<a name="line.366"></a>
-<span class="sourceLineNo">367</span><a name="line.367"></a>
-<span class="sourceLineNo">368</span>  public static void setFsDefault(final Configuration c, final Path root) {<a name="line.368"></a>
-<span class="sourceLineNo">369</span>    c.set("fs.defaultFS", root.toString());    // for hadoop 0.21+<a name="line.369"></a>
-<span class="sourceLineNo">370</span>  }<a name="line.370"></a>
-<span class="sourceLineNo">371</span><a name="line.371"></a>
-<span class="sourceLineNo">372</span>  public static FileSystem getRootDirFileSystem(final Configuration c) throws IOException {<a name="line.372"></a>
-<span class="sourceLineNo">373</span>    Path p = getRootDir(c);<a name="line.373"></a>
-<span class="sourceLineNo">374</span>    return p.getFileSystem(c);<a name="line.374"></a>
-<span class="sourceLineNo">375</span>  }<a name="line.375"></a>
-<span class="sourceLineNo">376</span><a name="line.376"></a>
-<span class="sourceLineNo">377</span>  /**<a name="line.377"></a>
-<span class="sourceLineNo">378</span>   * @param c configuration<a name="line.378"></a>
-<span class="sourceLineNo">379</span>   * @return {@link Path} to hbase log root directory: e.g. {@value HBASE_WAL_DIR} from<a name="line.379"></a>
-<span class="sourceLineNo">380</span>   *     configuration as a qualified Path. Defaults to HBase root dir.<a name="line.380"></a>
-<span class="sourceLineNo">381</span>   * @throws IOException e<a name="line.381"></a>
-<span class="sourceLineNo">382</span>   */<a name="line.382"></a>
-<span class="sourceLineNo">383</span>  public static Path getWALRootDir(final Configuration c) throws IOException {<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    Path p = new Path(c.get(HBASE_WAL_DIR, c.get(HConstants.HBASE_DIR)));<a name="line.384"></a>
-<span class="sourceLineNo">385</span>    if (!isValidWALRootDir(p, c)) {<a name="line.385"></a>
-<span class="sourceLineNo">386</span>      return getRootDir(c);<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    }<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    FileSystem fs = p.getFileSystem(c);<a name="line.388"></a>
-<span class="sourceLineNo">389</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.389"></a>
-<span class="sourceLineNo">390</span>  }<a name="line.390"></a>
-<span class="sourceLineNo">391</span><a name="line.391"></a>
-<span class="sourceLineNo">392</span>  @VisibleForTesting<a name="line.392"></a>
-<span class="sourceLineNo">393</span>  public static void setWALRootDir(final Configuration c, final Path root) {<a name="line.393"></a>
-<span class="sourceLineNo">394</span>    c.set(HBASE_WAL_DIR, root.toString());<a name="line.394"></a>
-<span class="sourceLineNo">395</span>  }<a name="line.395"></a>
-<span class="sourceLineNo">396</span><a name="line.396"></a>
-<span class="sourceLineNo">397</span>  public static FileSystem getWALFileSystem(final Configuration c) throws IOException {<a name="line.397"></a>
-<span class="sourceLineNo">398</span>    Path p = getWALRootDir(c);<a name="line.398"></a>
-<span class="sourceLineNo">399</span>    FileSystem fs = p.getFileSystem(c);<a name="line.399"></a>
-<span class="sourceLineNo">400</span>    // hadoop-core does fs caching, so need to propogate this if set<a name="line.400"></a>
-<span class="sourceLineNo">401</span>    String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);<a name="line.401"></a>
-<span class="sourceLineNo">402</span>    if (enforceStreamCapability != null) {<a name="line.402"></a>
-<span class="sourceLineNo">403</span>      fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);<a name="line.403"></a>
-<span class="sourceLineNo">404</span>    }<a name="line.404"></a>
-<span class="sourceLineNo">405</span>    return fs;<a name="line.405"></a>
-<span class="sourceLineNo">406</span>  }<a name="line.406"></a>
-<span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>  private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {<a name="line.408"></a>
-<span class="sourceLineNo">409</span>    Path rootDir = getRootDir(c);<a name="line.409"></a>
-<span class="sourceLineNo">410</span>    FileSystem fs = walDir.getFileSystem(c);<a name="line.410"></a>
-<span class="sourceLineNo">411</span>    Path qualifiedWalDir = walDir.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.411"></a>
-<span class="sourceLineNo">412</span>    if (!qualifiedWalDir.equals(rootDir)) {<a name="line.412"></a>
-<span class="sourceLineNo">413</span>      if (qualifiedWalDir.toString().startsWith(rootDir.toString() + "/")) {<a name="line.413"></a>
-<span class="sourceLineNo">414</span>        throw new IllegalStateException("Illegal WAL directory specified. " +<a name="line.414"></a>
-<span class="sourceLineNo">415</span>            "WAL directories are not permitted to be under the root directory if set.");<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      }<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    }<a name="line.417"></a>
-<span class="sourceLineNo">418</span>    return true;<a name="line.418"></a>
-<span class="sourceLineNo">419</span>  }<a name="line.419"></a>
-<span class="sourceLineNo">420</span><a name="line.420"></a>
-<span class="sourceLineNo">421</span>  /**<a name="line.421"></a>
-<span class="sourceLineNo">422</span>   * Returns the WAL region directory based on the given table name and region name<a name="line.422"></a>
-<span class="sourceLineNo">423</span>   * @param conf configuration to determine WALRootDir<a name="line.423"></a>
-<span class="sourceLineNo">424</span>   * @param tableName Table that the region is under<a name="line.424"></a>
-<span class="sourceLineNo">425</span>   * @param encodedRegionName Region name used for creating the final region directory<a name="line.425"></a>
-<span class="sourceLineNo">426</span>   * @return the region directory used to store WALs under the WALRootDir<a name="line.426"></a>
-<span class="sourceLineNo">427</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.427"></a>
-<span class="sourceLineNo">428</span>   */<a name="line.428"></a>
-<span class="sourceLineNo">429</span>  public static Path getWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.429"></a>
-<span class="sourceLineNo">430</span>      final String encodedRegionName) throws IOException {<a name="line.430"></a>
-<span class="sourceLineNo">431</span>    return new Path(getWALTableDir(conf, tableName), encodedRegionName);<a name="line.431"></a>
-<span class="sourceLineNo">432</span>  }<a name="line.432"></a>
-<span class="sourceLineNo">433</span><a name="line.433"></a>
-<span class="sourceLineNo">434</span>  /**<a name="line.434"></a>
-<span class="sourceLineNo">435</span>   * Returns the Table directory under the WALRootDir for the specified table name<a name="line.435"></a>
-<span class="sourceLineNo">436</span>   * @param conf configuration used to get the WALRootDir<a name="line.436"></a>
-<span class="sourceLineNo">437</span>   * @param tableName Table to get the directory for<a name="line.437"></a>
-<span class="sourceLineNo">438</span>   * @return a path to the WAL table directory for the specified table<a name="line.438"></a>
-<span class="sourceLineNo">439</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.439"></a>
-<span class="sourceLineNo">440</span>   */<a name="line.440"></a>
-<span class="sourceLineNo">441</span>  public static Path getWALTableDir(final Configuration conf, final TableName tableName)<a name="line.441"></a>
-<span class="sourceLineNo">442</span>      throws IOException {<a name="line.442"></a>
-<span class="sourceLineNo">443</span>    Path baseDir = new Path(getWALRootDir(conf), HConstants.BASE_NAMESPACE_DIR);<a name="line.443"></a>
-<span class="sourceLineNo">444</span>    return new Path(new Path(baseDir, tableName.getNamespaceAsString()),<a name="line.444"></a>
-<span class="sourceLineNo">445</span>      tableName.getQualifierAsString());<a name="line.445"></a>
-<span class="sourceLineNo">446</span>  }<a name="line.446"></a>
-<span class="sourceLineNo">447</span><a name="line.447"></a>
-<span class="sourceLineNo">448</span>  /**<a name="line.448"></a>
-<span class="sourceLineNo">449</span>   * For backward compatibility with HBASE-20734, where we store recovered edits in a wrong<a name="line.449"></a>
-<span class="sourceLineNo">450</span>   * directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.<a name="line.450"></a>
-<span class="sourceLineNo">451</span>   * @deprecated For compatibility, will be removed in 4.0.0.<a name="line.451"></a>
-<span class="sourceLineNo">452</span>   */<a name="line.452"></a>
-<span class="sourceLineNo">453</span>  @Deprecated<a name="line.453"></a>
-<span class="sourceLineNo">454</span>  public static Path getWrongWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.454"></a>
-<span class="sourceLineNo">455</span>      final String encodedRegionName) throws IOException {<a name="line.455"></a>
-<span class="sourceLineNo">456</span>    Path wrongTableDir = new Path(new Path(getWALRootDir(conf), tableName.getNamespaceAsString()),<a name="line.456"></a>
-<span class="sourceLineNo">457</span>      tableName.getQualifierAsString());<a name="line.457"></a>
-<span class="sourceLineNo">458</span>    return new Path(wrongTableDir, encodedRegionName);<a name="line.458"></a>
-<span class="sourceLineNo">459</span>  }<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>  /**<a name="line.461"></a>
-<span class="sourceLineNo">462</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under<a name="line.462"></a>
-<span class="sourceLineNo">463</span>   * path rootdir<a name="line.463"></a>
+<span class="sourceLineNo">152</span>   * @param fs filesystem object<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   * @return the default block size for the path's filesystem<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   */<a name="line.154"></a>
+<span class="sourceLineNo">155</span>  public static long getDefaultBlockSize(final FileSystem fs, final Path path) {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    return fs.getDefaultBlockSize(path);<a name="line.156"></a>
+<span class="sourceLineNo">157</span>  }<a name="line.157"></a>
+<span class="sourceLineNo">158</span><a name="line.158"></a>
+<span class="sourceLineNo">159</span>  /*<a name="line.159"></a>
+<span class="sourceLineNo">160</span>   * Get the default replication.<a name="line.160"></a>
+<span class="sourceLineNo">161</span>   *<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   * @param fs filesystem object<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   * @param f path of file<a name="line.163"></a>
+<span class="sourceLineNo">164</span>   * @return default replication for the path's filesystem<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   */<a name="line.165"></a>
+<span class="sourceLineNo">166</span>  public static short getDefaultReplication(final FileSystem fs, final Path path) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    return fs.getDefaultReplication(path);<a name="line.167"></a>
+<span class="sourceLineNo">168</span>  }<a name="line.168"></a>
+<span class="sourceLineNo">169</span><a name="line.169"></a>
+<span class="sourceLineNo">170</span>  /**<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   * Returns the default buffer size to use during writes.<a name="line.171"></a>
+<span class="sourceLineNo">172</span>   *<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   * The size of the buffer should probably be a multiple of hardware<a name="line.173"></a>
+<span class="sourceLineNo">174</span>   * page size (4096 on Intel x86), and it determines how much data is<a name="line.174"></a>
+<span class="sourceLineNo">175</span>   * buffered during read and write operations.<a name="line.175"></a>
+<span class="sourceLineNo">176</span>   *<a name="line.176"></a>
+<span class="sourceLineNo">177</span>   * @param fs filesystem object<a name="line.177"></a>
+<span class="sourceLineNo">178</span>   * @return default buffer size to use during writes<a name="line.178"></a>
+<span class="sourceLineNo">179</span>   */<a name="line.179"></a>
+<span class="sourceLineNo">180</span>  public static int getDefaultBufferSize(final FileSystem fs) {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    return fs.getConf().getInt("io.file.buffer.size", 4096);<a name="line.181"></a>
+<span class="sourceLineNo">182</span>  }<a name="line.182"></a>
+<span class="sourceLineNo">183</span><a name="line.183"></a>
+<span class="sourceLineNo">184</span>  /**<a name="line.184"></a>
+<span class="sourceLineNo">185</span>   * Create the specified file on the filesystem. By default, this will:<a name="line.185"></a>
+<span class="sourceLineNo">186</span>   * &lt;ol&gt;<a name="line.186"></a>
+<span class="sourceLineNo">187</span>   * &lt;li&gt;apply the umask in the configuration (if it is enabled)&lt;/li&gt;<a name="line.187"></a>
+<span class="sourceLineNo">188</span>   * &lt;li&gt;use the fs configured buffer size (or 4096 if not set)&lt;/li&gt;<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   * &lt;li&gt;use the default replication&lt;/li&gt;<a name="line.189"></a>
+<span class="sourceLineNo">190</span>   * &lt;li&gt;use the default block size&lt;/li&gt;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>   * &lt;li&gt;not track progress&lt;/li&gt;<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   * &lt;/ol&gt;<a name="line.192"></a>
+<span class="sourceLineNo">193</span>   *<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   * @param fs {@link FileSystem} on which to write the file<a name="line.194"></a>
+<span class="sourceLineNo">195</span>   * @param path {@link Path} to the file to write<a name="line.195"></a>
+<span class="sourceLineNo">196</span>   * @param perm intial permissions<a name="line.196"></a>
+<span class="sourceLineNo">197</span>   * @param overwrite Whether or not the created file should be overwritten.<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   * @return output stream to the created file<a name="line.198"></a>
+<span class="sourceLineNo">199</span>   * @throws IOException if the file cannot be created<a name="line.199"></a>
+<span class="sourceLineNo">200</span>   */<a name="line.200"></a>
+<span class="sourceLineNo">201</span>  public static FSDataOutputStream create(FileSystem fs, Path path,<a name="line.201"></a>
+<span class="sourceLineNo">202</span>      FsPermission perm, boolean overwrite) throws IOException {<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    if (LOG.isTraceEnabled()) {<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      LOG.trace("Creating file={} with permission={}, overwrite={}", path, perm, overwrite);<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    return fs.create(path, perm, overwrite, getDefaultBufferSize(fs),<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        getDefaultReplication(fs, path), getDefaultBlockSize(fs, path), null);<a name="line.207"></a>
+<span class="sourceLineNo">208</span>  }<a name="line.208"></a>
+<span class="sourceLineNo">209</span><a name="line.209"></a>
+<span class="sourceLineNo">210</span>  /**<a name="line.210"></a>
+<span class="sourceLineNo">211</span>   * Get the file permissions specified in the configuration, if they are<a name="line.211"></a>
+<span class="sourceLineNo">212</span>   * enabled.<a name="line.212"></a>
+<span class="sourceLineNo">213</span>   *<a name="line.213"></a>
+<span class="sourceLineNo">214</span>   * @param fs filesystem that the file will be created on.<a name="line.214"></a>
+<span class="sourceLineNo">215</span>   * @param conf configuration to read for determining if permissions are<a name="line.215"></a>
+<span class="sourceLineNo">216</span>   *          enabled and which to use<a name="line.216"></a>
+<span class="sourceLineNo">217</span>   * @param permssionConfKey property key in the configuration to use when<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   *          finding the permission<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   * @return the permission to use when creating a new file on the fs. If<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   *         special permissions are not specified in the configuration, then<a name="line.220"></a>
+<span class="sourceLineNo">221</span>   *         the default permissions on the the fs will be returned.<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   */<a name="line.222"></a>
+<span class="sourceLineNo">223</span>  public static FsPermission getFilePermissions(final FileSystem fs,<a name="line.223"></a>
+<span class="sourceLineNo">224</span>      final Configuration conf, final String permssionConfKey) {<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    boolean enablePermissions = conf.getBoolean(<a name="line.225"></a>
+<span class="sourceLineNo">226</span>        HConstants.ENABLE_DATA_FILE_UMASK, false);<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>    if (enablePermissions) {<a name="line.228"></a>
+<span class="sourceLineNo">229</span>      try {<a name="line.229"></a>
+<span class="sourceLineNo">230</span>        FsPermission perm = new FsPermission(FULL_RWX_PERMISSIONS);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>        // make sure that we have a mask, if not, go default.<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        String mask = conf.get(permssionConfKey);<a name="line.232"></a>
+<span class="sourceLineNo">233</span>        if (mask == null) {<a name="line.233"></a>
+<span class="sourceLineNo">234</span>          return FsPermission.getFileDefault();<a name="line.234"></a>
+<span class="sourceLineNo">235</span>        }<a name="line.235"></a>
+<span class="sourceLineNo">236</span>        // appy the umask<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        FsPermission umask = new FsPermission(mask);<a name="line.237"></a>
+<span class="sourceLineNo">238</span>        return perm.applyUMask(umask);<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      } catch (IllegalArgumentException e) {<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        LOG.warn(<a name="line.240"></a>
+<span class="sourceLineNo">241</span>            "Incorrect umask attempted to be created: "<a name="line.241"></a>
+<span class="sourceLineNo">242</span>                + conf.get(permssionConfKey)<a name="line.242"></a>
+<span class="sourceLineNo">243</span>                + ", using default file permissions.", e);<a name="line.243"></a>
+<span class="sourceLineNo">244</span>        return FsPermission.getFileDefault();<a name="line.244"></a>
+<span class="sourceLineNo">245</span>      }<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    }<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    return FsPermission.getFileDefault();<a name="line.247"></a>
+<span class="sourceLineNo">248</span>  }<a name="line.248"></a>
+<span class="sourceLineNo">249</span><a name="line.249"></a>
+<span class="sourceLineNo">250</span>  /**<a name="line.250"></a>
+<span class="sourceLineNo">251</span>   * Verifies root directory path is a valid URI with a scheme<a name="line.251"></a>
+<span class="sourceLineNo">252</span>   *<a name="line.252"></a>
+<span class="sourceLineNo">253</span>   * @param root root directory path<a name="line.253"></a>
+<span class="sourceLineNo">254</span>   * @return Passed &lt;code&gt;root&lt;/code&gt; argument.<a name="line.254"></a>
+<span class="sourceLineNo">255</span>   * @throws IOException if not a valid URI with a scheme<a name="line.255"></a>
+<span class="sourceLineNo">256</span>   */<a name="line.256"></a>
+<span class="sourceLineNo">257</span>  public static Path validateRootPath(Path root) throws IOException {<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    try {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>      URI rootURI = new URI(root.toString());<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      String scheme = rootURI.getScheme();<a name="line.260"></a>
+<span class="sourceLineNo">261</span>      if (scheme == null) {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>        throw new IOException("Root directory does not have a scheme");<a name="line.262"></a>
+<span class="sourceLineNo">263</span>      }<a name="line.263"></a>
+<span class="sourceLineNo">264</span>      return root;<a name="line.264"></a>
+<span class="sourceLineNo">265</span>    } catch (URISyntaxException e) {<a name="line.265"></a>
+<span class="sourceLineNo">266</span>      throw new IOException("Root directory path is not a valid " +<a name="line.266"></a>
+<span class="sourceLineNo">267</span>        "URI -- check your " + HConstants.HBASE_DIR + " configuration", e);<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    }<a name="line.268"></a>
+<span class="sourceLineNo">269</span>  }<a name="line.269"></a>
+<span class="sourceLineNo">270</span><a name="line.270"></a>
+<span class="sourceLineNo">271</span>  /**<a name="line.271"></a>
+<span class="sourceLineNo">272</span>   * Checks for the presence of the WAL log root path (using the provided conf object) in the given<a name="line.272"></a>
+<span class="sourceLineNo">273</span>   * path. If it exists, this method removes it and returns the String representation of remaining<a name="line.273"></a>
+<span class="sourceLineNo">274</span>   * relative path.<a name="line.274"></a>
+<span class="sourceLineNo">275</span>   * @param path must not be null<a name="line.275"></a>
+<span class="sourceLineNo">276</span>   * @param conf must not be null<a name="line.276"></a>
+<span class="sourceLineNo">277</span>   * @return String representation of the remaining relative path<a name="line.277"></a>
+<span class="sourceLineNo">278</span>   * @throws IOException from underlying filesystem<a name="line.278"></a>
+<span class="sourceLineNo">279</span>   */<a name="line.279"></a>
+<span class="sourceLineNo">280</span>  public static String removeWALRootPath(Path path, final Configuration conf) throws IOException {<a name="line.280"></a>
+<span class="sourceLineNo">281</span>    Path root = getWALRootDir(conf);<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    String pathStr = path.toString();<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    // check that the path is absolute... it has the root path in it.<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    if (!pathStr.startsWith(root.toString())) {<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      return pathStr;<a name="line.285"></a>
+<span class="sourceLineNo">286</span>    }<a name="line.286"></a>
+<span class="sourceLineNo">287</span>    // if not, return as it is.<a name="line.287"></a>
+<span class="sourceLineNo">288</span>    return pathStr.substring(root.toString().length() + 1);// remove the "/" too.<a name="line.288"></a>
+<span class="sourceLineNo">289</span>  }<a name="line.289"></a>
+<span class="sourceLineNo">290</span><a name="line.290"></a>
+<span class="sourceLineNo">291</span>  /**<a name="line.291"></a>
+<span class="sourceLineNo">292</span>   * Return the 'path' component of a Path.  In Hadoop, Path is a URI.  This<a name="line.292"></a>
+<span class="sourceLineNo">293</span>   * method returns the 'path' component of a Path's URI: e.g. If a Path is<a name="line.293"></a>
+<span class="sourceLineNo">294</span>   * &lt;code&gt;hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;,<a name="line.294"></a>
+<span class="sourceLineNo">295</span>   * this method returns &lt;code&gt;/hbase_trunk/TestTable/compaction.dir&lt;/code&gt;.<a name="line.295"></a>
+<span class="sourceLineNo">296</span>   * This method is useful if you want to print out a Path without qualifying<a name="line.296"></a>
+<span class="sourceLineNo">297</span>   * Filesystem instance.<a name="line.297"></a>
+<span class="sourceLineNo">298</span>   * @param p Filesystem Path whose 'path' component we are to return.<a name="line.298"></a>
+<span class="sourceLineNo">299</span>   * @return Path portion of the Filesystem<a name="line.299"></a>
+<span class="sourceLineNo">300</span>   */<a name="line.300"></a>
+<span class="sourceLineNo">301</span>  public static String getPath(Path p) {<a name="line.301"></a>
+<span class="sourceLineNo">302</span>    return p.toUri().getPath();<a name="line.302"></a>
+<span class="sourceLineNo">303</span>  }<a name="line.303"></a>
+<span class="sourceLineNo">304</span><a name="line.304"></a>
+<span class="sourceLineNo">305</span>  /**<a name="line.305"></a>
+<span class="sourceLineNo">306</span>   * @param c configuration<a name="line.306"></a>
+<span class="sourceLineNo">307</span>   * @return {@link Path} to hbase root directory from<a name="line.307"></a>
+<span class="sourceLineNo">308</span>   *     configuration as a qualified Path.<a name="line.308"></a>
+<span class="sourceLineNo">309</span>   * @throws IOException e<a name="line.309"></a>
+<span class="sourceLineNo">310</span>   */<a name="line.310"></a>
+<span class="sourceLineNo">311</span>  public static Path getRootDir(final Configuration c) throws IOException {<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    Path p = new Path(c.get(HConstants.HBASE_DIR));<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    FileSystem fs = p.getFileSystem(c);<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.314"></a>
+<span class="sourceLineNo">315</span>  }<a name="line.315"></a>
+<span class="sourceLineNo">316</span><a name="line.316"></a>
+<span class="sourceLineNo">317</span>  public static void setRootDir(final Configuration c, final Path root) {<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    c.set(HConstants.HBASE_DIR, root.toString());<a name="line.318"></a>
+<span class="sourceLineNo">319</span>  }<a name="line.319"></a>
+<span class="sourceLineNo">320</span><a name="line.320"></a>
+<span class="sourceLineNo">321</span>  public static void setFsDefault(final Configuration c, final Path root) {<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    c.set("fs.defaultFS", root.toString());    // for hadoop 0.21+<a name="line.322"></a>
+<span class="sourceLineNo">323</span>  }<a name="line.323"></a>
+<span class="sourceLineNo">324</span><a name="line.324"></a>
+<span class="sourceLineNo">325</span>  public static FileSystem getRootDirFileSystem(final Configuration c) throws IOException {<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    Path p = getRootDir(c);<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    return p.getFileSystem(c);<a name="line.327"></a>
+<span class="sourceLineNo">328</span>  }<a name="line.328"></a>
+<span class="sourceLineNo">329</span><a name="line.329"></a>
+<span class="sourceLineNo">330</span>  /**<a name="line.330"></a>
+<span class="sourceLineNo">331</span>   * @param c configuration<a name="line.331"></a>
+<span class="sourceLineNo">332</span>   * @return {@link Path} to hbase log root directory: e.g. {@value HBASE_WAL_DIR} from<a name="line.332"></a>
+<span class="sourceLineNo">333</span>   *     configuration as a qualified Path. Defaults to HBase root dir.<a name="line.333"></a>
+<span class="sourceLineNo">334</span>   * @throws IOException e<a name="line.334"></a>
+<span class="sourceLineNo">335</span>   */<a name="line.335"></a>
+<span class="sourceLineNo">336</span>  public static Path getWALRootDir(final Configuration c) throws IOException {<a name="line.336"></a>
+<span class="sourceLineNo">337</span>    Path p = new Path(c.get(HBASE_WAL_DIR, c.get(HConstants.HBASE_DIR)));<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    if (!isValidWALRootDir(p, c)) {<a name="line.338"></a>
+<span class="sourceLineNo">339</span>      return getRootDir(c);<a name="line.339"></a>
+<span class="sourceLineNo">340</span>    }<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    FileSystem fs = p.getFileSystem(c);<a name="line.341"></a>
+<span class="sourceLineNo">342</span>    return p.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.342"></a>
+<span class="sourceLineNo">343</span>  }<a name="line.343"></a>
+<span class="sourceLineNo">344</span><a name="line.344"></a>
+<span class="sourceLineNo">345</span>  @VisibleForTesting<a name="line.345"></a>
+<span class="sourceLineNo">346</span>  public static void setWALRootDir(final Configuration c, final Path root) {<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    c.set(HBASE_WAL_DIR, root.toString());<a name="line.347"></a>
+<span class="sourceLineNo">348</span>  }<a name="line.348"></a>
+<span class="sourceLineNo">349</span><a name="line.349"></a>
+<span class="sourceLineNo">350</span>  public static FileSystem getWALFileSystem(final Configuration c) throws IOException {<a name="line.350"></a>
+<span class="sourceLineNo">351</span>    Path p = getWALRootDir(c);<a name="line.351"></a>
+<span class="sourceLineNo">352</span>    FileSystem fs = p.getFileSystem(c);<a name="line.352"></a>
+<span class="sourceLineNo">353</span>    // hadoop-core does fs caching, so need to propogate this if set<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);<a name="line.354"></a>
+<span class="sourceLineNo">355</span>    if (enforceStreamCapability != null) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>      fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    }<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    return fs;<a name="line.358"></a>
+<span class="sourceLineNo">359</span>  }<a name="line.359"></a>
+<span class="sourceLineNo">360</span><a name="line.360"></a>
+<span class="sourceLineNo">361</span>  private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {<a name="line.361"></a>
+<span class="sourceLineNo">362</span>    Path rootDir = getRootDir(c);<a name="line.362"></a>
+<span class="sourceLineNo">363</span>    FileSystem fs = walDir.getFileSystem(c);<a name="line.363"></a>
+<span class="sourceLineNo">364</span>    Path qualifiedWalDir = walDir.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.364"></a>
+<span class="sourceLineNo">365</span>    if (!qualifiedWalDir.equals(rootDir)) {<a name="line.365"></a>
+<span class="sourceLineNo">366</span>      if (qualifiedWalDir.toString().startsWith(rootDir.toString() + "/")) {<a name="line.366"></a>
+<span class="sourceLineNo">367</span>        throw new IllegalStateException("Illegal WAL directory specified. " +<a name="line.367"></a>
+<span class="sourceLineNo">368</span>            "WAL directories are not permitted to be under the root directory if set.");<a name="line.368"></a>
+<span class="sourceLineNo">369</span>      }<a name="line.369"></a>
+<span class="sourceLineNo">370</span>    }<a name="line.370"></a>
+<span class="sourceLineNo">371</span>    return true;<a name="line.371"></a>
+<span class="sourceLineNo">372</span>  }<a name="line.372"></a>
+<span class="sourceLineNo">373</span><a name="line.373"></a>
+<span class="sourceLineNo">374</span>  /**<a name="line.374"></a>
+<span class="sourceLineNo">375</span>   * Returns the WAL region directory based on the given table name and region name<a name="line.375"></a>
+<span class="sourceLineNo">376</span>   * @param conf configuration to determine WALRootDir<a name="line.376"></a>
+<span class="sourceLineNo">377</span>   * @param tableName Table that the region is under<a name="line.377"></a>
+<span class="sourceLineNo">378</span>   * @param encodedRegionName Region name used for creating the final region directory<a name="line.378"></a>
+<span class="sourceLineNo">379</span>   * @return the region directory used to store WALs under the WALRootDir<a name="line.379"></a>
+<span class="sourceLineNo">380</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.380"></a>
+<span class="sourceLineNo">381</span>   */<a name="line.381"></a>
+<span class="sourceLineNo">382</span>  public static Path getWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.382"></a>
+<span class="sourceLineNo">383</span>      final String encodedRegionName) throws IOException {<a name="line.383"></a>
+<span class="sourceLineNo">384</span>    return new Path(getWALTableDir(conf, tableName), encodedRegionName);<a name="line.384"></a>
+<span class="sourceLineNo">385</span>  }<a name="line.385"></a>
+<span class="sourceLineNo">386</span><a name="line.386"></a>
+<span class="sourceLineNo">387</span>  /**<a name="line.387"></a>
+<span class="sourceLineNo">388</span>   * Returns the Table directory under the WALRootDir for the specified table name<a name="line.388"></a>
+<span class="sourceLineNo">389</span>   * @param conf configuration used to get the WALRootDir<a name="line.389"></a>
+<span class="sourceLineNo">390</span>   * @param tableName Table to get the directory for<a name="line.390"></a>
+<span class="sourceLineNo">391</span>   * @return a path to the WAL table directory for the specified table<a name="line.391"></a>
+<span class="sourceLineNo">392</span>   * @throws IOException if there is an exception determining the WALRootDir<a name="line.392"></a>
+<span class="sourceLineNo">393</span>   */<a name="line.393"></a>
+<span class="sourceLineNo">394</span>  public static Path getWALTableDir(final Configuration conf, final TableName tableName)<a name="line.394"></a>
+<span class="sourceLineNo">395</span>      throws IOException {<a name="line.395"></a>
+<span class="sourceLineNo">396</span>    Path baseDir = new Path(getWALRootDir(conf), HConstants.BASE_NAMESPACE_DIR);<a name="line.396"></a>
+<span class="sourceLineNo">397</span>    return new Path(new Path(baseDir, tableName.getNamespaceAsString()),<a name="line.397"></a>
+<span class="sourceLineNo">398</span>      tableName.getQualifierAsString());<a name="line.398"></a>
+<span class="sourceLineNo">399</span>  }<a name="line.399"></a>
+<span class="sourceLineNo">400</span><a name="line.400"></a>
+<span class="sourceLineNo">401</span>  /**<a name="line.401"></a>
+<span class="sourceLineNo">402</span>   * For backward compatibility with HBASE-20734, where we store recovered edits in a wrong<a name="line.402"></a>
+<span class="sourceLineNo">403</span>   * directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.<a name="line.403"></a>
+<span class="sourceLineNo">404</span>   * @deprecated For compatibility, will be removed in 4.0.0.<a name="line.404"></a>
+<span class="sourceLineNo">405</span>   */<a name="line.405"></a>
+<span class="sourceLineNo">406</span>  @Deprecated<a name="line.406"></a>
+<span class="sourceLineNo">407</span>  public static Path getWrongWALRegionDir(final Configuration conf, final TableName tableName,<a name="line.407"></a>
+<span class="sourceLineNo">408</span>      final String encodedRegionName) throws IOException {<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    Path wrongTableDir = new Path(new Path(getWALRootDir(conf), tableName.getNamespaceAsString()),<a name="line.409"></a>
+<span class="sourceLineNo">410</span>      tableName.getQualifierAsString());<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    return new Path(wrongTableDir, encodedRegionName);<a name="line.411"></a>
+<span class="sourceLineNo">412</span>  }<a name="line.412"></a>
+<span class="sourceLineNo">413</span><a name="line.413"></a>
+<span class="sourceLineNo">414</span>  /**<a name="line.414"></a>
+<span class="sourceLineNo">415</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under<a name="line.415"></a>
+<span class="sourceLineNo">416</span>   * path rootdir<a name="line.416"></a>
+<span class="sourceLineNo">417</span>   *<a name="line.417"></a>
+<span class="sourceLineNo">418</span>   * @param rootdir qualified path of HBase root directory<a name="line.418"></a>
+<span class="sourceLineNo">419</span>   * @param tableName name of table<a name="line.419"></a>
+<span class="sourceLineNo">420</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.420"></a>
+<span class="sourceLineNo">421</span>   */<a name="line.421"></a>
+<span class="sourceLineNo">422</span>  public static Path getTableDir(Path rootdir, final TableName tableName) {<a name="line.422"></a>
+<span class="sourceLineNo">423</span>    return new Path(getNamespaceDir(rootdir, tableName.getNamespaceAsString()),<a name="line.423"></a>
+<span class="sourceLineNo">424</span>        tableName.getQualifierAsString());<a name="line.424"></a>
+<span class="sourceLineNo">425</span>  }<a name="line.425"></a>
+<span class="sourceLineNo">426</span><a name="line.426"></a>
+<span class="sourceLineNo">427</span>  /**<a name="line.427"></a>
+<span class="sourceLineNo">428</span>   * Returns the {@link org.apache.hadoop.hbase.TableName} object representing<a name="line.428"></a>
+<span class="sourceLineNo">429</span>   * the table directory under<a name="line.429"></a>
+<span class="sourceLineNo">430</span>   * path rootdir<a name="line.430"></a>
+<span class="sourceLineNo">431</span>   *<a name="line.431"></a>
+<span class="sourceLineNo">432</span>   * @param tablePath path of table<a name="line.432"></a>
+<span class="sourceLineNo">433</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.433"></a>
+<span class="sourceLineNo">434</span>   */<a name="line.434"></a>
+<span class="sourceLineNo">435</span>  public static TableName getTableName(Path tablePath) {<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());<a name="line.436"></a>
+<span class="sourceLineNo">437</span>  }<a name="line.437"></a>
+<span class="sourceLineNo">438</span><a name="line.438"></a>
+<span class="sourceLineNo">439</span>  /**<a name="line.439"></a>
+<span class="sourceLineNo">440</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing<a name="line.440"></a>
+<span class="sourceLineNo">441</span>   * the namespace directory under path rootdir<a name="line.441"></a>
+<span class="sourceLineNo">442</span>   *<a name="line.442"></a>
+<span class="sourceLineNo">443</span>   * @param rootdir qualified path of HBase root directory<a name="line.443"></a>
+<span class="sourceLineNo">444</span>   * @param namespace namespace name<a name="line.444"></a>
+<span class="sourceLineNo">445</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.445"></a>
+<span class="sourceLineNo">446</span>   */<a name="line.446"></a>
+<span class="sourceLineNo">447</span>  public static Path getNamespaceDir(Path rootdir, final String namespace) {<a name="line.447"></a>
+<span class="sourceLineNo">448</span>    return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,<a name="line.448"></a>
+<span class="sourceLineNo">449</span>        new Path(namespace)));<a name="line.449"></a>
+<span class="sourceLineNo">450</span>  }<a name="line.450"></a>
+<span class="sourceLineNo">451</span><a name="line.451"></a>
+<span class="sourceLineNo">452</span>  // this mapping means that under a federated FileSystem implementation, we'll<a name="line.452"></a>
+<span class="sourceLineNo">453</span>  // only log the first failure from any of the underlying FileSystems at WARN and all others<a name="line.453"></a>
+<span class="sourceLineNo">454</span>  // will be at DEBUG.<a name="line.454"></a>
+<span class="sourceLineNo">455</span>  private static final Map&lt;FileSystem, Boolean&gt; warningMap = new ConcurrentHashMap&lt;&gt;();<a name="line.455"></a>
+<span class="sourceLineNo">456</span><a name="line.456"></a>
+<span class="sourceLineNo">457</span>  /**<a name="line.457"></a>
+<span class="sourceLineNo">458</span>   * Sets storage policy for given path.<a name="line.458"></a>
+<span class="sourceLineNo">459</span>   * If the passed path is a directory, we'll set the storage policy for all files<a name="line.459"></a>
+<span class="sourceLineNo">460</span>   * created in the future in said directory. Note that this change in storage<a name="line.460"></a>
+<span class="sourceLineNo">461</span>   * policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle.<a name="line.461"></a>
+<span class="sourceLineNo">462</span>   * If we're running on a version of FileSystem that doesn't support the given storage policy<a name="line.462"></a>
+<span class="sourceLineNo">463</span>   * (or storage policies at all), then we'll issue a log message and continue.<a name="line.463"></a>
 <span class="sourceLineNo">464</span>   *<a name="line.464"></a>
-<span class="sourceLineNo">465</span>   * @param rootdir qualified path of HBase root directory<a name="line.465"></a>
-<span class="sourceLineNo">466</span>   * @param tableName name of table<a name="line.466"></a>
-<span class="sourceLineNo">467</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.467"></a>
-<span class="sourceLineNo">468</span>   */<a name="line.468"></a>
-<span class="sourceLineNo">469</span>  public static Path getTableDir(Path rootdir, final TableName tableName) {<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    return new Path(getNamespaceDir(rootdir, tableName.getNamespaceAsString()),<a name="line.470"></a>
-<span class="sourceLineNo">471</span>        tableName.getQualifierAsString());<a name="line.471"></a>
-<span class="sourceLineNo">472</span>  }<a name="line.472"></a>
-<span class="sourceLineNo">473</span><a name="line.473"></a>
-<span class="sourceLineNo">474</span>  /**<a name="line.474"></a>
-<span class="sourceLineNo">475</span>   * Returns the {@link org.apache.hadoop.hbase.TableName} object representing<a name="line.475"></a>
-<span class="sourceLineNo">476</span>   * the table directory under<a name="line.476"></a>
-<span class="sourceLineNo">477</span>   * path rootdir<a name="line.477"></a>
-<span class="sourceLineNo">478</span>   *<a name="line.478"></a>
-<span class="sourceLineNo">479</span>   * @param tablePath path of table<a name="line.479"></a>
-<span class="sourceLineNo">480</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.480"></a>
-<span class="sourceLineNo">481</span>   */<a name="line.481"></a>
-<span class="sourceLineNo">482</span>  public static TableName getTableName(Path tablePath) {<a name="line.482"></a>
-<span class="sourceLineNo">483</span>    return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());<a name="line.483"></a>
-<span class="sourceLineNo">484</span>  }<a name="line.484"></a>
-<span class="sourceLineNo">485</span><a name="line.485"></a>
-<span class="sourceLineNo">486</span>  /**<a name="line.486"></a>
-<span class="sourceLineNo">487</span>   * Returns the {@link org.apache.hadoop.fs.Path} object representing<a name="line.487"></a>
-<span class="sourceLineNo">488</span>   * the namespace directory under path rootdir<a name="line.488"></a>
-<span class="sourceLineNo">489</span>   *<a name="line.489"></a>
-<span class="sourceLineNo">490</span>   * @param rootdir qualified path of HBase root directory<a name="line.490"></a>
-<span class="sourceLineNo">491</span>   * @param namespace namespace name<a name="line.491"></a>
-<span class="sourceLineNo">492</span>   * @return {@link org.apache.hadoop.fs.Path} for table<a name="line.492"></a>
-<span class="sourceLineNo">493</span>   */<a name="line.493"></a>
-<span class="sourceLineNo">494</span>  public static Path getNamespaceDir(Path rootdir, final String namespace) {<a name="line.494"></a>
-<span class="sourceLineNo">495</span>    return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,<a name="line.495"></a>
-<span class="sourceLineNo">496</span>        new Path(namespace)));<a name="line.496"></a>
-<span class="sourceLineNo">497</span>  }<a name="line.497"></a>
-<span class="sourceLineNo">498</span><a name="line.498"></a>
-<span class="sourceLineNo">499</span>  // this mapping means that under a federated FileSystem implementation, we'll<a name="line.499"></a>
-<span class="sourceLineNo">500</span>  // only log the first failure from any of the underlying FileSystems at WARN and all others<a name="line.500"></a>
-<span class="sourceLineNo">501</span>  // will be at DEBUG.<a name="line.501"></a>
-<span class="sourceLineNo">502</span>  private static final Map&lt;FileSystem, Boolean&gt; warningMap = new ConcurrentHashMap&lt;&gt;();<a name="line.502"></a>
-<span class="sourceLineNo">503</span><a name="line.503"></a>
-<span class="sourceLineNo">504</span>  /**<a name="line.504"></a>
-<span class="sourceLineNo">505</span>   * Sets storage policy for given path.<a name="line.505"></a>
-<span class="sourceLineNo">506</span>   * If the passed path is a directory, we'll set the storage policy for all files<a name="line.506"></a>
-<span class="sourceLineNo">507</span>   * created in the future in said directory. Note that this change in storage<a name="line.507"></a>
-<span class="sourceLineNo">508</span>   * policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle.<a name="line.508"></a>
-<span class="sourceLineNo">509</span>   * If we're running on a version of FileSystem that doesn't support the given storage policy<a name="line.509"></a>
-<span class="sourceLineNo">510</span>   * (or storage policies at all), then we'll issue a log message and continue.<a name="line.510"></a>
-<span class="sourceLineNo">511</span>   *<a name="line.511"></a>
-<span class="sourceLineNo">512</span>   * See http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html<a name="line.512"></a>
-<span class="sourceLineNo">513</span>   *<a name="line.513"></a>
-<span class="sourceLineNo">514</span>   * @param fs We only do anything it implements a setStoragePolicy method<a name="line.514"></a>
-<span class="sourceLineNo">515</span>   * @param path the Path whose storage policy is to be set<a name="line.515"></a>
-<span class="sourceLineNo">516</span>   * @param storagePolicy Policy to set on &lt;code&gt;path&lt;/code&gt;; see hadoop 2.6+<a name="line.516"></a>
-<span class="sourceLineNo">517</span>   *   org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g<a name="line.517"></a>
-<span class="sourceLineNo">518</span>   *   'COLD', 'WARM', 'HOT', 'ONE_SSD', 'ALL_SSD', 'LAZY_PERSIST'.<a name="line.518"></a>
-<span class="sourceLineNo">519</span>   */<a name="line.519"></a>
-<span class="sourceLineNo">520</span>  public static void setStoragePolicy(final FileSystem fs, final Path path,<a name="line.520"></a>
-<span class="sourceLineNo">521</span>      final String storagePolicy) {<a name="line.521"></a>
-<span class="sourceLineNo">522</span>    try {<a name="line.522"></a>
-<span class="sourceLineNo">523</span>      setStoragePolicy(fs, path, storagePolicy, false);<a name="line.523"></a>
-<span class="sourceLineNo">524</span>    } catch (IOException e) {<a name="line.524"></a>
-<span class="sourceLineNo">525</span>      // should never arrive here<a name="line.525"></a>
-<span class="sourceLineNo">526</span>      LOG.warn("We have chosen not to throw exception but some unexpectedly thrown out", e);<a name="line.526"></a>
-<span class="sourceLineNo">527</span>    }<a name="line.527"></a>
-<span class="sourceLineNo">528</span>  }<a name="line.528"></a>
-<span class="sourceLineNo">529</span><a name="line.529"></a>
-<span class="sourceLineNo">530</span>  static void setStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy,<a name="line.530"></a>
-<span class="sourceLineNo">531</span>      boolean throwException) throws IOException {<a name="line.531"></a>
-<span class="sourceLineNo">532</span>    if (storagePolicy == null) {<a name="line.532"></a>
-<span class="sourceLineNo">533</span>      if (LOG.isTraceEnabled()) {<a name="line.533"></a>
-<span class="sourceLineNo">534</span>        LOG.trace("We were passed a null storagePolicy, exiting early.");<a name="line.534"></a>
-<span class="sourceLineNo">535</span>      }<a name="line.535"></a>
-<span class="sourceLineNo">536</span>      return;<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    }<a name="line.537"></a>
-<span class="sourceLineNo">538</span>    String trimmedStoragePolicy = storagePolicy.trim();<a name="line.538"></a>
-<span class="sourceLineNo">539</span>    if (trimmedStoragePolicy.isEmpty()) {<a name="line.539"></a>
-<span class="sourceLineNo">540</span>      if (LOG.isTraceEnabled()) {<a name="line.540"></a>
-<span class="sourceLineNo">541</span>        LOG.trace("We were passed an empty storagePolicy, exiting early.");<a name="line.541"></a>
+<span class="sourceLineNo">465</span>   * See http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html<a name="line.465"></a>
+<span class="sourceLineNo">466</span>   *<a name="line.466"></a>
+<span class="sourceLineNo">467</span>   * @param fs We only do anything it implements a setStoragePolicy method<a name="line.467"></a>
+<span class="sourceLineNo">468</span>   * @param path the Path whose storage policy is to be set<a name="line.468"></a>
+<span class="sourceLineNo">469</span>   * @param storagePolicy Policy to set on &lt;code&gt;path&lt;/code&gt;; see hadoop 2.6+<a name="line.469"></a>
+<span class="sourceLineNo">470</span>   *   org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g<a name="line.470"></a>
+<span class="sourceLineNo">471</span>   *   'COLD', 'WARM', 'HOT', 'ONE_SSD', 'ALL_SSD', 'LAZY_PERSIST'.<a name="line.471"></a>
+<span class="sourceLineNo">472</span>   */<a name="line.472"></a>
+<span class="sourceLineNo">473</span>  public static void setStoragePolicy(final FileSystem fs, final Path path,<a name="line.473"></a>
+<span class="sourceLineNo">474</span>      final String storagePolicy) {<a name="line.474"></a>
+<span class="sourceLineNo">475</span>    try {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>      setStoragePolicy(fs, path, storagePolicy, false);<a name="line.476"></a>
+<span class="sourceLineNo">477</span>    } catch (IOException e) {<a name="line.477"></a>
+<span class="sourceLineNo">478</span>      // should never arrive here<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      LOG.warn("We have chosen not to throw exception but some unexpectedly thrown out", e);<a name="line.479"></a>
+<span class="sourceLineNo">480</span>    }<a name="line.480"></a>
+<span class="sourceLineNo">481</span>  }<a name="line.481"></a>
+<span class="sourceLineNo">482</span><a name="line.482"></a>
+<span class="sourceLineNo">483</span>  static void setStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy,<a name="line.483"></a>
+<span class="sourceLineNo">484</span>      boolean throwException) throws IOException {<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    if (storagePolicy == null) {<a name="line.485"></a>
+<span class="sourceLineNo">486</span>      if (LOG.isTraceEnabled()) {<a name="line.486"></a>
+<span class="sourceLineNo">487</span>        LOG.trace("We were passed a null storagePolicy, exiting early.");<a name="line.487"></a>
+<span class="sourceLineNo">488</span>      }<a name="line.488"></a>
+<span class="sourceLineNo">489</span>      return;<a name="line.489"></a>
+<span class="sourceLineNo">490</span>    }<a name="line.490"></a>
+<span class="sourceLineNo">491</span>    String trimmedStoragePolicy = storagePolicy.trim();<a name="line.491"></a>
+<span class="sourceLineNo">492</span>    if (trimmedStoragePolicy.isEmpty()) {<a name="line.492"></a>
+<span class="sourceLineNo">493</span>      if (LOG.isTraceEnabled()) {<a name="line.493"></a>
+<span class="sourceLineNo">494</span>        LOG.trace("We were passed an empty storagePolicy, exiting early.");<a name="line.494"></a>
+<span class="sourceLineNo">495</span>      }<a name="line.495"></a>
+<span class="sourceLineNo">496</span>      return;<a name="line.496"></a>
+<span class="sourceLineNo">497</span>    } else {<a name="line.497"></a>
+<span class="sourceLineNo">498</span>      trimmedStoragePolicy = trimmedStoragePolicy.toUpperCase(Locale.ROOT);<a name="line.498"></a>
+<span class="sourceLineNo">499</span>    }<a name="line.499"></a>
+<span class="sourceLineNo">500</span>    if (trimmedStoragePolicy.equals(HConstants.DEFER_TO_HDFS_STORAGE_POLICY)) {<a name="line.500"></a>
+<span class="sourceLineNo">501</span>      if (LOG.isTraceEnabled()) {<a name="line.501"></a>
+<span class="sourceLineNo">502</span>        LOG.trace("We were passed the defer-to-hdfs policy {}, exiting early.",<a name="line.502"></a>
+<span class="sourceLineNo">503</span>          trimmedStoragePolicy);<a name="line.503"></a>
+<span class="sourceLineNo">504</span>      }<a name="line.504"></a>
+<span class="sourceLineNo">505</span>      return;<a name="line.505"></a>
+<span class="sourceLineNo">506</span>    }<a name="line.506"></a>
+<span class="sourceLineNo">507</span>    try {<a name="line.507"></a>
+<span class="sourceLineNo">508</span>      invokeSetStoragePolicy(fs, path, trimmedStoragePolicy);<a name="line.508"></a>
+<span class="sourceLineNo">509</span>    } catch (IOException e) {<a name="line.509"></a>
+<span class="sourceLineNo">510</span>      if (LOG.isTraceEnabled()) {<a name="line.510"></a>
+<span class="sourceLineNo">511</span>        LOG.trace("Failed to invoke set storage policy API on FS", e);<a name="line.511"></a>
+<span class="sourceLineNo">512</span>      }<a name="line.512"></a>
+<span class="sourceLineNo">513</span>      if (throwException) {<a name="line.513"></a>
+<span class="sourceLineNo">514</span>        throw e;<a name="line.514"></a>
+<span class="sourceLineNo">515</span>      }<a name="line.515"></a>
+<span class="sourceLineNo">516</span>    }<a name="line.516"></a>
+<span class="sourceLineNo">517</span>  }<a name="line.517"></a>
+<span class="sourceLineNo">518</span><a name="line.518"></a>
+<span class="sourceLineNo">519</span>  /*<a name="line.519"></a>
+<span class="sourceLineNo">520</span>   * All args have been checked and are good. Run the setStoragePolicy invocation.<a name="line.520"></a>
+<span class="sourceLineNo">521</span>   */<a name="line.521"></a>
+<span class="sourceLineNo">522</span>  private static void invokeSetStoragePolicy(final FileSystem fs, final Path path,<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      final String storagePolicy) throws IOException {<a name="line.523"></a>
+<span class="sourceLineNo">524</span>    Exception toThrow = null;<a name="line.524"></a>
+<span class="sourceLineNo">525</span><a name="line.525"></a>
+<span class="sourceLineNo">526</span>    try {<a name="line.526"></a>
+<span class="sourceLineNo">527</span>      fs.setStoragePolicy(path, storagePolicy);<a name="line.527"></a>
+<span class="sourceLineNo">528</span><a name="line.528"></a>
+<span class="sourceLineNo">529</span>      if (LOG.isDebugEnabled()) {<a name="line.529"></a>
+<span class="sourceLineNo">530</span>        LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);<a name="line.530"></a>
+<span class="sourceLineNo">531</span>      }<a name="line.531"></a>
+<span class="sourceLineNo">532</span>    } catch (Exception e) {<a name="line.532"></a>
+<span class="sourceLineNo">533</span>      toThrow = e;<a name="line.533"></a>
+<span class="sourceLineNo">534</span>      // This swallows FNFE, should we be throwing it? seems more likely to indicate dev<a name="line.534"></a>
+<span class="sourceLineNo">535</span>      // misuse than a runtime problem with HDFS.<a name="line.535"></a>
+<span class="sourceLineNo">536</span>      if (!warningMap.containsKey(fs)) {<a name="line.536"></a>
+<span class="sourceLineNo">537</span>        warningMap.put(fs, true);<a name="line.537"></a>
+<span class="sourceLineNo">538</span>        LOG.warn("Unable to set storagePolicy=" + storagePolicy + " for path=" + path + ". " +<a name="line.538"></a>
+<span class="sourceLineNo">539</span>            "DEBUG log level might have more details.", e);<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      } else if (LOG.isDebugEnabled()) {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>        LOG.debug("Unable to set storagePolicy=" + storagePolicy + " for path=" + path, e);<a name="line.541"></a>
 <span class="sourceLineNo">542</span>      }<a name="line.542"></a>
-<span class="sourceLineNo">543</span>      return;<a name="line.543"></a>
-<span class="sourceLineNo">544</span>    } else {<a name="line.544"></a>
-<span class="sourceLineNo">545</span>      trimmedStoragePolicy = trimmedStoragePolicy.toUpperCase(Locale.ROOT);<a name="line.545"></a>
-<span class="sourceLineNo">546</span>    }<a name="line.546"></a>
-<span class="sourceLineNo">547</span>    if (trimmedStoragePolicy.equals(HConstants.DEFER_TO_HDFS_STORAGE_POLICY)) {<a name="line.547"></a>
-<span class="sourceLineNo">548</span>      if (LOG.isTraceEnabled()) {<a name="line.548"></a>
-<span class="sourceLineNo">549</span>        LOG.trace("We were passed the defer-to-hdfs policy {}, exiting early.",<a name="line.549"></a>
-<span class="sourceLineNo">550</span>          trimmedStoragePolicy);<a name="line.550"></a>
-<span class="sourceLineNo">551</span>      }<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      return;<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    }<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    try {<a name="line.554"></a>
-<span class="sourceLineNo">555</span>      invokeSetStoragePolicy(fs, path, trimmedStoragePolicy);<a name="line.555"></a>
-<span class="sourceLineNo">556</span>    } catch (IOException e) {<a name="line.556"></a>
-<span class="sourceLineNo">557</span>      if (LOG.isTraceEnabled()) {<a name="line.557"></a>
-<span class="sourceLineNo">558</span>        LOG.trace("Failed to invoke set storage policy API on FS", e);<a name="line.558"></a>
-<span class="sourceLineNo">559</span>      }<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      if (throwException) {<a name="line.560"></a>
-<span class="sourceLineNo">561</span>        throw e;<a name="line.561"></a>
-<span class="sourceLineNo">562</span>      }<a name="line.562"></a>
-<span class="sourceLineNo">563</span>    }<a name="line.563"></a>
-<span class="sourceLineNo">564</span>  }<a name="line.564"></a>
-<span class="sourceLineNo">565</span><a name="line.565"></a>
-<span class="sourceLineNo">566</span>  /*<a name="line.566"></a>
-<span class="sourceLineNo">567</span>   * All args have been checked and are good. Run the setStoragePolicy invocation.<a name="line.567"></a>
-<span class="sourceLineNo">568</span>   */<a name="line.568"></a>
-<span class="sourceLineNo">569</span>  private static void invokeSetStoragePolicy(final FileSystem fs, final Path path,<a name="line.569"></a>
-<span class="sourceLineNo">570</span>      final String storagePolicy) throws IOException {<a name="line.570"></a>
-<span class="sourceLineNo">571</span>    Method m = null;<a name="line.571"></a>
-<span class="sourceLineNo">572</span>    Exception toThrow = null;<a name="line.572"></a>
-<span class="sourceLineNo">573</span>    try {<a name="line.573"></a>
-<span class="sourceLineNo">574</span>      m = fs.getClass().getDeclaredMethod("setStoragePolicy", Path.class, String.class);<a name="line.574"></a>
-<span class="sourceLineNo">575</span>      m.setAccessible(true);<a name="line.575"></a>
-<span class="sourceLineNo">576</span>    } catch (NoSuchMethodException e) {<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      toThrow = e;<a name="line.577"></a>
-<span class="sourceLineNo">578</span>      final String msg = "FileSystem doesn't support setStoragePolicy; HDFS-6584, HDFS-9345 " +<a name="line.578"></a>
-<span class="sourceLineNo">579</span>          "not available. This is normal and expected on earlier Hadoop versions.";<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      if (!warningMap.containsKey(fs)) {<a name="line.580"></a>
-<span class="sourceLineNo">581</span>        warningMap.put(fs, true);<a name="line.581"></a>
-<span class="sourceLineNo">582</span>        LOG.warn(msg, e);<a name="line.582"></a>
-<span class="sourceLineNo">583</span>      } else if (LOG.isDebugEnabled()) {<a name="line.583"></a>
-<span class="sourceLineNo">584</span>        LOG.debug(msg, e);<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      }<a name="line.585"></a>
-<span class="sourceLineNo">586</span>      m = null;<a name="line.586"></a>
-<span class="sourceLineNo">587</span>    } catch (SecurityException e) {<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      toThrow = e;<a name="line.588"></a>
-<span class="sourceLineNo">589</span>      final String msg = "No access to setStoragePolicy on FileSystem from the SecurityManager; " +<a name="line.589"></a>
-<span class="sourceLineNo">590</span>          "HDFS-6584, HDFS-9345 not available. This is unusual and probably warrants an email " +<a name="line.590"></a>
-<span class="sourceLineNo">591</span>          "to the user@hbase mailing list. Please be sure to include a link to your configs, and " +<a name="line.591"></a>
-<span class="sourceLineNo">592</span>          "logs that include this message and period of time before it. Logs around service " +<a name="line.592"></a>
-<span class="sourceLineNo">593</span>          "start up will probably be useful as well.";<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      if (!warningMap.containsKey(fs)) {<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        warningMap.put(fs, true);<a name="line.595"></a>
-<span class="sourceLineNo">596</span>        LOG.warn(msg, e);<a name="line.596"></a>
-<span class="sourceLineNo">597</span>      } else if (LOG.isDebugEnabled()) {<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        LOG.debug(msg, e);<a name="line.598"></a>
-<span class="sourceLineNo">599</span>      }<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      m = null; // could happen on setAccessible() or getDeclaredMethod()<a name="line.600"></a>
-<span class="sourceLineNo">601</span>    }<a name="line.601"></a>
-<span class="sourceLineNo">602</span>    if (m != null) {<a name="line.602"></a>
-<span class="sourceLineNo">603</span>      try {<a name="line.603"></a>
-<span class="sourceLineNo">604</span>        m.invoke(fs, path, storagePolicy);<a name="line.604"></a>
-<span class="sourceLineNo">605</span>        if (LOG.isDebugEnabled()) {<a name="line.605"></a>
-<span class="sourceLineNo">606</span>          LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);<a name="line.606"></a>
-<span class="sourceLineNo">607</span>        }<a name="line.607"></a>
-<span class="sourceLineNo">608</span>      } catch (Exception e) {<a name="line.608"></a>
-<span class="sourceLineNo">609</span>        toThrow = e;<a name="line.609"></a>
-<span class="sourceLineNo">610</span>        // This swallows FNFE, should we be throwing it? seems more likely to indicate dev<a name="line.610"></a>
-<span class="sourceLineNo">611</span>        // misuse than a runtime problem with HDFS.<a name="line.611"></a>
-<span class="sourceLineNo">612</span>        if (!warningMap.containsKey(fs)) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>          warningMap.put(fs, true);<a name="line.613"></a>
-<span class="sourceLineNo">614</span>          LOG.warn("Unable to set storagePolicy=" + storagePolicy + " for path=" + path + ". " +<a name="line.614"></a>
-<span class="sourceLineNo">615</span>              "DEBUG log level might have more details.", e);<a name="line.615"></a>
-<span class="sourceLineNo">616</span>        } else if (LOG.isDebugEnabled()) {<a name="line.616"></a>
-<span class="sourceLineNo">617</span>          LOG.debug("Unable to set storagePolicy=" + storagePolicy + " for path=" + path, e);<a name="line.617"></a>
-<span class="sourceLineNo">618</span>        }<a name="line.618"></a>
-<span class="sourceLineNo">619</span>        // check for lack of HDFS-7228<a name="line.619"></a>
-<span class="sourceLineNo">620</span>        if (e instanceof InvocationTargetException) {<a name="line.620"></a>
-<span class="sourceLineNo">621</span>          final Throwable exception = e.getCause();<a name="line.621"></a>
-<span class="sourceLineNo">622</span>          if (exception instanceof RemoteException &amp;&amp;<a name="line.622"></a>
-<span class="sourceLineNo">623</span>              HadoopIllegalArgumentException.class.getName().equals(<a name="line.623"></a>
-<span class="sourceLineNo">624</span>                ((RemoteException)exception).getClassName())) {<a name="line.624"></a>
-<span class="sourceLineNo">625</span>            if (LOG.isDebugEnabled()) {<a name="line.625"></a>
-<span class="sourceLineNo">626</span>              LOG.debug("Given storage policy, '" +storagePolicy +"', was rejected and probably " +<a name="line.626"></a>
-<span class="sourceLineNo">627</span>                "isn't a valid policy for the version of Hadoop you're running. I.e. if you're " +<a name="line.627"></a>
-<span class="sourceLineNo">628</span>                "trying to use SSD related policies then you're likely missing HDFS-7228. For " +<a name="line.628"></a>
-<span class="sourceLineNo">629</span>                "more information see the 'ArchivalStorage' docs for your Hadoop release.");<a name="line.629"></a>
-<span class="sourceLineNo">630</span>            }<a name="line.630"></a>
-<span class="sourceLineNo">631</span>          // Hadoop 2.8+, 3.0-a1+ added FileSystem.setStoragePolicy with a default implementation<a name="line.631"></a>
-<span class="sourceLineNo">632</span>          // that throws UnsupportedOperationException<a name="line.632"></a>
-<span class="sourceLineNo">633</span>          } else if (exception instanceof UnsupportedOperationException) {<a name="line.633"></a>
-<span class="sourceLineNo">634</span>            if (LOG.isDebugEnabled()) {<a name="line.634"></a>
-<span class="sourceLineNo">635</span>              LOG.debug("The underlying FileSystem implementation doesn't support " +<a name="line.635"></a>
-<span class="sourceLineNo">636</span>                  "setStoragePolicy. This is probably intentional on their part, since HDFS-9345 " +<a name="line.636"></a>
-<span class="sourceLineNo">637</span>                  "appears to be present in your version of Hadoop. For more information check " +<a name="line.637"></a>
-<span class="sourceLineNo">638</span>                  "the Hadoop documentation on 'ArchivalStorage', the Hadoop FileSystem " +<a name="line.638"></a>
-<span class="sourceLineNo">639</span>                  "specification docs from HADOOP-11981, and/or related documentation from the " +<a name="line.639"></a>
-<span class="sourceLineNo">640</span>                  "provider of the underlying FileSystem (its name should appear in the " +<a name="line.640"></a>
-<span class="sourceLineNo">641</span>                  "stacktrace that accompanies this message). Note in particular that Hadoop's " +<a name="line.641"></a>
-<span class="sourceLineNo">642</span>                  "local filesystem implementation doesn't support storage policies.", exception);<a name="line.642"></a>
-<span class="sourceLineNo">643</span>            }<a name="line.643"></a>
-<span class="sourceLineNo">644</span>          }<a name="line.644"></a>
-<span class="sourceLineNo">645</span>        }<a name="line.645"></a>
-<span class="sourceLineNo">646</span>      }<a name="line.646"></a>
-<span class="sourceLineNo">647</span>    }<a name="line.647"></a>
-<span class="sourceLineNo">648</span>    if (toThrow != null) {<a name="line.648"></a>
-<span class="sourceLineNo">649</span>      throw new IOException(toThrow);<a name="line.649"></a>
-<span class="sourceLineNo">650</span>    }<a name="line.650"></a>
-<span class="sourceLineNo">651</span>  }<a name="line.651"></a>
-<span class="sourceLineNo">652</span><a name="line.652"></a>
-<span class="sourceLineNo">653</span>  /**<a name="line.653"></a>
-<span class="sourceLineNo">654</span>   * @param conf must not be null<a name="line.654"></a>
-<span class="sourceLineNo">655</span>   * @return True if this filesystem whose scheme is 'hdfs'.<a name="line.655"></a>
-<span class="sourceLineNo">656</span>   * @throws IOException from underlying FileSystem<a name="line.656"></a>
-<span class="sourceLineNo">657</span>   */<a name="line.657"></a>
-<span class="sourceLineNo">658</span>  public static boolean isHDFS(final Configuration conf) throws IOException {<a name="line.658"></a>
-<span class="sourceLineNo">659</span>    FileSystem fs = FileSystem.get(conf);<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    String scheme = fs.getUri().getScheme();<a name="line.660"></a>
-<span class="sourceLineNo">661</span>    return scheme.equalsIgnoreCase("hdfs");<a name="line.661"></a>
-<span class="sourceLineNo">662</span>  }<a name="line.662"></a>
-<span class="sourceLineNo">663</span><a name="line.663"></a>
-<span class="sourceLineNo">664</span>  /**<a name="line.664"></a>
-<span class="sourceLineNo">665</span>   * Checks if the given path is the one with 'recovered.edits' dir.<a name="line.665"></a>
-<span class="sourceLineNo">666</span>   * @param path must not be null<a name="line.666"></a>
-<span class="sourceLineNo">667</span>   * @return True if we recovered edits<a name="line.667"></a>
-<span class="sourceLineNo">668</span>   */<a name="line.668"></a>
-<span class="sourceLineNo">669</span>  public static boolean isRecoveredEdits(Path path) {<a name="line.669"></a>
-<span class="sourceLineNo">670</span>    return path.toString().contains(HConstants.RECOVERED_EDITS_DIR);<a name="line.670"></a>
-<span class="sourceLineNo">671</span>  }<a name="line.671"></a>
-<span class="sourceLineNo">672</span><a name="line.672"></a>
-<span class="sourceLineNo">673</span>  /**<a name="line.673"></a>
-<span class="sourceLineNo">674</span>   * @param conf must not be null<a name="line.674"></a>
-<span class="sourceLineNo">675</span>   * @return Returns the filesystem of the hbase rootdir.<a name="line.675"></a>
-<span class="sourceLineNo">676</span>   * @throws IOException from underlying FileSystem<a name="line.676"></a>
-<span class="sourceLineNo">677</span>   */<a name="line.677"></a>
-<span class="sourceLineNo">678</span>  public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {<a name="line.678"></a>
-<span class="sourceLineNo">679</span>    return getRootDir(conf).getFileSystem(conf);<a name="line.679"></a>
-<span class="sourceLineNo">680</span>  }<a name="line.680"></a>
-<span class="sourceLineNo">681</span><a name="line.681"></a>
-<span class="sourceLineNo">682</span>  /**<a name="line.682"></a>
-<span class="sourceLineNo">683</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.683"></a>
-<span class="sourceLineNo">684</span>   * This accommodates differences between hadoop versions, where hadoop 1<a name="line.684"></a>
-<span class="sourceLineNo">685</span>   * does not throw a FileNotFoundException, and return an empty FileStatus[]<a name="line.685"></a>
-<span class="sourceLineNo">686</span>   * while Hadoop 2 will throw FileNotFoundException.<a name="line.686"></a>
-<span class="sourceLineNo">687</span>   *<a name="line.687"></a>
-<span class="sourceLineNo">688</span>   * Where possible, prefer FSUtils#listStatusWithStatusFilter(FileSystem,<a name="line.688"></a>
-<span class="sourceLineNo">689</span>   * Path, FileStatusFilter) instead.<a name="line.689"></a>
-<span class="sourceLineNo">690</span>   *<a name="line.690"></a>
-<span class="sourceLineNo">691</span>   * @param fs file system<a name="line.691"></a>
-<span class="sourceLineNo">692</span>   * @param dir directory<a name="line.692"></a>
-<span class="sourceLineNo">693</span>   * @param filter path filter<a name="line.693"></a>
-<span class="sourceLineNo">694</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.694"></a>
-<span class="sourceLineNo">695</span>   */<a name="line.695"></a>
-<span class="sourceLineNo">696</span>  public static FileStatus[] listStatus(final FileSystem fs,<a name="line.696"></a>
-<span class="sourceLineNo">697</span>      final Path dir, final PathFilter filter) throws IOException {<a name="line.697"></a>
-<span class="sourceLineNo">698</span>    FileStatus [] status = null;<a name="line.698"></a>
-<span class="sourceLineNo">699</span>    try {<a name="line.699"></a>
-<span class="sourceLineNo">700</span>      status = filter == null ? fs.listStatus(dir) : fs.listStatus(dir, filter);<a name="line.700"></a>
-<span class="sourceLineNo">701</span>    } catch (FileNotFoundException fnfe) {<a name="line.701"></a>
-<span class="sourceLineNo">702</span>      // if directory doesn't exist, return null<a name="line.702"></a>
-<span class="sourceLineNo">703</span>      if (LOG.isTraceEnabled()) {<a name="line.703"></a>
-<span class="sourceLineNo">704</span>        LOG.trace("{} doesn't exist", dir);<a name="line.704"></a>
-<span class="sourceLineNo">705</span>      }<a name="line.705"></a>
-<span class="sourceLineNo">706</span>    }<a name="line.706"></a>
-<span class="sourceLineNo">707</span>    if (status == null || status.length &lt; 1) {<a name="line.707"></a>
-<span class="sourceLineNo">708</span>      return null;<a name="line.708"></a>
-<span class="sourceLineNo">709</span>    }<a name="line.709"></a>
-<span class="sourceLineNo">710</span>    return status;<a name="line.710"></a>
-<span class="sourceLineNo">711</span>  }<a name="line.711"></a>
-<span class="sourceLineNo">712</span><a name="line.712"></a>
-<span class="sourceLineNo">713</span>  /**<a name="line.713"></a>
-<span class="sourceLineNo">714</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.714"></a>
-<span class="sourceLineNo">715</span>   * This would accommodates differences between hadoop versions<a name="line.715"></a>
+<span class="sourceLineNo">543</span><a name="line.543"></a>
+<span class="sourceLineNo">544</span>      // check for lack of HDFS-7228<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      if (e instanceof RemoteException &amp;&amp;<a name="line.545"></a>
+<span class="sourceLineNo">546</span>          HadoopIllegalArgumentException.class.getName().equals(<a name="line.546"></a>
+<span class="sourceLineNo">547</span>            ((RemoteException)e).getClassName())) {<a name="line.547"></a>
+<span class="sourceLineNo">548</span>        if (LOG.isDebugEnabled()) {<a name="line.548"></a>
+<span class="sourceLineNo">549</span>          LOG.debug("Given storage policy, '" +storagePolicy +"', was rejected and probably " +<a name="line.549"></a>
+<span class="sourceLineNo">550</span>            "isn't a valid policy for the version of Hadoop you're running. I.e. if you're " +<a name="line.550"></a>
+<span class="sourceLineNo">551</span>            "trying to use SSD related policies then you're likely missing HDFS-7228. For " +<a name="line.551"></a>
+<span class="sourceLineNo">552</span>            "more information see the 'ArchivalStorage' docs for your Hadoop release.");<a name="line.552"></a>
+<span class="sourceLineNo">553</span>        }<a name="line.553"></a>
+<span class="sourceLineNo">554</span>      // Hadoop 2.8+, 3.0-a1+ added FileSystem.setStoragePolicy with a default implementation<a name="line.554"></a>
+<span class="sourceLineNo">555</span>      // that throws UnsupportedOperationException<a name="line.555"></a>
+<span class="sourceLineNo">556</span>      } else if (e instanceof UnsupportedOperationException) {<a name="line.556"></a>
+<span class="sourceLineNo">557</span>        if (LOG.isDebugEnabled()) {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>          LOG.debug("The underlying FileSystem implementation doesn't support " +<a name="line.558"></a>
+<span class="sourceLineNo">559</span>              "setStoragePolicy. This is probably intentional on their part, since HDFS-9345 " +<a name="line.559"></a>
+<span class="sourceLineNo">560</span>              "appears to be present in your version of Hadoop. For more information check " +<a name="line.560"></a>
+<span class="sourceLineNo">561</span>              "the Hadoop documentation on 'ArchivalStorage', the Hadoop FileSystem " +<a name="line.561"></a>
+<span class="sourceLineNo">562</span>              "specification docs from HADOOP-11981, and/or related documentation from the " +<a name="line.562"></a>
+<span class="sourceLineNo">563</span>              "provider of the underlying FileSystem (its name should appear in the " +<a name="line.563"></a>
+<span class="sourceLineNo">564</span>              "stacktrace that accompanies this message). Note in particular that Hadoop's " +<a name="line.564"></a>
+<span class="sourceLineNo">565</span>              "local filesystem implementation doesn't support storage policies.", e);<a name="line.565"></a>
+<span class="sourceLineNo">566</span>        }<a name="line.566"></a>
+<span class="sourceLineNo">567</span>      }<a name="line.567"></a>
+<span class="sourceLineNo">568</span>    }<a name="line.568"></a>
+<span class="sourceLineNo">569</span><a name="line.569"></a>
+<span class="sourceLineNo">570</span>    if (toThrow != null) {<a name="line.570"></a>
+<span class="sourceLineNo">571</span>      throw new IOException(toThrow);<a name="line.571"></a>
+<span class="sourceLineNo">572</span>    }<a name="line.572"></a>
+<span class="sourceLineNo">573</span>  }<a name="line.573"></a>
+<span class="sourceLineNo">574</span><a name="line.574"></a>
+<span class="sourceLineNo">575</span>  /**<a name="line.575"></a>
+<span class="sourceLineNo">576</span>   * @param conf must not be null<a name="line.576"></a>
+<span class="sourceLineNo">577</span>   * @return True if this filesystem whose scheme is 'hdfs'.<a name="line.577"></a>
+<span class="sourceLineNo">578</span>   * @throws IOException from underlying FileSystem<a name="line.578"></a>
+<span class="sourceLineNo">579</span>   */<a name="line.579"></a>
+<span class="sourceLineNo">580</span>  public static boolean isHDFS(final Configuration conf) throws IOException {<a name="line.580"></a>
+<span class="sourceLineNo">581</span>    FileSystem fs = FileSystem.get(conf);<a name="line.581"></a>
+<span class="sourceLineNo">582</span>    String scheme = fs.getUri().getScheme();<a name="line.582"></a>
+<span class="sourceLineNo">583</span>    return scheme.equalsIgnoreCase("hdfs");<a name="line.583"></a>
+<span class="sourceLineNo">584</span>  }<a name="line.584"></a>
+<span class="sourceLineNo">585</span><a name="line.585"></a>
+<span class="sourceLineNo">586</span>  /**<a name="line.586"></a>
+<span class="sourceLineNo">587</span>   * Checks if the given path is the one with 'recovered.edits' dir.<a name="line.587"></a>
+<span class="sourceLineNo">588</span>   * @param path must not be null<a name="line.588"></a>
+<span class="sourceLineNo">589</span>   * @return True if we recovered edits<a name="line.589"></a>
+<span class="sourceLineNo">590</span>   */<a name="line.590"></a>
+<span class="sourceLineNo">591</span>  public static boolean isRecoveredEdits(Path path) {<a name="line.591"></a>
+<span class="sourceLineNo">592</span>    return path.toString().contains(HConstants.RECOVERED_EDITS_DIR);<a name="line.592"></a>
+<span class="sourceLineNo">593</span>  }<a name="line.593"></a>
+<span class="sourceLineNo">594</span><a name="line.594"></a>
+<span class="sourceLineNo">595</span>  /**<a name="line.595"></a>
+<span class="sourceLineNo">596</span>   * @param conf must not be null<a name="line.596"></a>
+<span class="sourceLineNo">597</span>   * @return Returns the filesystem of the hbase rootdir.<a name="line.597"></a>
+<span class="sourceLineNo">598</span>   * @throws IOException from underlying FileSystem<a name="line.598"></a>
+<span class="sourceLineNo">599</span>   */<a name="line.599"></a>
+<span class="sourceLineNo">600</span>  public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {<a name="line.600"></a>
+<span class="sourceLineNo">601</span>    return getRootDir(conf).getFileSystem(conf);<a name="line.601"></a>
+<span class="sourceLineNo">602</span>  }<a name="line.602"></a>
+<span class="sourceLineNo">603</span><a name="line.603"></a>
+<span class="sourceLineNo">604</span>  /**<a name="line.604"></a>
+<span class="sourceLineNo">605</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.605"></a>
+<span class="sourceLineNo">606</span>   * This accommodates differences between hadoop versions, where hadoop 1<a name="line.606"></a>
+<span class="sourceLineNo">607</span>   * does not throw a FileNotFoundException, and return an empty FileStatus[]<a name="line.607"></a>
+<span class="sourceLineNo">608</span>   * while Hadoop 2 will throw FileNotFoundException.<a name="line.608"></a>
+<span class="sourceLineNo">609</span>   *<a name="line.609"></a>
+<span class="sourceLineNo">610</span>   * Where possible, prefer FSUtils#listStatusWithStatusFilter(FileSystem,<a name="line.610"></a>
+<span class="sourceLineNo">611</span>   * Path, FileStatusFilter) instead.<a name="line.611"></a>
+<span class="sourceLineNo">612</span>   *<a name="line.612"></a>
+<span class="sourceLineNo">613</span>   * @param fs file system<a name="line.613"></a>
+<span class="sourceLineNo">614</span>   * @param dir directory<a name="line.614"></a>
+<span class="sourceLineNo">615</span>   * @param filter path filter<a name="line.615"></a>
+<span class="sourceLineNo">616</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.616"></a>
+<span class="sourceLineNo">617</span>   */<a name="line.617"></a>
+<span class="sourceLineNo">618</span>  public static FileStatus[] listStatus(final FileSystem fs,<a name="line.618"></a>
+<span class="sourceLineNo">619</span>      final Path dir, final PathFilter filter) throws IOException {<a name="line.619"></a>
+<span class="sourceLineNo">620</span>    FileStatus [] status = null;<a name="line.620"></a>
+<span class="sourceLineNo">621</span>    try {<a name="line.621"></a>
+<span class="sourceLineNo">622</span>      status = filter == null ? fs.listStatus(dir) : fs.listStatus(dir, filter);<a name="line.622"></a>
+<span class="sourceLineNo">623</span>    } catch (FileNotFoundException fnfe) {<a name="line.623"></a>
+<span class="sourceLineNo">624</span>      // if directory doesn't exist, return null<a name="line.624"></a>
+<span class="sourceLineNo">625</span>      if (LOG.isTraceEnabled()) {<a name="line.625"></a>
+<span class="sourceLineNo">626</span>        LOG.trace("{} doesn't exist", dir);<a name="line.626"></a>
+<span class="sourceLineNo">627</span>      }<a name="line.627"></a>
+<span class="sourceLineNo">628</span>    }<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    if (status == null || status.length &lt; 1) {<a name="line.629"></a>
+<span class="sourceLineNo">630</span>      return null;<a name="line.630"></a>
+<span class="sourceLineNo">631</span>    }<a name="line.631"></a>
+<span class="sourceLineNo">632</span>    return status;<a name="line.632"></a>
+<span class="sourceLineNo">633</span>  }<a name="line.633"></a>
+<span class="sourceLineNo">634</span><a name="line.634"></a>
+<span class="sourceLineNo">635</span>  /**<a name="line.635"></a>
+<span class="sourceLineNo">636</span>   * Calls fs.listStatus() and treats FileNotFoundException as non-fatal<a name="line.636"></a>
+<span class="sourceLineNo">637</span>   * This would accommodates differences between hadoop versions<a name="line.637"></a>
+<span class="sourceLineNo">638</span>   *<a name="line.638"></a>
+<span class="sourceLineNo">639</span>   * @param fs file system<a name="line.639"></a>
+<span class="sourceLineNo">640</span>   * @param dir directory<a name="line.640"></a>
+<span class="sourceLineNo">641</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.641"></a>
+<span class="sourceLineNo">642</span>   */<a name="line.642"></a>
+<span class="sourceLineNo">643</span>  public static FileStatus[] listStatus(final FileSystem fs, final Path dir) throws IOException {<a name="line.643"></a>
+<span class="sourceLineNo">644</span>    return listStatus(fs, dir, null);<a name="line.644"></a>
+<span class="sourceLineNo">645</span>  }<a name="line.645"></a>
+<span class="sourceLineNo">646</span><a name="line.646"></a>
+<span class="sourceLineNo">647</span>  /**<a name="line.647"></a>
+<span class="sourceLineNo">648</span>   * Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call<a name="line.648"></a>
+<span class="sourceLineNo">649</span>   *<a name="line.649"></a>
+<span class="sourceLineNo">650</span>   * @param fs file system<a name="line.650"></a>
+<span class="sourceLineNo">651</span>   * @param dir directory<a name="line.651"></a>
+<span class="sourceLineNo">652</span>   * @return LocatedFileStatus list<a name="line.652"></a>
+<span class="sourceLineNo">653</span>   */<a name="line.653"></a>
+<span class="sourceLineNo">654</span>  public static List&lt;LocatedFileStatus&gt; listLocatedStatus(final FileSystem fs,<a name="line.654"></a>
+<span class="sourceLineNo">655</span>      final Path dir) throws IOException {<a name="line.655"></a>
+<span class="sourceLineNo">656</span>    List&lt;LocatedFileStatus&gt; status = null;<a name="line.656"></a>
+<span class="sourceLineNo">657</span>    try {<a name="line.657"></a>
+<span class="sourceLineNo">658</span>      RemoteIterator&lt;LocatedFileStatus&gt; locatedFileStatusRemoteIterator = fs<a name="line.658"></a>
+<span class="sourceLineNo">659</span>          .listFiles(dir, false);<a name="line.659"></a>
+<span class="sourceLineNo">660</span>      while (locatedFileStatusRemoteIterator.hasNext()) {<a name="line.660"></a>
+<span class="sourceLineNo">661</span>        if (status == null) {<a name="line.661"></a>
+<span class="sourceLineNo">662</span>          status = Lists.newArrayList();<a name="line.662"></a>
+<span class="sourceLineNo">663</span>        }<a name="line.663"></a>
+<span class="sourceLineNo">664</span>        status.add(locatedFileStatusRemoteIterator.next());<a name="line.664"></a>
+<span class="sourceLineNo">665</span>      }<a name="line.665"></a>
+<span class="sourceLineNo">666</span>    } catch (FileNotFoundException fnfe) {<a name="line.666"></a>
+<span class="sourceLineNo">667</span>      // if directory doesn't exist, return null<a name="line.667"></a>
+<span class="sourceLineNo">668</span>      if (LOG.isTraceEnabled()) {<a name="line.668"></a>
+<span class="sourceLineNo">669</span>        LOG.trace("{} doesn't exist", dir);<a name="line.669"></a>
+<span class="sourceLineNo">670</span>      }<a name="line.670"></a>
+<span class="sourceLineNo">671</span>    }<a name="line.671"></a>
+<span class="sourceLineNo">672</span>    return status;<a name="line.672"></a>
+<span class="sourceLineNo">673</span>  }<a name="line.673"></a>
+<span class="sourceLineNo">674</span><a name="line.674"></a>
+<span class="sourceLineNo">675</span>  /**<a name="line.675"></a>
+<span class="sourceLineNo">676</span>   * Calls fs.delete() and returns the value returned by the fs.delete()<a name="line.676"></a>
+<span class="sourceLineNo">677</span>   *<a name="line.677"></a>
+<span class="sourceLineNo">678</span>   * @param fs must not be null<a name="line.678"></a>
+<span class="sourceLineNo">679</span>   * @param path must not be null<a name="line.679"></a>
+<span class="sourceLineNo">680</span>   * @param recursive delete tree rooted at path<a name="line.680"></a>
+<span class="sourceLineNo">681</span>   * @return the value returned by the fs.delete()<a name="line.681"></a>
+<span class="sourceLineNo">682</span>   * @throws IOException from underlying FileSystem<a name="line.682"></a>
+<span class="sourceLineNo">683</span>   */<a name="line.683"></a>
+<span class="sourceLineNo">684</span>  public static boolean delete(final FileSystem fs, final Path path, final boolean recursive)<a name="line.684"></a>
+<span class="sourceLineNo">685</span>      throws IOException {<a name="line.685"></a>
+<span class="sourceLineNo">686</span>    return fs.delete(path, recursive);<a name="line.686"></a>
+<span class="sourceLineNo">687</span>  }<a name="line.687"></a>
+<span class="sourceLineNo">688</span><a name="line.688"></a>
+<span class="sourceLineNo">689</span>  /**<a name="line.689"></a>
+<span class="sourceLineNo">690</span>   * Calls fs.exists(). Checks if the specified path exists<a name="line.690"></a>
+<span class="sourceLineNo">691</span>   *<a name="line.691"></a>
+<span class="sourceLineNo">692</span>   * @param fs must not be null<a name="line.692"></a>
+<span class="sourceLineNo">693</span>   * @param path must not be null<a name="line.693"></a>
+<span class="sourceLineNo">694</span>   * @return the value returned by fs.exists()<a name="line.694"></a>
+<span class="sourceLineNo">695</span>   * @throws IOException from underlying FileSystem<a name="line.695"></a>
+<span class="sourceLineNo">696</span>   */<a name="line.696"></a>
+<span class="sourceLineNo">697</span>  public static boolean isExists(final FileSystem fs, final Path path) throws IOException {<a name="line.697"></a>
+<span class="sourceLineNo">698</span>    return fs.exists(path);<a name="line.698"></a>
+<span class="sourceLineNo">699</span>  }<a name="line.699"></a>
+<span class="sourceLineNo">700</span><a name="line.700"></a>
+<span class="sourceLineNo">701</span>  /**<a name="line.701"></a>
+<span class="sourceLineNo">702</span>   * Log the current state of the filesystem from a certain root directory<a name="line.702"></a>
+<span class="sourceLineNo">703</span>   * @param fs filesystem to investigate<a name="line.703"></a>
+<span class="sourceLineNo">704</span>   * @param root root file/directory to start logging from<a name="line.704"></a>
+<span class="sourceLineNo">705</span>   * @param log log to output information<a name="line.705"></a>
+<span class="sourceLineNo">706</span>   * @throws IOException if an unexpected exception occurs<a name="line.706"></a>
+<span class="sourceLineNo">707</span>   */<a name="line.707"></a>
+<span class="sourceLineNo">708</span>  public static void logFileSystemState(final FileSystem fs, final Path root, Logger log)<a name="line.708"></a>
+<span class="sourceLineNo">709</span>      throws IOException {<a name="line.709"></a>
+<span class="sourceLineNo">710</span>    log.debug("File system contents for path {}", root);<a name="line.710"></a>
+<span class="sourceLineNo">711</span>    logFSTree(log, fs, root, "|-");<a name="line.711"></a>
+<span class="sourceLineNo">712</span>  }<a name="line.712"></a>
+<span class="sourceLineNo">713</span><a name="line.713"></a>
+<span class="sourceLineNo">714</span>  /**<a name="line.714"></a>
+<span class="sourceLineNo">715</span>   * Recursive helper to log the state of the FS<a name="line.715"></a>
 <span class="sourceLineNo">716</span>   *<a name="line.716"></a>
-<span class="sourceLineNo">717</span>   * @param fs file system<a name="line.717"></a>
-<span class="sourceLineNo">718</span>   * @param dir directory<a name="line.718"></a>
-<span class="sourceLineNo">719</span>   * @return null if dir is empty or doesn't exist, otherwise FileStatus array<a name="line.719"></a>
-<span class="sourceLineNo">720</span>   */<a name="line.720"></a>
-<span class="sourceLineNo">721</span>  public static FileStatus[] listStatus(final FileSystem fs, final Path dir) throws IOException {<a name="line.721"></a>
-<span class="sourceLineNo">722</span>    return listStatus(fs, dir, null);<a name="line.722"></a>
-<span class="sourceLineNo">723</span>  }<a name="line.723"></a>
-<span class="sourceLineNo">724</span><a name="line.724"></a>
-<span class="sourceLineNo">725</span>  /**<a name="line.725"></a>
-<span class="sourceLineNo">726</span>   * Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call<a name="line.726"></a>
-<span class="sourceLineNo">727</span>   *<a name="line.727"></a>
-<span class="sourceLineNo">728</span>   * @param fs file system<a name="line.728"></a>
-<span class="sourceLineNo">729</span>   * @param dir directory<a name="line.729"></a>
-<span class="sourceLineNo">730</span>   * @return LocatedFileStatus list<a name="line.730"></a>
-<span class="sourceLineNo">731</span>   */<a name="line.731"></a>
-<span class="sourceLineNo">732</span>  public static List&lt;LocatedFileStatus&gt; listLocatedStatus(final FileSystem fs,<a name="line.732"></a>
-<span class="sourceLineNo">733</span>      final Path dir) throws IOException {<a name="line.733"></a>
-<span class="sourceLineNo">734</span>    List&lt;LocatedFileStatus&gt; status = null;<a name="line.734"></a>
-<span class="sourceLineNo">735</span>    try {<a name="line.735"></a>
-<span class="sourceLineNo">736</span>      RemoteIterator&lt;LocatedFileStatus&gt; locatedFileStatusRemoteIterator = fs<a name="line.736"></a>
-<span class="sourceLineNo">737</span>          .listFiles(dir, false);<a name="line.737"></a>
-<span class="sourceLineNo">738</span>      while (locatedFileStatusRemoteIterator.hasNext()) {<a name="line.738"></a>
-<span class="sourceLineNo">739</span>        if (status == null) {<a name="line.739"></a>
-<span class="sourceLineNo">740</span>          status = Lists.newArrayList();<a name="line.740"></a>
-<span class="sourceLineNo">741</span>        }<a name="line.741"></a>
-<span class="sourceLineNo">742</span>        status.add(locatedFileStatusRemoteIterator.next());<a name="line.742"></a>
-<span class="sourceLineNo">743</span>      }<a name="line.743"></a>
-<span class="sourceLineNo">744</span>    } catch (FileNotFoundException fnfe) {<a name="line.744"></a>
-<span class="sourceLineNo">745</span>      // if directory doesn't exist, return null<a name="line.745"></a>
-<span class="sourceLineNo">746</span>      if (LOG.isTraceEnabled()) {<a name="line.746"></a>
-<span class="sourceLineNo">747</span>        LOG.trace("{} doesn't exist", dir);<a name="line.747"></a>
-<span class="sourceLineNo">748</span>      }<a name="line.748"></a>
-<span class="sourceLineNo">749</span>    }<a name="line.749"></a>
-<span class="sourceLineNo">750</span>    return status;<a name="line.750"></a>
-<span class="sourceLineNo">751</span>  }<a name="line.751"></a>
-<span class="sourceLineNo">752</span><a name="line.752"></a>
-<span class="sourceLineNo">753</span>  /**<a name="line.753"></a>
-<span class="sourceLineNo">754</span>   * Calls fs.delete() and returns the value returned by the fs.delete()<a name="line.754"></a>
-<span class="sourceLineNo">755</span>   *<a name="line.755"></a>
-<span class="sourceLineNo">756</span>   * @param fs must not be null<a name="line.756"></a>
-<span class="sourceLineNo">757</span>   * @param path must not be null<a name="line.757"></a>
-<span class="sourceLineNo">758</span>   * @param recursive delete tree rooted at path<a name="line.758"></a>
-<span class="sourceLineNo">759</span>   * @return the value returned by the fs.delete()<a name="line.759"></a>
-<span class="sourceLineNo">760</span>   * @throws IOException from underlying FileSystem<a name="line.760"></a>
-<span class="sourceLineNo">761</span>   */<a name="line.761"></a>
-<span class="sourceLineNo">762</span>  public static boolean delete(final FileSystem fs, final Path path, final boolean recursive)<a name="line.762"></a>
-<span class="sourceLineNo">763</span>      throws IOException {<a name="line.763"></a>
-<span class="sourceLineNo">764</span>    return fs.delete(path, recursive);<a name="line.764"></a>
-<span class="sourceLineNo">765</span>  }<a name="line.765"></a>
-<span class="sourceLineNo">766</span><a name="line.766"></a>
-<span class="sourceLineNo">767</span>  /**<a name="line.767"></a>
-<span class="sourceLineNo">768</span>   * Calls fs.exists(). Checks if the specified path exists<a name="line.768"></a>
-<span class="sourceLineNo">769</span>   *<a name="line.769"></a>
-<span class="sourceLineNo">770</span>   * @param fs must not be null<a name="line.770"></a>
-<span class="sourceLineNo">771</span>   * @param path must not be null<a name="line.771"></a>
-<span class="sourceLineNo">772</span>   * @return the value returned by fs.exists()<a name="line.772"></a>
-<span class="sourceLineNo">773</span>   * @throws IOException from underlying FileSystem<a name="line.773"></a>
-<span class="sourceLineNo">774</span>   */<a name="line.774"></a>
-<span class="sourceLineNo">775</span>  public static boolean isExists(final FileSystem fs, final Path path) throws IOException {<a name="line.775"></a>
-<span class="sourceLineNo">776</span>    return fs.exists(path);<a name="line.776"></a>
-<span class="sourceLineNo">777</span>  }<a name="line.777"></a>
+<span class="sourceLineNo">717</span>   * @see #logFileSystemState(FileSystem, Path, Logger)<a name="line.717"></a>
+<span class="sourceLineNo">718</span>   */<a name="line.718"></a>
+<span class="sourceLineNo">719</span>  private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)<a name="line.719"></a>
+<span class="sourceLineNo">720</span>      throws IOException {<a name="line.720"></a>
+<span class="sourceLineNo">721</span>    FileStatus[] files = listStatus(fs, root, null);<a name="line.721"></a>
+<span class="sourceLineNo">722</span>    if (files == null) {<a name="line.722"></a>
+<span class="sourceLineNo">723</span>      return;<a name="line.723"></a>
+<span class="sourceLineNo">724</span>    }<a name="line.724"></a>
+<span class="sourceLineNo">725</span><a name="line.725"></a>
+<span class="sourceLineNo">726</span>    for (FileStatus file : files) {<a name="line.726"></a>
+<span class="sourceLineNo">727</span>      if (file.isDirectory()) {<a name="line.727"></a>
+<span class="sourceLineNo">728</span>        log.debug(prefix + file.getPath().getName() + "/");<a name="line.728"></a>
+<span class="sourceLineNo">729</span>        logFSTree(log, fs, file.getPath(), prefix + "---");<a name="line.729"></a>
+<span class="sourceLineNo">730</span>      } else {<a name="line.730"></a>
+<span class="sourceLineNo">731</span>        log.debug(prefix + file.getPath().getName());<a name="line.731"></a>
+<span class="sourceLineNo">732</span>      }<a name="line.732"></a>
+<span class="sourceLineNo">733</span>    }<a name="line.733"></a>
+<span class="sourceLineNo">734</span>  }<a name="line.734"></a>
+<span class="sourceLineNo">735</span><a name="line.735"></a>
+<span class="sourceLineNo">736</span>  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest)<a name="line.736"></a>
+<span class="sourceLineNo">737</span>      throws IOException {<a name="line.737"></a>
+<span class="sourceLineNo">738</span>    // set the modify time for TimeToLive Cleaner<a name="line.738"></a>
+<span class="sourceLineNo">739</span>    fs.setTimes(src, EnvironmentEdgeManager.currentTime(), -1);<a name="line.739"></a>
+<span class="sourceLineNo">740</span>    return fs.rename(src, dest);<a name="line.740"></a>
+<span class="sourceLineNo">741</span>  }<a name="line.741"></a>
+<span class="sourceLineNo">742</span><a name="line.742"></a>
+<span class="sourceLineNo">743</span>  /**<a name="line.743"></a>
+<span class="sourceLineNo">744</span>   * Check if short circuit read buffer size is set and if not, set it to hbase value.<a name="line.744"></a>
+<span class="sourceLineNo">745</span>   * @param conf must not be null<a name="line.745"></a>
+<span class="sourceLineNo">746</span>   */<a name="line.746"></a>
+<span class="sourceLineNo">747</span>  public static void checkShortCircuitReadBufferSize(final Configuration conf) {<a name="line.747"></a>
+<span class="sourceLineNo">748</span>    final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;<a name="line.748"></a>
+<span class="sourceLineNo">749</span>    final int notSet = -1;<a name="line.749"></a>
+<span class="sourceLineNo">750</span>    // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2<a name="line.750"></a>
+<span class="sourceLineNo">751</span>    final String dfsKey = "dfs.client.read.shortcircuit.buffer.size";<a name="line.751"></a>
+<span class="sourceLineNo">752</span>    int size = conf.getInt(dfsKey, notSet);<a name="line.752"></a>
+<span class="sourceLineNo">753</span>    // If a size is set, return -- we will use it.<a name="line.753"></a>
+<span class="sourceLineNo">754</span>    if (size != notSet) {<a name="line.754"></a>
+<span class="sourceLineNo">755</span>      return;<a name="line.755"></a>
+<span class="sourceLineNo">756</span>    }<a name="line.756"></a>
+<span class="sourceLineNo">757</span>    // But short circuit buffer size is normally not set.  Put in place the hbase wanted size.<a name="line.757"></a>
+<span class="sourceLineNo">758</span>    int hbaseSize = conf.getInt("hbase." + dfsKey, defaultSize);<a name="line.758"></a>
+<span class="sourceLineNo">759</span>    conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));<a name="line.759"></a>
+<span class="sourceLineNo">760</span>  }<a name="line.760"></a>
+<span class="sourceLineNo">761</span><a name="line.761"></a>
+<span class="sourceLineNo">762</span>  private static class DfsBuilderUtility {<a name="line.762"></a>
+<span class="sourceLineNo">763</span>    static Class&lt;?&gt; dfsClass = null;<a name="line.763"></a>
+<span class="sourceLineNo">764</span>    static Method createMethod;<a name="line.764"></a>
+<span class="sourceLineNo">765</span>    static Method overwriteMethod;<a name="line.765"></a>
+<span class="sourceLineNo">766</span>    static Method bufferSizeMethod;<a name="line.766"></a>
+<span class="sourceLineNo">767</span>    static Method blockSizeMethod;<a name="line.767"></a>
+<span class="sourceLineNo">768</span>    static Method recursiveMethod;<a name="line.768"></a>
+<span class="sourceLineNo">769</span>    static Method replicateMethod;<a name="line.769"></a>
+<span class="sourceLineNo">770</span>    static Method replicationMethod;<a name="line.770"></a>
+<span class="sourceLineNo">771</span>    static Method buildMethod;<a name="line.771"></a>
+<span class="sourceLineNo">772</span>    static boolean allMethodsPresent = false;<a name="line.772"></a>
+<span class="sourceLineNo">773</span><a name="line.773"></a>
+<span class="sourceLineNo">774</span>    static {<a name="line.774"></a>
+<span class="sourceLineNo">775</span>      String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";<a name="line.775"></a>
+<span class="sourceLineNo">776</span>      String builderName = dfsName + "$HdfsDataOutputStreamBuilder";<a name="line.776"></a>
+<span class="sourceLineNo">777</span>      Class&lt;?&gt; builderClass = null;<a name="line.777"></a>
 <span class="sourceLineNo">778</span><a name="line.778"></a>
-<span class="sourceLineNo">779</span>  /**<a name="line.779"></a>
-<span class="sourceLineNo">780</span>   * Log the current state of the filesystem from a certain root directory<a name="line.780"></a>
-<span class="sourceLineNo">781</span>   * @param fs filesystem to investigate<a name="line.781"></a>
-<span class="sourceLineNo">782</span>   * @param root root file/directory to start logging from<a name="line.782"></a>
-<span class="sourceLineNo">783</span>   * @param log log to output information<a name="line.783"></a>
-<span class="sourceLineNo">784</span>   * @throws IOException if an unexpected exception occurs<a name="line.784"></a>
-<span class="sourceLineNo">785</span>   */<a name="line.785"></a>
-<span class="sourceLineNo">786</span>  public static void logFileSystemState(final FileSystem fs, final Path root, Logger log)<a name="line.786"></a>
-<span class="sourceLineNo">787</span>      throws IOException {<a name="line.787"></a>
-<span class="sourceLineNo">788</span>    log.debug("File system contents for path {}", root);<a name="line.788"></a>
-<span class="sourceLineNo">789</span>    logFSTree(log, fs, root, "|-");<a name="line.789"></a>
-<span class="sourceLineNo">790</span>  }<a name="line.790"></a>
-<span class="sourceLineNo">791</span><a name="line.791"></a>
-<span class="sourceLineNo">792</span>  /**<a name="line.792"></a>
-<span class="sourceLineNo">793</span>   * Recursive helper to log the state of the FS<a name="line.793"></a>
-<span class="sourceLineNo">794</span>   *<a name="line.794"></a>
-<span class="sourceLineNo">795</span>   * @see #logFileSystemState(FileSystem, Path, Logger)<a name="line.795"></a>
-<span class="sourceLineNo">796</span>   */<a name="line.796"></a>
-<span class="sourceLineNo">797</span>  private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)<a name="line.797"></a>
-<span class="sourceLineNo">798</span>      throws IOException {<a name="line.798"></a>
-<span class="sourceLineNo">799</span>    FileStatus[] files = listStatus(fs, root, null);<a name="line.799"></a>
-<span class="sourceLineNo">800</span>    if (files == null) {<a name="line.800"></a>
-<span class="sourceLineNo">801</span>      return;<a name="line.801"></a>
-<span class="sourceLineNo">802</span>    }<a name="line.802"></a>
-<span class="sourceLineNo">803</span><a name="line.803"></a>
-<span class="sourceLineNo">804</span>    for (FileStatus file : files) {<a name="line.804"></a>
-<span class="sourceLineNo">805</span>      if (file.isDirectory()) {<a name="line.805"></a>
-<span class="sourceLineNo">806</span>        log.debug(prefix + file.getPath().getName() + "/");<a name="line.806"></a>
-<span class="sourceLineNo">807</span>        logFSTree(log, fs, file.getPath(), prefix + "---");<a name="line.807"></a>
-<span class="sourceLineNo">808</span>      } else {<a name="line.808"></a>
-<span class="sourceLineNo">809</span>        log.debug(prefix + file.getPath().getName());<a name="line.809"></a>
-<span class="sourceLineNo">810</span>      }<a name="line.810"></a>
-<span class="sourceLineNo">811</span>    }<a name="line.811"></a>
-<span class="sourceLineNo">812</span>  }<a name="line.812"></a>
-<span class="sourceLineNo">813</span><a name="line.813"></a>
-<span class="sourceLineNo">814</span>  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest)<a name="line.814"></a>
-<span class="sourceLineNo">815</span>      throws IOException {<a name="line.815"></a>
-<span class="sourceLineNo">816</span>    // set the modify time for TimeToLive Cleaner<a name="line.816"></a>
-<span class="sourceLineNo">817</span>    fs.setTimes(src, EnvironmentEdgeManager.currentTime(), -1);<a name="line.817"></a>
-<span class="sourceLineNo">818</span>    return fs.rename(src, dest);<a name="line.818"></a>
-<span class="sourceLineNo">819</span>  }<a name="line.819"></a>
-<span class="sourceLineNo">820</span><a name="line.820"></a>
-<span class="sourceLineNo">821</span>  /**<a name="line.821"></a>
-<span class="sourceLineNo">822</span>   * Check if short circuit read buffer size is set and if not, set it to hbase value.<a name="line.822"></a>
-<span class="sourceLineNo">823</span>   * @param conf must not be null<a name="line.823"></a>
-<span class="sourceLineNo">824</span>   */<a name="line.824"></a>
-<span class="sourceLineNo">825</span>  public static void checkShortCircuitReadBufferSize(final Configuration conf) {<a name="line.825"></a>
-<span class="sourceLineNo">826</span>    final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;<a name="line.826"></a>
-<span class="sourceLineNo">827</span>    final int notSet = -1;<a name="line.827"></a>
-<span class="sourceLineNo">828</span>    // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2<a name="line.828"></a>
-<span class="sourceLineNo">829</span>    final String dfsKey = "dfs.client.read.shortcircuit.buffer.size";<a name="line.829"></a>
-<span class="sourceLineNo">830</span>    int size = conf.getInt(dfsKey, notSet);<a name="line.830"></a>
-<span class="sourceLineNo">831</span>    // If a size is set, return -- we will use it.<a name="line.831"></a>
-<span class="sourceLineNo">832</span>    if (size != notSet) {<a name="line.832"></a>
-<span class="sourceLineNo">833</span>      return;<a name="line.833"></a>
-<span class="sourceLineNo">834</span>    }<a name="line.834"></a>
-<span class="sourceLineNo">835</span>    // But short circuit buffer size is normally not set.  Put in place the hbase wanted size.<a name="line.835"></a>
-<span class="sourceLineNo">836</span>    int hbaseSize = conf.getInt("hbase." + dfsKey, defaultSize);<a name="line.836"></a>
-<span class="sourceLineNo">837</span>    conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));<a name="line.837"></a>
-<span class="sourceLineNo">838</span>  }<a name="line.838"></a>
-<span class="sourceLineNo">839</span><a name="line.839"></a>
-<span class="sourceLineNo">840</span>  private static class DfsBuilderUtility {<a name="line.840"></a>
-<span class="sourceLineNo">841</span>    static Class&lt;?&gt; dfsClass = null;<a name="line.841"></a>
-<span class="sourceLineNo">842</span>    static Method createMethod;<a name="line.842"></a>
-<span class="sourceLineNo">843</span>    static Method overwriteMethod;<a name="line.843"></a>
-<span class="sourceLineNo">844</span>    static Method bufferSizeMethod;<a name="line.844"></a>
-<span class="sourceLineNo">845</span>    static Method blockSizeMethod;<a name="line.845"></a>
-<span class="sourceLineNo">846</span>    static Method recursiveMethod;<a name="line.846"></a>
-<span class="sourceLineNo">847</span>    static Method replicateMethod;<a name="line.847"></a>
-<span class="sourceLineNo">848</span>    static Method replicationMethod;<a name="line.848"></a>
-<span class="sourceLineNo">849</span>    static Method buildMethod;<a name="line.849"></a>
-<span class="sourceLineNo">850</span>    static boolean allMethodsPresent = false;<a name="line.850"></a>
+<span class="sourceLineNo">779</span>      try {<a name="line.779"></a>
+<span class="sourceLineNo">780</span>        dfsClass = Class.forName(dfsName);<a name="line.780"></a>
+<span class="sourceLineNo">781</span>      } catch (ClassNotFoundException e) {<a name="line.781"></a>
+<span class="sourceLineNo">782</span>        LOG.debug("{} not available, will not use builder API for file creation.", dfsName);<a name="line.782"></a>
+<span class="sourceLineNo">783</span>      }<a name="line.783"></a>
+<span class="sourceLineNo">784</span>      try {<a name="line.784"></a>
+<span class="sourceLineNo">785</span>        builderClass = Class.forName(builderName);<a name="line.785"></a>
+<span class="sourceLineNo">786</span>      } catch (ClassNotFoundException e) {<a name="line.786"></a>
+<span class="sourceLineNo">787</span>        LOG.debug("{} not available, will not use builder API for file creation.", builderName);<a name="line.787"></a>
+<span class="sourceLineNo">788</span>      }<a name="line.788"></a>
+<span class="sourceLineNo">789</span><a name="line.789"></a>
+<span class="sourceLineNo">790</span>      if (dfsClass != null &amp;&amp; builderClass != null) {<a name="line.790"></a>
+<span class="sourceLineNo">791</span>        try {<a name="line.791"></a>
+<span class="sourceLineNo">792</span>          createMethod = dfsClass.getMethod("createFile", Path.class);<a name="line.792"></a>
+<span class="sourceLineNo">793</span>          overwriteMethod = builderClass.getMethod("overwrite", boolean.class);<a name="line.793"></a>
+<span class="sourceLineNo">794</span>          bufferSizeMethod = builderClass.getMethod("bufferSize", int.class);<a name="line.794"></a>
+<span class="sourceLineNo">795</span>          blockSizeMethod = builderClass.getMethod("blockSize", long.class);<a name="line.795"></a>
+<span class="sourceLineNo">796</span>          recursiveMethod = builderClass.getMethod("recursive");<a name="line.796"></a>
+<span class="sourceLineNo">797</span>          replicateMethod = builderClass.getMethod("replicate");<a name="line.797"></a>
+<span class="sourceLineNo">798</span>          replicationMethod = builderClass.getMethod("replication", short.class);<a name="line.798"></a>
+<span class="sourceLineNo">799</span>          buildMethod = builderClass.getMethod("build");<a name="line.799"></a>
+<span class="sourceLineNo">800</span><a name="line.800"></a>
+<span class="sourceLineNo">801</span>          allMethodsPresent = true;<a name="line.801"></a>
+<span class="sourceLineNo">802</span>          LOG.debug("Using builder API via reflection for DFS file creation.");<a name="line.802"></a>
+<span class="sourceLineNo">803</span>        } catch (NoSuchMethodException e) {<a name="line.803"></a>
+<span class="sourceLineNo">804</span>          LOG.debug("Could not find method on builder; will use old DFS API for file creation {}",<a name="line.804"></a>
+<span class="sourceLineNo">805</span>              e.getMessage());<a name="line.805"></a>
+<span class="sourceLineNo">806</span>        }<a name="line.806"></a>
+<span class="sourceLineNo">807</span>      }<a name="line.807"></a>
+<span class="sourceLineNo">808</span>    }<a name="line.808"></a>
+<span class="sourceLineNo">809</span><a name="line.809"></a>
+<span class="sourceLineNo">810</span>    /**<a name="line.810"></a>
+<span class="sourceLineNo">811</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.811"></a>
+<span class="sourceLineNo">812</span>     * replication enabled.<a name="line.812"></a>
+<span class="sourceLineNo">813</span>     */<a name="line.813"></a>
+<span class="sourceLineNo">814</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable,<a name="line.814"></a>
+<span class="sourceLineNo">815</span>        int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.815"></a>
+<span class="sourceLineNo">816</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.816"></a>
+<span class="sourceLineNo">817</span>        try {<a name="line.817"></a>
+<span class="sourceLineNo">818</span>          Object builder;<a name="line.818"></a>
+<span class="sourceLineNo">819</span><a name="line.819"></a>
+<span class="sourceLineNo">820</span>          builder = createMethod.invoke(fs, path);<a name="line.820"></a>
+<span class="sourceLineNo">821</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.821"></a>
+<span class="sourceLineNo">822</span>          builder = bufferSizeMethod.invoke(builder, bufferSize);<a name="line.822"></a>
+<span class="sourceLineNo">823</span>          builder = blockSizeMethod.invoke(builder, blockSize);<a name="line.823"></a>
+<span class="sourceLineNo">824</span>          if (isRecursive) {<a name="line.824"></a>
+<span class="sourceLineNo">825</span>            builder = recursiveMethod.invoke(builder);<a name="line.825"></a>
+<span class="sourceLineNo">826</span>          }<a name="line.826"></a>
+<span class="sourceLineNo">827</span>          builder = replicateMethod.invoke(builder);<a name="line.827"></a>
+<span class="sourceLineNo">828</span>          builder = replicationMethod.invoke(builder, replication);<a name="line.828"></a>
+<span class="sourceLineNo">829</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.829"></a>
+<span class="sourceLineNo">830</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.830"></a>
+<span class="sourceLineNo">831</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.831"></a>
+<span class="sourceLineNo">832</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.832"></a>
+<span class="sourceLineNo">833</span>        }<a name="line.833"></a>
+<span class="sourceLineNo">834</span>      }<a name="line.834"></a>
+<span class="sourceLineNo">835</span><a name="line.835"></a>
+<span class="sourceLineNo">836</span>      if (isRecursive) {<a name="line.836"></a>
+<span class="sourceLineNo">837</span>        return fs.create(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.837"></a>
+<span class="sourceLineNo">838</span>      }<a name="line.838"></a>
+<span class="sourceLineNo">839</span>      return fs.createNonRecursive(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.839"></a>
+<span class="sourceLineNo">840</span>    }<a name="line.840"></a>
+<span class="sourceLineNo">841</span><a name="line.841"></a>
+<span class="sourceLineNo">842</span>    /**<a name="line.842"></a>
+<span class="sourceLineNo">843</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.843"></a>
+<span class="sourceLineNo">844</span>     * replication enabled.<a name="line.844"></a>
+<span class="sourceLineNo">845</span>     */<a name="line.845"></a>
+<span class="sourceLineNo">846</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable)<a name="line.846"></a>
+<span class="sourceLineNo">847</span>        throws IOException {<a name="line.847"></a>
+<span class="sourceLineNo">848</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.848"></a>
+<span class="sourceLineNo">849</span>        try {<a name="line.849"></a>
+<span class="sourceLineNo">850</span>          Object builder;<a name="line.850"></a>
 <span class="sourceLineNo">851</span><a name="line.851"></a>
-<span class="sourceLineNo">852</span>    static {<a name="line.852"></a>
-<span class="sourceLineNo">853</span>      String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";<a name="line.853"></a>
-<span class="sourceLineNo">854</span>      String builderName = dfsName + "$HdfsDataOutputStreamBuilder";<a name="line.854"></a>
-<span class="sourceLineNo">855</span>      Class&lt;?&gt; builderClass = null;<a name="line.855"></a>
-<span class="sourceLineNo">856</span><a name="line.856"></a>
-<span class="sourceLineNo">857</span>      try {<a name="line.857"></a>
-<span class="sourceLineNo">858</span>        dfsClass = Class.forName(dfsName);<a name="line.858"></a>
-<span class="sourceLineNo">859</span>      } catch (ClassNotFoundException e) {<a name="line.859"></a>
-<span class="sourceLineNo">860</span>        LOG.debug("{} not available, will not use builder API for file creation.", dfsName);<a name="line.860"></a>
-<span class="sourceLineNo">861</span>      }<a name="line.861"></a>
-<span class="sourceLineNo">862</span>      try {<a name="line.862"></a>
-<span class="sourceLineNo">863</span>        builderClass = Class.forName(builderName);<a name="line.863"></a>
-<span class="sourceLineNo">864</span>      } catch (ClassNotFoundException e) {<a name="line.864"></a>
-<span class="sourceLineNo">865</span>        LOG.debug("{} not available, will not use builder API for file creation.", builderName);<a name="line.865"></a>
-<span class="sourceLineNo">866</span>      }<a name="line.866"></a>
-<span class="sourceLineNo">867</span><a name="line.867"></a>
-<span class="sourceLineNo">868</span>      if (dfsClass != null &amp;&amp; builderClass != null) {<a name="line.868"></a>
-<span class="sourceLineNo">869</span>        try {<a name="line.869"></a>
-<span class="sourceLineNo">870</span>          createMethod = dfsClass.getMethod("createFile", Path.class);<a name="line.870"></a>
-<span class="sourceLineNo">871</span>          overwriteMethod = builderClass.getMethod("overwrite", boolean.class);<a name="line.871"></a>
-<span class="sourceLineNo">872</span>          bufferSizeMethod = builderClass.getMethod("bufferSize", int.class);<a name="line.872"></a>
-<span class="sourceLineNo">873</span>          blockSizeMethod = builderClass.getMethod("blockSize", long.class);<a name="line.873"></a>
-<span class="sourceLineNo">874</span>          recursiveMethod = builderClass.getMethod("recursive");<a name="line.874"></a>
-<span class="sourceLineNo">875</span>          replicateMethod = builderClass.getMethod("replicate");<a name="line.875"></a>
-<span class="sourceLineNo">876</span>          replicationMethod = builderClass.getMethod("replication", short.class);<a name="line.876"></a>
-<span class="sourceLineNo">877</span>          buildMethod = builderClass.getMethod("build");<a name="line.877"></a>
-<span class="sourceLineNo">878</span><a name="line.878"></a>
-<span class="sourceLineNo">879</span>          allMethodsPresent = true;<a name="line.879"></a>
-<span class="sourceLineNo">880</span>          LOG.debug("Using builder API via reflection for DFS file creation.");<a name="line.880"></a>
-<span class="sourceLineNo">881</span>        } catch (NoSuchMethodException e) {<a name="line.881"></a>
-<span class="sourceLineNo">882</span>          LOG.debug("Could not find method on builder; will use old DFS API for file creation {}",<a name="line.882"></a>
-<span class="sourceLineNo">883</span>              e.getMessage());<a name="line.883"></a>
-<span class="sourceLineNo">884</span>        }<a name="line.884"></a>
-<span class="sourceLineNo">885</span>      }<a name="line.885"></a>
-<span class="sourceLineNo">886</span>    }<a name="line.886"></a>
-<span class="sourceLineNo">887</span><a name="line.887"></a>
-<span class="sourceLineNo">888</span>    /**<a name="line.888"></a>
-<span class="sourceLineNo">889</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.889"></a>
-<span class="sourceLineNo">890</span>     * replication enabled.<a name="line.890"></a>
-<span class="sourceLineNo">891</span>     */<a name="line.891"></a>
-<span class="sourceLineNo">892</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable,<a name="line.892"></a>
-<span class="sourceLineNo">893</span>        int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.893"></a>
-<span class="sourceLineNo">894</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.894"></a>
-<span class="sourceLineNo">895</span>        try {<a name="line.895"></a>
-<span class="sourceLineNo">896</span>          Object builder;<a name="line.896"></a>
-<span class="sourceLineNo">897</span><a name="line.897"></a>
-<span class="sourceLineNo">898</span>          builder = createMethod.invoke(fs, path);<a name="line.898"></a>
-<span class="sourceLineNo">899</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.899"></a>
-<span class="sourceLineNo">900</span>          builder = bufferSizeMethod.invoke(builder, bufferSize);<a name="line.900"></a>
-<span class="sourceLineNo">901</span>          builder = blockSizeMethod.invoke(builder, blockSize);<a name="line.901"></a>
-<span class="sourceLineNo">902</span>          if (isRecursive) {<a name="line.902"></a>
-<span class="sourceLineNo">903</span>            builder = recursiveMethod.invoke(builder);<a name="line.903"></a>
-<span class="sourceLineNo">904</span>          }<a name="line.904"></a>
-<span class="sourceLineNo">905</span>          builder = replicateMethod.invoke(builder);<a name="line.905"></a>
-<span class="sourceLineNo">906</span>          builder = replicationMethod.invoke(builder, replication);<a name="line.906"></a>
-<span class="sourceLineNo">907</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.907"></a>
-<span class="sourceLineNo">908</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.908"></a>
-<span class="sourceLineNo">909</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.909"></a>
-<span class="sourceLineNo">910</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.910"></a>
-<span class="sourceLineNo">911</span>        }<a name="line.911"></a>
-<span class="sourceLineNo">912</span>      }<a name="line.912"></a>
-<span class="sourceLineNo">913</span><a name="line.913"></a>
-<span class="sourceLineNo">914</span>      if (isRecursive) {<a name="line.914"></a>
-<span class="sourceLineNo">915</span>        return fs.create(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.915"></a>
-<span class="sourceLineNo">916</span>      }<a name="line.916"></a>
-<span class="sourceLineNo">917</span>      return fs.createNonRecursive(path, overwritable, bufferSize, replication, blockSize, null);<a name="line.917"></a>
+<span class="sourceLineNo">852</span>          builder = createMethod.invoke(fs, path);<a name="line.852"></a>
+<span class="sourceLineNo">853</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.853"></a>
+<span class="sourceLineNo">854</span>          builder = replicateMethod.invoke(builder);<a name="line.854"></a>
+<span class="sourceLineNo">855</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.855"></a>
+<span class="sourceLineNo">856</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.856"></a>
+<span class="sourceLineNo">857</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.857"></a>
+<span class="sourceLineNo">858</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.858"></a>
+<span class="sourceLineNo">859</span>        }<a name="line.859"></a>
+<span class="sourceLineNo">860</span>      }<a name="line.860"></a>
+<span class="sourceLineNo">861</span><a name="line.861"></a>
+<span class="sourceLineNo">862</span>      return fs.create(path, overwritable);<a name="line.862"></a>
+<span class="sourceLineNo">863</span>    }<a name="line.863"></a>
+<span class="sourceLineNo">864</span>  }<a name="line.864"></a>
+<span class="sourceLineNo">865</span><a name="line.865"></a>
+<span class="sourceLineNo">866</span>  /**<a name="line.866"></a>
+<span class="sourceLineNo">867</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.867"></a>
+<span class="sourceLineNo">868</span>   * replication enabled.<a name="line.868"></a>
+<span class="sourceLineNo">869</span>   * &lt;p&gt;<a name="line.869"></a>
+<span class="sourceLineNo">870</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.870"></a>
+<span class="sourceLineNo">871</span>   */<a name="line.871"></a>
+<span class="sourceLineNo">872</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable)<a name="line.872"></a>
+<span class="sourceLineNo">873</span>      throws IOException {<a name="line.873"></a>
+<span class="sourceLineNo">874</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable);<a name="line.874"></a>
+<span class="sourceLineNo">875</span>  }<a name="line.875"></a>
+<span class="sourceLineNo">876</span><a name="line.876"></a>
+<span class="sourceLineNo">877</span>  /**<a name="line.877"></a>
+<span class="sourceLineNo">878</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.878"></a>
+<span class="sourceLineNo">879</span>   * replication enabled.<a name="line.879"></a>
+<span class="sourceLineNo">880</span>   * &lt;p&gt;<a name="line.880"></a>
+<span class="sourceLineNo">881</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.881"></a>
+<span class="sourceLineNo">882</span>   */<a name="line.882"></a>
+<span class="sourceLineNo">883</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable,<a name="line.883"></a>
+<span class="sourceLineNo">884</span>      int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.884"></a>
+<span class="sourceLineNo">885</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable, bufferSize, replication,<a name="line.885"></a>
+<span class="sourceLineNo">886</span>        blockSize, isRecursive);<a name="line.886"></a>
+<span class="sourceLineNo">887</span>  }<a name="line.887"></a>
+<span class="sourceLineNo">888</span><a name="line.888"></a>
+<span class="sourceLineNo">889</span>  // Holder singleton idiom. JVM spec ensures this will be run at most once per Classloader, and<a name="line.889"></a>
+<span class="sourceLineNo">890</span>  // not until we attempt to reference it.<a name="line.890"></a>
+<span class="sourceLineNo">891</span>  private static class StreamCapabilities {<a name="line.891"></a>
+<span class="sourceLineNo">892</span>    public static final boolean PRESENT;<a name="line.892"></a>
+<span class="sourceLineNo">893</span>    public static final Class&lt;?&gt; CLASS;<a name="line.893"></a>
+<span class="sourceLineNo">894</span>    public static final Method METHOD;<a name="line.894"></a>
+<span class="sourceLineNo">895</span>    static {<a name="line.895"></a>
+<span class="sourceLineNo">896</span>      boolean tmp = false;<a name="line.896"></a>
+<span class="sourceLineNo">897</span>      Class&lt;?&gt; clazz = null;<a name="line.897"></a>
+<span class="sourceLineNo">898</span>      Method method = null;<a name="line.898"></a>
+<span class="sourceLineNo">899</span>      try {<a name="line.899"></a>
+<span class="sourceLineNo">900</span>        clazz = Class.forName("org.apache.hadoop.fs.StreamCapabilities");<a name="line.900"></a>
+<span class="sourceLineNo">901</span>        method = clazz.getMethod("hasCapability", String.class);<a name="line.901"></a>
+<span class="sourceLineNo">902</span>        tmp = true;<a name="line.902"></a>
+<span class="sourceLineNo">903</span>      } catch(ClassNotFoundException|NoSuchMethodException|SecurityException exception) {<a name="line.903"></a>
+<span class="sourceLineNo">904</span>        LOG.warn("Your Hadoop installation does not include the StreamCapabilities class from " +<a name="line.904"></a>
+<span class="sourceLineNo">905</span>                 "HDFS-11644, so we will skip checking if any FSDataOutputStreams actually " +<a name="line.905"></a>
+<span class="sourceLineNo">906</span>                 "support hflush/hsync. If you are running on top of HDFS this probably just " +<a name="line.906"></a>
+<span class="sourceLineNo">907</span>                 "means you have an older version and this can be ignored. If you are running on " +<a name="line.907"></a>
+<span class="sourceLineNo">908</span>                 "top of an alternate FileSystem implementation you should manually verify that " +<a name="line.908"></a>
+<span class="sourceLineNo">909</span>                 "hflush and hsync are implemented; otherwise you risk data loss and hard to " +<a name="line.909"></a>
+<span class="sourceLineNo">910</span>                 "diagnose errors when our assumptions are violated.");<a name="line.910"></a>
+<span class="sourceLineNo">911</span>        LOG.debug("The first request to check for StreamCapabilities came from this stacktrace.",<a name="line.911"></a>
+<span class="sourceLineNo">912</span>            exception);<a name="line.912"></a>
+<span class="sourceLineNo">913</span>      } finally {<a name="line.913"></a>
+<span class="sourceLineNo">914</span>        PRESENT = tmp;<a name="line.914"></a>
+<span class="sourceLineNo">915</span>        CLASS = clazz;<a name="line.915"></a>
+<span class="sourceLineNo">916</span>        METHOD = method;<a name="line.916"></a>
+<span class="sourceLineNo">917</span>      }<a name="line.917"></a>
 <span class="sourceLineNo">918</span>    }<a name="line.918"></a>
-<span class="sourceLineNo">919</span><a name="line.919"></a>
-<span class="sourceLineNo">920</span>    /**<a name="line.920"></a>
-<span class="sourceLineNo">921</span>     * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.921"></a>
-<span class="sourceLineNo">922</span>     * replication enabled.<a name="line.922"></a>
-<span class="sourceLineNo">923</span>     */<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    static FSDataOutputStream createHelper(FileSystem fs, Path path, boolean overwritable)<a name="line.924"></a>
-<span class="sourceLineNo">925</span>        throws IOException {<a name="line.925"></a>
-<span class="sourceLineNo">926</span>      if (allMethodsPresent &amp;&amp; dfsClass.isInstance(fs)) {<a name="line.926"></a>
-<span class="sourceLineNo">927</span>        try {<a name="line.927"></a>
-<span class="sourceLineNo">928</span>          Object builder;<a name="line.928"></a>
-<span class="sourceLineNo">929</span><a name="line.929"></a>
-<span class="sourceLineNo">930</span>          builder = createMethod.invoke(fs, path);<a name="line.930"></a>
-<span class="sourceLineNo">931</span>          builder = overwriteMethod.invoke(builder, overwritable);<a name="line.931"></a>
-<span class="sourceLineNo">932</span>          builder = replicateMethod.invoke(builder);<a name="line.932"></a>
-<span class="sourceLineNo">933</span>          return (FSDataOutputStream) buildMethod.invoke(builder);<a name="line.933"></a>
-<span class="sourceLineNo">934</span>        } catch (IllegalAccessException | InvocationTargetException e) {<a name="line.934"></a>
-<span class="sourceLineNo">935</span>          // Should have caught this failure during initialization, so log full trace here<a name="line.935"></a>
-<span class="sourceLineNo">936</span>          LOG.warn("Couldn't use reflection with builder API", e);<a name="line.936"></a>
-<span class="sourceLineNo">937</span>        }<a name="line.937"></a>
-<span class="sourceLineNo">938</span>      }<a name="line.938"></a>
-<span class="sourceLineNo">939</span><a name="line.939"></a>
-<span class="sourceLineNo">940</span>      return fs.create(path, overwritable);<a name="line.940"></a>
-<span class="sourceLineNo">941</span>    }<a name="line.941"></a>
-<span class="sourceLineNo">942</span>  }<a name="line.942"></a>
-<span class="sourceLineNo">943</span><a name="line.943"></a>
-<span class="sourceLineNo">944</span>  /**<a name="line.944"></a>
-<span class="sourceLineNo">945</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.945"></a>
-<span class="sourceLineNo">946</span>   * replication enabled.<a name="line.946"></a>
-<span class="sourceLineNo">947</span>   * &lt;p&gt;<a name="line.947"></a>
-<span class="sourceLineNo">948</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.948"></a>
-<span class="sourceLineNo">949</span>   */<a name="line.949"></a>
-<span class="sourceLineNo">950</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable)<a name="line.950"></a>
-<span class="sourceLineNo">951</span>      throws IOException {<a name="line.951"></a>
-<span class="sourceLineNo">952</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable);<a name="line.952"></a>
-<span class="sourceLineNo">953</span>  }<a name="line.953"></a>
-<span class="sourceLineNo">954</span><a name="line.954"></a>
-<span class="sourceLineNo">955</span>  /**<a name="line.955"></a>
-<span class="sourceLineNo">956</span>   * Attempt to use builder API via reflection to create a file with the given parameters and<a name="line.956"></a>
-<span class="sourceLineNo">957</span>   * replication enabled.<a name="line.957"></a>
-<span class="sourceLineNo">958</span>   * &lt;p&gt;<a name="line.958"></a>
-<span class="sourceLineNo">959</span>   * Will not attempt to enable replication when passed an HFileSystem.<a name="line.959"></a>
-<span class="sourceLineNo">960</span>   */<a name="line.960"></a>
-<span class="sourceLineNo">961</span>  public static FSDataOutputStream createForWal(FileSystem fs, Path path, boolean overwritable,<a name="line.961"></a>
-<span class="sourceLineNo">962</span>      int bufferSize, short replication, long blockSize, boolean isRecursive) throws IOException {<a name="line.962"></a>
-<span class="sourceLineNo">963</span>    return DfsBuilderUtility.createHelper(fs, path, overwritable, bufferSize, replication,<a name="line.963"></a>
-<span class="sourceLineNo">964</span>        blockSize, isRecursive);<a name="line.964"></a>
-<span class="sourceLineNo">965</span>  }<a name="line.965"></a>
-<span class="sourceLineNo">966</span><a name="line.966"></a>
-<span class="sourceLineNo">967</span>  // Holder singleton idiom. JVM spec ensures this will be run at most once per Classloader, and<a name="line.967"></a>
-<span class="sourceLineNo">968</span>  // not until we attempt to reference it.<a name="line.968"></a>
-<span class="sourceLineNo">969</span>  private static class StreamCapabilities {<a name="line.969"></a>
-<span class="sourceLineNo">970</span>    public static final boolean PRESENT;<a name="line.970"></a>
-<span class="sourceLineNo">971</span>    public static final Class&lt;?&gt; CLASS;<a name="line.971"></a>
-<span class="sourceLineNo">972</span>    public static final Method METHOD;<a name="line.972"></a>
-<span class="sourceLineNo">973</span>    static {<a name="line.973"></a>
-<span class="sourceLineNo">974</span>      boolean tmp = false;<a name="line.974"></a>
-<span class="sourceLineNo">975</span>      Class&lt;?&gt; clazz = null;<a name="line.975"></a>
-<span class="sourceLineNo">976</span>      Method method = null;<a name="line.976"></a>
-<span class="sourceLineNo">977</span>      try {<a name="line.977"></a>
-<span class="sourceLineNo">978</span>        clazz = Class.forName("org.apache.hadoop.fs.StreamCapabilities");<a name="line.978"></a>
-<span class="sourceLineNo">979</span>        method = clazz.getMethod("hasCapability", String.class);<a name="line.979"></a>
-<span class="sourceLineNo">980</span>        tmp = true;<a name="line.980"></a>
-<span class="sourceLineNo">981</span>      } catch(ClassNotFoundException|NoSuchMethodException|SecurityException exception) {<a name="line.981"></a>
-<span class="sourceLineNo">982</span>        LOG.warn("Your Hadoop installation does not include the StreamCapabilities class from " +<a name="line.982"></a>
-<span class="sourceLineNo">983</span>                 "HDFS-11644, so we will skip checking if any FSDataOutputStreams actually " +<a name="line.983"></a>
-<span class="sourceLineNo">984</span>                 "support hflush/hsync. If you are running on top of HDFS this probably just " +<a name="line.984"></a>
-<span class="sourceLineNo">985</span>                 "means you have an older version and this can be ignored. If you are running on " +<a name="line.985"></a>
-<span class="sourceLineNo">986</span>                 "top of an alternate FileSystem implementation you should manually verify that " +<a name="line.986"></a>
-<span class="sourceLineNo">987</span>                 "hflush and hsync are implemented; otherwise you risk data loss and hard to " +<a name="line.987"></a>
-<span class="sourceLineNo">988</span>                 "diagnose errors when our assumptions are violated.");<a name="line.988"></a>
-<span class="sourceLineNo">989</span>        LOG.debug("The first request to check for StreamCapabilities came from this stacktrace.",<a name="line.989"></a>
-<span class="sourceLineNo">990</span>            exception);<a name="line.990"></a>
-<span class="sourceLineNo">991</span>      } finally {<a name="line.991"></a>
-<span class="sourceLineNo">992</span>        PRESENT = tmp;<a name="line.992"></a>
-<span class="sourceLineNo">993</span>        CLASS = clazz;<a name="line.993"></a>
-<span class="sourceLineNo">994</span>        METHOD = method;<a name="line.994"></a>
-<span class="sourceLineNo">995</span>      }<a name="line.995"></a>
-<span class="sourceLineNo">996</span>    }<a name="line.996"></a>
-<span class="sourceLineNo">997</span>  }<a name="line.997"></a>
-<span class="sourceLineNo">998</span><a name="line.998"></a>
-<span class="sourceLineNo">999</span>  /**<a name="line.999"></a>
-<span class="sourceLineNo">1000</span>   * If our FileSystem version includes the StreamCapabilities class, check if the given stream has<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>   * a particular capability.<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>   * @param stream capabilities are per-stream instance, so check this one specifically. must not be<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>   *          null<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>   * @param capability what to look for, per Hadoop Common's FileSystem docs<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>   * @return true if there are no StreamCapabilities. false if there are, but this stream doesn't<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>   *         implement it. return result of asking the stream otherwise.<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>   * @throws NullPointerException if {@code stream} is {@code null}<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>   */<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>  public static boolean hasCapability(FSDataOutputStream stream, String capability) {<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>    // be consistent whether or not StreamCapabilities is present<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>    Objects.requireNonNull(stream, "stream cannot be null");<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>    // If o.a.h.fs.StreamCapabilities doesn't exist, assume everyone does everything<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>    // otherwise old versions of Hadoop will break.<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>    boolean result = true;<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>    if (StreamCapabilities.PRESENT) {<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>      // if StreamCapabilities is present, but the stream doesn't implement it<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>      // or we run into a problem invoking the method,<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>      // we treat that as equivalent to not declaring anything<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>      result = false;<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>      if (StreamCapabilities.CLASS.isAssignableFrom(stream.getClass())) {<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>        try {<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>          result = ((Boolean)StreamCapabilities.METHOD.invoke(stream, capability)).booleanValue();<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>            exception) {<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>          LOG.warn("Your Hadoop installation's StreamCapabilities implementation doesn't match " +<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>              "our understanding of how it's supposed to work. Please file a JIRA and include " +<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>              "the following stack trace. In the mean time we're interpreting this behavior " +<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span>              "difference as a lack of capability support, which will probably cause a failure.",<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>              exception);<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>        }<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span>      }<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>    }<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>    return result;<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>  }<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span><a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>  /**<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>   * Helper exception for those cases where the place where we need to check a stream capability<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>   * is not where we have the needed context to explain the impact and mitigation for a lack.<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>   */<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>  public static class StreamLacksCapabilityException extends Exception {<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>    public StreamLacksCapabilityException(String message, Throwable cause) {<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>      super(message, cause);<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>    }<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>    public StreamLacksCapabilityException(String message) {<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>      super(message);<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>    }<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>  }<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>}<a name="line.1048"></a>
+<span class="sourceLineNo">919</span>  }<a name="line.919"></a>
+<span class="sourceLineNo">920</span><a name="line.920"></a>
+<span class="sourceLineNo">921</span>  /**<a name="line.921"></a>
+<span class="sourceLineNo">922</span>   * If our FileSystem version includes the StreamCapabilities class, check if the given stream has<a name="line.922"></a>
+<span class="sourceLineNo">923</span>   * a particular capability.<a name="line.923"></a>
+<span class="sourceLineNo">924</span>   * @param stream capabilities are per-stream instance, so check this one specifically. must not be<a name="line.924"></a>
+<span class="sourceLineNo">925</span>   *          null<a name="line.925"></a>
+<span class="sourceLineNo">926</span>   * @param capability what to look for, per Hadoop Common's FileSystem docs<a name="line.926"></a>
+<span class="sourceLineNo">927</span>   * @return true if there are no StreamCapabilities. false if there are, but this stream doesn't<a name="line.927"></a>
+<span class="sourceLineNo">928</span>   *         implement it. return result of asking the stream otherwise.<a name="line.928"></a>
+<span class="sourceLineNo">929</span>   * @throws NullPointerException if {@code stream} is {@code null}<a name="line.929"></a>
+<span class="sourceLineNo">930</span>   */<a name="line.930"></a>
+<span class="sourceLineNo">931</span>  public static boolean hasCapability(FSDataOutputStream stream, String capability) {<a name="line.931"></a>
+<span class="sourceLineNo">932</span>    // be consistent whether or not StreamCapabilities is present<a name="line.932"></a>
+<span class="sourceLineNo">933</span>    Objects.requireNonNull(stream, "stream cannot be null");<a name="line.933"></a>
+<span class="sourceLineNo">934</span>    // If o.a.h.fs.StreamCapabilities doesn't exist, assume everyone does everything<a name="line.934"></a>
+<span class="sourceLineNo">935</span>    // otherwise old versions of Hadoop will break.<a name="line.935"></a>
+<span class="sourceLineNo">936</span>    boolean result = true;<a name="line.936"></a>
+<span class="sourceLineNo">937</span>    if (StreamCapabilities.PRESENT) {<a name="line.937"></a>
+<span class="sourceLineNo">938</span>      // if StreamCapabilities is present, but the stream doesn't implement it<a name="line.938"></a>
+<span class="sourceLineNo">939</span>      // or we run into a problem invoking the method,<a name="line.939"></a>
+<span class="sourceLineNo">940</span>      // we treat that as equivalent to not declaring anything<a name="line.940"></a>
+<span class="sourceLineNo">941</span>      result = false;<a name="line.941"></a>
+<span class="sourceLineNo">942</span>      if (StreamCapabilities.CLASS.isAssignableFrom(stream.getClass())) {<a name="line.942"></a>
+<span class="sourceLineNo">943</span>        try {<a name="line.943"></a>
+<span class="sourceLineNo">944</span>          result = ((Boolean)StreamCapabilities.METHOD.invoke(stream, capability)).booleanValue();<a name="line.944"></a>
+<span class="sourceLineNo">945</span>        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException<a name="line.945"></a>
+<span class="sourceLineNo">946</span>            exception) {<a name="line.946"></a>
+<span class="sourceLineNo">947</span>          LOG.warn("Your Hadoop installation's StreamCapabilities implementation doesn't match " +<a name="line.947"></a>
+<span class="sourceLineNo">948</span>              "our understanding of how it's supposed to work. Please file a JIRA and include " +<a name="line.948"></a>
+<span class="sourceLineNo">949</span>              "the following stack trace. In the mean time we're interpreting this behavior " +<a name="line.949"></a>
+<span class="sourceLineNo">950</span>              "difference as a lack of capability support, which will probably cause a failure.",<a name="line.950"></a>
+<span class="sourceLineNo">951</span>              exception);<a name="line.951"></a>
+<span class="sourceLineNo">952</span>        }<a name="line.952"></a>
+<span class="sourceLineNo">953</span>      }<a name="line.953"></a>
+<span class="sourceLineNo">954</span>    }<a name="line.954"></a>
+<span class="sourceLineNo">955</span>    return result;<a name="line.955"></a>
+<span class="sourceLineNo">956</span>  }<a name="line.956"></a>
+<span class="sourceLineNo">957</span><a name="line.957"></a>
+<span class="sourceLineNo">958</span>  /**<a name="line.958"></a>
+<span class="sourceLineNo">959</span>   * Helper exception for those cases where the place where we need to check a stream capability<a name="line.959"></a>
+<span class="sourceLineNo">960</span>   * is not where we have the needed context to explain the impact and mitigation for a lack.<a name="line.960"></a>
+<span class="sourceLineNo">961</span>   */<a name="line.961"></a>
+<span class="sourceLineNo">962</span>  public static class StreamLacksCapabilityException extends Exception {<a name="line.962"></a>
+<span class="sourceLineNo">963</span>    public StreamLacksCapabilityException(String message, Throwable cause) {<a name="line.963"></a>
+<span class="sourceLineNo">964</span>      super(message, cause);<a name="line.964"></a>
+<span class="sourceLineNo">965</span>    }<a name="line.965"></a>
+<span class="sourceLineNo">966</span>    public StreamLacksCapabilityException(String message) {<a name="line.966"></a>
+<span class="sourceLineNo">967</span>      super(message);<a name="line.967"></a>
+<span class="sourceLineNo">968</span>    }<a name="line.968"></a>
+<span class="sourceLineNo">969</span>  }<a name="line.969"></a>
+<span class="sourceLineNo">970</span>}<a name="line.970"></a>
 
 
 
diff --git a/downloads.html b/downloads.html
index aeda228..e474dab 100644
--- a/downloads.html
+++ b/downloads.html
@@ -435,7 +435,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/export_control.html b/export_control.html
index 60de474..362cf62 100644
--- a/export_control.html
+++ b/export_control.html
@@ -197,7 +197,7 @@ for more details.</p>
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/index.html b/index.html
index 2660633..0c4bed9 100644
--- a/index.html
+++ b/index.html
@@ -275,7 +275,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/issue-tracking.html b/issue-tracking.html
index c28ff01..ce3983c 100644
--- a/issue-tracking.html
+++ b/issue-tracking.html
@@ -169,7 +169,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/mail-lists.html b/mail-lists.html
index f753a6a..9aedda6 100644
--- a/mail-lists.html
+++ b/mail-lists.html
@@ -222,7 +222,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/metrics.html b/metrics.html
index 47bd023..f435961 100644
--- a/metrics.html
+++ b/metrics.html
@@ -325,7 +325,7 @@ export HBASE_REGIONSERVER_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxrem
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/old_news.html b/old_news.html
index 53ea735..736b0c5 100644
--- a/old_news.html
+++ b/old_news.html
@@ -316,7 +316,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/plugin-management.html b/plugin-management.html
index 1ffbd09..de05a3c 100644
--- a/plugin-management.html
+++ b/plugin-management.html
@@ -321,7 +321,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/plugins.html b/plugins.html
index 92a7819..1829031 100644
--- a/plugins.html
+++ b/plugins.html
@@ -248,7 +248,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/poweredbyhbase.html b/poweredbyhbase.html
index 77654b1..83f9236 100644
--- a/poweredbyhbase.html
+++ b/poweredbyhbase.html
@@ -650,7 +650,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/project-info.html b/project-info.html
index 6d27b4c..5354300 100644
--- a/project-info.html
+++ b/project-info.html
@@ -210,7 +210,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/project-reports.html b/project-reports.html
index a2645fe..f78bd59 100644
--- a/project-reports.html
+++ b/project-reports.html
@@ -186,7 +186,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/project-summary.html b/project-summary.html
index 378ca80..a7790d7 100644
--- a/project-summary.html
+++ b/project-summary.html
@@ -212,7 +212,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/pseudo-distributed.html b/pseudo-distributed.html
index f06ac61..59d4810 100644
--- a/pseudo-distributed.html
+++ b/pseudo-distributed.html
@@ -174,7 +174,7 @@ Running Apache HBase (TM) in pseudo-distributed mode
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/replication.html b/replication.html
index 1fb0a68..b58972a 100644
--- a/replication.html
+++ b/replication.html
@@ -169,7 +169,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/resources.html b/resources.html
index c7c9bf9..196bc33 100644
--- a/resources.html
+++ b/resources.html
@@ -197,7 +197,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/source-repository.html b/source-repository.html
index 8e96e48..6cd7a6f 100644
--- a/source-repository.html
+++ b/source-repository.html
@@ -180,7 +180,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/sponsors.html b/sponsors.html
index 4c42e93..40c01ea 100644
--- a/sponsors.html
+++ b/sponsors.html
@@ -199,7 +199,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/supportingprojects.html b/supportingprojects.html
index 5ee7a70..6dc79ce 100644
--- a/supportingprojects.html
+++ b/supportingprojects.html
@@ -390,7 +390,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
diff --git a/team-list.html b/team-list.html
index 9326e7a..f5bef9b 100644
--- a/team-list.html
+++ b/team-list.html
@@ -689,7 +689,7 @@
         <div class="row">
             <p>Copyright &copy;2007&#x2013;2020
 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
-All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-19</li>
+All rights reserved.        <li id="publishDate" class="pull-right">Last Published: 2020-01-20</li>
 </p>
         </div>
         <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>


Mime
View raw message