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 dcf0c65 Published site at 29ea96fad8aea9432836af9e9080d0d35a488ab7. dcf0c65 is described below commit dcf0c65256912fa795ec81b019e0add0a01a4e4c Author: jenkins <bui...@apache.org> AuthorDate: Wed Mar 4 14:44:14 2020 +0000 Published site at 29ea96fad8aea9432836af9e9080d0d35a488ab7. --- acid-semantics.html | 2 +- apache_hbase_reference_guide.pdf | 4 +- 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 +- .../src-html/org/apache/hadoop/hbase/Version.html | 4 +- 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 +- .../regionserver/slowlog/TestSlowLogRecorder.html | 2 +- .../hadoop/hbase/snapshot/TestExportSnapshot.html | 18 +- .../regionserver/slowlog/TestSlowLogRecorder.html | 65 ++-- .../TestExportSnapshot.RegionPredicate.html | 333 +++++++++++---------- .../hadoop/hbase/snapshot/TestExportSnapshot.html | 333 +++++++++++---------- 37 files changed, 412 insertions(+), 409 deletions(-) diff --git a/acid-semantics.html b/acid-semantics.html index bf8795f..f939bb9 100644 --- a/acid-semantics.html +++ b/acid-semantics.html @@ -467,7 +467,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 8bfe0e2..caf31d6 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.rc.2, based on Prawn 2.2.2) /Producer (Apache HBase Team) -/ModDate (D:20200303143038+00'00') -/CreationDate (D:20200303144307+00'00') +/ModDate (D:20200304143035+00'00') +/CreationDate (D:20200304144120+00'00') >> endobj 2 0 obj diff --git a/book.html b/book.html index eba3d0a..ffb8813 100644 --- a/book.html +++ b/book.html @@ -44671,7 +44671,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-03-03 14:30:38 UTC +Last updated 2020-03-04 14:30:35 UTC </div> </div> </body> diff --git a/bulk-loads.html b/bulk-loads.html index 277176b..fa8a5dd 100644 --- a/bulk-loads.html +++ b/bulk-loads.html @@ -172,7 +172,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 5de497e..b94addf 100644 --- a/checkstyle-aggregate.html +++ b/checkstyle-aggregate.html @@ -81760,7 +81760,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 59b7f23..7ffc3b0 100644 --- a/coc.html +++ b/coc.html @@ -241,7 +241,7 @@ email to <a class="externalLink" href="mailto:priv...@hbase.apache.org">the priv <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 deb5c74..19b1528 100644 --- a/dependencies.html +++ b/dependencies.html @@ -313,7 +313,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 00cd8c3..6da5ec9 100644 --- a/dependency-convergence.html +++ b/dependency-convergence.html @@ -550,7 +550,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 82c4f1d..e0f6d23 100644 --- a/dependency-info.html +++ b/dependency-info.html @@ -194,7 +194,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 99e748a..0457157 100644 --- a/dependency-management.html +++ b/dependency-management.html @@ -916,7 +916,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 fc8d15e..ed19e7a 100644 --- a/devapidocs/constant-values.html +++ b/devapidocs/constant-values.html @@ -4165,14 +4165,14 @@ <!-- --> </a><code>public static final <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>"Tue Mar 3 14:38:35 UTC 2020"</code></td> +<td class="colLast"><code>"Wed Mar 4 14:37:48 UTC 2020"</code></td> </tr> <tr class="rowColor"> <td class="colFirst"><a name="org.apache.hadoop.hbase.Version.revision"> <!-- --> </a><code>public static final <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>"5dcbe687aee4c65eefe39b7648874fb96efaa9a9"</code></td> +<td class="colLast"><code>"29ea96fad8aea9432836af9e9080d0d35a488ab7"</code></td> </tr> <tr class="altColor"> <td class="colFirst"><a name="org.apache.hadoop.hbase.Version.srcChecksum"> diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html index 2ef1368..8998b7b 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 = "5dcbe687aee4c65eefe39b7648874fb96efaa9a9";<a name="line.13"></a> +<span class="sourceLineNo">013</span> public static final String revision = "29ea96fad8aea9432836af9e9080d0d35a488ab7";<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 = "Tue Mar 3 14:38:35 UTC 2020";<a name="line.15"></a> +<span class="sourceLineNo">015</span> public static final String date = "Wed Mar 4 14:37:48 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/downloads.html b/downloads.html index 482a683..9ec243e 100644 --- a/downloads.html +++ b/downloads.html @@ -465,7 +465,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 271af9e..19ecab9 100644 --- a/export_control.html +++ b/export_control.html @@ -197,7 +197,7 @@ for more details.</p> <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 f2f764f..37a3091 100644 --- a/index.html +++ b/index.html @@ -275,7 +275,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 5877f48..eb3290f 100644 --- a/issue-tracking.html +++ b/issue-tracking.html @@ -169,7 +169,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 e3573b4..2eb2f4d 100644 --- a/mail-lists.html +++ b/mail-lists.html @@ -229,7 +229,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 5c26c51..6548225 100644 --- a/metrics.html +++ b/metrics.html @@ -325,7 +325,7 @@ export HBASE_REGIONSERVER_OPTS="$HBASE_JMX_OPTS -Dcom.sun.management.jmxrem <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 61ce41f..1cff947 100644 --- a/old_news.html +++ b/old_news.html @@ -316,7 +316,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 6d08053..4833f35 100644 --- a/plugin-management.html +++ b/plugin-management.html @@ -321,7 +321,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 b42eca8..0f5b436 100644 --- a/plugins.html +++ b/plugins.html @@ -248,7 +248,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 dbe730c..dbdb85e 100644 --- a/poweredbyhbase.html +++ b/poweredbyhbase.html @@ -650,7 +650,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 db3b848..2df9244 100644 --- a/project-info.html +++ b/project-info.html @@ -210,7 +210,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 6ef7527..58db7df 100644 --- a/project-reports.html +++ b/project-reports.html @@ -186,7 +186,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 ae886f6..ed923eb 100644 --- a/project-summary.html +++ b/project-summary.html @@ -212,7 +212,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 008d6e7..d241f20 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 ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 502b3ca..32269ab 100644 --- a/replication.html +++ b/replication.html @@ -169,7 +169,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 3a9e3a8..672fbe1 100644 --- a/resources.html +++ b/resources.html @@ -197,7 +197,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 ce5edcf..c3762c4 100644 --- a/source-repository.html +++ b/source-repository.html @@ -180,7 +180,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 1e15777..4b153b7 100644 --- a/sponsors.html +++ b/sponsors.html @@ -199,7 +199,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 4c70478..99b4d63 100644 --- a/supportingprojects.html +++ b/supportingprojects.html @@ -390,7 +390,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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 41ff86e..2f8bca3 100644 --- a/team-list.html +++ b/team-list.html @@ -701,7 +701,7 @@ <div class="row"> <p>Copyright ©2007–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. -All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-03</li> +All rights reserved. <li id="publishDate" class="pull-right">Last Published: 2020-03-04</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/testdevapidocs/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html b/testdevapidocs/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html index e29b27a..3d49b19 100644 --- a/testdevapidocs/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html +++ b/testdevapidocs/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html @@ -476,7 +476,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockListLast"> <li class="blockList"> <h4>getUser</h4> -<pre>private <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html?is-external=true" title="class or interface in java.util">Optional</a><org.apache.hadoop.hbase.security.User> <a href="../../../../../../src-html/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html#line.566">getUser</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> use [...] +<pre>private <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html?is-external=true" title="class or interface in java.util">Optional</a><org.apache.hadoop.hbase.security.User> <a href="../../../../../../src-html/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html#line.567">getUser</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> use [...] </li> </ul> </li> diff --git a/testdevapidocs/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html b/testdevapidocs/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html index 4cb870b..365fa46 100644 --- a/testdevapidocs/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html +++ b/testdevapidocs/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html @@ -724,7 +724,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockList"> <li class="blockList"> <h4>testExportRetry</h4> -<pre>public void <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.259">testExportRetry</a>() +<pre>public void <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.260">testExportRetry</a>() throws <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">Check that ExportSnapshot will succeed if something fails but the retry succeed.</div> <dl> @@ -739,7 +739,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockList"> <li class="blockList"> <h4>testExportFailure</h4> -<pre>public void <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.273">testExportFailure</a>() +<pre>public void <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.274">testExportFailure</a>() throws <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">Check that ExportSnapshot will fail if we inject failure more times than MR will retry.</div> <dl> @@ -754,7 +754,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockList"> <li class="blockList"> <h4>verifySnapshotDir</h4> -<pre>protected static void <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.288">verifySnapshotDir</a>(org.apache.hadoop.fs.FileSystem fs1, +<pre>protected static void <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.289">verifySnapshotDir</a>(org.apache.hadoop.fs.FileSystem fs1, org.apache.hadoop.fs.Path root1, org.apache.hadoop.fs.FileSystem fs2, org.apache.hadoop.fs.Path root2) @@ -771,7 +771,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockList"> <li class="blockList"> <h4>verifySnapshot</h4> -<pre>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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>> <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.293">verifySnapshot</a>(org.apache.hadoop.fs.FileSystem fs, +<pre>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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>> <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.294">verifySnapshot</a>(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.TableName 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> snapshotName) @@ -788,7 +788,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockList"> <li class="blockList"> <h4>verifySnapshot</h4> -<pre>protected static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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>> <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.302">verifySnapshot</a>(org.apache.hadoop.conf.Configuration conf, +<pre>protected static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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>> <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.303">verifySnapshot</a>(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.TableName tableName, @@ -807,7 +807,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockList"> <li class="blockList"> <h4>listFiles</h4> -<pre>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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>> <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.340">listFiles</a>(org.apache.hadoop.fs.FileSystem fs, +<pre>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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>> <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.341">listFiles</a>(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path root, org.apache.hadoop.fs.Path 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> @@ -823,7 +823,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockList"> <li class="blockList"> <h4>getHdfsDestinationDir</h4> -<pre>private org.apache.hadoop.fs.Path <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.359">getHdfsDestinationDir</a>()</pre> +<pre>private org.apache.hadoop.fs.Path <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.360">getHdfsDestinationDir</a>()</pre> </li> </ul> <a name="getLocalDestinationDir--"> @@ -832,7 +832,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockList"> <li class="blockList"> <h4>getLocalDestinationDir</h4> -<pre>private org.apache.hadoop.fs.Path <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.366">getLocalDestinationDir</a>()</pre> +<pre>private org.apache.hadoop.fs.Path <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.367">getLocalDestinationDir</a>()</pre> </li> </ul> <a name="removeExportDir-org.apache.hadoop.fs.Path-"> @@ -841,7 +841,7 @@ extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html <ul class="blockListLast"> <li class="blockList"> <h4>removeExportDir</h4> -<pre>private static void <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.377">removeExportDir</a>(org.apache.hadoop.fs.Path path) +<pre>private static void <a href="../../../../../src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html#line.378">removeExportDir</a>(org.apache.hadoop.fs.Path 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> diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html index e4cdde9..e46f37b 100644 --- a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html +++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.html @@ -564,41 +564,42 @@ <span class="sourceLineNo">556</span> .build();<a name="line.556"></a> <span class="sourceLineNo">557</span> break;<a name="line.557"></a> <span class="sourceLineNo">558</span> }<a name="line.558"></a> -<span class="sourceLineNo">559</span><a name="line.559"></a> -<span class="sourceLineNo">560</span> }<a name="line.560"></a> -<span class="sourceLineNo">561</span><a name="line.561"></a> -<span class="sourceLineNo">562</span> return message;<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> private Optional<User> getUser(String userName) {<a name="line.566"></a> -<span class="sourceLineNo">567</span><a name="line.567"></a> -<span class="sourceLineNo">568</span> return Optional.of(new User() {<a name="line.568"></a> -<span class="sourceLineNo">569</span><a name="line.569"></a> +<span class="sourceLineNo">559</span> default:<a name="line.559"></a> +<span class="sourceLineNo">560</span> throw new RuntimeException("Not supposed to get here?");<a name="line.560"></a> +<span class="sourceLineNo">561</span> }<a name="line.561"></a> +<span class="sourceLineNo">562</span><a name="line.562"></a> +<span class="sourceLineNo">563</span> return message;<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> private Optional<User> getUser(String userName) {<a name="line.567"></a> +<span class="sourceLineNo">568</span><a name="line.568"></a> +<span class="sourceLineNo">569</span> return Optional.of(new User() {<a name="line.569"></a> <span class="sourceLineNo">570</span><a name="line.570"></a> -<span class="sourceLineNo">571</span> @Override<a name="line.571"></a> -<span class="sourceLineNo">572</span> public String getShortName() {<a name="line.572"></a> -<span class="sourceLineNo">573</span> return userName;<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">571</span><a name="line.571"></a> +<span class="sourceLineNo">572</span> @Override<a name="line.572"></a> +<span class="sourceLineNo">573</span> public String getShortName() {<a name="line.573"></a> +<span class="sourceLineNo">574</span> return userName;<a name="line.574"></a> +<span class="sourceLineNo">575</span> }<a name="line.575"></a> <span class="sourceLineNo">576</span><a name="line.576"></a> -<span class="sourceLineNo">577</span> @Override<a name="line.577"></a> -<span class="sourceLineNo">578</span> public <T> T runAs(PrivilegedAction<T> action) {<a name="line.578"></a> -<span class="sourceLineNo">579</span> return null;<a name="line.579"></a> -<span class="sourceLineNo">580</span> }<a name="line.580"></a> -<span class="sourceLineNo">581</span><a name="line.581"></a> +<span class="sourceLineNo">577</span><a name="line.577"></a> +<span class="sourceLineNo">578</span> @Override<a name="line.578"></a> +<span class="sourceLineNo">579</span> public <T> T runAs(PrivilegedAction<T> action) {<a name="line.579"></a> +<span class="sourceLineNo">580</span> return null;<a name="line.580"></a> +<span class="sourceLineNo">581</span> }<a name="line.581"></a> <span class="sourceLineNo">582</span><a name="line.582"></a> -<span class="sourceLineNo">583</span> @Override<a name="line.583"></a> -<span class="sourceLineNo">584</span> public <T> T runAs(PrivilegedExceptionAction<T> action) throws<a name="line.584"></a> -<span class="sourceLineNo">585</span> IOException, InterruptedException {<a name="line.585"></a> -<span class="sourceLineNo">586</span> return null;<a name="line.586"></a> -<span class="sourceLineNo">587</span> }<a name="line.587"></a> -<span class="sourceLineNo">588</span><a name="line.588"></a> -<span class="sourceLineNo">589</span> });<a name="line.589"></a> -<span class="sourceLineNo">590</span><a name="line.590"></a> -<span class="sourceLineNo">591</span> }<a name="line.591"></a> -<span class="sourceLineNo">592</span><a name="line.592"></a> -<span class="sourceLineNo">593</span>}<a name="line.593"></a> +<span class="sourceLineNo">583</span><a name="line.583"></a> +<span class="sourceLineNo">584</span> @Override<a name="line.584"></a> +<span class="sourceLineNo">585</span> public <T> T runAs(PrivilegedExceptionAction<T> action) throws<a name="line.585"></a> +<span class="sourceLineNo">586</span> IOException, InterruptedException {<a name="line.586"></a> +<span class="sourceLineNo">587</span> return null;<a name="line.587"></a> +<span class="sourceLineNo">588</span> }<a name="line.588"></a> +<span class="sourceLineNo">589</span><a name="line.589"></a> +<span class="sourceLineNo">590</span> });<a name="line.590"></a> +<span class="sourceLineNo">591</span><a name="line.591"></a> +<span class="sourceLineNo">592</span> }<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> diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.RegionPredicate.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.RegionPredicate.html index 838110a..c00634b 100644 --- a/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.RegionPredicate.html +++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.RegionPredicate.html @@ -221,172 +221,173 @@ <span class="sourceLineNo">213</span> opts.add("--snapshot");<a name="line.213"></a> <span class="sourceLineNo">214</span> opts.add(snapshotName);<a name="line.214"></a> <span class="sourceLineNo">215</span> opts.add("--copy-to");<a name="line.215"></a> -<span class="sourceLineNo">216</span> if (!targetName.equals(snapshotName)) {<a name="line.216"></a> -<span class="sourceLineNo">217</span> opts.add("--target");<a name="line.217"></a> -<span class="sourceLineNo">218</span> opts.add(targetName);<a name="line.218"></a> -<span class="sourceLineNo">219</span> }<a name="line.219"></a> -<span class="sourceLineNo">220</span> if (overwrite) {<a name="line.220"></a> -<span class="sourceLineNo">221</span> opts.add("--overwrite");<a name="line.221"></a> -<span class="sourceLineNo">222</span> }<a name="line.222"></a> -<span class="sourceLineNo">223</span><a name="line.223"></a> -<span class="sourceLineNo">224</span> // Export Snapshot<a name="line.224"></a> -<span class="sourceLineNo">225</span> int res = run(conf, new ExportSnapshot(), opts.toArray(new String[opts.size()]));<a name="line.225"></a> -<span class="sourceLineNo">226</span> assertEquals("success " + success + ", res=" + res, success ? 0 : 1, res);<a name="line.226"></a> -<span class="sourceLineNo">227</span> if (!success) {<a name="line.227"></a> -<span class="sourceLineNo">228</span> final Path targetDir = new Path(HConstants.SNAPSHOT_DIR_NAME, targetName);<a name="line.228"></a> -<span class="sourceLineNo">229</span> assertFalse(tgtDir.toString() + " " + targetDir.toString(),<a name="line.229"></a> -<span class="sourceLineNo">230</span> tgtFs.exists(new Path(tgtDir, targetDir)));<a name="line.230"></a> -<span class="sourceLineNo">231</span> return;<a name="line.231"></a> -<span class="sourceLineNo">232</span> }<a name="line.232"></a> -<span class="sourceLineNo">233</span> LOG.info("Exported snapshot");<a name="line.233"></a> -<span class="sourceLineNo">234</span><a name="line.234"></a> -<span class="sourceLineNo">235</span> // Verify File-System state<a name="line.235"></a> -<span class="sourceLineNo">236</span> FileStatus[] rootFiles = tgtFs.listStatus(tgtDir);<a name="line.236"></a> -<span class="sourceLineNo">237</span> assertEquals(filesExpected > 0 ? 2 : 1, rootFiles.length);<a name="line.237"></a> -<span class="sourceLineNo">238</span> for (FileStatus fileStatus: rootFiles) {<a name="line.238"></a> -<span class="sourceLineNo">239</span> String name = fileStatus.getPath().getName();<a name="line.239"></a> -<span class="sourceLineNo">240</span> assertTrue(fileStatus.toString(), fileStatus.isDirectory());<a name="line.240"></a> -<span class="sourceLineNo">241</span> assertTrue(name.toString(), name.equals(HConstants.SNAPSHOT_DIR_NAME) ||<a name="line.241"></a> -<span class="sourceLineNo">242</span> name.equals(HConstants.HFILE_ARCHIVE_DIRECTORY));<a name="line.242"></a> -<span class="sourceLineNo">243</span> }<a name="line.243"></a> -<span class="sourceLineNo">244</span> LOG.info("Verified filesystem state");<a name="line.244"></a> -<span class="sourceLineNo">245</span><a name="line.245"></a> -<span class="sourceLineNo">246</span> // Compare the snapshot metadata and verify the hfiles<a name="line.246"></a> -<span class="sourceLineNo">247</span> final Path snapshotDir = new Path(HConstants.SNAPSHOT_DIR_NAME, snapshotName);<a name="line.247"></a> -<span class="sourceLineNo">248</span> final Path targetDir = new Path(HConstants.SNAPSHOT_DIR_NAME, targetName);<a name="line.248"></a> -<span class="sourceLineNo">249</span> verifySnapshotDir(srcFs, new Path(srcDir, snapshotDir), tgtFs, new Path(tgtDir, targetDir));<a name="line.249"></a> -<span class="sourceLineNo">250</span> Set<String> snapshotFiles = verifySnapshot(conf, tgtFs, tgtDir, tableName,<a name="line.250"></a> -<span class="sourceLineNo">251</span> targetName, bypassregionPredicate);<a name="line.251"></a> -<span class="sourceLineNo">252</span> assertEquals(filesExpected, snapshotFiles.size());<a name="line.252"></a> -<span class="sourceLineNo">253</span> }<a name="line.253"></a> -<span class="sourceLineNo">254</span><a name="line.254"></a> -<span class="sourceLineNo">255</span> /**<a name="line.255"></a> -<span class="sourceLineNo">256</span> * Check that ExportSnapshot will succeed if something fails but the retry succeed.<a name="line.256"></a> -<span class="sourceLineNo">257</span> */<a name="line.257"></a> -<span class="sourceLineNo">258</span> @Test<a name="line.258"></a> -<span class="sourceLineNo">259</span> public void testExportRetry() throws Exception {<a name="line.259"></a> -<span class="sourceLineNo">260</span> Path copyDir = getLocalDestinationDir();<a name="line.260"></a> -<span class="sourceLineNo">261</span> Configuration conf = new Configuration(TEST_UTIL.getConfiguration());<a name="line.261"></a> -<span class="sourceLineNo">262</span> conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);<a name="line.262"></a> -<span class="sourceLineNo">263</span> conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 2);<a name="line.263"></a> -<span class="sourceLineNo">264</span> conf.setInt("mapreduce.map.maxattempts", 3);<a name="line.264"></a> -<span class="sourceLineNo">265</span> testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles,<a name="line.265"></a> -<span class="sourceLineNo">266</span> TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), true);<a name="line.266"></a> -<span class="sourceLineNo">267</span> }<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> * Check that ExportSnapshot will fail if we inject failure more times than MR will retry.<a name="line.270"></a> -<span class="sourceLineNo">271</span> */<a name="line.271"></a> -<span class="sourceLineNo">272</span> @Test<a name="line.272"></a> -<span class="sourceLineNo">273</span> public void testExportFailure() throws Exception {<a name="line.273"></a> -<span class="sourceLineNo">274</span> Path copyDir = getLocalDestinationDir();<a name="line.274"></a> -<span class="sourceLineNo">275</span> FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration());<a name="line.275"></a> -<span class="sourceLineNo">276</span> copyDir = copyDir.makeQualified(fs);<a name="line.276"></a> -<span class="sourceLineNo">277</span> Configuration conf = new Configuration(TEST_UTIL.getConfiguration());<a name="line.277"></a> -<span class="sourceLineNo">278</span> conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);<a name="line.278"></a> -<span class="sourceLineNo">279</span> conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 4);<a name="line.279"></a> -<span class="sourceLineNo">280</span> conf.setInt("mapreduce.map.maxattempts", 3);<a name="line.280"></a> -<span class="sourceLineNo">281</span> testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles,<a name="line.281"></a> -<span class="sourceLineNo">282</span> TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), false);<a name="line.282"></a> -<span class="sourceLineNo">283</span> }<a name="line.283"></a> -<span class="sourceLineNo">284</span><a name="line.284"></a> -<span class="sourceLineNo">285</span> /*<a name="line.285"></a> -<span class="sourceLineNo">286</span> * verify if the snapshot folder on file-system 1 match the one on file-system 2<a name="line.286"></a> -<span class="sourceLineNo">287</span> */<a name="line.287"></a> -<span class="sourceLineNo">288</span> protected static void verifySnapshotDir(final FileSystem fs1, final Path root1,<a name="line.288"></a> -<span class="sourceLineNo">289</span> final FileSystem fs2, final Path root2) throws IOException {<a name="line.289"></a> -<span class="sourceLineNo">290</span> assertEquals(listFiles(fs1, root1, root1), listFiles(fs2, root2, root2));<a name="line.290"></a> -<span class="sourceLineNo">291</span> }<a name="line.291"></a> -<span class="sourceLineNo">292</span><a name="line.292"></a> -<span class="sourceLineNo">293</span> protected Set<String> verifySnapshot(final FileSystem fs, final Path rootDir,<a name="line.293"></a> -<span class="sourceLineNo">294</span> final TableName tableName, final String snapshotName) throws IOException {<a name="line.294"></a> -<span class="sourceLineNo">295</span> return verifySnapshot(TEST_UTIL.getConfiguration(), fs, rootDir, tableName,<a name="line.295"></a> -<span class="sourceLineNo">296</span> snapshotName, getBypassRegionPredicate());<a name="line.296"></a> -<span class="sourceLineNo">297</span> }<a name="line.297"></a> -<span class="sourceLineNo">298</span><a name="line.298"></a> -<span class="sourceLineNo">299</span> /*<a name="line.299"></a> -<span class="sourceLineNo">300</span> * Verify if the files exists<a name="line.300"></a> -<span class="sourceLineNo">301</span> */<a name="line.301"></a> -<span class="sourceLineNo">302</span> protected static Set<String> verifySnapshot(final Configuration conf, final FileSystem fs,<a name="line.302"></a> -<span class="sourceLineNo">303</span> final Path rootDir, final TableName tableName, final String snapshotName,<a name="line.303"></a> -<span class="sourceLineNo">304</span> final RegionPredicate bypassregionPredicate) throws IOException {<a name="line.304"></a> -<span class="sourceLineNo">305</span> final Path exportedSnapshot = new Path(rootDir,<a name="line.305"></a> -<span class="sourceLineNo">306</span> new Path(HConstants.SNAPSHOT_DIR_NAME, snapshotName));<a name="line.306"></a> -<span class="sourceLineNo">307</span> final Set<String> snapshotFiles = new HashSet<>();<a name="line.307"></a> -<span class="sourceLineNo">308</span> final Path exportedArchive = new Path(rootDir, HConstants.HFILE_ARCHIVE_DIRECTORY);<a name="line.308"></a> -<span class="sourceLineNo">309</span> SnapshotReferenceUtil.visitReferencedFiles(conf, fs, exportedSnapshot,<a name="line.309"></a> -<span class="sourceLineNo">310</span> new SnapshotReferenceUtil.SnapshotVisitor() {<a name="line.310"></a> -<span class="sourceLineNo">311</span> @Override<a name="line.311"></a> -<span class="sourceLineNo">312</span> public void storeFile(final RegionInfo regionInfo, final String family,<a name="line.312"></a> -<span class="sourceLineNo">313</span> final SnapshotRegionManifest.StoreFile storeFile) throws IOException {<a name="line.313"></a> -<span class="sourceLineNo">314</span> if (bypassregionPredicate != null && bypassregionPredicate.evaluate(regionInfo)) {<a name="line.314"></a> -<span class="sourceLineNo">315</span> return;<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> String hfile = storeFile.getName();<a name="line.318"></a> -<span class="sourceLineNo">319</span> snapshotFiles.add(hfile);<a name="line.319"></a> -<span class="sourceLineNo">320</span> if (!storeFile.hasReference()) {<a name="line.320"></a> -<span class="sourceLineNo">321</span> verifyNonEmptyFile(new Path(exportedArchive,<a name="line.321"></a> -<span class="sourceLineNo">322</span> new Path(FSUtils.getTableDir(new Path("./"), tableName),<a name="line.322"></a> -<span class="sourceLineNo">323</span> new Path(regionInfo.getEncodedName(), new Path(family, hfile)))));<a name="line.323"></a> -<span class="sourceLineNo">324</span> }<a name="line.324"></a> -<span class="sourceLineNo">325</span> }<a name="line.325"></a> -<span class="sourceLineNo">326</span><a name="line.326"></a> -<span class="sourceLineNo">327</span> private void verifyNonEmptyFile(final Path path) throws IOException {<a name="line.327"></a> -<span class="sourceLineNo">328</span> assertTrue(path + " should exists", fs.exists(path));<a name="line.328"></a> -<span class="sourceLineNo">329</span> assertTrue(path + " should not be empty", fs.getFileStatus(path).getLen() > 0);<a name="line.329"></a> -<span class="sourceLineNo">330</span> }<a name="line.330"></a> -<span class="sourceLineNo">331</span> });<a name="line.331"></a> -<span class="sourceLineNo">332</span><a name="line.332"></a> -<span class="sourceLineNo">333</span> // Verify Snapshot description<a name="line.333"></a> -<span class="sourceLineNo">334</span> SnapshotDescription desc = SnapshotDescriptionUtils.readSnapshotInfo(fs, exportedSnapshot);<a name="line.334"></a> -<span class="sourceLineNo">335</span> assertTrue(desc.getName().equals(snapshotName));<a name="line.335"></a> -<span class="sourceLineNo">336</span> assertTrue(desc.getTable().equals(tableName.getNameAsString()));<a name="line.336"></a> -<span class="sourceLineNo">337</span> return snapshotFiles;<a name="line.337"></a> -<span class="sourceLineNo">338</span> }<a name="line.338"></a> -<span class="sourceLineNo">339</span><a name="line.339"></a> -<span class="sourceLineNo">340</span> private static Set<String> listFiles(final FileSystem fs, final Path root, final Path dir)<a name="line.340"></a> -<span class="sourceLineNo">341</span> throws IOException {<a name="line.341"></a> -<span class="sourceLineNo">342</span> Set<String> files = new HashSet<>();<a name="line.342"></a> -<span class="sourceLineNo">343</span> LOG.debug("List files in {} in root {} at {}", fs, root, dir);<a name="line.343"></a> -<span class="sourceLineNo">344</span> int rootPrefix = root.makeQualified(fs.getUri(), fs.getWorkingDirectory()).toString().length();<a name="line.344"></a> -<span class="sourceLineNo">345</span> FileStatus[] list = FSUtils.listStatus(fs, dir);<a name="line.345"></a> -<span class="sourceLineNo">346</span> if (list != null) {<a name="line.346"></a> -<span class="sourceLineNo">347</span> for (FileStatus fstat: list) {<a name="line.347"></a> -<span class="sourceLineNo">348</span> LOG.debug(Objects.toString(fstat.getPath()));<a name="line.348"></a> -<span class="sourceLineNo">349</span> if (fstat.isDirectory()) {<a name="line.349"></a> -<span class="sourceLineNo">350</span> files.addAll(listFiles(fs, root, fstat.getPath()));<a name="line.350"></a> -<span class="sourceLineNo">351</span> } else {<a name="line.351"></a> -<span class="sourceLineNo">352</span> files.add(fstat.getPath().makeQualified(fs).toString().substring(rootPrefix));<a name="line.352"></a> -<span class="sourceLineNo">353</span> }<a name="line.353"></a> -<span class="sourceLineNo">354</span> }<a name="line.354"></a> -<span class="sourceLineNo">355</span> }<a name="line.355"></a> -<span class="sourceLineNo">356</span> return files;<a name="line.356"></a> -<span class="sourceLineNo">357</span> }<a name="line.357"></a> -<span class="sourceLineNo">358</span><a name="line.358"></a> -<span class="sourceLineNo">359</span> private Path getHdfsDestinationDir() {<a name="line.359"></a> -<span class="sourceLineNo">360</span> Path rootDir = TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();<a name="line.360"></a> -<span class="sourceLineNo">361</span> Path path = new Path(new Path(rootDir, "export-test"), "export-" + System.currentTimeMillis());<a name="line.361"></a> -<span class="sourceLineNo">362</span> LOG.info("HDFS export destination path: " + path);<a name="line.362"></a> -<span class="sourceLineNo">363</span> return path;<a name="line.363"></a> -<span class="sourceLineNo">364</span> }<a name="line.364"></a> -<span class="sourceLineNo">365</span><a name="line.365"></a> -<span class="sourceLineNo">366</span> private Path getLocalDestinationDir() {<a name="line.366"></a> -<span class="sourceLineNo">367</span> Path path = TEST_UTIL.getDataTestDir("local-export-" + System.currentTimeMillis());<a name="line.367"></a> -<span class="sourceLineNo">368</span> try {<a name="line.368"></a> -<span class="sourceLineNo">369</span> FileSystem fs = FileSystem.getLocal(TEST_UTIL.getConfiguration());<a name="line.369"></a> -<span class="sourceLineNo">370</span> LOG.info("Local export destination path: " + path);<a name="line.370"></a> -<span class="sourceLineNo">371</span> return path.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.371"></a> -<span class="sourceLineNo">372</span> } catch (IOException ioe) {<a name="line.372"></a> -<span class="sourceLineNo">373</span> throw new RuntimeException(ioe);<a name="line.373"></a> -<span class="sourceLineNo">374</span> }<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> private static void removeExportDir(final Path path) throws IOException {<a name="line.377"></a> -<span class="sourceLineNo">378</span> FileSystem fs = FileSystem.get(path.toUri(), new Configuration());<a name="line.378"></a> -<span class="sourceLineNo">379</span> fs.delete(path, true);<a name="line.379"></a> -<span class="sourceLineNo">380</span> }<a name="line.380"></a> -<span class="sourceLineNo">381</span>}<a name="line.381"></a> +<span class="sourceLineNo">216</span> opts.add(tgtDir.toString());<a name="line.216"></a> +<span class="sourceLineNo">217</span> if (!targetName.equals(snapshotName)) {<a name="line.217"></a> +<span class="sourceLineNo">218</span> opts.add("--target");<a name="line.218"></a> +<span class="sourceLineNo">219</span> opts.add(targetName);<a name="line.219"></a> +<span class="sourceLineNo">220</span> }<a name="line.220"></a> +<span class="sourceLineNo">221</span> if (overwrite) {<a name="line.221"></a> +<span class="sourceLineNo">222</span> opts.add("--overwrite");<a name="line.222"></a> +<span class="sourceLineNo">223</span> }<a name="line.223"></a> +<span class="sourceLineNo">224</span><a name="line.224"></a> +<span class="sourceLineNo">225</span> // Export Snapshot<a name="line.225"></a> +<span class="sourceLineNo">226</span> int res = run(conf, new ExportSnapshot(), opts.toArray(new String[opts.size()]));<a name="line.226"></a> +<span class="sourceLineNo">227</span> assertEquals("success " + success + ", res=" + res, success ? 0 : 1, res);<a name="line.227"></a> +<span class="sourceLineNo">228</span> if (!success) {<a name="line.228"></a> +<span class="sourceLineNo">229</span> final Path targetDir = new Path(HConstants.SNAPSHOT_DIR_NAME, targetName);<a name="line.229"></a> +<span class="sourceLineNo">230</span> assertFalse(tgtDir.toString() + " " + targetDir.toString(),<a name="line.230"></a> +<span class="sourceLineNo">231</span> tgtFs.exists(new Path(tgtDir, targetDir)));<a name="line.231"></a> +<span class="sourceLineNo">232</span> return;<a name="line.232"></a> +<span class="sourceLineNo">233</span> }<a name="line.233"></a> +<span class="sourceLineNo">234</span> LOG.info("Exported snapshot");<a name="line.234"></a> +<span class="sourceLineNo">235</span><a name="line.235"></a> +<span class="sourceLineNo">236</span> // Verify File-System state<a name="line.236"></a> +<span class="sourceLineNo">237</span> FileStatus[] rootFiles = tgtFs.listStatus(tgtDir);<a name="line.237"></a> +<span class="sourceLineNo">238</span> assertEquals(filesExpected > 0 ? 2 : 1, rootFiles.length);<a name="line.238"></a> +<span class="sourceLineNo">239</span> for (FileStatus fileStatus: rootFiles) {<a name="line.239"></a> +<span class="sourceLineNo">240</span> String name = fileStatus.getPath().getName();<a name="line.240"></a> +<span class="sourceLineNo">241</span> assertTrue(fileStatus.toString(), fileStatus.isDirectory());<a name="line.241"></a> +<span class="sourceLineNo">242</span> assertTrue(name.toString(), name.equals(HConstants.SNAPSHOT_DIR_NAME) ||<a name="line.242"></a> +<span class="sourceLineNo">243</span> name.equals(HConstants.HFILE_ARCHIVE_DIRECTORY));<a name="line.243"></a> +<span class="sourceLineNo">244</span> }<a name="line.244"></a> +<span class="sourceLineNo">245</span> LOG.info("Verified filesystem state");<a name="line.245"></a> +<span class="sourceLineNo">246</span><a name="line.246"></a> +<span class="sourceLineNo">247</span> // Compare the snapshot metadata and verify the hfiles<a name="line.247"></a> +<span class="sourceLineNo">248</span> final Path snapshotDir = new Path(HConstants.SNAPSHOT_DIR_NAME, snapshotName);<a name="line.248"></a> +<span class="sourceLineNo">249</span> final Path targetDir = new Path(HConstants.SNAPSHOT_DIR_NAME, targetName);<a name="line.249"></a> +<span class="sourceLineNo">250</span> verifySnapshotDir(srcFs, new Path(srcDir, snapshotDir), tgtFs, new Path(tgtDir, targetDir));<a name="line.250"></a> +<span class="sourceLineNo">251</span> Set<String> snapshotFiles = verifySnapshot(conf, tgtFs, tgtDir, tableName,<a name="line.251"></a> +<span class="sourceLineNo">252</span> targetName, bypassregionPredicate);<a name="line.252"></a> +<span class="sourceLineNo">253</span> assertEquals(filesExpected, snapshotFiles.size());<a name="line.253"></a> +<span class="sourceLineNo">254</span> }<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> * Check that ExportSnapshot will succeed if something fails but the retry succeed.<a name="line.257"></a> +<span class="sourceLineNo">258</span> */<a name="line.258"></a> +<span class="sourceLineNo">259</span> @Test<a name="line.259"></a> +<span class="sourceLineNo">260</span> public void testExportRetry() throws Exception {<a name="line.260"></a> +<span class="sourceLineNo">261</span> Path copyDir = getLocalDestinationDir();<a name="line.261"></a> +<span class="sourceLineNo">262</span> Configuration conf = new Configuration(TEST_UTIL.getConfiguration());<a name="line.262"></a> +<span class="sourceLineNo">263</span> conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);<a name="line.263"></a> +<span class="sourceLineNo">264</span> conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 2);<a name="line.264"></a> +<span class="sourceLineNo">265</span> conf.setInt("mapreduce.map.maxattempts", 3);<a name="line.265"></a> +<span class="sourceLineNo">266</span> testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles,<a name="line.266"></a> +<span class="sourceLineNo">267</span> TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), true);<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> * Check that ExportSnapshot will fail if we inject failure more times than MR will retry.<a name="line.271"></a> +<span class="sourceLineNo">272</span> */<a name="line.272"></a> +<span class="sourceLineNo">273</span> @Test<a name="line.273"></a> +<span class="sourceLineNo">274</span> public void testExportFailure() throws Exception {<a name="line.274"></a> +<span class="sourceLineNo">275</span> Path copyDir = getLocalDestinationDir();<a name="line.275"></a> +<span class="sourceLineNo">276</span> FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration());<a name="line.276"></a> +<span class="sourceLineNo">277</span> copyDir = copyDir.makeQualified(fs);<a name="line.277"></a> +<span class="sourceLineNo">278</span> Configuration conf = new Configuration(TEST_UTIL.getConfiguration());<a name="line.278"></a> +<span class="sourceLineNo">279</span> conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);<a name="line.279"></a> +<span class="sourceLineNo">280</span> conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 4);<a name="line.280"></a> +<span class="sourceLineNo">281</span> conf.setInt("mapreduce.map.maxattempts", 3);<a name="line.281"></a> +<span class="sourceLineNo">282</span> testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles,<a name="line.282"></a> +<span class="sourceLineNo">283</span> TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), false);<a name="line.283"></a> +<span class="sourceLineNo">284</span> }<a name="line.284"></a> +<span class="sourceLineNo">285</span><a name="line.285"></a> +<span class="sourceLineNo">286</span> /*<a name="line.286"></a> +<span class="sourceLineNo">287</span> * verify if the snapshot folder on file-system 1 match the one on file-system 2<a name="line.287"></a> +<span class="sourceLineNo">288</span> */<a name="line.288"></a> +<span class="sourceLineNo">289</span> protected static void verifySnapshotDir(final FileSystem fs1, final Path root1,<a name="line.289"></a> +<span class="sourceLineNo">290</span> final FileSystem fs2, final Path root2) throws IOException {<a name="line.290"></a> +<span class="sourceLineNo">291</span> assertEquals(listFiles(fs1, root1, root1), listFiles(fs2, root2, root2));<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> protected Set<String> verifySnapshot(final FileSystem fs, final Path rootDir,<a name="line.294"></a> +<span class="sourceLineNo">295</span> final TableName tableName, final String snapshotName) throws IOException {<a name="line.295"></a> +<span class="sourceLineNo">296</span> return verifySnapshot(TEST_UTIL.getConfiguration(), fs, rootDir, tableName,<a name="line.296"></a> +<span class="sourceLineNo">297</span> snapshotName, getBypassRegionPredicate());<a name="line.297"></a> +<span class="sourceLineNo">298</span> }<a name="line.298"></a> +<span class="sourceLineNo">299</span><a name="line.299"></a> +<span class="sourceLineNo">300</span> /*<a name="line.300"></a> +<span class="sourceLineNo">301</span> * Verify if the files exists<a name="line.301"></a> +<span class="sourceLineNo">302</span> */<a name="line.302"></a> +<span class="sourceLineNo">303</span> protected static Set<String> verifySnapshot(final Configuration conf, final FileSystem fs,<a name="line.303"></a> +<span class="sourceLineNo">304</span> final Path rootDir, final TableName tableName, final String snapshotName,<a name="line.304"></a> +<span class="sourceLineNo">305</span> final RegionPredicate bypassregionPredicate) throws IOException {<a name="line.305"></a> +<span class="sourceLineNo">306</span> final Path exportedSnapshot = new Path(rootDir,<a name="line.306"></a> +<span class="sourceLineNo">307</span> new Path(HConstants.SNAPSHOT_DIR_NAME, snapshotName));<a name="line.307"></a> +<span class="sourceLineNo">308</span> final Set<String> snapshotFiles = new HashSet<>();<a name="line.308"></a> +<span class="sourceLineNo">309</span> final Path exportedArchive = new Path(rootDir, HConstants.HFILE_ARCHIVE_DIRECTORY);<a name="line.309"></a> +<span class="sourceLineNo">310</span> SnapshotReferenceUtil.visitReferencedFiles(conf, fs, exportedSnapshot,<a name="line.310"></a> +<span class="sourceLineNo">311</span> new SnapshotReferenceUtil.SnapshotVisitor() {<a name="line.311"></a> +<span class="sourceLineNo">312</span> @Override<a name="line.312"></a> +<span class="sourceLineNo">313</span> public void storeFile(final RegionInfo regionInfo, final String family,<a name="line.313"></a> +<span class="sourceLineNo">314</span> final SnapshotRegionManifest.StoreFile storeFile) throws IOException {<a name="line.314"></a> +<span class="sourceLineNo">315</span> if (bypassregionPredicate != null && bypassregionPredicate.evaluate(regionInfo)) {<a name="line.315"></a> +<span class="sourceLineNo">316</span> return;<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> String hfile = storeFile.getName();<a name="line.319"></a> +<span class="sourceLineNo">320</span> snapshotFiles.add(hfile);<a name="line.320"></a> +<span class="sourceLineNo">321</span> if (!storeFile.hasReference()) {<a name="line.321"></a> +<span class="sourceLineNo">322</span> verifyNonEmptyFile(new Path(exportedArchive,<a name="line.322"></a> +<span class="sourceLineNo">323</span> new Path(FSUtils.getTableDir(new Path("./"), tableName),<a name="line.323"></a> +<span class="sourceLineNo">324</span> new Path(regionInfo.getEncodedName(), new Path(family, hfile)))));<a name="line.324"></a> +<span class="sourceLineNo">325</span> }<a name="line.325"></a> +<span class="sourceLineNo">326</span> }<a name="line.326"></a> +<span class="sourceLineNo">327</span><a name="line.327"></a> +<span class="sourceLineNo">328</span> private void verifyNonEmptyFile(final Path path) throws IOException {<a name="line.328"></a> +<span class="sourceLineNo">329</span> assertTrue(path + " should exists", fs.exists(path));<a name="line.329"></a> +<span class="sourceLineNo">330</span> assertTrue(path + " should not be empty", fs.getFileStatus(path).getLen() > 0);<a name="line.330"></a> +<span class="sourceLineNo">331</span> }<a name="line.331"></a> +<span class="sourceLineNo">332</span> });<a name="line.332"></a> +<span class="sourceLineNo">333</span><a name="line.333"></a> +<span class="sourceLineNo">334</span> // Verify Snapshot description<a name="line.334"></a> +<span class="sourceLineNo">335</span> SnapshotDescription desc = SnapshotDescriptionUtils.readSnapshotInfo(fs, exportedSnapshot);<a name="line.335"></a> +<span class="sourceLineNo">336</span> assertTrue(desc.getName().equals(snapshotName));<a name="line.336"></a> +<span class="sourceLineNo">337</span> assertTrue(desc.getTable().equals(tableName.getNameAsString()));<a name="line.337"></a> +<span class="sourceLineNo">338</span> return snapshotFiles;<a name="line.338"></a> +<span class="sourceLineNo">339</span> }<a name="line.339"></a> +<span class="sourceLineNo">340</span><a name="line.340"></a> +<span class="sourceLineNo">341</span> private static Set<String> listFiles(final FileSystem fs, final Path root, final Path dir)<a name="line.341"></a> +<span class="sourceLineNo">342</span> throws IOException {<a name="line.342"></a> +<span class="sourceLineNo">343</span> Set<String> files = new HashSet<>();<a name="line.343"></a> +<span class="sourceLineNo">344</span> LOG.debug("List files in {} in root {} at {}", fs, root, dir);<a name="line.344"></a> +<span class="sourceLineNo">345</span> int rootPrefix = root.makeQualified(fs.getUri(), fs.getWorkingDirectory()).toString().length();<a name="line.345"></a> +<span class="sourceLineNo">346</span> FileStatus[] list = FSUtils.listStatus(fs, dir);<a name="line.346"></a> +<span class="sourceLineNo">347</span> if (list != null) {<a name="line.347"></a> +<span class="sourceLineNo">348</span> for (FileStatus fstat: list) {<a name="line.348"></a> +<span class="sourceLineNo">349</span> LOG.debug(Objects.toString(fstat.getPath()));<a name="line.349"></a> +<span class="sourceLineNo">350</span> if (fstat.isDirectory()) {<a name="line.350"></a> +<span class="sourceLineNo">351</span> files.addAll(listFiles(fs, root, fstat.getPath()));<a name="line.351"></a> +<span class="sourceLineNo">352</span> } else {<a name="line.352"></a> +<span class="sourceLineNo">353</span> files.add(fstat.getPath().makeQualified(fs).toString().substring(rootPrefix));<a name="line.353"></a> +<span class="sourceLineNo">354</span> }<a name="line.354"></a> +<span class="sourceLineNo">355</span> }<a name="line.355"></a> +<span class="sourceLineNo">356</span> }<a name="line.356"></a> +<span class="sourceLineNo">357</span> return files;<a name="line.357"></a> +<span class="sourceLineNo">358</span> }<a name="line.358"></a> +<span class="sourceLineNo">359</span><a name="line.359"></a> +<span class="sourceLineNo">360</span> private Path getHdfsDestinationDir() {<a name="line.360"></a> +<span class="sourceLineNo">361</span> Path rootDir = TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();<a name="line.361"></a> +<span class="sourceLineNo">362</span> Path path = new Path(new Path(rootDir, "export-test"), "export-" + System.currentTimeMillis());<a name="line.362"></a> +<span class="sourceLineNo">363</span> LOG.info("HDFS export destination path: " + path);<a name="line.363"></a> +<span class="sourceLineNo">364</span> return path;<a name="line.364"></a> +<span class="sourceLineNo">365</span> }<a name="line.365"></a> +<span class="sourceLineNo">366</span><a name="line.366"></a> +<span class="sourceLineNo">367</span> private Path getLocalDestinationDir() {<a name="line.367"></a> +<span class="sourceLineNo">368</span> Path path = TEST_UTIL.getDataTestDir("local-export-" + System.currentTimeMillis());<a name="line.368"></a> +<span class="sourceLineNo">369</span> try {<a name="line.369"></a> +<span class="sourceLineNo">370</span> FileSystem fs = FileSystem.getLocal(TEST_UTIL.getConfiguration());<a name="line.370"></a> +<span class="sourceLineNo">371</span> LOG.info("Local export destination path: " + path);<a name="line.371"></a> +<span class="sourceLineNo">372</span> return path.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.372"></a> +<span class="sourceLineNo">373</span> } catch (IOException ioe) {<a name="line.373"></a> +<span class="sourceLineNo">374</span> throw new RuntimeException(ioe);<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> private static void removeExportDir(final Path path) throws IOException {<a name="line.378"></a> +<span class="sourceLineNo">379</span> FileSystem fs = FileSystem.get(path.toUri(), new Configuration());<a name="line.379"></a> +<span class="sourceLineNo">380</span> fs.delete(path, true);<a name="line.380"></a> +<span class="sourceLineNo">381</span> }<a name="line.381"></a> +<span class="sourceLineNo">382</span>}<a name="line.382"></a> diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html index 838110a..c00634b 100644 --- a/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html +++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.html @@ -221,172 +221,173 @@ <span class="sourceLineNo">213</span> opts.add("--snapshot");<a name="line.213"></a> <span class="sourceLineNo">214</span> opts.add(snapshotName);<a name="line.214"></a> <span class="sourceLineNo">215</span> opts.add("--copy-to");<a name="line.215"></a> -<span class="sourceLineNo">216</span> if (!targetName.equals(snapshotName)) {<a name="line.216"></a> -<span class="sourceLineNo">217</span> opts.add("--target");<a name="line.217"></a> -<span class="sourceLineNo">218</span> opts.add(targetName);<a name="line.218"></a> -<span class="sourceLineNo">219</span> }<a name="line.219"></a> -<span class="sourceLineNo">220</span> if (overwrite) {<a name="line.220"></a> -<span class="sourceLineNo">221</span> opts.add("--overwrite");<a name="line.221"></a> -<span class="sourceLineNo">222</span> }<a name="line.222"></a> -<span class="sourceLineNo">223</span><a name="line.223"></a> -<span class="sourceLineNo">224</span> // Export Snapshot<a name="line.224"></a> -<span class="sourceLineNo">225</span> int res = run(conf, new ExportSnapshot(), opts.toArray(new String[opts.size()]));<a name="line.225"></a> -<span class="sourceLineNo">226</span> assertEquals("success " + success + ", res=" + res, success ? 0 : 1, res);<a name="line.226"></a> -<span class="sourceLineNo">227</span> if (!success) {<a name="line.227"></a> -<span class="sourceLineNo">228</span> final Path targetDir = new Path(HConstants.SNAPSHOT_DIR_NAME, targetName);<a name="line.228"></a> -<span class="sourceLineNo">229</span> assertFalse(tgtDir.toString() + " " + targetDir.toString(),<a name="line.229"></a> -<span class="sourceLineNo">230</span> tgtFs.exists(new Path(tgtDir, targetDir)));<a name="line.230"></a> -<span class="sourceLineNo">231</span> return;<a name="line.231"></a> -<span class="sourceLineNo">232</span> }<a name="line.232"></a> -<span class="sourceLineNo">233</span> LOG.info("Exported snapshot");<a name="line.233"></a> -<span class="sourceLineNo">234</span><a name="line.234"></a> -<span class="sourceLineNo">235</span> // Verify File-System state<a name="line.235"></a> -<span class="sourceLineNo">236</span> FileStatus[] rootFiles = tgtFs.listStatus(tgtDir);<a name="line.236"></a> -<span class="sourceLineNo">237</span> assertEquals(filesExpected > 0 ? 2 : 1, rootFiles.length);<a name="line.237"></a> -<span class="sourceLineNo">238</span> for (FileStatus fileStatus: rootFiles) {<a name="line.238"></a> -<span class="sourceLineNo">239</span> String name = fileStatus.getPath().getName();<a name="line.239"></a> -<span class="sourceLineNo">240</span> assertTrue(fileStatus.toString(), fileStatus.isDirectory());<a name="line.240"></a> -<span class="sourceLineNo">241</span> assertTrue(name.toString(), name.equals(HConstants.SNAPSHOT_DIR_NAME) ||<a name="line.241"></a> -<span class="sourceLineNo">242</span> name.equals(HConstants.HFILE_ARCHIVE_DIRECTORY));<a name="line.242"></a> -<span class="sourceLineNo">243</span> }<a name="line.243"></a> -<span class="sourceLineNo">244</span> LOG.info("Verified filesystem state");<a name="line.244"></a> -<span class="sourceLineNo">245</span><a name="line.245"></a> -<span class="sourceLineNo">246</span> // Compare the snapshot metadata and verify the hfiles<a name="line.246"></a> -<span class="sourceLineNo">247</span> final Path snapshotDir = new Path(HConstants.SNAPSHOT_DIR_NAME, snapshotName);<a name="line.247"></a> -<span class="sourceLineNo">248</span> final Path targetDir = new Path(HConstants.SNAPSHOT_DIR_NAME, targetName);<a name="line.248"></a> -<span class="sourceLineNo">249</span> verifySnapshotDir(srcFs, new Path(srcDir, snapshotDir), tgtFs, new Path(tgtDir, targetDir));<a name="line.249"></a> -<span class="sourceLineNo">250</span> Set<String> snapshotFiles = verifySnapshot(conf, tgtFs, tgtDir, tableName,<a name="line.250"></a> -<span class="sourceLineNo">251</span> targetName, bypassregionPredicate);<a name="line.251"></a> -<span class="sourceLineNo">252</span> assertEquals(filesExpected, snapshotFiles.size());<a name="line.252"></a> -<span class="sourceLineNo">253</span> }<a name="line.253"></a> -<span class="sourceLineNo">254</span><a name="line.254"></a> -<span class="sourceLineNo">255</span> /**<a name="line.255"></a> -<span class="sourceLineNo">256</span> * Check that ExportSnapshot will succeed if something fails but the retry succeed.<a name="line.256"></a> -<span class="sourceLineNo">257</span> */<a name="line.257"></a> -<span class="sourceLineNo">258</span> @Test<a name="line.258"></a> -<span class="sourceLineNo">259</span> public void testExportRetry() throws Exception {<a name="line.259"></a> -<span class="sourceLineNo">260</span> Path copyDir = getLocalDestinationDir();<a name="line.260"></a> -<span class="sourceLineNo">261</span> Configuration conf = new Configuration(TEST_UTIL.getConfiguration());<a name="line.261"></a> -<span class="sourceLineNo">262</span> conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);<a name="line.262"></a> -<span class="sourceLineNo">263</span> conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 2);<a name="line.263"></a> -<span class="sourceLineNo">264</span> conf.setInt("mapreduce.map.maxattempts", 3);<a name="line.264"></a> -<span class="sourceLineNo">265</span> testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles,<a name="line.265"></a> -<span class="sourceLineNo">266</span> TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), true);<a name="line.266"></a> -<span class="sourceLineNo">267</span> }<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> * Check that ExportSnapshot will fail if we inject failure more times than MR will retry.<a name="line.270"></a> -<span class="sourceLineNo">271</span> */<a name="line.271"></a> -<span class="sourceLineNo">272</span> @Test<a name="line.272"></a> -<span class="sourceLineNo">273</span> public void testExportFailure() throws Exception {<a name="line.273"></a> -<span class="sourceLineNo">274</span> Path copyDir = getLocalDestinationDir();<a name="line.274"></a> -<span class="sourceLineNo">275</span> FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration());<a name="line.275"></a> -<span class="sourceLineNo">276</span> copyDir = copyDir.makeQualified(fs);<a name="line.276"></a> -<span class="sourceLineNo">277</span> Configuration conf = new Configuration(TEST_UTIL.getConfiguration());<a name="line.277"></a> -<span class="sourceLineNo">278</span> conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);<a name="line.278"></a> -<span class="sourceLineNo">279</span> conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 4);<a name="line.279"></a> -<span class="sourceLineNo">280</span> conf.setInt("mapreduce.map.maxattempts", 3);<a name="line.280"></a> -<span class="sourceLineNo">281</span> testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles,<a name="line.281"></a> -<span class="sourceLineNo">282</span> TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), false);<a name="line.282"></a> -<span class="sourceLineNo">283</span> }<a name="line.283"></a> -<span class="sourceLineNo">284</span><a name="line.284"></a> -<span class="sourceLineNo">285</span> /*<a name="line.285"></a> -<span class="sourceLineNo">286</span> * verify if the snapshot folder on file-system 1 match the one on file-system 2<a name="line.286"></a> -<span class="sourceLineNo">287</span> */<a name="line.287"></a> -<span class="sourceLineNo">288</span> protected static void verifySnapshotDir(final FileSystem fs1, final Path root1,<a name="line.288"></a> -<span class="sourceLineNo">289</span> final FileSystem fs2, final Path root2) throws IOException {<a name="line.289"></a> -<span class="sourceLineNo">290</span> assertEquals(listFiles(fs1, root1, root1), listFiles(fs2, root2, root2));<a name="line.290"></a> -<span class="sourceLineNo">291</span> }<a name="line.291"></a> -<span class="sourceLineNo">292</span><a name="line.292"></a> -<span class="sourceLineNo">293</span> protected Set<String> verifySnapshot(final FileSystem fs, final Path rootDir,<a name="line.293"></a> -<span class="sourceLineNo">294</span> final TableName tableName, final String snapshotName) throws IOException {<a name="line.294"></a> -<span class="sourceLineNo">295</span> return verifySnapshot(TEST_UTIL.getConfiguration(), fs, rootDir, tableName,<a name="line.295"></a> -<span class="sourceLineNo">296</span> snapshotName, getBypassRegionPredicate());<a name="line.296"></a> -<span class="sourceLineNo">297</span> }<a name="line.297"></a> -<span class="sourceLineNo">298</span><a name="line.298"></a> -<span class="sourceLineNo">299</span> /*<a name="line.299"></a> -<span class="sourceLineNo">300</span> * Verify if the files exists<a name="line.300"></a> -<span class="sourceLineNo">301</span> */<a name="line.301"></a> -<span class="sourceLineNo">302</span> protected static Set<String> verifySnapshot(final Configuration conf, final FileSystem fs,<a name="line.302"></a> -<span class="sourceLineNo">303</span> final Path rootDir, final TableName tableName, final String snapshotName,<a name="line.303"></a> -<span class="sourceLineNo">304</span> final RegionPredicate bypassregionPredicate) throws IOException {<a name="line.304"></a> -<span class="sourceLineNo">305</span> final Path exportedSnapshot = new Path(rootDir,<a name="line.305"></a> -<span class="sourceLineNo">306</span> new Path(HConstants.SNAPSHOT_DIR_NAME, snapshotName));<a name="line.306"></a> -<span class="sourceLineNo">307</span> final Set<String> snapshotFiles = new HashSet<>();<a name="line.307"></a> -<span class="sourceLineNo">308</span> final Path exportedArchive = new Path(rootDir, HConstants.HFILE_ARCHIVE_DIRECTORY);<a name="line.308"></a> -<span class="sourceLineNo">309</span> SnapshotReferenceUtil.visitReferencedFiles(conf, fs, exportedSnapshot,<a name="line.309"></a> -<span class="sourceLineNo">310</span> new SnapshotReferenceUtil.SnapshotVisitor() {<a name="line.310"></a> -<span class="sourceLineNo">311</span> @Override<a name="line.311"></a> -<span class="sourceLineNo">312</span> public void storeFile(final RegionInfo regionInfo, final String family,<a name="line.312"></a> -<span class="sourceLineNo">313</span> final SnapshotRegionManifest.StoreFile storeFile) throws IOException {<a name="line.313"></a> -<span class="sourceLineNo">314</span> if (bypassregionPredicate != null && bypassregionPredicate.evaluate(regionInfo)) {<a name="line.314"></a> -<span class="sourceLineNo">315</span> return;<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> String hfile = storeFile.getName();<a name="line.318"></a> -<span class="sourceLineNo">319</span> snapshotFiles.add(hfile);<a name="line.319"></a> -<span class="sourceLineNo">320</span> if (!storeFile.hasReference()) {<a name="line.320"></a> -<span class="sourceLineNo">321</span> verifyNonEmptyFile(new Path(exportedArchive,<a name="line.321"></a> -<span class="sourceLineNo">322</span> new Path(FSUtils.getTableDir(new Path("./"), tableName),<a name="line.322"></a> -<span class="sourceLineNo">323</span> new Path(regionInfo.getEncodedName(), new Path(family, hfile)))));<a name="line.323"></a> -<span class="sourceLineNo">324</span> }<a name="line.324"></a> -<span class="sourceLineNo">325</span> }<a name="line.325"></a> -<span class="sourceLineNo">326</span><a name="line.326"></a> -<span class="sourceLineNo">327</span> private void verifyNonEmptyFile(final Path path) throws IOException {<a name="line.327"></a> -<span class="sourceLineNo">328</span> assertTrue(path + " should exists", fs.exists(path));<a name="line.328"></a> -<span class="sourceLineNo">329</span> assertTrue(path + " should not be empty", fs.getFileStatus(path).getLen() > 0);<a name="line.329"></a> -<span class="sourceLineNo">330</span> }<a name="line.330"></a> -<span class="sourceLineNo">331</span> });<a name="line.331"></a> -<span class="sourceLineNo">332</span><a name="line.332"></a> -<span class="sourceLineNo">333</span> // Verify Snapshot description<a name="line.333"></a> -<span class="sourceLineNo">334</span> SnapshotDescription desc = SnapshotDescriptionUtils.readSnapshotInfo(fs, exportedSnapshot);<a name="line.334"></a> -<span class="sourceLineNo">335</span> assertTrue(desc.getName().equals(snapshotName));<a name="line.335"></a> -<span class="sourceLineNo">336</span> assertTrue(desc.getTable().equals(tableName.getNameAsString()));<a name="line.336"></a> -<span class="sourceLineNo">337</span> return snapshotFiles;<a name="line.337"></a> -<span class="sourceLineNo">338</span> }<a name="line.338"></a> -<span class="sourceLineNo">339</span><a name="line.339"></a> -<span class="sourceLineNo">340</span> private static Set<String> listFiles(final FileSystem fs, final Path root, final Path dir)<a name="line.340"></a> -<span class="sourceLineNo">341</span> throws IOException {<a name="line.341"></a> -<span class="sourceLineNo">342</span> Set<String> files = new HashSet<>();<a name="line.342"></a> -<span class="sourceLineNo">343</span> LOG.debug("List files in {} in root {} at {}", fs, root, dir);<a name="line.343"></a> -<span class="sourceLineNo">344</span> int rootPrefix = root.makeQualified(fs.getUri(), fs.getWorkingDirectory()).toString().length();<a name="line.344"></a> -<span class="sourceLineNo">345</span> FileStatus[] list = FSUtils.listStatus(fs, dir);<a name="line.345"></a> -<span class="sourceLineNo">346</span> if (list != null) {<a name="line.346"></a> -<span class="sourceLineNo">347</span> for (FileStatus fstat: list) {<a name="line.347"></a> -<span class="sourceLineNo">348</span> LOG.debug(Objects.toString(fstat.getPath()));<a name="line.348"></a> -<span class="sourceLineNo">349</span> if (fstat.isDirectory()) {<a name="line.349"></a> -<span class="sourceLineNo">350</span> files.addAll(listFiles(fs, root, fstat.getPath()));<a name="line.350"></a> -<span class="sourceLineNo">351</span> } else {<a name="line.351"></a> -<span class="sourceLineNo">352</span> files.add(fstat.getPath().makeQualified(fs).toString().substring(rootPrefix));<a name="line.352"></a> -<span class="sourceLineNo">353</span> }<a name="line.353"></a> -<span class="sourceLineNo">354</span> }<a name="line.354"></a> -<span class="sourceLineNo">355</span> }<a name="line.355"></a> -<span class="sourceLineNo">356</span> return files;<a name="line.356"></a> -<span class="sourceLineNo">357</span> }<a name="line.357"></a> -<span class="sourceLineNo">358</span><a name="line.358"></a> -<span class="sourceLineNo">359</span> private Path getHdfsDestinationDir() {<a name="line.359"></a> -<span class="sourceLineNo">360</span> Path rootDir = TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();<a name="line.360"></a> -<span class="sourceLineNo">361</span> Path path = new Path(new Path(rootDir, "export-test"), "export-" + System.currentTimeMillis());<a name="line.361"></a> -<span class="sourceLineNo">362</span> LOG.info("HDFS export destination path: " + path);<a name="line.362"></a> -<span class="sourceLineNo">363</span> return path;<a name="line.363"></a> -<span class="sourceLineNo">364</span> }<a name="line.364"></a> -<span class="sourceLineNo">365</span><a name="line.365"></a> -<span class="sourceLineNo">366</span> private Path getLocalDestinationDir() {<a name="line.366"></a> -<span class="sourceLineNo">367</span> Path path = TEST_UTIL.getDataTestDir("local-export-" + System.currentTimeMillis());<a name="line.367"></a> -<span class="sourceLineNo">368</span> try {<a name="line.368"></a> -<span class="sourceLineNo">369</span> FileSystem fs = FileSystem.getLocal(TEST_UTIL.getConfiguration());<a name="line.369"></a> -<span class="sourceLineNo">370</span> LOG.info("Local export destination path: " + path);<a name="line.370"></a> -<span class="sourceLineNo">371</span> return path.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.371"></a> -<span class="sourceLineNo">372</span> } catch (IOException ioe) {<a name="line.372"></a> -<span class="sourceLineNo">373</span> throw new RuntimeException(ioe);<a name="line.373"></a> -<span class="sourceLineNo">374</span> }<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> private static void removeExportDir(final Path path) throws IOException {<a name="line.377"></a> -<span class="sourceLineNo">378</span> FileSystem fs = FileSystem.get(path.toUri(), new Configuration());<a name="line.378"></a> -<span class="sourceLineNo">379</span> fs.delete(path, true);<a name="line.379"></a> -<span class="sourceLineNo">380</span> }<a name="line.380"></a> -<span class="sourceLineNo">381</span>}<a name="line.381"></a> +<span class="sourceLineNo">216</span> opts.add(tgtDir.toString());<a name="line.216"></a> +<span class="sourceLineNo">217</span> if (!targetName.equals(snapshotName)) {<a name="line.217"></a> +<span class="sourceLineNo">218</span> opts.add("--target");<a name="line.218"></a> +<span class="sourceLineNo">219</span> opts.add(targetName);<a name="line.219"></a> +<span class="sourceLineNo">220</span> }<a name="line.220"></a> +<span class="sourceLineNo">221</span> if (overwrite) {<a name="line.221"></a> +<span class="sourceLineNo">222</span> opts.add("--overwrite");<a name="line.222"></a> +<span class="sourceLineNo">223</span> }<a name="line.223"></a> +<span class="sourceLineNo">224</span><a name="line.224"></a> +<span class="sourceLineNo">225</span> // Export Snapshot<a name="line.225"></a> +<span class="sourceLineNo">226</span> int res = run(conf, new ExportSnapshot(), opts.toArray(new String[opts.size()]));<a name="line.226"></a> +<span class="sourceLineNo">227</span> assertEquals("success " + success + ", res=" + res, success ? 0 : 1, res);<a name="line.227"></a> +<span class="sourceLineNo">228</span> if (!success) {<a name="line.228"></a> +<span class="sourceLineNo">229</span> final Path targetDir = new Path(HConstants.SNAPSHOT_DIR_NAME, targetName);<a name="line.229"></a> +<span class="sourceLineNo">230</span> assertFalse(tgtDir.toString() + " " + targetDir.toString(),<a name="line.230"></a> +<span class="sourceLineNo">231</span> tgtFs.exists(new Path(tgtDir, targetDir)));<a name="line.231"></a> +<span class="sourceLineNo">232</span> return;<a name="line.232"></a> +<span class="sourceLineNo">233</span> }<a name="line.233"></a> +<span class="sourceLineNo">234</span> LOG.info("Exported snapshot");<a name="line.234"></a> +<span class="sourceLineNo">235</span><a name="line.235"></a> +<span class="sourceLineNo">236</span> // Verify File-System state<a name="line.236"></a> +<span class="sourceLineNo">237</span> FileStatus[] rootFiles = tgtFs.listStatus(tgtDir);<a name="line.237"></a> +<span class="sourceLineNo">238</span> assertEquals(filesExpected > 0 ? 2 : 1, rootFiles.length);<a name="line.238"></a> +<span class="sourceLineNo">239</span> for (FileStatus fileStatus: rootFiles) {<a name="line.239"></a> +<span class="sourceLineNo">240</span> String name = fileStatus.getPath().getName();<a name="line.240"></a> +<span class="sourceLineNo">241</span> assertTrue(fileStatus.toString(), fileStatus.isDirectory());<a name="line.241"></a> +<span class="sourceLineNo">242</span> assertTrue(name.toString(), name.equals(HConstants.SNAPSHOT_DIR_NAME) ||<a name="line.242"></a> +<span class="sourceLineNo">243</span> name.equals(HConstants.HFILE_ARCHIVE_DIRECTORY));<a name="line.243"></a> +<span class="sourceLineNo">244</span> }<a name="line.244"></a> +<span class="sourceLineNo">245</span> LOG.info("Verified filesystem state");<a name="line.245"></a> +<span class="sourceLineNo">246</span><a name="line.246"></a> +<span class="sourceLineNo">247</span> // Compare the snapshot metadata and verify the hfiles<a name="line.247"></a> +<span class="sourceLineNo">248</span> final Path snapshotDir = new Path(HConstants.SNAPSHOT_DIR_NAME, snapshotName);<a name="line.248"></a> +<span class="sourceLineNo">249</span> final Path targetDir = new Path(HConstants.SNAPSHOT_DIR_NAME, targetName);<a name="line.249"></a> +<span class="sourceLineNo">250</span> verifySnapshotDir(srcFs, new Path(srcDir, snapshotDir), tgtFs, new Path(tgtDir, targetDir));<a name="line.250"></a> +<span class="sourceLineNo">251</span> Set<String> snapshotFiles = verifySnapshot(conf, tgtFs, tgtDir, tableName,<a name="line.251"></a> +<span class="sourceLineNo">252</span> targetName, bypassregionPredicate);<a name="line.252"></a> +<span class="sourceLineNo">253</span> assertEquals(filesExpected, snapshotFiles.size());<a name="line.253"></a> +<span class="sourceLineNo">254</span> }<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> * Check that ExportSnapshot will succeed if something fails but the retry succeed.<a name="line.257"></a> +<span class="sourceLineNo">258</span> */<a name="line.258"></a> +<span class="sourceLineNo">259</span> @Test<a name="line.259"></a> +<span class="sourceLineNo">260</span> public void testExportRetry() throws Exception {<a name="line.260"></a> +<span class="sourceLineNo">261</span> Path copyDir = getLocalDestinationDir();<a name="line.261"></a> +<span class="sourceLineNo">262</span> Configuration conf = new Configuration(TEST_UTIL.getConfiguration());<a name="line.262"></a> +<span class="sourceLineNo">263</span> conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);<a name="line.263"></a> +<span class="sourceLineNo">264</span> conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 2);<a name="line.264"></a> +<span class="sourceLineNo">265</span> conf.setInt("mapreduce.map.maxattempts", 3);<a name="line.265"></a> +<span class="sourceLineNo">266</span> testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles,<a name="line.266"></a> +<span class="sourceLineNo">267</span> TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), true);<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> * Check that ExportSnapshot will fail if we inject failure more times than MR will retry.<a name="line.271"></a> +<span class="sourceLineNo">272</span> */<a name="line.272"></a> +<span class="sourceLineNo">273</span> @Test<a name="line.273"></a> +<span class="sourceLineNo">274</span> public void testExportFailure() throws Exception {<a name="line.274"></a> +<span class="sourceLineNo">275</span> Path copyDir = getLocalDestinationDir();<a name="line.275"></a> +<span class="sourceLineNo">276</span> FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration());<a name="line.276"></a> +<span class="sourceLineNo">277</span> copyDir = copyDir.makeQualified(fs);<a name="line.277"></a> +<span class="sourceLineNo">278</span> Configuration conf = new Configuration(TEST_UTIL.getConfiguration());<a name="line.278"></a> +<span class="sourceLineNo">279</span> conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);<a name="line.279"></a> +<span class="sourceLineNo">280</span> conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 4);<a name="line.280"></a> +<span class="sourceLineNo">281</span> conf.setInt("mapreduce.map.maxattempts", 3);<a name="line.281"></a> +<span class="sourceLineNo">282</span> testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles,<a name="line.282"></a> +<span class="sourceLineNo">283</span> TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), false);<a name="line.283"></a> +<span class="sourceLineNo">284</span> }<a name="line.284"></a> +<span class="sourceLineNo">285</span><a name="line.285"></a> +<span class="sourceLineNo">286</span> /*<a name="line.286"></a> +<span class="sourceLineNo">287</span> * verify if the snapshot folder on file-system 1 match the one on file-system 2<a name="line.287"></a> +<span class="sourceLineNo">288</span> */<a name="line.288"></a> +<span class="sourceLineNo">289</span> protected static void verifySnapshotDir(final FileSystem fs1, final Path root1,<a name="line.289"></a> +<span class="sourceLineNo">290</span> final FileSystem fs2, final Path root2) throws IOException {<a name="line.290"></a> +<span class="sourceLineNo">291</span> assertEquals(listFiles(fs1, root1, root1), listFiles(fs2, root2, root2));<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> protected Set<String> verifySnapshot(final FileSystem fs, final Path rootDir,<a name="line.294"></a> +<span class="sourceLineNo">295</span> final TableName tableName, final String snapshotName) throws IOException {<a name="line.295"></a> +<span class="sourceLineNo">296</span> return verifySnapshot(TEST_UTIL.getConfiguration(), fs, rootDir, tableName,<a name="line.296"></a> +<span class="sourceLineNo">297</span> snapshotName, getBypassRegionPredicate());<a name="line.297"></a> +<span class="sourceLineNo">298</span> }<a name="line.298"></a> +<span class="sourceLineNo">299</span><a name="line.299"></a> +<span class="sourceLineNo">300</span> /*<a name="line.300"></a> +<span class="sourceLineNo">301</span> * Verify if the files exists<a name="line.301"></a> +<span class="sourceLineNo">302</span> */<a name="line.302"></a> +<span class="sourceLineNo">303</span> protected static Set<String> verifySnapshot(final Configuration conf, final FileSystem fs,<a name="line.303"></a> +<span class="sourceLineNo">304</span> final Path rootDir, final TableName tableName, final String snapshotName,<a name="line.304"></a> +<span class="sourceLineNo">305</span> final RegionPredicate bypassregionPredicate) throws IOException {<a name="line.305"></a> +<span class="sourceLineNo">306</span> final Path exportedSnapshot = new Path(rootDir,<a name="line.306"></a> +<span class="sourceLineNo">307</span> new Path(HConstants.SNAPSHOT_DIR_NAME, snapshotName));<a name="line.307"></a> +<span class="sourceLineNo">308</span> final Set<String> snapshotFiles = new HashSet<>();<a name="line.308"></a> +<span class="sourceLineNo">309</span> final Path exportedArchive = new Path(rootDir, HConstants.HFILE_ARCHIVE_DIRECTORY);<a name="line.309"></a> +<span class="sourceLineNo">310</span> SnapshotReferenceUtil.visitReferencedFiles(conf, fs, exportedSnapshot,<a name="line.310"></a> +<span class="sourceLineNo">311</span> new SnapshotReferenceUtil.SnapshotVisitor() {<a name="line.311"></a> +<span class="sourceLineNo">312</span> @Override<a name="line.312"></a> +<span class="sourceLineNo">313</span> public void storeFile(final RegionInfo regionInfo, final String family,<a name="line.313"></a> +<span class="sourceLineNo">314</span> final SnapshotRegionManifest.StoreFile storeFile) throws IOException {<a name="line.314"></a> +<span class="sourceLineNo">315</span> if (bypassregionPredicate != null && bypassregionPredicate.evaluate(regionInfo)) {<a name="line.315"></a> +<span class="sourceLineNo">316</span> return;<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> String hfile = storeFile.getName();<a name="line.319"></a> +<span class="sourceLineNo">320</span> snapshotFiles.add(hfile);<a name="line.320"></a> +<span class="sourceLineNo">321</span> if (!storeFile.hasReference()) {<a name="line.321"></a> +<span class="sourceLineNo">322</span> verifyNonEmptyFile(new Path(exportedArchive,<a name="line.322"></a> +<span class="sourceLineNo">323</span> new Path(FSUtils.getTableDir(new Path("./"), tableName),<a name="line.323"></a> +<span class="sourceLineNo">324</span> new Path(regionInfo.getEncodedName(), new Path(family, hfile)))));<a name="line.324"></a> +<span class="sourceLineNo">325</span> }<a name="line.325"></a> +<span class="sourceLineNo">326</span> }<a name="line.326"></a> +<span class="sourceLineNo">327</span><a name="line.327"></a> +<span class="sourceLineNo">328</span> private void verifyNonEmptyFile(final Path path) throws IOException {<a name="line.328"></a> +<span class="sourceLineNo">329</span> assertTrue(path + " should exists", fs.exists(path));<a name="line.329"></a> +<span class="sourceLineNo">330</span> assertTrue(path + " should not be empty", fs.getFileStatus(path).getLen() > 0);<a name="line.330"></a> +<span class="sourceLineNo">331</span> }<a name="line.331"></a> +<span class="sourceLineNo">332</span> });<a name="line.332"></a> +<span class="sourceLineNo">333</span><a name="line.333"></a> +<span class="sourceLineNo">334</span> // Verify Snapshot description<a name="line.334"></a> +<span class="sourceLineNo">335</span> SnapshotDescription desc = SnapshotDescriptionUtils.readSnapshotInfo(fs, exportedSnapshot);<a name="line.335"></a> +<span class="sourceLineNo">336</span> assertTrue(desc.getName().equals(snapshotName));<a name="line.336"></a> +<span class="sourceLineNo">337</span> assertTrue(desc.getTable().equals(tableName.getNameAsString()));<a name="line.337"></a> +<span class="sourceLineNo">338</span> return snapshotFiles;<a name="line.338"></a> +<span class="sourceLineNo">339</span> }<a name="line.339"></a> +<span class="sourceLineNo">340</span><a name="line.340"></a> +<span class="sourceLineNo">341</span> private static Set<String> listFiles(final FileSystem fs, final Path root, final Path dir)<a name="line.341"></a> +<span class="sourceLineNo">342</span> throws IOException {<a name="line.342"></a> +<span class="sourceLineNo">343</span> Set<String> files = new HashSet<>();<a name="line.343"></a> +<span class="sourceLineNo">344</span> LOG.debug("List files in {} in root {} at {}", fs, root, dir);<a name="line.344"></a> +<span class="sourceLineNo">345</span> int rootPrefix = root.makeQualified(fs.getUri(), fs.getWorkingDirectory()).toString().length();<a name="line.345"></a> +<span class="sourceLineNo">346</span> FileStatus[] list = FSUtils.listStatus(fs, dir);<a name="line.346"></a> +<span class="sourceLineNo">347</span> if (list != null) {<a name="line.347"></a> +<span class="sourceLineNo">348</span> for (FileStatus fstat: list) {<a name="line.348"></a> +<span class="sourceLineNo">349</span> LOG.debug(Objects.toString(fstat.getPath()));<a name="line.349"></a> +<span class="sourceLineNo">350</span> if (fstat.isDirectory()) {<a name="line.350"></a> +<span class="sourceLineNo">351</span> files.addAll(listFiles(fs, root, fstat.getPath()));<a name="line.351"></a> +<span class="sourceLineNo">352</span> } else {<a name="line.352"></a> +<span class="sourceLineNo">353</span> files.add(fstat.getPath().makeQualified(fs).toString().substring(rootPrefix));<a name="line.353"></a> +<span class="sourceLineNo">354</span> }<a name="line.354"></a> +<span class="sourceLineNo">355</span> }<a name="line.355"></a> +<span class="sourceLineNo">356</span> }<a name="line.356"></a> +<span class="sourceLineNo">357</span> return files;<a name="line.357"></a> +<span class="sourceLineNo">358</span> }<a name="line.358"></a> +<span class="sourceLineNo">359</span><a name="line.359"></a> +<span class="sourceLineNo">360</span> private Path getHdfsDestinationDir() {<a name="line.360"></a> +<span class="sourceLineNo">361</span> Path rootDir = TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();<a name="line.361"></a> +<span class="sourceLineNo">362</span> Path path = new Path(new Path(rootDir, "export-test"), "export-" + System.currentTimeMillis());<a name="line.362"></a> +<span class="sourceLineNo">363</span> LOG.info("HDFS export destination path: " + path);<a name="line.363"></a> +<span class="sourceLineNo">364</span> return path;<a name="line.364"></a> +<span class="sourceLineNo">365</span> }<a name="line.365"></a> +<span class="sourceLineNo">366</span><a name="line.366"></a> +<span class="sourceLineNo">367</span> private Path getLocalDestinationDir() {<a name="line.367"></a> +<span class="sourceLineNo">368</span> Path path = TEST_UTIL.getDataTestDir("local-export-" + System.currentTimeMillis());<a name="line.368"></a> +<span class="sourceLineNo">369</span> try {<a name="line.369"></a> +<span class="sourceLineNo">370</span> FileSystem fs = FileSystem.getLocal(TEST_UTIL.getConfiguration());<a name="line.370"></a> +<span class="sourceLineNo">371</span> LOG.info("Local export destination path: " + path);<a name="line.371"></a> +<span class="sourceLineNo">372</span> return path.makeQualified(fs.getUri(), fs.getWorkingDirectory());<a name="line.372"></a> +<span class="sourceLineNo">373</span> } catch (IOException ioe) {<a name="line.373"></a> +<span class="sourceLineNo">374</span> throw new RuntimeException(ioe);<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> private static void removeExportDir(final Path path) throws IOException {<a name="line.378"></a> +<span class="sourceLineNo">379</span> FileSystem fs = FileSystem.get(path.toUri(), new Configuration());<a name="line.379"></a> +<span class="sourceLineNo">380</span> fs.delete(path, true);<a name="line.380"></a> +<span class="sourceLineNo">381</span> }<a name="line.381"></a> +<span class="sourceLineNo">382</span>}<a name="line.382"></a>