hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [30/51] [partial] hbase-site git commit: Published site at 00095a2ef9442e3fd86c04876c9d91f2f8b23ad8.
Date Sat, 17 Mar 2018 14:54:06 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/backup/HFileArchiver.FileStatusConverter.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/backup/HFileArchiver.FileStatusConverter.html b/devapidocs/src-html/org/apache/hadoop/hbase/backup/HFileArchiver.FileStatusConverter.html
index f47d627..c3d225c 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/backup/HFileArchiver.FileStatusConverter.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/backup/HFileArchiver.FileStatusConverter.html
@@ -117,219 +117,219 @@
 <span class="sourceLineNo">109</span>   */<a name="line.109"></a>
 <span class="sourceLineNo">110</span>  public static boolean archiveRegion(FileSystem fs, Path rootdir, Path tableDir, Path regionDir)<a name="line.110"></a>
 <span class="sourceLineNo">111</span>      throws IOException {<a name="line.111"></a>
-<span class="sourceLineNo">112</span>    if (LOG.isDebugEnabled()) {<a name="line.112"></a>
-<span class="sourceLineNo">113</span>      LOG.debug("ARCHIVING " + regionDir.toString());<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    }<a name="line.114"></a>
-<span class="sourceLineNo">115</span><a name="line.115"></a>
-<span class="sourceLineNo">116</span>    // otherwise, we archive the files<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    // make sure we can archive<a name="line.117"></a>
-<span class="sourceLineNo">118</span>    if (tableDir == null || regionDir == null) {<a name="line.118"></a>
-<span class="sourceLineNo">119</span>      LOG.error("No archive directory could be found because tabledir (" + tableDir<a name="line.119"></a>
-<span class="sourceLineNo">120</span>          + ") or regiondir (" + regionDir + "was null. Deleting files instead.");<a name="line.120"></a>
-<span class="sourceLineNo">121</span>      deleteRegionWithoutArchiving(fs, regionDir);<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      // we should have archived, but failed to. Doesn't matter if we deleted<a name="line.122"></a>
-<span class="sourceLineNo">123</span>      // the archived files correctly or not.<a name="line.123"></a>
-<span class="sourceLineNo">124</span>      return false;<a name="line.124"></a>
-<span class="sourceLineNo">125</span>    }<a name="line.125"></a>
-<span class="sourceLineNo">126</span><a name="line.126"></a>
-<span class="sourceLineNo">127</span>    // make sure the regiondir lives under the tabledir<a name="line.127"></a>
-<span class="sourceLineNo">128</span>    Preconditions.checkArgument(regionDir.toString().startsWith(tableDir.toString()));<a name="line.128"></a>
-<span class="sourceLineNo">129</span>    Path regionArchiveDir = HFileArchiveUtil.getRegionArchiveDir(rootdir,<a name="line.129"></a>
-<span class="sourceLineNo">130</span>        FSUtils.getTableName(tableDir),<a name="line.130"></a>
-<span class="sourceLineNo">131</span>        regionDir.getName());<a name="line.131"></a>
-<span class="sourceLineNo">132</span><a name="line.132"></a>
-<span class="sourceLineNo">133</span>    FileStatusConverter getAsFile = new FileStatusConverter(fs);<a name="line.133"></a>
-<span class="sourceLineNo">134</span>    // otherwise, we attempt to archive the store files<a name="line.134"></a>
-<span class="sourceLineNo">135</span><a name="line.135"></a>
-<span class="sourceLineNo">136</span>    // build collection of just the store directories to archive<a name="line.136"></a>
-<span class="sourceLineNo">137</span>    Collection&lt;File&gt; toArchive = new ArrayList&lt;&gt;();<a name="line.137"></a>
-<span class="sourceLineNo">138</span>    final PathFilter dirFilter = new FSUtils.DirFilter(fs);<a name="line.138"></a>
-<span class="sourceLineNo">139</span>    PathFilter nonHidden = new PathFilter() {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>      @Override<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      public boolean accept(Path file) {<a name="line.141"></a>
-<span class="sourceLineNo">142</span>        return dirFilter.accept(file) &amp;&amp; !file.getName().toString().startsWith(".");<a name="line.142"></a>
-<span class="sourceLineNo">143</span>      }<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    };<a name="line.144"></a>
-<span class="sourceLineNo">145</span>    FileStatus[] storeDirs = FSUtils.listStatus(fs, regionDir, nonHidden);<a name="line.145"></a>
-<span class="sourceLineNo">146</span>    // if there no files, we can just delete the directory and return;<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    if (storeDirs == null) {<a name="line.147"></a>
-<span class="sourceLineNo">148</span>      LOG.debug("Region directory " + regionDir + " empty.");<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      return deleteRegionWithoutArchiving(fs, regionDir);<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    }<a name="line.150"></a>
-<span class="sourceLineNo">151</span><a name="line.151"></a>
-<span class="sourceLineNo">152</span>    // convert the files in the region to a File<a name="line.152"></a>
-<span class="sourceLineNo">153</span>    toArchive.addAll(Lists.transform(Arrays.asList(storeDirs), getAsFile));<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    LOG.debug("Archiving " + toArchive);<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    List&lt;File&gt; failedArchive = resolveAndArchive(fs, regionArchiveDir, toArchive,<a name="line.155"></a>
-<span class="sourceLineNo">156</span>        EnvironmentEdgeManager.currentTime());<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    if (!failedArchive.isEmpty()) {<a name="line.157"></a>
-<span class="sourceLineNo">158</span>      throw new FailedArchiveException("Failed to archive/delete all the files for region:"<a name="line.158"></a>
-<span class="sourceLineNo">159</span>          + regionDir.getName() + " into " + regionArchiveDir<a name="line.159"></a>
-<span class="sourceLineNo">160</span>          + ". Something is probably awry on the filesystem.",<a name="line.160"></a>
-<span class="sourceLineNo">161</span>          Collections2.transform(failedArchive, FUNC_FILE_TO_PATH));<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    }<a name="line.162"></a>
-<span class="sourceLineNo">163</span>    // if that was successful, then we delete the region<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    return deleteRegionWithoutArchiving(fs, regionDir);<a name="line.164"></a>
-<span class="sourceLineNo">165</span>  }<a name="line.165"></a>
-<span class="sourceLineNo">166</span><a name="line.166"></a>
-<span class="sourceLineNo">167</span>  /**<a name="line.167"></a>
-<span class="sourceLineNo">168</span>   * Remove from the specified region the store files of the specified column family,<a name="line.168"></a>
-<span class="sourceLineNo">169</span>   * either by archiving them or outright deletion<a name="line.169"></a>
-<span class="sourceLineNo">170</span>   * @param fs the filesystem where the store files live<a name="line.170"></a>
-<span class="sourceLineNo">171</span>   * @param conf {@link Configuration} to examine to determine the archive directory<a name="line.171"></a>
-<span class="sourceLineNo">172</span>   * @param parent Parent region hosting the store files<a name="line.172"></a>
-<span class="sourceLineNo">173</span>   * @param tableDir {@link Path} to where the table is being stored (for building the archive path)<a name="line.173"></a>
-<span class="sourceLineNo">174</span>   * @param family the family hosting the store files<a name="line.174"></a>
-<span class="sourceLineNo">175</span>   * @throws IOException if the files could not be correctly disposed.<a name="line.175"></a>
-<span class="sourceLineNo">176</span>   */<a name="line.176"></a>
-<span class="sourceLineNo">177</span>  public static void archiveFamily(FileSystem fs, Configuration conf,<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      RegionInfo parent, Path tableDir, byte[] family) throws IOException {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    Path familyDir = new Path(tableDir, new Path(parent.getEncodedName(), Bytes.toString(family)));<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    archiveFamilyByFamilyDir(fs, conf, parent, familyDir, family);<a name="line.180"></a>
-<span class="sourceLineNo">181</span>  }<a name="line.181"></a>
-<span class="sourceLineNo">182</span><a name="line.182"></a>
-<span class="sourceLineNo">183</span>  /**<a name="line.183"></a>
-<span class="sourceLineNo">184</span>   * Removes from the specified region the store files of the specified column family,<a name="line.184"></a>
-<span class="sourceLineNo">185</span>   * either by archiving them or outright deletion<a name="line.185"></a>
-<span class="sourceLineNo">186</span>   * @param fs the filesystem where the store files live<a name="line.186"></a>
-<span class="sourceLineNo">187</span>   * @param conf {@link Configuration} to examine to determine the archive directory<a name="line.187"></a>
-<span class="sourceLineNo">188</span>   * @param parent Parent region hosting the store files<a name="line.188"></a>
-<span class="sourceLineNo">189</span>   * @param familyDir {@link Path} to where the family is being stored<a name="line.189"></a>
-<span class="sourceLineNo">190</span>   * @param family the family hosting the store files<a name="line.190"></a>
-<span class="sourceLineNo">191</span>   * @throws IOException if the files could not be correctly disposed.<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   */<a name="line.192"></a>
-<span class="sourceLineNo">193</span>  public static void archiveFamilyByFamilyDir(FileSystem fs, Configuration conf,<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      RegionInfo parent, Path familyDir, byte[] family) throws IOException {<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    FileStatus[] storeFiles = FSUtils.listStatus(fs, familyDir);<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    if (storeFiles == null) {<a name="line.196"></a>
-<span class="sourceLineNo">197</span>      LOG.debug("No store files to dispose for region=" + parent.getRegionNameAsString() +<a name="line.197"></a>
-<span class="sourceLineNo">198</span>          ", family=" + Bytes.toString(family));<a name="line.198"></a>
-<span class="sourceLineNo">199</span>      return;<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    }<a name="line.200"></a>
-<span class="sourceLineNo">201</span><a name="line.201"></a>
-<span class="sourceLineNo">202</span>    FileStatusConverter getAsFile = new FileStatusConverter(fs);<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    Collection&lt;File&gt; toArchive = Lists.transform(Arrays.asList(storeFiles), getAsFile);<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, parent, family);<a name="line.204"></a>
-<span class="sourceLineNo">205</span><a name="line.205"></a>
-<span class="sourceLineNo">206</span>    // do the actual archive<a name="line.206"></a>
-<span class="sourceLineNo">207</span>    List&lt;File&gt; failedArchive = resolveAndArchive(fs, storeArchiveDir, toArchive,<a name="line.207"></a>
-<span class="sourceLineNo">208</span>        EnvironmentEdgeManager.currentTime());<a name="line.208"></a>
-<span class="sourceLineNo">209</span>    if (!failedArchive.isEmpty()){<a name="line.209"></a>
-<span class="sourceLineNo">210</span>      throw new FailedArchiveException("Failed to archive/delete all the files for region:"<a name="line.210"></a>
-<span class="sourceLineNo">211</span>          + Bytes.toString(parent.getRegionName()) + ", family:" + Bytes.toString(family)<a name="line.211"></a>
-<span class="sourceLineNo">212</span>          + " into " + storeArchiveDir + ". Something is probably awry on the filesystem.",<a name="line.212"></a>
-<span class="sourceLineNo">213</span>          Collections2.transform(failedArchive, FUNC_FILE_TO_PATH));<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>  }<a name="line.215"></a>
-<span class="sourceLineNo">216</span><a name="line.216"></a>
-<span class="sourceLineNo">217</span>  /**<a name="line.217"></a>
-<span class="sourceLineNo">218</span>   * Remove the store files, either by archiving them or outright deletion<a name="line.218"></a>
-<span class="sourceLineNo">219</span>   * @param conf {@link Configuration} to examine to determine the archive directory<a name="line.219"></a>
-<span class="sourceLineNo">220</span>   * @param fs the filesystem where the store files live<a name="line.220"></a>
-<span class="sourceLineNo">221</span>   * @param regionInfo {@link RegionInfo} of the region hosting the store files<a name="line.221"></a>
-<span class="sourceLineNo">222</span>   * @param family the family hosting the store files<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   * @param compactedFiles files to be disposed of. No further reading of these files should be<a name="line.223"></a>
-<span class="sourceLineNo">224</span>   *          attempted; otherwise likely to cause an {@link IOException}<a name="line.224"></a>
-<span class="sourceLineNo">225</span>   * @throws IOException if the files could not be correctly disposed.<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>  public static void archiveStoreFiles(Configuration conf, FileSystem fs, RegionInfo regionInfo,<a name="line.227"></a>
-<span class="sourceLineNo">228</span>      Path tableDir, byte[] family, Collection&lt;HStoreFile&gt; compactedFiles)<a name="line.228"></a>
-<span class="sourceLineNo">229</span>      throws IOException, FailedArchiveException {<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>    // sometimes in testing, we don't have rss, so we need to check for that<a name="line.231"></a>
-<span class="sourceLineNo">232</span>    if (fs == null) {<a name="line.232"></a>
-<span class="sourceLineNo">233</span>      LOG.warn("Passed filesystem is null, so just deleting the files without archiving for region:"<a name="line.233"></a>
-<span class="sourceLineNo">234</span>          + Bytes.toString(regionInfo.getRegionName()) + ", family:" + Bytes.toString(family));<a name="line.234"></a>
-<span class="sourceLineNo">235</span>      deleteStoreFilesWithoutArchiving(compactedFiles);<a name="line.235"></a>
-<span class="sourceLineNo">236</span>      return;<a name="line.236"></a>
-<span class="sourceLineNo">237</span>    }<a name="line.237"></a>
-<span class="sourceLineNo">238</span><a name="line.238"></a>
-<span class="sourceLineNo">239</span>    // short circuit if we don't have any files to delete<a name="line.239"></a>
-<span class="sourceLineNo">240</span>    if (compactedFiles.isEmpty()) {<a name="line.240"></a>
-<span class="sourceLineNo">241</span>      LOG.debug("No store files to dispose, done!");<a name="line.241"></a>
-<span class="sourceLineNo">242</span>      return;<a name="line.242"></a>
-<span class="sourceLineNo">243</span>    }<a name="line.243"></a>
-<span class="sourceLineNo">244</span><a name="line.244"></a>
-<span class="sourceLineNo">245</span>    // build the archive path<a name="line.245"></a>
-<span class="sourceLineNo">246</span>    if (regionInfo == null || family == null) throw new IOException(<a name="line.246"></a>
-<span class="sourceLineNo">247</span>        "Need to have a region and a family to archive from.");<a name="line.247"></a>
+<span class="sourceLineNo">112</span>    LOG.debug("ARCHIVING {}", rootdir.toString());<a name="line.112"></a>
+<span class="sourceLineNo">113</span><a name="line.113"></a>
+<span class="sourceLineNo">114</span>    // otherwise, we archive the files<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    // make sure we can archive<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    if (tableDir == null || regionDir == null) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>      LOG.error("No archive directory could be found because tabledir (" + tableDir<a name="line.117"></a>
+<span class="sourceLineNo">118</span>          + ") or regiondir (" + regionDir + "was null. Deleting files instead.");<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      deleteRegionWithoutArchiving(fs, regionDir);<a name="line.119"></a>
+<span class="sourceLineNo">120</span>      // we should have archived, but failed to. Doesn't matter if we deleted<a name="line.120"></a>
+<span class="sourceLineNo">121</span>      // the archived files correctly or not.<a name="line.121"></a>
+<span class="sourceLineNo">122</span>      return false;<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    }<a name="line.123"></a>
+<span class="sourceLineNo">124</span><a name="line.124"></a>
+<span class="sourceLineNo">125</span>    // make sure the regiondir lives under the tabledir<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    Preconditions.checkArgument(regionDir.toString().startsWith(tableDir.toString()));<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    Path regionArchiveDir = HFileArchiveUtil.getRegionArchiveDir(rootdir,<a name="line.127"></a>
+<span class="sourceLineNo">128</span>        FSUtils.getTableName(tableDir),<a name="line.128"></a>
+<span class="sourceLineNo">129</span>        regionDir.getName());<a name="line.129"></a>
+<span class="sourceLineNo">130</span><a name="line.130"></a>
+<span class="sourceLineNo">131</span>    FileStatusConverter getAsFile = new FileStatusConverter(fs);<a name="line.131"></a>
+<span class="sourceLineNo">132</span>    // otherwise, we attempt to archive the store files<a name="line.132"></a>
+<span class="sourceLineNo">133</span><a name="line.133"></a>
+<span class="sourceLineNo">134</span>    // build collection of just the store directories to archive<a name="line.134"></a>
+<span class="sourceLineNo">135</span>    Collection&lt;File&gt; toArchive = new ArrayList&lt;&gt;();<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    final PathFilter dirFilter = new FSUtils.DirFilter(fs);<a name="line.136"></a>
+<span class="sourceLineNo">137</span>    PathFilter nonHidden = new PathFilter() {<a name="line.137"></a>
+<span class="sourceLineNo">138</span>      @Override<a name="line.138"></a>
+<span class="sourceLineNo">139</span>      public boolean accept(Path file) {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        return dirFilter.accept(file) &amp;&amp; !file.getName().toString().startsWith(".");<a name="line.140"></a>
+<span class="sourceLineNo">141</span>      }<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    };<a name="line.142"></a>
+<span class="sourceLineNo">143</span>    FileStatus[] storeDirs = FSUtils.listStatus(fs, regionDir, nonHidden);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    // if there no files, we can just delete the directory and return;<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    if (storeDirs == null) {<a name="line.145"></a>
+<span class="sourceLineNo">146</span>      LOG.debug("Directory {} empty.", regionDir);<a name="line.146"></a>
+<span class="sourceLineNo">147</span>      return deleteRegionWithoutArchiving(fs, regionDir);<a name="line.147"></a>
+<span class="sourceLineNo">148</span>    }<a name="line.148"></a>
+<span class="sourceLineNo">149</span><a name="line.149"></a>
+<span class="sourceLineNo">150</span>    // convert the files in the region to a File<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    toArchive.addAll(Lists.transform(Arrays.asList(storeDirs), getAsFile));<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    LOG.debug("Archiving " + toArchive);<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    List&lt;File&gt; failedArchive = resolveAndArchive(fs, regionArchiveDir, toArchive,<a name="line.153"></a>
+<span class="sourceLineNo">154</span>        EnvironmentEdgeManager.currentTime());<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    if (!failedArchive.isEmpty()) {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>      throw new FailedArchiveException("Failed to archive/delete all the files for region:"<a name="line.156"></a>
+<span class="sourceLineNo">157</span>          + regionDir.getName() + " into " + regionArchiveDir<a name="line.157"></a>
+<span class="sourceLineNo">158</span>          + ". Something is probably awry on the filesystem.",<a name="line.158"></a>
+<span class="sourceLineNo">159</span>          Collections2.transform(failedArchive, FUNC_FILE_TO_PATH));<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    }<a name="line.160"></a>
+<span class="sourceLineNo">161</span>    // if that was successful, then we delete the region<a name="line.161"></a>
+<span class="sourceLineNo">162</span>    return deleteRegionWithoutArchiving(fs, regionDir);<a name="line.162"></a>
+<span class="sourceLineNo">163</span>  }<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>  /**<a name="line.165"></a>
+<span class="sourceLineNo">166</span>   * Remove from the specified region the store files of the specified column family,<a name="line.166"></a>
+<span class="sourceLineNo">167</span>   * either by archiving them or outright deletion<a name="line.167"></a>
+<span class="sourceLineNo">168</span>   * @param fs the filesystem where the store files live<a name="line.168"></a>
+<span class="sourceLineNo">169</span>   * @param conf {@link Configuration} to examine to determine the archive directory<a name="line.169"></a>
+<span class="sourceLineNo">170</span>   * @param parent Parent region hosting the store files<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   * @param tableDir {@link Path} to where the table is being stored (for building the archive path)<a name="line.171"></a>
+<span class="sourceLineNo">172</span>   * @param family the family hosting the store files<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   * @throws IOException if the files could not be correctly disposed.<a name="line.173"></a>
+<span class="sourceLineNo">174</span>   */<a name="line.174"></a>
+<span class="sourceLineNo">175</span>  public static void archiveFamily(FileSystem fs, Configuration conf,<a name="line.175"></a>
+<span class="sourceLineNo">176</span>      RegionInfo parent, Path tableDir, byte[] family) throws IOException {<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    Path familyDir = new Path(tableDir, new Path(parent.getEncodedName(), Bytes.toString(family)));<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    archiveFamilyByFamilyDir(fs, conf, parent, familyDir, family);<a name="line.178"></a>
+<span class="sourceLineNo">179</span>  }<a name="line.179"></a>
+<span class="sourceLineNo">180</span><a name="line.180"></a>
+<span class="sourceLineNo">181</span>  /**<a name="line.181"></a>
+<span class="sourceLineNo">182</span>   * Removes from the specified region the store files of the specified column family,<a name="line.182"></a>
+<span class="sourceLineNo">183</span>   * either by archiving them or outright deletion<a name="line.183"></a>
+<span class="sourceLineNo">184</span>   * @param fs the filesystem where the store files live<a name="line.184"></a>
+<span class="sourceLineNo">185</span>   * @param conf {@link Configuration} to examine to determine the archive directory<a name="line.185"></a>
+<span class="sourceLineNo">186</span>   * @param parent Parent region hosting the store files<a name="line.186"></a>
+<span class="sourceLineNo">187</span>   * @param familyDir {@link Path} to where the family is being stored<a name="line.187"></a>
+<span class="sourceLineNo">188</span>   * @param family the family hosting the store files<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   * @throws IOException if the files could not be correctly disposed.<a name="line.189"></a>
+<span class="sourceLineNo">190</span>   */<a name="line.190"></a>
+<span class="sourceLineNo">191</span>  public static void archiveFamilyByFamilyDir(FileSystem fs, Configuration conf,<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      RegionInfo parent, Path familyDir, byte[] family) throws IOException {<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    FileStatus[] storeFiles = FSUtils.listStatus(fs, familyDir);<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    if (storeFiles == null) {<a name="line.194"></a>
+<span class="sourceLineNo">195</span>      LOG.debug("No files to dispose of in {}, family={}", parent.getRegionNameAsString(),<a name="line.195"></a>
+<span class="sourceLineNo">196</span>          Bytes.toString(family));<a name="line.196"></a>
+<span class="sourceLineNo">197</span>      return;<a name="line.197"></a>
+<span class="sourceLineNo">198</span>    }<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span>    FileStatusConverter getAsFile = new FileStatusConverter(fs);<a name="line.200"></a>
+<span class="sourceLineNo">201</span>    Collection&lt;File&gt; toArchive = Lists.transform(Arrays.asList(storeFiles), getAsFile);<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, parent, family);<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>    // do the actual archive<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    List&lt;File&gt; failedArchive = resolveAndArchive(fs, storeArchiveDir, toArchive,<a name="line.205"></a>
+<span class="sourceLineNo">206</span>        EnvironmentEdgeManager.currentTime());<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    if (!failedArchive.isEmpty()){<a name="line.207"></a>
+<span class="sourceLineNo">208</span>      throw new FailedArchiveException("Failed to archive/delete all the files for region:"<a name="line.208"></a>
+<span class="sourceLineNo">209</span>          + Bytes.toString(parent.getRegionName()) + ", family:" + Bytes.toString(family)<a name="line.209"></a>
+<span class="sourceLineNo">210</span>          + " into " + storeArchiveDir + ". Something is probably awry on the filesystem.",<a name="line.210"></a>
+<span class="sourceLineNo">211</span>          Collections2.transform(failedArchive, FUNC_FILE_TO_PATH));<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    }<a name="line.212"></a>
+<span class="sourceLineNo">213</span>  }<a name="line.213"></a>
+<span class="sourceLineNo">214</span><a name="line.214"></a>
+<span class="sourceLineNo">215</span>  /**<a name="line.215"></a>
+<span class="sourceLineNo">216</span>   * Remove the store files, either by archiving them or outright deletion<a name="line.216"></a>
+<span class="sourceLineNo">217</span>   * @param conf {@link Configuration} to examine to determine the archive directory<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   * @param fs the filesystem where the store files live<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   * @param regionInfo {@link RegionInfo} of the region hosting the store files<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   * @param family the family hosting the store files<a name="line.220"></a>
+<span class="sourceLineNo">221</span>   * @param compactedFiles files to be disposed of. No further reading of these files should be<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   *          attempted; otherwise likely to cause an {@link IOException}<a name="line.222"></a>
+<span class="sourceLineNo">223</span>   * @throws IOException if the files could not be correctly disposed.<a name="line.223"></a>
+<span class="sourceLineNo">224</span>   */<a name="line.224"></a>
+<span class="sourceLineNo">225</span>  public static void archiveStoreFiles(Configuration conf, FileSystem fs, RegionInfo regionInfo,<a name="line.225"></a>
+<span class="sourceLineNo">226</span>      Path tableDir, byte[] family, Collection&lt;HStoreFile&gt; compactedFiles)<a name="line.226"></a>
+<span class="sourceLineNo">227</span>      throws IOException, FailedArchiveException {<a name="line.227"></a>
+<span class="sourceLineNo">228</span><a name="line.228"></a>
+<span class="sourceLineNo">229</span>    // sometimes in testing, we don't have rss, so we need to check for that<a name="line.229"></a>
+<span class="sourceLineNo">230</span>    if (fs == null) {<a name="line.230"></a>
+<span class="sourceLineNo">231</span>      LOG.warn("Passed filesystem is null, so just deleting files without archiving for {}," +<a name="line.231"></a>
+<span class="sourceLineNo">232</span>              "family={}", Bytes.toString(regionInfo.getRegionName()), Bytes.toString(family));<a name="line.232"></a>
+<span class="sourceLineNo">233</span>      deleteStoreFilesWithoutArchiving(compactedFiles);<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      return;<a name="line.234"></a>
+<span class="sourceLineNo">235</span>    }<a name="line.235"></a>
+<span class="sourceLineNo">236</span><a name="line.236"></a>
+<span class="sourceLineNo">237</span>    // short circuit if we don't have any files to delete<a name="line.237"></a>
+<span class="sourceLineNo">238</span>    if (compactedFiles.isEmpty()) {<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      LOG.debug("No files to dispose of, done!");<a name="line.239"></a>
+<span class="sourceLineNo">240</span>      return;<a name="line.240"></a>
+<span class="sourceLineNo">241</span>    }<a name="line.241"></a>
+<span class="sourceLineNo">242</span><a name="line.242"></a>
+<span class="sourceLineNo">243</span>    // build the archive path<a name="line.243"></a>
+<span class="sourceLineNo">244</span>    if (regionInfo == null || family == null) throw new IOException(<a name="line.244"></a>
+<span class="sourceLineNo">245</span>        "Need to have a region and a family to archive from.");<a name="line.245"></a>
+<span class="sourceLineNo">246</span><a name="line.246"></a>
+<span class="sourceLineNo">247</span>    Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, regionInfo, tableDir, family);<a name="line.247"></a>
 <span class="sourceLineNo">248</span><a name="line.248"></a>
-<span class="sourceLineNo">249</span>    Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, regionInfo, tableDir, family);<a name="line.249"></a>
-<span class="sourceLineNo">250</span><a name="line.250"></a>
-<span class="sourceLineNo">251</span>    // make sure we don't archive if we can't and that the archive dir exists<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    if (!fs.mkdirs(storeArchiveDir)) {<a name="line.252"></a>
-<span class="sourceLineNo">253</span>      throw new IOException("Could not make archive directory (" + storeArchiveDir + ") for store:"<a name="line.253"></a>
-<span class="sourceLineNo">254</span>          + Bytes.toString(family) + ", deleting compacted files instead.");<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>    // otherwise we attempt to archive the store files<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    LOG.debug("Archiving compacted store files.");<a name="line.258"></a>
-<span class="sourceLineNo">259</span><a name="line.259"></a>
-<span class="sourceLineNo">260</span>    // Wrap the storefile into a File<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    StoreToFile getStorePath = new StoreToFile(fs);<a name="line.261"></a>
-<span class="sourceLineNo">262</span>    Collection&lt;File&gt; storeFiles = Collections2.transform(compactedFiles, getStorePath);<a name="line.262"></a>
-<span class="sourceLineNo">263</span><a name="line.263"></a>
-<span class="sourceLineNo">264</span>    // do the actual archive<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    List&lt;File&gt; failedArchive = resolveAndArchive(fs, storeArchiveDir, storeFiles,<a name="line.265"></a>
-<span class="sourceLineNo">266</span>        EnvironmentEdgeManager.currentTime());<a name="line.266"></a>
-<span class="sourceLineNo">267</span><a name="line.267"></a>
-<span class="sourceLineNo">268</span>    if (!failedArchive.isEmpty()){<a name="line.268"></a>
-<span class="sourceLineNo">269</span>      throw new FailedArchiveException("Failed to archive/delete all the files for region:"<a name="line.269"></a>
-<span class="sourceLineNo">270</span>          + Bytes.toString(regionInfo.getRegionName()) + ", family:" + Bytes.toString(family)<a name="line.270"></a>
-<span class="sourceLineNo">271</span>          + " into " + storeArchiveDir + ". Something is probably awry on the filesystem.",<a name="line.271"></a>
-<span class="sourceLineNo">272</span>          Collections2.transform(failedArchive, FUNC_FILE_TO_PATH));<a name="line.272"></a>
-<span class="sourceLineNo">273</span>    }<a name="line.273"></a>
-<span class="sourceLineNo">274</span>  }<a name="line.274"></a>
-<span class="sourceLineNo">275</span><a name="line.275"></a>
-<span class="sourceLineNo">276</span>  /**<a name="line.276"></a>
-<span class="sourceLineNo">277</span>   * Archive the store file<a name="line.277"></a>
-<span class="sourceLineNo">278</span>   * @param fs the filesystem where the store files live<a name="line.278"></a>
-<span class="sourceLineNo">279</span>   * @param regionInfo region hosting the store files<a name="line.279"></a>
-<span class="sourceLineNo">280</span>   * @param conf {@link Configuration} to examine to determine the archive directory<a name="line.280"></a>
-<span class="sourceLineNo">281</span>   * @param tableDir {@link Path} to where the table is being stored (for building the archive path)<a name="line.281"></a>
-<span class="sourceLineNo">282</span>   * @param family the family hosting the store files<a name="line.282"></a>
-<span class="sourceLineNo">283</span>   * @param storeFile file to be archived<a name="line.283"></a>
-<span class="sourceLineNo">284</span>   * @throws IOException if the files could not be correctly disposed.<a name="line.284"></a>
-<span class="sourceLineNo">285</span>   */<a name="line.285"></a>
-<span class="sourceLineNo">286</span>  public static void archiveStoreFile(Configuration conf, FileSystem fs, RegionInfo regionInfo,<a name="line.286"></a>
-<span class="sourceLineNo">287</span>      Path tableDir, byte[] family, Path storeFile) throws IOException {<a name="line.287"></a>
-<span class="sourceLineNo">288</span>    Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, regionInfo, tableDir, family);<a name="line.288"></a>
-<span class="sourceLineNo">289</span>    // make sure we don't archive if we can't and that the archive dir exists<a name="line.289"></a>
-<span class="sourceLineNo">290</span>    if (!fs.mkdirs(storeArchiveDir)) {<a name="line.290"></a>
-<span class="sourceLineNo">291</span>      throw new IOException("Could not make archive directory (" + storeArchiveDir + ") for store:"<a name="line.291"></a>
-<span class="sourceLineNo">292</span>          + Bytes.toString(family) + ", deleting compacted files instead.");<a name="line.292"></a>
-<span class="sourceLineNo">293</span>    }<a name="line.293"></a>
-<span class="sourceLineNo">294</span><a name="line.294"></a>
-<span class="sourceLineNo">295</span>    // do the actual archive<a name="line.295"></a>
-<span class="sourceLineNo">296</span>    long start = EnvironmentEdgeManager.currentTime();<a name="line.296"></a>
-<span class="sourceLineNo">297</span>    File file = new FileablePath(fs, storeFile);<a name="line.297"></a>
-<span class="sourceLineNo">298</span>    if (!resolveAndArchiveFile(storeArchiveDir, file, Long.toString(start))) {<a name="line.298"></a>
-<span class="sourceLineNo">299</span>      throw new IOException("Failed to archive/delete the file for region:"<a name="line.299"></a>
-<span class="sourceLineNo">300</span>          + regionInfo.getRegionNameAsString() + ", family:" + Bytes.toString(family)<a name="line.300"></a>
-<span class="sourceLineNo">301</span>          + " into " + storeArchiveDir + ". Something is probably awry on the filesystem.");<a name="line.301"></a>
-<span class="sourceLineNo">302</span>    }<a name="line.302"></a>
-<span class="sourceLineNo">303</span>  }<a name="line.303"></a>
-<span class="sourceLineNo">304</span><a name="line.304"></a>
-<span class="sourceLineNo">305</span>  /**<a name="line.305"></a>
-<span class="sourceLineNo">306</span>   * Resolve any conflict with an existing archive file via timestamp-append<a name="line.306"></a>
-<span class="sourceLineNo">307</span>   * renaming of the existing file and then archive the passed in files.<a name="line.307"></a>
-<span class="sourceLineNo">308</span>   * @param fs {@link FileSystem} on which to archive the files<a name="line.308"></a>
-<span class="sourceLineNo">309</span>   * @param baseArchiveDir base archive directory to store the files. If any of<a name="line.309"></a>
-<span class="sourceLineNo">310</span>   *          the files to archive are directories, will append the name of the<a name="line.310"></a>
-<span class="sourceLineNo">311</span>   *          directory to the base archive directory name, creating a parallel<a name="line.311"></a>
-<span class="sourceLineNo">312</span>   *          structure.<a name="line.312"></a>
-<span class="sourceLineNo">313</span>   * @param toArchive files/directories that need to be archvied<a name="line.313"></a>
-<span class="sourceLineNo">314</span>   * @param start time the archiving started - used for resolving archive<a name="line.314"></a>
-<span class="sourceLineNo">315</span>   *          conflicts.<a name="line.315"></a>
-<span class="sourceLineNo">316</span>   * @return the list of failed to archive files.<a name="line.316"></a>
-<span class="sourceLineNo">317</span>   * @throws IOException if an unexpected file operation exception occurred<a name="line.317"></a>
-<span class="sourceLineNo">318</span>   */<a name="line.318"></a>
-<span class="sourceLineNo">319</span>  private static List&lt;File&gt; resolveAndArchive(FileSystem fs, Path baseArchiveDir,<a name="line.319"></a>
-<span class="sourceLineNo">320</span>      Collection&lt;File&gt; toArchive, long start) throws IOException {<a name="line.320"></a>
-<span class="sourceLineNo">321</span>    // short circuit if no files to move<a name="line.321"></a>
-<span class="sourceLineNo">322</span>    if (toArchive.isEmpty()) return Collections.emptyList();<a name="line.322"></a>
+<span class="sourceLineNo">249</span>    // make sure we don't archive if we can't and that the archive dir exists<a name="line.249"></a>
+<span class="sourceLineNo">250</span>    if (!fs.mkdirs(storeArchiveDir)) {<a name="line.250"></a>
+<span class="sourceLineNo">251</span>      throw new IOException("Could not make archive directory (" + storeArchiveDir + ") for store:"<a name="line.251"></a>
+<span class="sourceLineNo">252</span>          + Bytes.toString(family) + ", deleting compacted files instead.");<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>    // otherwise we attempt to archive the store files<a name="line.255"></a>
+<span class="sourceLineNo">256</span>    LOG.debug("Archiving compacted files.");<a name="line.256"></a>
+<span class="sourceLineNo">257</span><a name="line.257"></a>
+<span class="sourceLineNo">258</span>    // Wrap the storefile into a File<a name="line.258"></a>
+<span class="sourceLineNo">259</span>    StoreToFile getStorePath = new StoreToFile(fs);<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    Collection&lt;File&gt; storeFiles = Collections2.transform(compactedFiles, getStorePath);<a name="line.260"></a>
+<span class="sourceLineNo">261</span><a name="line.261"></a>
+<span class="sourceLineNo">262</span>    // do the actual archive<a name="line.262"></a>
+<span class="sourceLineNo">263</span>    List&lt;File&gt; failedArchive = resolveAndArchive(fs, storeArchiveDir, storeFiles,<a name="line.263"></a>
+<span class="sourceLineNo">264</span>        EnvironmentEdgeManager.currentTime());<a name="line.264"></a>
+<span class="sourceLineNo">265</span><a name="line.265"></a>
+<span class="sourceLineNo">266</span>    if (!failedArchive.isEmpty()){<a name="line.266"></a>
+<span class="sourceLineNo">267</span>      throw new FailedArchiveException("Failed to archive/delete all the files for region:"<a name="line.267"></a>
+<span class="sourceLineNo">268</span>          + Bytes.toString(regionInfo.getRegionName()) + ", family:" + Bytes.toString(family)<a name="line.268"></a>
+<span class="sourceLineNo">269</span>          + " into " + storeArchiveDir + ". Something is probably awry on the filesystem.",<a name="line.269"></a>
+<span class="sourceLineNo">270</span>          Collections2.transform(failedArchive, FUNC_FILE_TO_PATH));<a name="line.270"></a>
+<span class="sourceLineNo">271</span>    }<a name="line.271"></a>
+<span class="sourceLineNo">272</span>  }<a name="line.272"></a>
+<span class="sourceLineNo">273</span><a name="line.273"></a>
+<span class="sourceLineNo">274</span>  /**<a name="line.274"></a>
+<span class="sourceLineNo">275</span>   * Archive the store file<a name="line.275"></a>
+<span class="sourceLineNo">276</span>   * @param fs the filesystem where the store files live<a name="line.276"></a>
+<span class="sourceLineNo">277</span>   * @param regionInfo region hosting the store files<a name="line.277"></a>
+<span class="sourceLineNo">278</span>   * @param conf {@link Configuration} to examine to determine the archive directory<a name="line.278"></a>
+<span class="sourceLineNo">279</span>   * @param tableDir {@link Path} to where the table is being stored (for building the archive path)<a name="line.279"></a>
+<span class="sourceLineNo">280</span>   * @param family the family hosting the store files<a name="line.280"></a>
+<span class="sourceLineNo">281</span>   * @param storeFile file to be archived<a name="line.281"></a>
+<span class="sourceLineNo">282</span>   * @throws IOException if the files could not be correctly disposed.<a name="line.282"></a>
+<span class="sourceLineNo">283</span>   */<a name="line.283"></a>
+<span class="sourceLineNo">284</span>  public static void archiveStoreFile(Configuration conf, FileSystem fs, RegionInfo regionInfo,<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      Path tableDir, byte[] family, Path storeFile) throws IOException {<a name="line.285"></a>
+<span class="sourceLineNo">286</span>    Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, regionInfo, tableDir, family);<a name="line.286"></a>
+<span class="sourceLineNo">287</span>    // make sure we don't archive if we can't and that the archive dir exists<a name="line.287"></a>
+<span class="sourceLineNo">288</span>    if (!fs.mkdirs(storeArchiveDir)) {<a name="line.288"></a>
+<span class="sourceLineNo">289</span>      throw new IOException("Could not make archive directory (" + storeArchiveDir + ") for store:"<a name="line.289"></a>
+<span class="sourceLineNo">290</span>          + Bytes.toString(family) + ", deleting compacted files instead.");<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>    // do the actual archive<a name="line.293"></a>
+<span class="sourceLineNo">294</span>    long start = EnvironmentEdgeManager.currentTime();<a name="line.294"></a>
+<span class="sourceLineNo">295</span>    File file = new FileablePath(fs, storeFile);<a name="line.295"></a>
+<span class="sourceLineNo">296</span>    if (!resolveAndArchiveFile(storeArchiveDir, file, Long.toString(start))) {<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      throw new IOException("Failed to archive/delete the file for region:"<a name="line.297"></a>
+<span class="sourceLineNo">298</span>          + regionInfo.getRegionNameAsString() + ", family:" + Bytes.toString(family)<a name="line.298"></a>
+<span class="sourceLineNo">299</span>          + " into " + storeArchiveDir + ". Something is probably awry on the filesystem.");<a name="line.299"></a>
+<span class="sourceLineNo">300</span>    }<a name="line.300"></a>
+<span class="sourceLineNo">301</span>  }<a name="line.301"></a>
+<span class="sourceLineNo">302</span><a name="line.302"></a>
+<span class="sourceLineNo">303</span>  /**<a name="line.303"></a>
+<span class="sourceLineNo">304</span>   * Resolve any conflict with an existing archive file via timestamp-append<a name="line.304"></a>
+<span class="sourceLineNo">305</span>   * renaming of the existing file and then archive the passed in files.<a name="line.305"></a>
+<span class="sourceLineNo">306</span>   * @param fs {@link FileSystem} on which to archive the files<a name="line.306"></a>
+<span class="sourceLineNo">307</span>   * @param baseArchiveDir base archive directory to store the files. If any of<a name="line.307"></a>
+<span class="sourceLineNo">308</span>   *          the files to archive are directories, will append the name of the<a name="line.308"></a>
+<span class="sourceLineNo">309</span>   *          directory to the base archive directory name, creating a parallel<a name="line.309"></a>
+<span class="sourceLineNo">310</span>   *          structure.<a name="line.310"></a>
+<span class="sourceLineNo">311</span>   * @param toArchive files/directories that need to be archvied<a name="line.311"></a>
+<span class="sourceLineNo">312</span>   * @param start time the archiving started - used for resolving archive<a name="line.312"></a>
+<span class="sourceLineNo">313</span>   *          conflicts.<a name="line.313"></a>
+<span class="sourceLineNo">314</span>   * @return the list of failed to archive files.<a name="line.314"></a>
+<span class="sourceLineNo">315</span>   * @throws IOException if an unexpected file operation exception occurred<a name="line.315"></a>
+<span class="sourceLineNo">316</span>   */<a name="line.316"></a>
+<span class="sourceLineNo">317</span>  private static List&lt;File&gt; resolveAndArchive(FileSystem fs, Path baseArchiveDir,<a name="line.317"></a>
+<span class="sourceLineNo">318</span>      Collection&lt;File&gt; toArchive, long start) throws IOException {<a name="line.318"></a>
+<span class="sourceLineNo">319</span>    // short circuit if no files to move<a name="line.319"></a>
+<span class="sourceLineNo">320</span>    if (toArchive.isEmpty()) {<a name="line.320"></a>
+<span class="sourceLineNo">321</span>      return Collections.emptyList();<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    }<a name="line.322"></a>
 <span class="sourceLineNo">323</span><a name="line.323"></a>
-<span class="sourceLineNo">324</span>    if (LOG.isTraceEnabled()) LOG.trace("moving files to the archive directory: " + baseArchiveDir);<a name="line.324"></a>
+<span class="sourceLineNo">324</span>    LOG.trace("Moving files to the archive directory {}", baseArchiveDir);<a name="line.324"></a>
 <span class="sourceLineNo">325</span><a name="line.325"></a>
 <span class="sourceLineNo">326</span>    // make sure the archive directory exists<a name="line.326"></a>
 <span class="sourceLineNo">327</span>    if (!fs.exists(baseArchiveDir)) {<a name="line.327"></a>
@@ -337,7 +337,7 @@
 <span class="sourceLineNo">329</span>        throw new IOException("Failed to create the archive directory:" + baseArchiveDir<a name="line.329"></a>
 <span class="sourceLineNo">330</span>            + ", quitting archive attempt.");<a name="line.330"></a>
 <span class="sourceLineNo">331</span>      }<a name="line.331"></a>
-<span class="sourceLineNo">332</span>      if (LOG.isTraceEnabled()) LOG.trace("Created archive directory:" + baseArchiveDir);<a name="line.332"></a>
+<span class="sourceLineNo">332</span>      LOG.trace("Created archive directory {}", baseArchiveDir);<a name="line.332"></a>
 <span class="sourceLineNo">333</span>    }<a name="line.333"></a>
 <span class="sourceLineNo">334</span><a name="line.334"></a>
 <span class="sourceLineNo">335</span>    List&lt;File&gt; failures = new ArrayList&lt;&gt;();<a name="line.335"></a>
@@ -345,7 +345,7 @@
 <span class="sourceLineNo">337</span>    for (File file : toArchive) {<a name="line.337"></a>
 <span class="sourceLineNo">338</span>      // if its a file archive it<a name="line.338"></a>
 <span class="sourceLineNo">339</span>      try {<a name="line.339"></a>
-<span class="sourceLineNo">340</span>        if (LOG.isTraceEnabled()) LOG.trace("Archiving: " + file);<a name="line.340"></a>
+<span class="sourceLineNo">340</span>        LOG.trace("Archiving {}", file);<a name="line.340"></a>
 <span class="sourceLineNo">341</span>        if (file.isFile()) {<a name="line.341"></a>
 <span class="sourceLineNo">342</span>          // attempt to archive the file<a name="line.342"></a>
 <span class="sourceLineNo">343</span>          if (!resolveAndArchiveFile(baseArchiveDir, file, startTime)) {<a name="line.343"></a>
@@ -354,7 +354,7 @@
 <span class="sourceLineNo">346</span>          }<a name="line.346"></a>
 <span class="sourceLineNo">347</span>        } else {<a name="line.347"></a>
 <span class="sourceLineNo">348</span>          // otherwise its a directory and we need to archive all files<a name="line.348"></a>
-<span class="sourceLineNo">349</span>          if (LOG.isTraceEnabled()) LOG.trace(file + " is a directory, archiving children files");<a name="line.349"></a>
+<span class="sourceLineNo">349</span>          LOG.trace("{} is a directory, archiving children files", file);<a name="line.349"></a>
 <span class="sourceLineNo">350</span>          // so we add the directory name to the one base archive<a name="line.350"></a>
 <span class="sourceLineNo">351</span>          Path parentArchiveDir = new Path(baseArchiveDir, file.getName());<a name="line.351"></a>
 <span class="sourceLineNo">352</span>          // and then get all the files from that directory and attempt to<a name="line.352"></a>
@@ -363,7 +363,7 @@
 <span class="sourceLineNo">355</span>          failures.addAll(resolveAndArchive(fs, parentArchiveDir, children, start));<a name="line.355"></a>
 <span class="sourceLineNo">356</span>        }<a name="line.356"></a>
 <span class="sourceLineNo">357</span>      } catch (IOException e) {<a name="line.357"></a>
-<span class="sourceLineNo">358</span>        LOG.warn("Failed to archive " + file, e);<a name="line.358"></a>
+<span class="sourceLineNo">358</span>        LOG.warn("Failed to archive {}", file, e);<a name="line.358"></a>
 <span class="sourceLineNo">359</span>        failures.add(file);<a name="line.359"></a>
 <span class="sourceLineNo">360</span>      }<a name="line.360"></a>
 <span class="sourceLineNo">361</span>    }<a name="line.361"></a>
@@ -393,319 +393,312 @@
 <span class="sourceLineNo">385</span>    // really, really unlikely situtation, where we get the same name for the existing file, but<a name="line.385"></a>
 <span class="sourceLineNo">386</span>    // is included just for that 1 in trillion chance.<a name="line.386"></a>
 <span class="sourceLineNo">387</span>    if (fs.exists(archiveFile)) {<a name="line.387"></a>
-<span class="sourceLineNo">388</span>      if (LOG.isDebugEnabled()) {<a name="line.388"></a>
-<span class="sourceLineNo">389</span>        LOG.debug("File:" + archiveFile + " already exists in archive, moving to "<a name="line.389"></a>
-<span class="sourceLineNo">390</span>            + "timestamped backup and overwriting current.");<a name="line.390"></a>
-<span class="sourceLineNo">391</span>      }<a name="line.391"></a>
-<span class="sourceLineNo">392</span><a name="line.392"></a>
-<span class="sourceLineNo">393</span>      // move the archive file to the stamped backup<a name="line.393"></a>
-<span class="sourceLineNo">394</span>      Path backedupArchiveFile = new Path(archiveDir, filename + SEPARATOR + archiveStartTime);<a name="line.394"></a>
-<span class="sourceLineNo">395</span>      if (!fs.rename(archiveFile, backedupArchiveFile)) {<a name="line.395"></a>
-<span class="sourceLineNo">396</span>        LOG.error("Could not rename archive file to backup: " + backedupArchiveFile<a name="line.396"></a>
-<span class="sourceLineNo">397</span>            + ", deleting existing file in favor of newer.");<a name="line.397"></a>
-<span class="sourceLineNo">398</span>        // try to delete the exisiting file, if we can't rename it<a name="line.398"></a>
-<span class="sourceLineNo">399</span>        if (!fs.delete(archiveFile, false)) {<a name="line.399"></a>
-<span class="sourceLineNo">400</span>          throw new IOException("Couldn't delete existing archive file (" + archiveFile<a name="line.400"></a>
-<span class="sourceLineNo">401</span>              + ") or rename it to the backup file (" + backedupArchiveFile<a name="line.401"></a>
-<span class="sourceLineNo">402</span>              + ") to make room for similarly named file.");<a name="line.402"></a>
-<span class="sourceLineNo">403</span>        }<a name="line.403"></a>
-<span class="sourceLineNo">404</span>      }<a name="line.404"></a>
-<span class="sourceLineNo">405</span>      LOG.debug("Backed up archive file from " + archiveFile);<a name="line.405"></a>
-<span class="sourceLineNo">406</span>    }<a name="line.406"></a>
+<span class="sourceLineNo">388</span>      LOG.debug("{} already exists in archive, moving to timestamped backup and " +<a name="line.388"></a>
+<span class="sourceLineNo">389</span>          "overwriting current.", archiveFile);<a name="line.389"></a>
+<span class="sourceLineNo">390</span><a name="line.390"></a>
+<span class="sourceLineNo">391</span>      // move the archive file to the stamped backup<a name="line.391"></a>
+<span class="sourceLineNo">392</span>      Path backedupArchiveFile = new Path(archiveDir, filename + SEPARATOR + archiveStartTime);<a name="line.392"></a>
+<span class="sourceLineNo">393</span>      if (!fs.rename(archiveFile, backedupArchiveFile)) {<a name="line.393"></a>
+<span class="sourceLineNo">394</span>        LOG.error("Could not rename archive file to backup: " + backedupArchiveFile<a name="line.394"></a>
+<span class="sourceLineNo">395</span>            + ", deleting existing file in favor of newer.");<a name="line.395"></a>
+<span class="sourceLineNo">396</span>        // try to delete the exisiting file, if we can't rename it<a name="line.396"></a>
+<span class="sourceLineNo">397</span>        if (!fs.delete(archiveFile, false)) {<a name="line.397"></a>
+<span class="sourceLineNo">398</span>          throw new IOException("Couldn't delete existing archive file (" + archiveFile<a name="line.398"></a>
+<span class="sourceLineNo">399</span>              + ") or rename it to the backup file (" + backedupArchiveFile<a name="line.399"></a>
+<span class="sourceLineNo">400</span>              + ") to make room for similarly named file.");<a name="line.400"></a>
+<span class="sourceLineNo">401</span>        }<a name="line.401"></a>
+<span class="sourceLineNo">402</span>      }<a name="line.402"></a>
+<span class="sourceLineNo">403</span>      LOG.debug("Backed up archive file from " + archiveFile);<a name="line.403"></a>
+<span class="sourceLineNo">404</span>    }<a name="line.404"></a>
+<span class="sourceLineNo">405</span><a name="line.405"></a>
+<span class="sourceLineNo">406</span>    LOG.trace("No existing file in archive for {}, free to archive original file.", archiveFile);<a name="line.406"></a>
 <span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>    if (LOG.isTraceEnabled()) {<a name="line.408"></a>
-<span class="sourceLineNo">409</span>      LOG.trace("No existing file in archive for: " + archiveFile +<a name="line.409"></a>
-<span class="sourceLineNo">410</span>        ", free to archive original file.");<a name="line.410"></a>
-<span class="sourceLineNo">411</span>    }<a name="line.411"></a>
-<span class="sourceLineNo">412</span><a name="line.412"></a>
-<span class="sourceLineNo">413</span>    // at this point, we should have a free spot for the archive file<a name="line.413"></a>
-<span class="sourceLineNo">414</span>    boolean success = false;<a name="line.414"></a>
-<span class="sourceLineNo">415</span>    for (int i = 0; !success &amp;&amp; i &lt; DEFAULT_RETRIES_NUMBER; ++i) {<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      if (i &gt; 0) {<a name="line.416"></a>
-<span class="sourceLineNo">417</span>        // Ensure that the archive directory exists.<a name="line.417"></a>
-<span class="sourceLineNo">418</span>        // The previous "move to archive" operation has failed probably because<a name="line.418"></a>
-<span class="sourceLineNo">419</span>        // the cleaner has removed our archive directory (HBASE-7643).<a name="line.419"></a>
-<span class="sourceLineNo">420</span>        // (we're in a retry loop, so don't worry too much about the exception)<a name="line.420"></a>
-<span class="sourceLineNo">421</span>        try {<a name="line.421"></a>
-<span class="sourceLineNo">422</span>          if (!fs.exists(archiveDir)) {<a name="line.422"></a>
-<span class="sourceLineNo">423</span>            if (fs.mkdirs(archiveDir)) {<a name="line.423"></a>
-<span class="sourceLineNo">424</span>              LOG.debug("Created archive directory:" + archiveDir);<a name="line.424"></a>
-<span class="sourceLineNo">425</span>            }<a name="line.425"></a>
-<span class="sourceLineNo">426</span>          }<a name="line.426"></a>
-<span class="sourceLineNo">427</span>        } catch (IOException e) {<a name="line.427"></a>
-<span class="sourceLineNo">428</span>          LOG.warn("Failed to create directory: " + archiveDir, e);<a name="line.428"></a>
-<span class="sourceLineNo">429</span>        }<a name="line.429"></a>
-<span class="sourceLineNo">430</span>      }<a name="line.430"></a>
-<span class="sourceLineNo">431</span><a name="line.431"></a>
-<span class="sourceLineNo">432</span>      try {<a name="line.432"></a>
-<span class="sourceLineNo">433</span>        success = currentFile.moveAndClose(archiveFile);<a name="line.433"></a>
-<span class="sourceLineNo">434</span>      } catch (FileNotFoundException fnfe) {<a name="line.434"></a>
-<span class="sourceLineNo">435</span>        LOG.warn("Failed to archive " + currentFile +<a name="line.435"></a>
-<span class="sourceLineNo">436</span>            " because it does not exist! Skipping and continuing on.", fnfe);<a name="line.436"></a>
-<span class="sourceLineNo">437</span>        success = true;<a name="line.437"></a>
-<span class="sourceLineNo">438</span>      } catch (IOException e) {<a name="line.438"></a>
-<span class="sourceLineNo">439</span>        LOG.warn("Failed to archive " + currentFile + " on try #" + i, e);<a name="line.439"></a>
-<span class="sourceLineNo">440</span>        success = false;<a name="line.440"></a>
-<span class="sourceLineNo">441</span>      }<a name="line.441"></a>
+<span class="sourceLineNo">408</span>    // at this point, we should have a free spot for the archive file<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    boolean success = false;<a name="line.409"></a>
+<span class="sourceLineNo">410</span>    for (int i = 0; !success &amp;&amp; i &lt; DEFAULT_RETRIES_NUMBER; ++i) {<a name="line.410"></a>
+<span class="sourceLineNo">411</span>      if (i &gt; 0) {<a name="line.411"></a>
+<span class="sourceLineNo">412</span>        // Ensure that the archive directory exists.<a name="line.412"></a>
+<span class="sourceLineNo">413</span>        // The previous "move to archive" operation has failed probably because<a name="line.413"></a>
+<span class="sourceLineNo">414</span>        // the cleaner has removed our archive directory (HBASE-7643).<a name="line.414"></a>
+<span class="sourceLineNo">415</span>        // (we're in a retry loop, so don't worry too much about the exception)<a name="line.415"></a>
+<span class="sourceLineNo">416</span>        try {<a name="line.416"></a>
+<span class="sourceLineNo">417</span>          if (!fs.exists(archiveDir)) {<a name="line.417"></a>
+<span class="sourceLineNo">418</span>            if (fs.mkdirs(archiveDir)) {<a name="line.418"></a>
+<span class="sourceLineNo">419</span>              LOG.debug("Created archive directory {}", archiveDir);<a name="line.419"></a>
+<span class="sourceLineNo">420</span>            }<a name="line.420"></a>
+<span class="sourceLineNo">421</span>          }<a name="line.421"></a>
+<span class="sourceLineNo">422</span>        } catch (IOException e) {<a name="line.422"></a>
+<span class="sourceLineNo">423</span>          LOG.warn("Failed to create directory {}", archiveDir, e);<a name="line.423"></a>
+<span class="sourceLineNo">424</span>        }<a name="line.424"></a>
+<span class="sourceLineNo">425</span>      }<a name="line.425"></a>
+<span class="sourceLineNo">426</span><a name="line.426"></a>
+<span class="sourceLineNo">427</span>      try {<a name="line.427"></a>
+<span class="sourceLineNo">428</span>        success = currentFile.moveAndClose(archiveFile);<a name="line.428"></a>
+<span class="sourceLineNo">429</span>      } catch (FileNotFoundException fnfe) {<a name="line.429"></a>
+<span class="sourceLineNo">430</span>        LOG.warn("Failed to archive " + currentFile +<a name="line.430"></a>
+<span class="sourceLineNo">431</span>            " because it does not exist! Skipping and continuing on.", fnfe);<a name="line.431"></a>
+<span class="sourceLineNo">432</span>        success = true;<a name="line.432"></a>
+<span class="sourceLineNo">433</span>      } catch (IOException e) {<a name="line.433"></a>
+<span class="sourceLineNo">434</span>        LOG.warn("Failed to archive " + currentFile + " on try #" + i, e);<a name="line.434"></a>
+<span class="sourceLineNo">435</span>        success = false;<a name="line.435"></a>
+<span class="sourceLineNo">436</span>      }<a name="line.436"></a>
+<span class="sourceLineNo">437</span>    }<a name="line.437"></a>
+<span class="sourceLineNo">438</span><a name="line.438"></a>
+<span class="sourceLineNo">439</span>    if (!success) {<a name="line.439"></a>
+<span class="sourceLineNo">440</span>      LOG.error("Failed to archive " + currentFile);<a name="line.440"></a>
+<span class="sourceLineNo">441</span>      return false;<a name="line.441"></a>
 <span class="sourceLineNo">442</span>    }<a name="line.442"></a>
 <span class="sourceLineNo">443</span><a name="line.443"></a>
-<span class="sourceLineNo">444</span>    if (!success) {<a name="line.444"></a>
-<span class="sourceLineNo">445</span>      LOG.error("Failed to archive " + currentFile);<a name="line.445"></a>
-<span class="sourceLineNo">446</span>      return false;<a name="line.446"></a>
-<span class="sourceLineNo">447</span>    }<a name="line.447"></a>
-<span class="sourceLineNo">448</span><a name="line.448"></a>
-<span class="sourceLineNo">449</span>    if (LOG.isDebugEnabled()) {<a name="line.449"></a>
-<span class="sourceLineNo">450</span>      LOG.debug("Finished archiving from " + currentFile + ", to " + archiveFile);<a name="line.450"></a>
-<span class="sourceLineNo">451</span>    }<a name="line.451"></a>
-<span class="sourceLineNo">452</span>    return true;<a name="line.452"></a>
-<span class="sourceLineNo">453</span>  }<a name="line.453"></a>
-<span class="sourceLineNo">454</span><a name="line.454"></a>
-<span class="sourceLineNo">455</span>  /**<a name="line.455"></a>
-<span class="sourceLineNo">456</span>   * Without regard for backup, delete a region. Should be used with caution.<a name="line.456"></a>
-<span class="sourceLineNo">457</span>   * @param regionDir {@link Path} to the region to be deleted.<a name="line.457"></a>
-<span class="sourceLineNo">458</span>   * @param fs FileSystem from which to delete the region<a name="line.458"></a>
-<span class="sourceLineNo">459</span>   * @return &lt;tt&gt;true&lt;/tt&gt; on successful deletion, &lt;tt&gt;false&lt;/tt&gt; otherwise<a name="line.459"></a>
-<span class="sourceLineNo">460</span>   * @throws IOException on filesystem operation failure<a name="line.460"></a>
-<span class="sourceLineNo">461</span>   */<a name="line.461"></a>
-<span class="sourceLineNo">462</span>  private static boolean deleteRegionWithoutArchiving(FileSystem fs, Path regionDir)<a name="line.462"></a>
-<span class="sourceLineNo">463</span>      throws IOException {<a name="line.463"></a>
-<span class="sourceLineNo">464</span>    if (fs.delete(regionDir, true)) {<a name="line.464"></a>
-<span class="sourceLineNo">465</span>      LOG.debug("Deleted " + regionDir);<a name="line.465"></a>
-<span class="sourceLineNo">466</span>      return true;<a name="line.466"></a>
-<span class="sourceLineNo">467</span>    }<a name="line.467"></a>
-<span class="sourceLineNo">468</span>    LOG.debug("Failed to delete region directory:" + regionDir);<a name="line.468"></a>
-<span class="sourceLineNo">469</span>    return false;<a name="line.469"></a>
-<span class="sourceLineNo">470</span>  }<a name="line.470"></a>
-<span class="sourceLineNo">471</span><a name="line.471"></a>
-<span class="sourceLineNo">472</span>  /**<a name="line.472"></a>
-<span class="sourceLineNo">473</span>   * Just do a simple delete of the given store files<a name="line.473"></a>
-<span class="sourceLineNo">474</span>   * &lt;p&gt;<a name="line.474"></a>
-<span class="sourceLineNo">475</span>   * A best effort is made to delete each of the files, rather than bailing on the first failure.<a name="line.475"></a>
-<span class="sourceLineNo">476</span>   * &lt;p&gt;<a name="line.476"></a>
-<span class="sourceLineNo">477</span>   * @param compactedFiles store files to delete from the file system.<a name="line.477"></a>
-<span class="sourceLineNo">478</span>   * @throws IOException if a file cannot be deleted. All files will be attempted to deleted before<a name="line.478"></a>
-<span class="sourceLineNo">479</span>   *           throwing the exception, rather than failing at the first file.<a name="line.479"></a>
-<span class="sourceLineNo">480</span>   */<a name="line.480"></a>
-<span class="sourceLineNo">481</span>  private static void deleteStoreFilesWithoutArchiving(Collection&lt;HStoreFile&gt; compactedFiles)<a name="line.481"></a>
-<span class="sourceLineNo">482</span>      throws IOException {<a name="line.482"></a>
-<span class="sourceLineNo">483</span>    LOG.debug("Deleting store files without archiving.");<a name="line.483"></a>
-<span class="sourceLineNo">484</span>    List&lt;IOException&gt; errors = new ArrayList&lt;&gt;(0);<a name="line.484"></a>
-<span class="sourceLineNo">485</span>    for (HStoreFile hsf : compactedFiles) {<a name="line.485"></a>
-<span class="sourceLineNo">486</span>      try {<a name="line.486"></a>
-<span class="sourceLineNo">487</span>        hsf.deleteStoreFile();<a name="line.487"></a>
-<span class="sourceLineNo">488</span>      } catch (IOException e) {<a name="line.488"></a>
-<span class="sourceLineNo">489</span>        LOG.error("Failed to delete store file:" + hsf.getPath());<a name="line.489"></a>
-<span class="sourceLineNo">490</span>        errors.add(e);<a name="line.490"></a>
-<span class="sourceLineNo">491</span>      }<a name="line.491"></a>
-<span class="sourceLineNo">492</span>    }<a name="line.492"></a>
-<span class="sourceLineNo">493</span>    if (errors.size() &gt; 0) {<a name="line.493"></a>
-<span class="sourceLineNo">494</span>      throw MultipleIOException.createIOException(errors);<a name="line.494"></a>
-<span class="sourceLineNo">495</span>    }<a name="line.495"></a>
-<span class="sourceLineNo">496</span>  }<a name="line.496"></a>
-<span class="sourceLineNo">497</span><a name="line.497"></a>
-<span class="sourceLineNo">498</span>  /**<a name="line.498"></a>
-<span class="sourceLineNo">499</span>   * Adapt a type to match the {@link File} interface, which is used internally for handling<a name="line.499"></a>
-<span class="sourceLineNo">500</span>   * archival/removal of files<a name="line.500"></a>
-<span class="sourceLineNo">501</span>   * @param &lt;T&gt; type to adapt to the {@link File} interface<a name="line.501"></a>
-<span class="sourceLineNo">502</span>   */<a name="line.502"></a>
-<span class="sourceLineNo">503</span>  private static abstract class FileConverter&lt;T&gt; implements Function&lt;T, File&gt; {<a name="line.503"></a>
-<span class="sourceLineNo">504</span>    protected final FileSystem fs;<a name="line.504"></a>
-<span class="sourceLineNo">505</span><a name="line.505"></a>
-<span class="sourceLineNo">506</span>    public FileConverter(FileSystem fs) {<a name="line.506"></a>
-<span class="sourceLineNo">507</span>      this.fs = fs;<a name="line.507"></a>
-<span class="sourceLineNo">508</span>    }<a name="line.508"></a>
-<span class="sourceLineNo">509</span>  }<a name="line.509"></a>
-<span class="sourceLineNo">510</span><a name="line.510"></a>
-<span class="sourceLineNo">511</span>  /**<a name="line.511"></a>
-<span class="sourceLineNo">512</span>   * Convert a FileStatus to something we can manage in the archiving<a name="line.512"></a>
-<span class="sourceLineNo">513</span>   */<a name="line.513"></a>
-<span class="sourceLineNo">514</span>  private static class FileStatusConverter extends FileConverter&lt;FileStatus&gt; {<a name="line.514"></a>
-<span class="sourceLineNo">515</span>    public FileStatusConverter(FileSystem fs) {<a name="line.515"></a>
-<span class="sourceLineNo">516</span>      super(fs);<a name="line.516"></a>
-<span class="sourceLineNo">517</span>    }<a name="line.517"></a>
-<span class="sourceLineNo">518</span><a name="line.518"></a>
-<span class="sourceLineNo">519</span>    @Override<a name="line.519"></a>
-<span class="sourceLineNo">520</span>    public File apply(FileStatus input) {<a name="line.520"></a>
-<span class="sourceLineNo">521</span>      return new FileablePath(fs, input.getPath());<a name="line.521"></a>
-<span class="sourceLineNo">522</span>    }<a name="line.522"></a>
-<span class="sourceLineNo">523</span>  }<a name="line.523"></a>
-<span class="sourceLineNo">524</span><a name="line.524"></a>
-<span class="sourceLineNo">525</span>  /**<a name="line.525"></a>
-<span class="sourceLineNo">526</span>   * Convert the {@link HStoreFile} into something we can manage in the archive<a name="line.526"></a>
-<span class="sourceLineNo">527</span>   * methods<a name="line.527"></a>
-<span class="sourceLineNo">528</span>   */<a name="line.528"></a>
-<span class="sourceLineNo">529</span>  private static class StoreToFile extends FileConverter&lt;HStoreFile&gt; {<a name="line.529"></a>
-<span class="sourceLineNo">530</span>    public StoreToFile(FileSystem fs) {<a name="line.530"></a>
-<span class="sourceLineNo">531</span>      super(fs);<a name="line.531"></a>
-<span class="sourceLineNo">532</span>    }<a name="line.532"></a>
-<span class="sourceLineNo">533</span><a name="line.533"></a>
-<span class="sourceLineNo">534</span>    @Override<a name="line.534"></a>
-<span class="sourceLineNo">535</span>    public File apply(HStoreFile input) {<a name="line.535"></a>
-<span class="sourceLineNo">536</span>      return new FileableStoreFile(fs, input);<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    }<a name="line.537"></a>
-<span class="sourceLineNo">538</span>  }<a name="line.538"></a>
-<span class="sourceLineNo">539</span><a name="line.539"></a>
-<span class="sourceLineNo">540</span>  /**<a name="line.540"></a>
-<span class="sourceLineNo">541</span>   * Wrapper to handle file operations uniformly<a name="line.541"></a>
-<span class="sourceLineNo">542</span>   */<a name="line.542"></a>
-<span class="sourceLineNo">543</span>  private static abstract class File {<a name="line.543"></a>
-<span class="sourceLineNo">544</span>    protected final FileSystem fs;<a name="line.544"></a>
-<span class="sourceLineNo">545</span><a name="line.545"></a>
-<span class="sourceLineNo">546</span>    public File(FileSystem fs) {<a name="line.546"></a>
-<span class="sourceLineNo">547</span>      this.fs = fs;<a name="line.547"></a>
-<span class="sourceLineNo">548</span>    }<a name="line.548"></a>
-<span class="sourceLineNo">549</span><a name="line.549"></a>
-<span class="sourceLineNo">550</span>    /**<a name="line.550"></a>
-<span class="sourceLineNo">551</span>     * Delete the file<a name="line.551"></a>
-<span class="sourceLineNo">552</span>     * @throws IOException on failure<a name="line.552"></a>
+<span class="sourceLineNo">444</span>    LOG.debug("Archived from {} to {}", currentFile, archiveFile);<a name="line.444"></a>
+<span class="sourceLineNo">445</span>    return true;<a name="line.445"></a>
+<span class="sourceLineNo">446</span>  }<a name="line.446"></a>
+<span class="sourceLineNo">447</span><a name="line.447"></a>
+<span class="sourceLineNo">448</span>  /**<a name="line.448"></a>
+<span class="sourceLineNo">449</span>   * Without regard for backup, delete a region. Should be used with caution.<a name="line.449"></a>
+<span class="sourceLineNo">450</span>   * @param regionDir {@link Path} to the region to be deleted.<a name="line.450"></a>
+<span class="sourceLineNo">451</span>   * @param fs FileSystem from which to delete the region<a name="line.451"></a>
+<span class="sourceLineNo">452</span>   * @return &lt;tt&gt;true&lt;/tt&gt; on successful deletion, &lt;tt&gt;false&lt;/tt&gt; otherwise<a name="line.452"></a>
+<span class="sourceLineNo">453</span>   * @throws IOException on filesystem operation failure<a name="line.453"></a>
+<span class="sourceLineNo">454</span>   */<a name="line.454"></a>
+<span class="sourceLineNo">455</span>  private static boolean deleteRegionWithoutArchiving(FileSystem fs, Path regionDir)<a name="line.455"></a>
+<span class="sourceLineNo">456</span>      throws IOException {<a name="line.456"></a>
+<span class="sourceLineNo">457</span>    if (fs.delete(regionDir, true)) {<a name="line.457"></a>
+<span class="sourceLineNo">458</span>      LOG.debug("Deleted {}", regionDir);<a name="line.458"></a>
+<span class="sourceLineNo">459</span>      return true;<a name="line.459"></a>
+<span class="sourceLineNo">460</span>    }<a name="line.460"></a>
+<span class="sourceLineNo">461</span>    LOG.debug("Failed to delete directory {}", regionDir);<a name="line.461"></a>
+<span class="sourceLineNo">462</span>    return false;<a name="line.462"></a>
+<span class="sourceLineNo">463</span>  }<a name="line.463"></a>
+<span class="sourceLineNo">464</span><a name="line.464"></a>
+<span class="sourceLineNo">465</span>  /**<a name="line.465"></a>
+<span class="sourceLineNo">466</span>   * Just do a simple delete of the given store files<a name="line.466"></a>
+<span class="sourceLineNo">467</span>   * &lt;p&gt;<a name="line.467"></a>
+<span class="sourceLineNo">468</span>   * A best effort is made to delete each of the files, rather than bailing on the first failure.<a name="line.468"></a>
+<span class="sourceLineNo">469</span>   * &lt;p&gt;<a name="line.469"></a>
+<span class="sourceLineNo">470</span>   * @param compactedFiles store files to delete from the file system.<a name="line.470"></a>
+<span class="sourceLineNo">471</span>   * @throws IOException if a file cannot be deleted. All files will be attempted to deleted before<a name="line.471"></a>
+<span class="sourceLineNo">472</span>   *           throwing the exception, rather than failing at the first file.<a name="line.472"></a>
+<span class="sourceLineNo">473</span>   */<a name="line.473"></a>
+<span class="sourceLineNo">474</span>  private static void deleteStoreFilesWithoutArchiving(Collection&lt;HStoreFile&gt; compactedFiles)<a name="line.474"></a>
+<span class="sourceLineNo">475</span>      throws IOException {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>    LOG.debug("Deleting files without archiving.");<a name="line.476"></a>
+<span class="sourceLineNo">477</span>    List&lt;IOException&gt; errors = new ArrayList&lt;&gt;(0);<a name="line.477"></a>
+<span class="sourceLineNo">478</span>    for (HStoreFile hsf : compactedFiles) {<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      try {<a name="line.479"></a>
+<span class="sourceLineNo">480</span>        hsf.deleteStoreFile();<a name="line.480"></a>
+<span class="sourceLineNo">481</span>      } catch (IOException e) {<a name="line.481"></a>
+<span class="sourceLineNo">482</span>        LOG.error("Failed to delete {}", hsf.getPath());<a name="line.482"></a>
+<span class="sourceLineNo">483</span>        errors.add(e);<a name="line.483"></a>
+<span class="sourceLineNo">484</span>      }<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    }<a name="line.485"></a>
+<span class="sourceLineNo">486</span>    if (errors.size() &gt; 0) {<a name="line.486"></a>
+<span class="sourceLineNo">487</span>      throw MultipleIOException.createIOException(errors);<a name="line.487"></a>
+<span class="sourceLineNo">488</span>    }<a name="line.488"></a>
+<span class="sourceLineNo">489</span>  }<a name="line.489"></a>
+<span class="sourceLineNo">490</span><a name="line.490"></a>
+<span class="sourceLineNo">491</span>  /**<a name="line.491"></a>
+<span class="sourceLineNo">492</span>   * Adapt a type to match the {@link File} interface, which is used internally for handling<a name="line.492"></a>
+<span class="sourceLineNo">493</span>   * archival/removal of files<a name="line.493"></a>
+<span class="sourceLineNo">494</span>   * @param &lt;T&gt; type to adapt to the {@link File} interface<a name="line.494"></a>
+<span class="sourceLineNo">495</span>   */<a name="line.495"></a>
+<span class="sourceLineNo">496</span>  private static abstract class FileConverter&lt;T&gt; implements Function&lt;T, File&gt; {<a name="line.496"></a>
+<span class="sourceLineNo">497</span>    protected final FileSystem fs;<a name="line.497"></a>
+<span class="sourceLineNo">498</span><a name="line.498"></a>
+<span class="sourceLineNo">499</span>    public FileConverter(FileSystem fs) {<a name="line.499"></a>
+<span class="sourceLineNo">500</span>      this.fs = fs;<a name="line.500"></a>
+<span class="sourceLineNo">501</span>    }<a name="line.501"></a>
+<span class="sourceLineNo">502</span>  }<a name="line.502"></a>
+<span class="sourceLineNo">503</span><a name="line.503"></a>
+<span class="sourceLineNo">504</span>  /**<a name="line.504"></a>
+<span class="sourceLineNo">505</span>   * Convert a FileStatus to something we can manage in the archiving<a name="line.505"></a>
+<span class="sourceLineNo">506</span>   */<a name="line.506"></a>
+<span class="sourceLineNo">507</span>  private static class FileStatusConverter extends FileConverter&lt;FileStatus&gt; {<a name="line.507"></a>
+<span class="sourceLineNo">508</span>    public FileStatusConverter(FileSystem fs) {<a name="line.508"></a>
+<span class="sourceLineNo">509</span>      super(fs);<a name="line.509"></a>
+<span class="sourceLineNo">510</span>    }<a name="line.510"></a>
+<span class="sourceLineNo">511</span><a name="line.511"></a>
+<span class="sourceLineNo">512</span>    @Override<a name="line.512"></a>
+<span class="sourceLineNo">513</span>    public File apply(FileStatus input) {<a name="line.513"></a>
+<span class="sourceLineNo">514</span>      return new FileablePath(fs, input.getPath());<a name="line.514"></a>
+<span class="sourceLineNo">515</span>    }<a name="line.515"></a>
+<span class="sourceLineNo">516</span>  }<a name="line.516"></a>
+<span class="sourceLineNo">517</span><a name="line.517"></a>
+<span class="sourceLineNo">518</span>  /**<a name="line.518"></a>
+<span class="sourceLineNo">519</span>   * Convert the {@link HStoreFile} into something we can manage in the archive<a name="line.519"></a>
+<span class="sourceLineNo">520</span>   * methods<a name="line.520"></a>
+<span class="sourceLineNo">521</span>   */<a name="line.521"></a>
+<span class="sourceLineNo">522</span>  private static class StoreToFile extends FileConverter&lt;HStoreFile&gt; {<a name="line.522"></a>
+<span class="sourceLineNo">523</span>    public StoreToFile(FileSystem fs) {<a name="line.523"></a>
+<span class="sourceLineNo">524</span>      super(fs);<a name="line.524"></a>
+<span class="sourceLineNo">525</span>    }<a name="line.525"></a>
+<span class="sourceLineNo">526</span><a name="line.526"></a>
+<span class="sourceLineNo">527</span>    @Override<a name="line.527"></a>
+<span class="sourceLineNo">528</span>    public File apply(HStoreFile input) {<a name="line.528"></a>
+<span class="sourceLineNo">529</span>      return new FileableStoreFile(fs, input);<a name="line.529"></a>
+<span class="sourceLineNo">530</span>    }<a name="line.530"></a>
+<span class="sourceLineNo">531</span>  }<a name="line.531"></a>
+<span class="sourceLineNo">532</span><a name="line.532"></a>
+<span class="sourceLineNo">533</span>  /**<a name="line.533"></a>
+<span class="sourceLineNo">534</span>   * Wrapper to handle file operations uniformly<a name="line.534"></a>
+<span class="sourceLineNo">535</span>   */<a name="line.535"></a>
+<span class="sourceLineNo">536</span>  private static abstract class File {<a name="line.536"></a>
+<span class="sourceLineNo">537</span>    protected final FileSystem fs;<a name="line.537"></a>
+<span class="sourceLineNo">538</span><a name="line.538"></a>
+<span class="sourceLineNo">539</span>    public File(FileSystem fs) {<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      this.fs = fs;<a name="line.540"></a>
+<span class="sourceLineNo">541</span>    }<a name="line.541"></a>
+<span class="sourceLineNo">542</span><a name="line.542"></a>
+<span class="sourceLineNo">543</span>    /**<a name="line.543"></a>
+<span class="sourceLineNo">544</span>     * Delete the file<a name="line.544"></a>
+<span class="sourceLineNo">545</span>     * @throws IOException on failure<a name="line.545"></a>
+<span class="sourceLineNo">546</span>     */<a name="line.546"></a>
+<span class="sourceLineNo">547</span>    abstract void delete() throws IOException;<a name="line.547"></a>
+<span class="sourceLineNo">548</span><a name="line.548"></a>
+<span class="sourceLineNo">549</span>    /**<a name="line.549"></a>
+<span class="sourceLineNo">550</span>     * Check to see if this is a file or a directory<a name="line.550"></a>
+<span class="sourceLineNo">551</span>     * @return &lt;tt&gt;true&lt;/tt&gt; if it is a file, &lt;tt&gt;false&lt;/tt&gt; otherwise<a name="line.551"></a>
+<span class="sourceLineNo">552</span>     * @throws IOException on {@link FileSystem} connection error<a name="line.552"></a>
 <span class="sourceLineNo">553</span>     */<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    abstract void delete() throws IOException;<a name="line.554"></a>
+<span class="sourceLineNo">554</span>    abstract boolean isFile() throws IOException;<a name="line.554"></a>
 <span class="sourceLineNo">555</span><a name="line.555"></a>
 <span class="sourceLineNo">556</span>    /**<a name="line.556"></a>
-<span class="sourceLineNo">557</span>     * Check to see if this is a file or a directory<a name="line.557"></a>
-<span class="sourceLineNo">558</span>     * @return &lt;tt&gt;true&lt;/tt&gt; if it is a file, &lt;tt&gt;false&lt;/tt&gt; otherwise<a name="line.558"></a>
-<span class="sourceLineNo">559</span>     * @throws IOException on {@link FileSystem} connection error<a name="line.559"></a>
+<span class="sourceLineNo">557</span>     * @return if this is a directory, returns all the children in the<a name="line.557"></a>
+<span class="sourceLineNo">558</span>     *         directory, otherwise returns an empty list<a name="line.558"></a>
+<span class="sourceLineNo">559</span>     * @throws IOException<a name="line.559"></a>
 <span class="sourceLineNo">560</span>     */<a name="line.560"></a>
-<span class="sourceLineNo">561</span>    abstract boolean isFile() throws IOException;<a name="line.561"></a>
+<span class="sourceLineNo">561</span>    abstract Collection&lt;File&gt; getChildren() throws IOException;<a name="line.561"></a>
 <span class="sourceLineNo">562</span><a name="line.562"></a>
 <span class="sourceLineNo">563</span>    /**<a name="line.563"></a>
-<span class="sourceLineNo">564</span>     * @return if this is a directory, returns all the children in the<a name="line.564"></a>
-<span class="sourceLineNo">565</span>     *         directory, otherwise returns an empty list<a name="line.565"></a>
-<span class="sourceLineNo">566</span>     * @throws IOException<a name="line.566"></a>
-<span class="sourceLineNo">567</span>     */<a name="line.567"></a>
-<span class="sourceLineNo">568</span>    abstract Collection&lt;File&gt; getChildren() throws IOException;<a name="line.568"></a>
-<span class="sourceLineNo">569</span><a name="line.569"></a>
-<span class="sourceLineNo">570</span>    /**<a name="line.570"></a>
-<span class="sourceLineNo">571</span>     * close any outside readers of the file<a name="line.571"></a>
-<span class="sourceLineNo">572</span>     * @throws IOException<a name="line.572"></a>
-<span class="sourceLineNo">573</span>     */<a name="line.573"></a>
-<span class="sourceLineNo">574</span>    abstract void close() throws IOException;<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>     * @return the name of the file (not the full fs path, just the individual<a name="line.577"></a>
-<span class="sourceLineNo">578</span>     *         file name)<a name="line.578"></a>
-<span class="sourceLineNo">579</span>     */<a name="line.579"></a>
-<span class="sourceLineNo">580</span>    abstract String getName();<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>     * @return the path to this file<a name="line.583"></a>
-<span class="sourceLineNo">584</span>     */<a name="line.584"></a>
-<span class="sourceLineNo">585</span>    abstract Path getPath();<a name="line.585"></a>
-<span class="sourceLineNo">586</span><a name="line.586"></a>
-<span class="sourceLineNo">587</span>    /**<a name="line.587"></a>
-<span class="sourceLineNo">588</span>     * Move the file to the given destination<a name="line.588"></a>
-<span class="sourceLineNo">589</span>     * @param dest<a name="line.589"></a>
-<span class="sourceLineNo">590</span>     * @return &lt;tt&gt;true&lt;/tt&gt; on success<a name="line.590"></a>
-<span class="sourceLineNo">591</span>     * @throws IOException<a name="line.591"></a>
-<span class="sourceLineNo">592</span>     */<a name="line.592"></a>
-<span class="sourceLineNo">593</span>    public boolean moveAndClose(Path dest) throws IOException {<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      this.close();<a name="line.594"></a>
-<span class="sourceLineNo">595</span>      Path p = this.getPath();<a name="line.595"></a>
-<span class="sourceLineNo">596</span>      return FSUtils.renameAndSetModifyTime(fs, p, dest);<a name="line.596"></a>
+<span class="sourceLineNo">564</span>     * close any outside readers of the file<a name="line.564"></a>
+<span class="sourceLineNo">565</span>     * @throws IOException<a name="line.565"></a>
+<span class="sourceLineNo">566</span>     */<a name="line.566"></a>
+<span class="sourceLineNo">567</span>    abstract void close() throws IOException;<a name="line.567"></a>
+<span class="sourceLineNo">568</span><a name="line.568"></a>
+<span class="sourceLineNo">569</span>    /**<a name="line.569"></a>
+<span class="sourceLineNo">570</span>     * @return the name of the file (not the full fs path, just the individual<a name="line.570"></a>
+<span class="sourceLineNo">571</span>     *         file name)<a name="line.571"></a>
+<span class="sourceLineNo">572</span>     */<a name="line.572"></a>
+<span class="sourceLineNo">573</span>    abstract String getName();<a name="line.573"></a>
+<span class="sourceLineNo">574</span><a name="line.574"></a>
+<span class="sourceLineNo">575</span>    /**<a name="line.575"></a>
+<span class="sourceLineNo">576</span>     * @return the path to this file<a name="line.576"></a>
+<span class="sourceLineNo">577</span>     */<a name="line.577"></a>
+<span class="sourceLineNo">578</span>    abstract Path getPath();<a name="line.578"></a>
+<span class="sourceLineNo">579</span><a name="line.579"></a>
+<span class="sourceLineNo">580</span>    /**<a name="line.580"></a>
+<span class="sourceLineNo">581</span>     * Move the file to the given destination<a name="line.581"></a>
+<span class="sourceLineNo">582</sp

<TRUNCATED>

Mime
View raw message