http://git-wip-us.apache.org/repos/asf/hbase-site/blob/7816cbde/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.html
----------------------------------------------------------------------
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.html
 
b/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.html
index bcf966e..de32a91 100644
--- 
a/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.html
+++ 
b/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.html
@@ -26,100 +26,100 @@
 <span class="sourceLineNo">018</span><a name="line.18"></a>
 <span class="sourceLineNo">019</span>package 
org.apache.hadoop.hbase.backup.impl;<a name="line.19"></a>
 <span class="sourceLineNo">020</span><a name="line.20"></a>
-<span class="sourceLineNo">021</span>import java.io.FileNotFoundException;<a 
name="line.21"></a>
-<span class="sourceLineNo">022</span>import java.io.IOException;<a 
name="line.22"></a>
-<span class="sourceLineNo">023</span>import java.net.URI;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import java.net.URISyntaxException;<a 
name="line.24"></a>
-<span class="sourceLineNo">025</span>import java.util.ArrayList;<a 
name="line.25"></a>
-<span class="sourceLineNo">026</span>import java.util.HashMap;<a 
name="line.26"></a>
-<span class="sourceLineNo">027</span>import java.util.List;<a 
name="line.27"></a>
-<span class="sourceLineNo">028</span>import java.util.Map;<a 
name="line.28"></a>
-<span class="sourceLineNo">029</span>import java.util.Set;<a 
name="line.29"></a>
-<span class="sourceLineNo">030</span>import java.util.TreeMap;<a 
name="line.30"></a>
-<span class="sourceLineNo">031</span><a name="line.31"></a>
-<span class="sourceLineNo">032</span>import 
org.apache.commons.lang3.StringUtils;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.commons.logging.Log;<a 
name="line.33"></a>
-<span class="sourceLineNo">034</span>import 
org.apache.commons.logging.LogFactory;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.apache.hadoop.fs.FileSystem;<a 
name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.hadoop.fs.FileUtil;<a 
name="line.36"></a>
-<span class="sourceLineNo">037</span>import org.apache.hadoop.fs.Path;<a 
name="line.37"></a>
-<span class="sourceLineNo">038</span>import 
org.apache.hadoop.hbase.TableName;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import 
org.apache.hadoop.hbase.backup.BackupCopyJob;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>import 
org.apache.hadoop.hbase.backup.BackupInfo;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>import 
org.apache.hadoop.hbase.backup.BackupInfo.BackupPhase;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import 
org.apache.hadoop.hbase.backup.BackupRequest;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import 
org.apache.hadoop.hbase.backup.BackupRestoreFactory;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>import 
org.apache.hadoop.hbase.backup.BackupType;<a name="line.44"></a>
-<span class="sourceLineNo">045</span>import 
org.apache.hadoop.hbase.backup.util.BackupUtils;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>import 
org.apache.yetus.audience.InterfaceAudience;<a name="line.46"></a>
-<span class="sourceLineNo">047</span>import 
org.apache.hadoop.hbase.client.Admin;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>import 
org.apache.hadoop.hbase.client.Connection;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>import 
org.apache.hadoop.hbase.mapreduce.WALPlayer;<a name="line.49"></a>
-<span class="sourceLineNo">050</span>import 
org.apache.hadoop.hbase.util.Bytes;<a name="line.50"></a>
-<span class="sourceLineNo">051</span>import 
org.apache.hadoop.hbase.util.FSUtils;<a name="line.51"></a>
-<span class="sourceLineNo">052</span>import 
org.apache.hadoop.hbase.util.HFileArchiveUtil;<a name="line.52"></a>
-<span class="sourceLineNo">053</span>import 
org.apache.hadoop.hbase.util.Pair;<a name="line.53"></a>
-<span class="sourceLineNo">054</span>import 
org.apache.hadoop.hbase.wal.AbstractFSWALProvider;<a name="line.54"></a>
-<span class="sourceLineNo">055</span>import org.apache.hadoop.util.Tool;<a 
name="line.55"></a>
-<span class="sourceLineNo">056</span><a name="line.56"></a>
-<span class="sourceLineNo">057</span>/**<a name="line.57"></a>
-<span class="sourceLineNo">058</span> * Incremental backup implementation.<a 
name="line.58"></a>
-<span class="sourceLineNo">059</span> * See the {@link #execute() execute} 
method.<a name="line.59"></a>
-<span class="sourceLineNo">060</span> *<a name="line.60"></a>
-<span class="sourceLineNo">061</span> */<a name="line.61"></a>
-<span class="sourceLineNo">062</span>@InterfaceAudience.Private<a 
name="line.62"></a>
-<span class="sourceLineNo">063</span>public class IncrementalTableBackupClient 
extends TableBackupClient {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>  private static final Log LOG = 
LogFactory.getLog(IncrementalTableBackupClient.class);<a name="line.64"></a>
-<span class="sourceLineNo">065</span><a name="line.65"></a>
-<span class="sourceLineNo">066</span>  protected 
IncrementalTableBackupClient() {<a name="line.66"></a>
-<span class="sourceLineNo">067</span>  }<a name="line.67"></a>
-<span class="sourceLineNo">068</span><a name="line.68"></a>
-<span class="sourceLineNo">069</span>  public 
IncrementalTableBackupClient(final Connection conn, final String backupId,<a 
name="line.69"></a>
-<span class="sourceLineNo">070</span>      BackupRequest request) throws 
IOException {<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    super(conn, backupId, request);<a 
name="line.71"></a>
-<span class="sourceLineNo">072</span>  }<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>  protected List&lt;String&gt; 
filterMissingFiles(List&lt;String&gt; incrBackupFileList) throws IOException 
{<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    FileSystem fs = 
FileSystem.get(conf);<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    List&lt;String&gt; list = new 
ArrayList&lt;String&gt;();<a name="line.76"></a>
-<span class="sourceLineNo">077</span>    for (String file : 
incrBackupFileList) {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>      Path p = new Path(file);<a 
name="line.78"></a>
-<span class="sourceLineNo">079</span>      if (fs.exists(p) || 
isActiveWalPath(p)) {<a name="line.79"></a>
-<span class="sourceLineNo">080</span>        list.add(file);<a 
name="line.80"></a>
-<span class="sourceLineNo">081</span>      } else {<a name="line.81"></a>
-<span class="sourceLineNo">082</span>        LOG.warn("Can't find file: " + 
file);<a name="line.82"></a>
-<span class="sourceLineNo">083</span>      }<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    }<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    return list;<a name="line.85"></a>
-<span class="sourceLineNo">086</span>  }<a name="line.86"></a>
-<span class="sourceLineNo">087</span><a name="line.87"></a>
-<span class="sourceLineNo">088</span>  /**<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   * Check if a given path is belongs to 
active WAL directory<a name="line.89"></a>
-<span class="sourceLineNo">090</span>   * @param p path<a name="line.90"></a>
-<span class="sourceLineNo">091</span>   * @return true, if yes<a 
name="line.91"></a>
-<span class="sourceLineNo">092</span>   */<a name="line.92"></a>
-<span class="sourceLineNo">093</span>  protected boolean isActiveWalPath(Path 
p) {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>    return 
!AbstractFSWALProvider.isArchivedLogFile(p);<a name="line.94"></a>
-<span class="sourceLineNo">095</span>  }<a name="line.95"></a>
-<span class="sourceLineNo">096</span><a name="line.96"></a>
-<span class="sourceLineNo">097</span>  protected static int getIndex(TableName 
tbl, List&lt;TableName&gt; sTableList) {<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    if (sTableList == null) return 0;<a 
name="line.98"></a>
-<span class="sourceLineNo">099</span>    for (int i = 0; i &lt; 
sTableList.size(); i++) {<a name="line.99"></a>
-<span class="sourceLineNo">100</span>      if (tbl.equals(sTableList.get(i))) 
{<a name="line.100"></a>
-<span class="sourceLineNo">101</span>        return i;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      }<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    }<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    return -1;<a name="line.104"></a>
-<span class="sourceLineNo">105</span>  }<a name="line.105"></a>
-<span class="sourceLineNo">106</span><a name="line.106"></a>
-<span class="sourceLineNo">107</span>  /*<a name="line.107"></a>
-<span class="sourceLineNo">108</span>   * Reads bulk load records from backup 
table, iterates through the records and forms the paths<a name="line.108"></a>
-<span class="sourceLineNo">109</span>   * for bulk loaded hfiles. Copies the 
bulk loaded hfiles to backup destination<a name="line.109"></a>
-<span class="sourceLineNo">110</span>   * @param sTableList list of tables to 
be backed up<a name="line.110"></a>
-<span class="sourceLineNo">111</span>   * @return map of table to List of 
files<a name="line.111"></a>
-<span class="sourceLineNo">112</span>   */<a name="line.112"></a>
-<span class="sourceLineNo">113</span>  protected Map&lt;byte[], 
List&lt;Path&gt;&gt;[] handleBulkLoad(List&lt;TableName&gt; sTableList) throws 
IOException {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    Map&lt;byte[], List&lt;Path&gt;&gt;[] 
mapForSrc = new Map[sTableList.size()];<a name="line.114"></a>
+<span class="sourceLineNo">021</span>import java.io.IOException;<a 
name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.net.URI;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.net.URISyntaxException;<a 
name="line.23"></a>
+<span class="sourceLineNo">024</span>import java.util.ArrayList;<a 
name="line.24"></a>
+<span class="sourceLineNo">025</span>import java.util.HashMap;<a 
name="line.25"></a>
+<span class="sourceLineNo">026</span>import java.util.List;<a 
name="line.26"></a>
+<span class="sourceLineNo">027</span>import java.util.Map;<a 
name="line.27"></a>
+<span class="sourceLineNo">028</span>import java.util.Set;<a 
name="line.28"></a>
+<span class="sourceLineNo">029</span>import java.util.TreeMap;<a 
name="line.29"></a>
+<span class="sourceLineNo">030</span><a name="line.30"></a>
+<span class="sourceLineNo">031</span>import 
org.apache.commons.lang3.StringUtils;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.commons.logging.Log;<a 
name="line.32"></a>
+<span class="sourceLineNo">033</span>import 
org.apache.commons.logging.LogFactory;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.hadoop.fs.FileSystem;<a 
name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.apache.hadoop.fs.Path;<a 
name="line.35"></a>
+<span class="sourceLineNo">036</span>import 
org.apache.hadoop.hbase.TableName;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import 
org.apache.hadoop.hbase.backup.BackupCopyJob;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import 
org.apache.hadoop.hbase.backup.BackupInfo.BackupPhase;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import 
org.apache.hadoop.hbase.backup.BackupRequest;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import 
org.apache.hadoop.hbase.backup.BackupRestoreFactory;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>import 
org.apache.hadoop.hbase.backup.BackupType;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>import 
org.apache.hadoop.hbase.backup.mapreduce.MapReduceBackupCopyJob;<a 
name="line.42"></a>
+<span class="sourceLineNo">043</span>import 
org.apache.hadoop.hbase.backup.util.BackupUtils;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>import 
org.apache.hadoop.hbase.client.Admin;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>import 
org.apache.hadoop.hbase.client.Connection;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>import 
org.apache.hadoop.hbase.mapreduce.WALPlayer;<a name="line.46"></a>
+<span class="sourceLineNo">047</span>import 
org.apache.hadoop.hbase.util.Bytes;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>import 
org.apache.hadoop.hbase.util.FSUtils;<a name="line.48"></a>
+<span class="sourceLineNo">049</span>import 
org.apache.hadoop.hbase.util.HFileArchiveUtil;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>import 
org.apache.hadoop.hbase.util.Pair;<a name="line.50"></a>
+<span class="sourceLineNo">051</span>import 
org.apache.hadoop.hbase.wal.AbstractFSWALProvider;<a name="line.51"></a>
+<span class="sourceLineNo">052</span>import org.apache.hadoop.util.Tool;<a 
name="line.52"></a>
+<span class="sourceLineNo">053</span>import 
org.apache.yetus.audience.InterfaceAudience;<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>/**<a name="line.55"></a>
+<span class="sourceLineNo">056</span> * Incremental backup implementation.<a 
name="line.56"></a>
+<span class="sourceLineNo">057</span> * See the {@link #execute() execute} 
method.<a name="line.57"></a>
+<span class="sourceLineNo">058</span> *<a name="line.58"></a>
+<span class="sourceLineNo">059</span> */<a name="line.59"></a>
+<span class="sourceLineNo">060</span>@InterfaceAudience.Private<a 
name="line.60"></a>
+<span class="sourceLineNo">061</span>public class IncrementalTableBackupClient 
extends TableBackupClient {<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  private static final Log LOG = 
LogFactory.getLog(IncrementalTableBackupClient.class);<a name="line.62"></a>
+<span class="sourceLineNo">063</span><a name="line.63"></a>
+<span class="sourceLineNo">064</span>  protected 
IncrementalTableBackupClient() {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>  }<a name="line.65"></a>
+<span class="sourceLineNo">066</span><a name="line.66"></a>
+<span class="sourceLineNo">067</span>  public 
IncrementalTableBackupClient(final Connection conn, final String backupId,<a 
name="line.67"></a>
+<span class="sourceLineNo">068</span>      BackupRequest request) throws 
IOException {<a name="line.68"></a>
+<span class="sourceLineNo">069</span>    super(conn, backupId, request);<a 
name="line.69"></a>
+<span class="sourceLineNo">070</span>  }<a name="line.70"></a>
+<span class="sourceLineNo">071</span><a name="line.71"></a>
+<span class="sourceLineNo">072</span>  protected List&lt;String&gt; 
filterMissingFiles(List&lt;String&gt; incrBackupFileList) throws IOException 
{<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    FileSystem fs = 
FileSystem.get(conf);<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    List&lt;String&gt; list = new 
ArrayList&lt;String&gt;();<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    for (String file : 
incrBackupFileList) {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>      Path p = new Path(file);<a 
name="line.76"></a>
+<span class="sourceLineNo">077</span>      if (fs.exists(p) || 
isActiveWalPath(p)) {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>        list.add(file);<a 
name="line.78"></a>
+<span class="sourceLineNo">079</span>      } else {<a name="line.79"></a>
+<span class="sourceLineNo">080</span>        LOG.warn("Can't find file: " + 
file);<a name="line.80"></a>
+<span class="sourceLineNo">081</span>      }<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    }<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    return list;<a name="line.83"></a>
+<span class="sourceLineNo">084</span>  }<a name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>  /**<a name="line.86"></a>
+<span class="sourceLineNo">087</span>   * Check if a given path is belongs to 
active WAL directory<a name="line.87"></a>
+<span class="sourceLineNo">088</span>   * @param p path<a name="line.88"></a>
+<span class="sourceLineNo">089</span>   * @return true, if yes<a 
name="line.89"></a>
+<span class="sourceLineNo">090</span>   */<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  protected boolean isActiveWalPath(Path 
p) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    return 
!AbstractFSWALProvider.isArchivedLogFile(p);<a name="line.92"></a>
+<span class="sourceLineNo">093</span>  }<a name="line.93"></a>
+<span class="sourceLineNo">094</span><a name="line.94"></a>
+<span class="sourceLineNo">095</span>  protected static int getIndex(TableName 
tbl, List&lt;TableName&gt; sTableList) {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>    if (sTableList == null) return 0;<a 
name="line.96"></a>
+<span class="sourceLineNo">097</span>    for (int i = 0; i &lt; 
sTableList.size(); i++) {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>      if (tbl.equals(sTableList.get(i))) 
{<a name="line.98"></a>
+<span class="sourceLineNo">099</span>        return i;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>      }<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    }<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    return -1;<a name="line.102"></a>
+<span class="sourceLineNo">103</span>  }<a name="line.103"></a>
+<span class="sourceLineNo">104</span><a name="line.104"></a>
+<span class="sourceLineNo">105</span>  /*<a name="line.105"></a>
+<span class="sourceLineNo">106</span>   * Reads bulk load records from backup 
table, iterates through the records and forms the paths<a name="line.106"></a>
+<span class="sourceLineNo">107</span>   * for bulk loaded hfiles. Copies the 
bulk loaded hfiles to backup destination<a name="line.107"></a>
+<span class="sourceLineNo">108</span>   * @param sTableList list of tables to 
be backed up<a name="line.108"></a>
+<span class="sourceLineNo">109</span>   * @return map of table to List of 
files<a name="line.109"></a>
+<span class="sourceLineNo">110</span>   */<a name="line.110"></a>
+<span class="sourceLineNo">111</span>  protected Map&lt;byte[], 
List&lt;Path&gt;&gt;[] handleBulkLoad(List&lt;TableName&gt; sTableList) throws 
IOException {<a name="line.111"></a>
+<span class="sourceLineNo">112</span>    Map&lt;byte[], List&lt;Path&gt;&gt;[] 
mapForSrc = new Map[sTableList.size()];<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    List&lt;String&gt; activeFiles = new 
ArrayList&lt;String&gt;();<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    List&lt;String&gt; archiveFiles = new 
ArrayList&lt;String&gt;();<a name="line.114"></a>
 <span class="sourceLineNo">115</span>    Pair&lt;Map&lt;TableName, 
Map&lt;String, Map&lt;String, List&lt;Pair&lt;String, 
Boolean&gt;&gt;&gt;&gt;&gt;, List&lt;byte[]&gt;&gt; pair =<a 
name="line.115"></a>
 <span class="sourceLineNo">116</span>    
backupManager.readBulkloadRows(sTableList);<a name="line.116"></a>
 <span class="sourceLineNo">117</span>    Map&lt;TableName, Map&lt;String, 
Map&lt;String, List&lt;Pair&lt;String, Boolean&gt;&gt;&gt;&gt;&gt; map = 
pair.getFirst();<a name="line.117"></a>
@@ -135,42 +135,42 @@
 <span class="sourceLineNo">127</span>    for (Map.Entry&lt;TableName, 
Map&lt;String, Map&lt;String, List&lt;Pair&lt;String, 
Boolean&gt;&gt;&gt;&gt;&gt; tblEntry :<a name="line.127"></a>
 <span class="sourceLineNo">128</span>      map.entrySet()) {<a 
name="line.128"></a>
 <span class="sourceLineNo">129</span>      TableName srcTable = 
tblEntry.getKey();<a name="line.129"></a>
-<span class="sourceLineNo">130</span>      int srcIdx = getIndex(srcTable, 
sTableList);<a name="line.130"></a>
-<span class="sourceLineNo">131</span>      if (srcIdx &lt; 0) {<a 
name="line.131"></a>
-<span class="sourceLineNo">132</span>        LOG.warn("Couldn't find " + 
srcTable + " in source table List");<a name="line.132"></a>
-<span class="sourceLineNo">133</span>        continue;<a name="line.133"></a>
-<span class="sourceLineNo">134</span>      }<a name="line.134"></a>
-<span class="sourceLineNo">135</span>      if (mapForSrc[srcIdx] == null) {<a 
name="line.135"></a>
-<span class="sourceLineNo">136</span>        mapForSrc[srcIdx] = new 
TreeMap&lt;byte[], List&lt;Path&gt;&gt;(Bytes.BYTES_COMPARATOR);<a 
name="line.136"></a>
-<span class="sourceLineNo">137</span>      }<a name="line.137"></a>
-<span class="sourceLineNo">138</span>      Path tblDir = 
FSUtils.getTableDir(rootdir, srcTable);<a name="line.138"></a>
-<span class="sourceLineNo">139</span>      Path tgtTable = new Path(new 
Path(tgtRoot, srcTable.getNamespaceAsString()),<a name="line.139"></a>
-<span class="sourceLineNo">140</span>          
srcTable.getQualifierAsString());<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      for 
(Map.Entry&lt;String,Map&lt;String,List&lt;Pair&lt;String, 
Boolean&gt;&gt;&gt;&gt; regionEntry :<a name="line.141"></a>
-<span class="sourceLineNo">142</span>        
tblEntry.getValue().entrySet()){<a name="line.142"></a>
-<span class="sourceLineNo">143</span>        String regionName = 
regionEntry.getKey();<a name="line.143"></a>
-<span class="sourceLineNo">144</span>        Path regionDir = new Path(tblDir, 
regionName);<a name="line.144"></a>
-<span class="sourceLineNo">145</span>        // map from family to List of 
hfiles<a name="line.145"></a>
-<span class="sourceLineNo">146</span>        for 
(Map.Entry&lt;String,List&lt;Pair&lt;String, Boolean&gt;&gt;&gt; famEntry :<a 
name="line.146"></a>
-<span class="sourceLineNo">147</span>          
regionEntry.getValue().entrySet()) {<a name="line.147"></a>
-<span class="sourceLineNo">148</span>          String fam = 
famEntry.getKey();<a name="line.148"></a>
-<span class="sourceLineNo">149</span>          Path famDir = new 
Path(regionDir, fam);<a name="line.149"></a>
-<span class="sourceLineNo">150</span>          List&lt;Path&gt; files;<a 
name="line.150"></a>
-<span class="sourceLineNo">151</span>          if 
(!mapForSrc[srcIdx].containsKey(fam.getBytes())) {<a name="line.151"></a>
-<span class="sourceLineNo">152</span>            files = new 
ArrayList&lt;Path&gt;();<a name="line.152"></a>
-<span class="sourceLineNo">153</span>            
mapForSrc[srcIdx].put(fam.getBytes(), files);<a name="line.153"></a>
-<span class="sourceLineNo">154</span>          } else {<a name="line.154"></a>
-<span class="sourceLineNo">155</span>            files = 
mapForSrc[srcIdx].get(fam.getBytes());<a name="line.155"></a>
-<span class="sourceLineNo">156</span>          }<a name="line.156"></a>
-<span class="sourceLineNo">157</span>          Path archiveDir = 
HFileArchiveUtil.getStoreArchivePath(conf, srcTable, regionName, fam);<a 
name="line.157"></a>
-<span class="sourceLineNo">158</span>          String tblName = 
srcTable.getQualifierAsString();<a name="line.158"></a>
-<span class="sourceLineNo">159</span>          Path tgtFam = new Path(new 
Path(tgtTable, regionName), fam);<a name="line.159"></a>
-<span class="sourceLineNo">160</span>          if (!tgtFs.mkdirs(tgtFam)) {<a 
name="line.160"></a>
-<span class="sourceLineNo">161</span>            throw new 
IOException("couldn't create " + tgtFam);<a name="line.161"></a>
-<span class="sourceLineNo">162</span>          }<a name="line.162"></a>
-<span class="sourceLineNo">163</span>          for (Pair&lt;String, 
Boolean&gt; fileWithState : famEntry.getValue()) {<a name="line.163"></a>
-<span class="sourceLineNo">164</span>            String file = 
fileWithState.getFirst();<a name="line.164"></a>
-<span class="sourceLineNo">165</span>            boolean raw = 
fileWithState.getSecond();<a name="line.165"></a>
+<span class="sourceLineNo">130</span><a name="line.130"></a>
+<span class="sourceLineNo">131</span>      int srcIdx = getIndex(srcTable, 
sTableList);<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      if (srcIdx &lt; 0) {<a 
name="line.132"></a>
+<span class="sourceLineNo">133</span>        LOG.warn("Couldn't find " + 
srcTable + " in source table List");<a name="line.133"></a>
+<span class="sourceLineNo">134</span>        continue;<a name="line.134"></a>
+<span class="sourceLineNo">135</span>      }<a name="line.135"></a>
+<span class="sourceLineNo">136</span>      if (mapForSrc[srcIdx] == null) {<a 
name="line.136"></a>
+<span class="sourceLineNo">137</span>        mapForSrc[srcIdx] = new 
TreeMap&lt;byte[], List&lt;Path&gt;&gt;(Bytes.BYTES_COMPARATOR);<a 
name="line.137"></a>
+<span class="sourceLineNo">138</span>      }<a name="line.138"></a>
+<span class="sourceLineNo">139</span>      Path tblDir = 
FSUtils.getTableDir(rootdir, srcTable);<a name="line.139"></a>
+<span class="sourceLineNo">140</span>      Path tgtTable = new Path(new 
Path(tgtRoot, srcTable.getNamespaceAsString()),<a name="line.140"></a>
+<span class="sourceLineNo">141</span>          
srcTable.getQualifierAsString());<a name="line.141"></a>
+<span class="sourceLineNo">142</span>      for 
(Map.Entry&lt;String,Map&lt;String,List&lt;Pair&lt;String, 
Boolean&gt;&gt;&gt;&gt; regionEntry :<a name="line.142"></a>
+<span class="sourceLineNo">143</span>        
tblEntry.getValue().entrySet()){<a name="line.143"></a>
+<span class="sourceLineNo">144</span>        String regionName = 
regionEntry.getKey();<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        Path regionDir = new Path(tblDir, 
regionName);<a name="line.145"></a>
+<span class="sourceLineNo">146</span>        // map from family to List of 
hfiles<a name="line.146"></a>
+<span class="sourceLineNo">147</span>        for 
(Map.Entry&lt;String,List&lt;Pair&lt;String, Boolean&gt;&gt;&gt; famEntry :<a 
name="line.147"></a>
+<span class="sourceLineNo">148</span>          
regionEntry.getValue().entrySet()) {<a name="line.148"></a>
+<span class="sourceLineNo">149</span>          String fam = 
famEntry.getKey();<a name="line.149"></a>
+<span class="sourceLineNo">150</span>          Path famDir = new 
Path(regionDir, fam);<a name="line.150"></a>
+<span class="sourceLineNo">151</span>          List&lt;Path&gt; files;<a 
name="line.151"></a>
+<span class="sourceLineNo">152</span>          if 
(!mapForSrc[srcIdx].containsKey(fam.getBytes())) {<a name="line.152"></a>
+<span class="sourceLineNo">153</span>            files = new 
ArrayList&lt;Path&gt;();<a name="line.153"></a>
+<span class="sourceLineNo">154</span>            
mapForSrc[srcIdx].put(fam.getBytes(), files);<a name="line.154"></a>
+<span class="sourceLineNo">155</span>          } else {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>            files = 
mapForSrc[srcIdx].get(fam.getBytes());<a name="line.156"></a>
+<span class="sourceLineNo">157</span>          }<a name="line.157"></a>
+<span class="sourceLineNo">158</span>          Path archiveDir = 
HFileArchiveUtil.getStoreArchivePath(conf, srcTable, regionName, fam);<a 
name="line.158"></a>
+<span class="sourceLineNo">159</span>          String tblName = 
srcTable.getQualifierAsString();<a name="line.159"></a>
+<span class="sourceLineNo">160</span>          Path tgtFam = new Path(new 
Path(tgtTable, regionName), fam);<a name="line.160"></a>
+<span class="sourceLineNo">161</span>          if (!tgtFs.mkdirs(tgtFam)) {<a 
name="line.161"></a>
+<span class="sourceLineNo">162</span>            throw new 
IOException("couldn't create " + tgtFam);<a name="line.162"></a>
+<span class="sourceLineNo">163</span>          }<a name="line.163"></a>
+<span class="sourceLineNo">164</span>          for (Pair&lt;String, 
Boolean&gt; fileWithState : famEntry.getValue()) {<a name="line.164"></a>
+<span class="sourceLineNo">165</span>            String file = 
fileWithState.getFirst();<a name="line.165"></a>
 <span class="sourceLineNo">166</span>            int idx = 
file.lastIndexOf("/");<a name="line.166"></a>
 <span class="sourceLineNo">167</span>            String filename = file;<a 
name="line.167"></a>
 <span class="sourceLineNo">168</span>            if (idx &gt; 0) {<a 
name="line.168"></a>
@@ -183,207 +183,221 @@
 <span class="sourceLineNo">175</span>              if (LOG.isTraceEnabled()) 
{<a name="line.175"></a>
 <span class="sourceLineNo">176</span>                LOG.trace("found bulk 
hfile " + file + " in " + famDir + " for " + tblName);<a name="line.176"></a>
 <span class="sourceLineNo">177</span>              }<a name="line.177"></a>
-<span class="sourceLineNo">178</span>              try {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>                if (LOG.isTraceEnabled()) 
{<a name="line.179"></a>
-<span class="sourceLineNo">180</span>                  LOG.trace("copying " + 
p + " to " + tgt);<a name="line.180"></a>
-<span class="sourceLineNo">181</span>                }<a name="line.181"></a>
-<span class="sourceLineNo">182</span>                FileUtil.copy(fs, p, 
tgtFs, tgt, false,conf);<a name="line.182"></a>
-<span class="sourceLineNo">183</span>              } catch 
(FileNotFoundException e) {<a name="line.183"></a>
-<span class="sourceLineNo">184</span>                LOG.debug("copying 
archive " + archive + " to " + tgt);<a name="line.184"></a>
-<span class="sourceLineNo">185</span>                try {<a 
name="line.185"></a>
-<span class="sourceLineNo">186</span>                  FileUtil.copy(fs, 
archive, tgtFs, tgt, false, conf);<a name="line.186"></a>
-<span class="sourceLineNo">187</span>                } catch 
(FileNotFoundException fnfe) {<a name="line.187"></a>
-<span class="sourceLineNo">188</span>                  if (!raw) throw fnfe;<a 
name="line.188"></a>
-<span class="sourceLineNo">189</span>                }<a name="line.189"></a>
-<span class="sourceLineNo">190</span>              }<a name="line.190"></a>
-<span class="sourceLineNo">191</span>            } else {<a 
name="line.191"></a>
-<span class="sourceLineNo">192</span>              LOG.debug("copying archive 
" + archive + " to " + tgt);<a name="line.192"></a>
-<span class="sourceLineNo">193</span>              try {<a name="line.193"></a>
-<span class="sourceLineNo">194</span>                FileUtil.copy(fs, 
archive, tgtFs, tgt, false, conf);<a name="line.194"></a>
-<span class="sourceLineNo">195</span>              } catch 
(FileNotFoundException fnfe) {<a name="line.195"></a>
-<span class="sourceLineNo">196</span>                if (!raw) throw fnfe;<a 
name="line.196"></a>
-<span class="sourceLineNo">197</span>              }<a name="line.197"></a>
-<span class="sourceLineNo">198</span>            }<a name="line.198"></a>
-<span class="sourceLineNo">199</span>            files.add(tgt);<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>      }<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    }<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    
backupManager.writeBulkLoadedFiles(sTableList, mapForSrc);<a 
name="line.204"></a>
-<span class="sourceLineNo">205</span>    
backupManager.removeBulkLoadedRows(sTableList, pair.getSecond());<a 
name="line.205"></a>
-<span class="sourceLineNo">206</span>    return mapForSrc;<a 
name="line.206"></a>
-<span class="sourceLineNo">207</span>  }<a name="line.207"></a>
-<span class="sourceLineNo">208</span><a name="line.208"></a>
-<span class="sourceLineNo">209</span>  @Override<a name="line.209"></a>
-<span class="sourceLineNo">210</span>  public void execute() throws 
IOException {<a name="line.210"></a>
-<span class="sourceLineNo">211</span><a name="line.211"></a>
-<span class="sourceLineNo">212</span>    try {<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      // case PREPARE_INCREMENTAL:<a 
name="line.213"></a>
-<span class="sourceLineNo">214</span>      beginBackup(backupManager, 
backupInfo);<a name="line.214"></a>
-<span class="sourceLineNo">215</span>      
backupInfo.setPhase(BackupPhase.PREPARE_INCREMENTAL);<a name="line.215"></a>
-<span class="sourceLineNo">216</span>      LOG.debug("For incremental backup, 
current table set is "<a name="line.216"></a>
-<span class="sourceLineNo">217</span>          + 
backupManager.getIncrementalBackupTableSet());<a name="line.217"></a>
-<span class="sourceLineNo">218</span>      newTimestamps =<a 
name="line.218"></a>
-<span class="sourceLineNo">219</span>          ((IncrementalBackupManager) 
backupManager).getIncrBackupLogFileMap();<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    } catch (Exception e) {<a 
name="line.220"></a>
-<span class="sourceLineNo">221</span>      // fail the overall backup and 
return<a name="line.221"></a>
-<span class="sourceLineNo">222</span>      failBackup(conn, backupInfo, 
backupManager, e, "Unexpected Exception : ",<a name="line.222"></a>
-<span class="sourceLineNo">223</span>        BackupType.INCREMENTAL, conf);<a 
name="line.223"></a>
-<span class="sourceLineNo">224</span>      throw new IOException(e);<a 
name="line.224"></a>
-<span class="sourceLineNo">225</span>    }<a name="line.225"></a>
-<span class="sourceLineNo">226</span><a name="line.226"></a>
-<span class="sourceLineNo">227</span>    // case INCREMENTAL_COPY:<a 
name="line.227"></a>
+<span class="sourceLineNo">178</span>                if (LOG.isTraceEnabled()) 
{<a name="line.178"></a>
+<span class="sourceLineNo">179</span>                  LOG.trace("copying " + 
p + " to " + tgt);<a name="line.179"></a>
+<span class="sourceLineNo">180</span>                }<a name="line.180"></a>
+<span class="sourceLineNo">181</span>                
activeFiles.add(p.toString());<a name="line.181"></a>
+<span class="sourceLineNo">182</span>            } else if 
(fs.exists(archive)){<a name="line.182"></a>
+<span class="sourceLineNo">183</span>              LOG.debug("copying archive 
" + archive + " to " + tgt);<a name="line.183"></a>
+<span class="sourceLineNo">184</span>                
archiveFiles.add(archive.toString());<a name="line.184"></a>
+<span class="sourceLineNo">185</span>            }<a name="line.185"></a>
+<span class="sourceLineNo">186</span>            files.add(tgt);<a 
name="line.186"></a>
+<span class="sourceLineNo">187</span>          }<a name="line.187"></a>
+<span class="sourceLineNo">188</span>        }<a name="line.188"></a>
+<span class="sourceLineNo">189</span>      }<a name="line.189"></a>
+<span class="sourceLineNo">190</span>    }<a name="line.190"></a>
+<span class="sourceLineNo">191</span><a name="line.191"></a>
+<span class="sourceLineNo">192</span>    copyBulkLoadedFiles(activeFiles, 
archiveFiles);<a name="line.192"></a>
+<span class="sourceLineNo">193</span><a name="line.193"></a>
+<span class="sourceLineNo">194</span>    
backupManager.writeBulkLoadedFiles(sTableList, mapForSrc);<a 
name="line.194"></a>
+<span class="sourceLineNo">195</span>    
backupManager.removeBulkLoadedRows(sTableList, pair.getSecond());<a 
name="line.195"></a>
+<span class="sourceLineNo">196</span>    return mapForSrc;<a 
name="line.196"></a>
+<span class="sourceLineNo">197</span>  }<a name="line.197"></a>
+<span class="sourceLineNo">198</span><a name="line.198"></a>
+<span class="sourceLineNo">199</span>  private void 
copyBulkLoadedFiles(List&lt;String&gt; activeFiles, List&lt;String&gt; 
archiveFiles)<a name="line.199"></a>
+<span class="sourceLineNo">200</span>    throws IOException<a 
name="line.200"></a>
+<span class="sourceLineNo">201</span>  {<a name="line.201"></a>
+<span class="sourceLineNo">202</span><a name="line.202"></a>
+<span class="sourceLineNo">203</span>    try {<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      // Enable special mode of 
BackupDistCp<a name="line.204"></a>
+<span class="sourceLineNo">205</span>      
conf.setInt(MapReduceBackupCopyJob.NUMBER_OF_LEVELS_TO_PRESERVE_KEY, 5);<a 
name="line.205"></a>
+<span class="sourceLineNo">206</span>      // Copy active files<a 
name="line.206"></a>
+<span class="sourceLineNo">207</span>      String tgtDest = 
backupInfo.getBackupRootDir() + Path.SEPARATOR + backupInfo.getBackupId();<a 
name="line.207"></a>
+<span class="sourceLineNo">208</span>      if (activeFiles.size() &gt; 0) {<a 
name="line.208"></a>
+<span class="sourceLineNo">209</span>        String[] toCopy = new 
String[activeFiles.size()];<a name="line.209"></a>
+<span class="sourceLineNo">210</span>        activeFiles.toArray(toCopy);<a 
name="line.210"></a>
+<span class="sourceLineNo">211</span>        incrementalCopyHFiles(toCopy, 
tgtDest);<a name="line.211"></a>
+<span class="sourceLineNo">212</span>      }<a name="line.212"></a>
+<span class="sourceLineNo">213</span>      if (archiveFiles.size() &gt; 0) {<a 
name="line.213"></a>
+<span class="sourceLineNo">214</span>        String[] toCopy = new 
String[archiveFiles.size()];<a name="line.214"></a>
+<span class="sourceLineNo">215</span>        archiveFiles.toArray(toCopy);<a 
name="line.215"></a>
+<span class="sourceLineNo">216</span>        incrementalCopyHFiles(toCopy, 
tgtDest);<a name="line.216"></a>
+<span class="sourceLineNo">217</span>      }<a name="line.217"></a>
+<span class="sourceLineNo">218</span>    } finally {<a name="line.218"></a>
+<span class="sourceLineNo">219</span>      // Disable special mode of 
BackupDistCp<a name="line.219"></a>
+<span class="sourceLineNo">220</span>      
conf.unset(MapReduceBackupCopyJob.NUMBER_OF_LEVELS_TO_PRESERVE_KEY);<a 
name="line.220"></a>
+<span class="sourceLineNo">221</span>    }<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><a name="line.224"></a>
+<span class="sourceLineNo">225</span>  @Override<a name="line.225"></a>
+<span class="sourceLineNo">226</span>  public void execute() throws 
IOException {<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
 <span class="sourceLineNo">228</span>    try {<a name="line.228"></a>
-<span class="sourceLineNo">229</span>      // copy out the table and region 
info files for each table<a name="line.229"></a>
-<span class="sourceLineNo">230</span>      
BackupUtils.copyTableRegionInfo(conn, backupInfo, conf);<a name="line.230"></a>
-<span class="sourceLineNo">231</span>      // convert WAL to HFiles and copy 
them to .tmp under BACKUP_ROOT<a name="line.231"></a>
-<span class="sourceLineNo">232</span>      convertWALsToHFiles(backupInfo);<a 
name="line.232"></a>
-<span class="sourceLineNo">233</span>      
incrementalCopyHFiles(backupInfo);<a name="line.233"></a>
-<span class="sourceLineNo">234</span>      // Save list of WAL files copied<a 
name="line.234"></a>
-<span class="sourceLineNo">235</span>      
backupManager.recordWALFiles(backupInfo.getIncrBackupFileList());<a 
name="line.235"></a>
+<span class="sourceLineNo">229</span>      // case PREPARE_INCREMENTAL:<a 
name="line.229"></a>
+<span class="sourceLineNo">230</span>      beginBackup(backupManager, 
backupInfo);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>      
backupInfo.setPhase(BackupPhase.PREPARE_INCREMENTAL);<a name="line.231"></a>
+<span class="sourceLineNo">232</span>      LOG.debug("For incremental backup, 
current table set is "<a name="line.232"></a>
+<span class="sourceLineNo">233</span>          + 
backupManager.getIncrementalBackupTableSet());<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      newTimestamps =<a 
name="line.234"></a>
+<span class="sourceLineNo">235</span>          ((IncrementalBackupManager) 
backupManager).getIncrBackupLogFileMap();<a name="line.235"></a>
 <span class="sourceLineNo">236</span>    } catch (Exception e) {<a 
name="line.236"></a>
-<span class="sourceLineNo">237</span>      String msg = "Unexpected exception 
in incremental-backup: incremental copy " + backupId;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>      // fail the overall backup and 
return<a name="line.238"></a>
-<span class="sourceLineNo">239</span>      failBackup(conn, backupInfo, 
backupManager, e, msg, BackupType.INCREMENTAL, conf);<a name="line.239"></a>
+<span class="sourceLineNo">237</span>      // fail the overall backup and 
return<a name="line.237"></a>
+<span class="sourceLineNo">238</span>      failBackup(conn, backupInfo, 
backupManager, e, "Unexpected Exception : ",<a name="line.238"></a>
+<span class="sourceLineNo">239</span>        BackupType.INCREMENTAL, conf);<a 
name="line.239"></a>
 <span class="sourceLineNo">240</span>      throw new IOException(e);<a 
name="line.240"></a>
 <span class="sourceLineNo">241</span>    }<a name="line.241"></a>
-<span class="sourceLineNo">242</span>    // case INCR_BACKUP_COMPLETE:<a 
name="line.242"></a>
-<span class="sourceLineNo">243</span>    // set overall backup status: 
complete. Here we make sure to complete the backup.<a name="line.243"></a>
-<span class="sourceLineNo">244</span>    // After this checkpoint, even if 
entering cancel process, will let the backup finished<a name="line.244"></a>
-<span class="sourceLineNo">245</span>    try {<a name="line.245"></a>
-<span class="sourceLineNo">246</span>      // Set the previousTimestampMap 
which is before this current log roll to the manifest.<a name="line.246"></a>
-<span class="sourceLineNo">247</span>      HashMap&lt;TableName, 
HashMap&lt;String, Long&gt;&gt; previousTimestampMap =<a name="line.247"></a>
-<span class="sourceLineNo">248</span>          
backupManager.readLogTimestampMap();<a name="line.248"></a>
-<span class="sourceLineNo">249</span>      
backupInfo.setIncrTimestampMap(previousTimestampMap);<a name="line.249"></a>
-<span class="sourceLineNo">250</span><a name="line.250"></a>
-<span class="sourceLineNo">251</span>      // The table list in backupInfo is 
good for both full backup and incremental backup.<a name="line.251"></a>
-<span class="sourceLineNo">252</span>      // For incremental backup, it 
contains the incremental backup table set.<a name="line.252"></a>
-<span class="sourceLineNo">253</span>      
backupManager.writeRegionServerLogTimestamp(backupInfo.getTables(), 
newTimestamps);<a name="line.253"></a>
-<span class="sourceLineNo">254</span><a name="line.254"></a>
-<span class="sourceLineNo">255</span>      HashMap&lt;TableName, 
HashMap&lt;String, Long&gt;&gt; newTableSetTimestampMap =<a name="line.255"></a>
-<span class="sourceLineNo">256</span>          
backupManager.readLogTimestampMap();<a name="line.256"></a>
-<span class="sourceLineNo">257</span><a name="line.257"></a>
-<span class="sourceLineNo">258</span>      Long newStartCode =<a 
name="line.258"></a>
-<span class="sourceLineNo">259</span>          
BackupUtils.getMinValue(BackupUtils.getRSLogTimestampMins(newTableSetTimestampMap));<a
 name="line.259"></a>
-<span class="sourceLineNo">260</span>      
backupManager.writeBackupStartCode(newStartCode);<a name="line.260"></a>
-<span class="sourceLineNo">261</span><a name="line.261"></a>
-<span class="sourceLineNo">262</span>      
handleBulkLoad(backupInfo.getTableNames());<a name="line.262"></a>
-<span class="sourceLineNo">263</span>      // backup complete<a 
name="line.263"></a>
-<span class="sourceLineNo">264</span>      completeBackup(conn, backupInfo, 
backupManager, BackupType.INCREMENTAL, conf);<a name="line.264"></a>
-<span class="sourceLineNo">265</span><a name="line.265"></a>
-<span class="sourceLineNo">266</span>    } catch (IOException e) {<a 
name="line.266"></a>
-<span class="sourceLineNo">267</span>      failBackup(conn, backupInfo, 
backupManager, e, "Unexpected Exception : ",<a name="line.267"></a>
-<span class="sourceLineNo">268</span>        BackupType.INCREMENTAL, conf);<a 
name="line.268"></a>
-<span class="sourceLineNo">269</span>      throw new IOException(e);<a 
name="line.269"></a>
-<span class="sourceLineNo">270</span>    }<a name="line.270"></a>
-<span class="sourceLineNo">271</span>  }<a name="line.271"></a>
-<span class="sourceLineNo">272</span><a name="line.272"></a>
-<span class="sourceLineNo">273</span>  protected void 
incrementalCopyHFiles(BackupInfo backupInfo) throws Exception {<a 
name="line.273"></a>
-<span class="sourceLineNo">274</span><a name="line.274"></a>
-<span class="sourceLineNo">275</span>    try {<a name="line.275"></a>
-<span class="sourceLineNo">276</span>      LOG.debug("Incremental copy HFiles 
is starting.");<a name="line.276"></a>
-<span class="sourceLineNo">277</span>      // set overall backup phase: 
incremental_copy<a name="line.277"></a>
-<span class="sourceLineNo">278</span>      
backupInfo.setPhase(BackupPhase.INCREMENTAL_COPY);<a name="line.278"></a>
-<span class="sourceLineNo">279</span>      // get incremental backup file list 
and prepare parms for DistCp<a name="line.279"></a>
-<span class="sourceLineNo">280</span>      List&lt;String&gt; 
incrBackupFileList = new ArrayList&lt;String&gt;();<a name="line.280"></a>
-<span class="sourceLineNo">281</span>      // Add Bulk output<a 
name="line.281"></a>
-<span class="sourceLineNo">282</span>      
incrBackupFileList.add(getBulkOutputDir().toString());<a name="line.282"></a>
-<span class="sourceLineNo">283</span>      String[] strArr = 
incrBackupFileList.toArray(new String[incrBackupFileList.size() + 1]);<a 
name="line.283"></a>
-<span class="sourceLineNo">284</span>      strArr[strArr.length - 1] = 
backupInfo.getBackupRootDir();<a name="line.284"></a>
-<span class="sourceLineNo">285</span>      BackupCopyJob copyService = 
BackupRestoreFactory.getBackupCopyJob(conf);<a name="line.285"></a>
-<span class="sourceLineNo">286</span>      int res = 
copyService.copy(backupInfo, backupManager, conf, BackupType.INCREMENTAL, 
strArr);<a name="line.286"></a>
-<span class="sourceLineNo">287</span>      if (res != 0) {<a 
name="line.287"></a>
-<span class="sourceLineNo">288</span>        LOG.error("Copy incremental HFile 
files failed with return code: " + res + ".");<a name="line.288"></a>
-<span class="sourceLineNo">289</span>        throw new IOException("Failed 
copy from " + StringUtils.join(incrBackupFileList, ',')<a name="line.289"></a>
-<span class="sourceLineNo">290</span>            + " to " + 
backupInfo.getHLogTargetDir());<a name="line.290"></a>
-<span class="sourceLineNo">291</span>      }<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      LOG.debug("Incremental copy HFiles 
from " + StringUtils.join(incrBackupFileList, ',')<a name="line.292"></a>
-<span class="sourceLineNo">293</span>          + " to " + 
backupInfo.getBackupRootDir() + " finished.");<a name="line.293"></a>
-<span class="sourceLineNo">294</span>    } finally {<a name="line.294"></a>
-<span class="sourceLineNo">295</span>      deleteBulkLoadDirectory();<a 
name="line.295"></a>
-<span class="sourceLineNo">296</span>    }<a name="line.296"></a>
-<span class="sourceLineNo">297</span>  }<a name="line.297"></a>
-<span class="sourceLineNo">298</span><a name="line.298"></a>
-<span class="sourceLineNo">299</span>  protected void 
deleteBulkLoadDirectory() throws IOException {<a name="line.299"></a>
-<span class="sourceLineNo">300</span>    // delete original bulk load 
directory on method exit<a name="line.300"></a>
-<span class="sourceLineNo">301</span>    Path path = getBulkOutputDir();<a 
name="line.301"></a>
-<span class="sourceLineNo">302</span>    FileSystem fs = 
FileSystem.get(conf);<a name="line.302"></a>
-<span class="sourceLineNo">303</span>    boolean result = fs.delete(path, 
true);<a name="line.303"></a>
-<span class="sourceLineNo">304</span>    if (!result) {<a name="line.304"></a>
-<span class="sourceLineNo">305</span>      LOG.warn("Could not delete " + 
path);<a name="line.305"></a>
-<span class="sourceLineNo">306</span>    }<a name="line.306"></a>
-<span class="sourceLineNo">307</span><a name="line.307"></a>
-<span class="sourceLineNo">308</span>  }<a name="line.308"></a>
-<span class="sourceLineNo">309</span><a name="line.309"></a>
-<span class="sourceLineNo">310</span>  protected void 
convertWALsToHFiles(BackupInfo backupInfo) throws IOException {<a 
name="line.310"></a>
-<span class="sourceLineNo">311</span>    // get incremental backup file list 
and prepare parameters for DistCp<a name="line.311"></a>
-<span class="sourceLineNo">312</span>    List&lt;String&gt; incrBackupFileList 
= backupInfo.getIncrBackupFileList();<a name="line.312"></a>
-<span class="sourceLineNo">313</span>    // Get list of tables in incremental 
backup set<a name="line.313"></a>
-<span class="sourceLineNo">314</span>    Set&lt;TableName&gt; tableSet = 
backupManager.getIncrementalBackupTableSet();<a name="line.314"></a>
-<span class="sourceLineNo">315</span>    // filter missing files out (they 
have been copied by previous backups)<a name="line.315"></a>
-<span class="sourceLineNo">316</span>    incrBackupFileList = 
filterMissingFiles(incrBackupFileList);<a name="line.316"></a>
-<span class="sourceLineNo">317</span>    for (TableName table : tableSet) {<a 
name="line.317"></a>
-<span class="sourceLineNo">318</span>      // Check if table exists<a 
name="line.318"></a>
-<span class="sourceLineNo">319</span>      if (tableExists(table, conn)) {<a 
name="line.319"></a>
-<span class="sourceLineNo">320</span>        walToHFiles(incrBackupFileList, 
table);<a name="line.320"></a>
-<span class="sourceLineNo">321</span>      } else {<a name="line.321"></a>
-<span class="sourceLineNo">322</span>        LOG.warn("Table " + table + " 
does not exists. Skipping in WAL converter");<a name="line.322"></a>
-<span class="sourceLineNo">323</span>      }<a name="line.323"></a>
-<span class="sourceLineNo">324</span>    }<a name="line.324"></a>
-<span class="sourceLineNo">325</span>  }<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>  protected boolean tableExists(TableName 
table, Connection conn) throws IOException {<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    try (Admin admin = conn.getAdmin();) 
{<a name="line.329"></a>
-<span class="sourceLineNo">330</span>      return admin.tableExists(table);<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>  protected void 
walToHFiles(List&lt;String&gt; dirPaths, TableName tableName) throws 
IOException {<a name="line.334"></a>
-<span class="sourceLineNo">335</span><a name="line.335"></a>
-<span class="sourceLineNo">336</span>    Tool player = new WALPlayer();<a 
name="line.336"></a>
-<span class="sourceLineNo">337</span><a name="line.337"></a>
-<span class="sourceLineNo">338</span>    // Player reads all files in 
arbitrary directory structure and creates<a name="line.338"></a>
-<span class="sourceLineNo">339</span>    // a Map task for each file. We use 
';' as separator<a name="line.339"></a>
-<span class="sourceLineNo">340</span>    // because WAL file names contains 
','<a name="line.340"></a>
-<span class="sourceLineNo">341</span>    String dirs = 
StringUtils.join(dirPaths, ';');<a name="line.341"></a>
-<span class="sourceLineNo">342</span><a name="line.342"></a>
-<span class="sourceLineNo">343</span>    Path bulkOutputPath = 
getBulkOutputDirForTable(tableName);<a name="line.343"></a>
-<span class="sourceLineNo">344</span>    
conf.set(WALPlayer.BULK_OUTPUT_CONF_KEY, bulkOutputPath.toString());<a 
name="line.344"></a>
-<span class="sourceLineNo">345</span>    
conf.set(WALPlayer.INPUT_FILES_SEPARATOR_KEY, ";");<a name="line.345"></a>
-<span class="sourceLineNo">346</span>    String[] playerArgs = { dirs, 
tableName.getNameAsString() };<a name="line.346"></a>
+<span class="sourceLineNo">242</span><a name="line.242"></a>
+<span class="sourceLineNo">243</span>    // case INCREMENTAL_COPY:<a 
name="line.243"></a>
+<span class="sourceLineNo">244</span>    try {<a name="line.244"></a>
+<span class="sourceLineNo">245</span>      // copy out the table and region 
info files for each table<a name="line.245"></a>
+<span class="sourceLineNo">246</span>      
BackupUtils.copyTableRegionInfo(conn, backupInfo, conf);<a name="line.246"></a>
+<span class="sourceLineNo">247</span>      // convert WAL to HFiles and copy 
them to .tmp under BACKUP_ROOT<a name="line.247"></a>
+<span class="sourceLineNo">248</span>      convertWALsToHFiles();<a 
name="line.248"></a>
+<span class="sourceLineNo">249</span>      incrementalCopyHFiles(new String[] 
{getBulkOutputDir().toString()}, backupInfo.getBackupRootDir());<a 
name="line.249"></a>
+<span class="sourceLineNo">250</span>      // Save list of WAL files copied<a 
name="line.250"></a>
+<span class="sourceLineNo">251</span>      
backupManager.recordWALFiles(backupInfo.getIncrBackupFileList());<a 
name="line.251"></a>
+<span class="sourceLineNo">252</span>    } catch (Exception e) {<a 
name="line.252"></a>
+<span class="sourceLineNo">253</span>      String msg = "Unexpected exception 
in incremental-backup: incremental copy " + backupId;<a name="line.253"></a>
+<span class="sourceLineNo">254</span>      // fail the overall backup and 
return<a name="line.254"></a>
+<span class="sourceLineNo">255</span>      failBackup(conn, backupInfo, 
backupManager, e, msg, BackupType.INCREMENTAL, conf);<a name="line.255"></a>
+<span class="sourceLineNo">256</span>      throw new IOException(e);<a 
name="line.256"></a>
+<span class="sourceLineNo">257</span>    }<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    // case INCR_BACKUP_COMPLETE:<a 
name="line.258"></a>
+<span class="sourceLineNo">259</span>    // set overall backup status: 
complete. Here we make sure to complete the backup.<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    // After this checkpoint, even if 
entering cancel process, will let the backup finished<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    try {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>      // Set the previousTimestampMap 
which is before this current log roll to the manifest.<a name="line.262"></a>
+<span class="sourceLineNo">263</span>      HashMap&lt;TableName, 
HashMap&lt;String, Long&gt;&gt; previousTimestampMap =<a name="line.263"></a>
+<span class="sourceLineNo">264</span>          
backupManager.readLogTimestampMap();<a name="line.264"></a>
+<span class="sourceLineNo">265</span>      
backupInfo.setIncrTimestampMap(previousTimestampMap);<a name="line.265"></a>
+<span class="sourceLineNo">266</span><a name="line.266"></a>
+<span class="sourceLineNo">267</span>      // The table list in backupInfo is 
good for both full backup and incremental backup.<a name="line.267"></a>
+<span class="sourceLineNo">268</span>      // For incremental backup, it 
contains the incremental backup table set.<a name="line.268"></a>
+<span class="sourceLineNo">269</span>      
backupManager.writeRegionServerLogTimestamp(backupInfo.getTables(), 
newTimestamps);<a name="line.269"></a>
+<span class="sourceLineNo">270</span><a name="line.270"></a>
+<span class="sourceLineNo">271</span>      HashMap&lt;TableName, 
HashMap&lt;String, Long&gt;&gt; newTableSetTimestampMap =<a name="line.271"></a>
+<span class="sourceLineNo">272</span>          
backupManager.readLogTimestampMap();<a name="line.272"></a>
+<span class="sourceLineNo">273</span><a name="line.273"></a>
+<span class="sourceLineNo">274</span>      Long newStartCode =<a 
name="line.274"></a>
+<span class="sourceLineNo">275</span>          
BackupUtils.getMinValue(BackupUtils.getRSLogTimestampMins(newTableSetTimestampMap));<a
 name="line.275"></a>
+<span class="sourceLineNo">276</span>      
backupManager.writeBackupStartCode(newStartCode);<a name="line.276"></a>
+<span class="sourceLineNo">277</span><a name="line.277"></a>
+<span class="sourceLineNo">278</span>      
handleBulkLoad(backupInfo.getTableNames());<a name="line.278"></a>
+<span class="sourceLineNo">279</span>      // backup complete<a 
name="line.279"></a>
+<span class="sourceLineNo">280</span>      completeBackup(conn, backupInfo, 
backupManager, BackupType.INCREMENTAL, conf);<a name="line.280"></a>
+<span class="sourceLineNo">281</span><a name="line.281"></a>
+<span class="sourceLineNo">282</span>    } catch (IOException e) {<a 
name="line.282"></a>
+<span class="sourceLineNo">283</span>      failBackup(conn, backupInfo, 
backupManager, e, "Unexpected Exception : ",<a name="line.283"></a>
+<span class="sourceLineNo">284</span>        BackupType.INCREMENTAL, conf);<a 
name="line.284"></a>
+<span class="sourceLineNo">285</span>      throw new IOException(e);<a 
name="line.285"></a>
+<span class="sourceLineNo">286</span>    }<a name="line.286"></a>
+<span class="sourceLineNo">287</span>  }<a name="line.287"></a>
+<span class="sourceLineNo">288</span><a name="line.288"></a>
+<span class="sourceLineNo">289</span>  protected void 
incrementalCopyHFiles(String[] files, String backupDest) throws IOException {<a 
name="line.289"></a>
+<span class="sourceLineNo">290</span><a name="line.290"></a>
+<span class="sourceLineNo">291</span>    try {<a name="line.291"></a>
+<span class="sourceLineNo">292</span>      LOG.debug("Incremental copy HFiles 
is starting. dest="+backupDest);<a name="line.292"></a>
+<span class="sourceLineNo">293</span>      // set overall backup phase: 
incremental_copy<a name="line.293"></a>
+<span class="sourceLineNo">294</span>      
backupInfo.setPhase(BackupPhase.INCREMENTAL_COPY);<a name="line.294"></a>
+<span class="sourceLineNo">295</span>      // get incremental backup file list 
and prepare parms for DistCp<a name="line.295"></a>
+<span class="sourceLineNo">296</span>      String[] strArr = new 
String[files.length + 1];<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      System.arraycopy(files, 0, strArr, 
0, files.length);<a name="line.297"></a>
+<span class="sourceLineNo">298</span>      strArr[strArr.length - 1] = 
backupDest;<a name="line.298"></a>
+<span class="sourceLineNo">299</span>      BackupCopyJob copyService = 
BackupRestoreFactory.getBackupCopyJob(conf);<a name="line.299"></a>
+<span class="sourceLineNo">300</span>      int res = 
copyService.copy(backupInfo, backupManager, conf, BackupType.INCREMENTAL, 
strArr);<a name="line.300"></a>
+<span class="sourceLineNo">301</span>      if (res != 0) {<a 
name="line.301"></a>
+<span class="sourceLineNo">302</span>        LOG.error("Copy incremental HFile 
files failed with return code: " + res + ".");<a name="line.302"></a>
+<span class="sourceLineNo">303</span>        throw new IOException("Failed 
copy from " + StringUtils.join(files, ',')<a name="line.303"></a>
+<span class="sourceLineNo">304</span>            + " to " + backupDest);<a 
name="line.304"></a>
+<span class="sourceLineNo">305</span>      }<a name="line.305"></a>
+<span class="sourceLineNo">306</span>      LOG.debug("Incremental copy HFiles 
from " + StringUtils.join(files, ',')<a name="line.306"></a>
+<span class="sourceLineNo">307</span>          + " to " + backupDest + " 
finished.");<a name="line.307"></a>
+<span class="sourceLineNo">308</span>    } finally {<a name="line.308"></a>
+<span class="sourceLineNo">309</span>      deleteBulkLoadDirectory();<a 
name="line.309"></a>
+<span class="sourceLineNo">310</span>    }<a name="line.310"></a>
+<span class="sourceLineNo">311</span>  }<a name="line.311"></a>
+<span class="sourceLineNo">312</span><a name="line.312"></a>
+<span class="sourceLineNo">313</span>  protected void 
deleteBulkLoadDirectory() throws IOException {<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    // delete original bulk load 
directory on method exit<a name="line.314"></a>
+<span class="sourceLineNo">315</span>    Path path = getBulkOutputDir();<a 
name="line.315"></a>
+<span class="sourceLineNo">316</span>    FileSystem fs = 
FileSystem.get(conf);<a name="line.316"></a>
+<span class="sourceLineNo">317</span>    boolean result = fs.delete(path, 
true);<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    if (!result) {<a name="line.318"></a>
+<span class="sourceLineNo">319</span>      LOG.warn("Could not delete " + 
path);<a name="line.319"></a>
+<span class="sourceLineNo">320</span>    }<a name="line.320"></a>
+<span class="sourceLineNo">321</span><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>  protected void convertWALsToHFiles() 
throws IOException {<a name="line.324"></a>
+<span class="sourceLineNo">325</span>    // get incremental backup file list 
and prepare parameters for DistCp<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    List&lt;String&gt; incrBackupFileList 
= backupInfo.getIncrBackupFileList();<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    // Get list of tables in incremental 
backup set<a name="line.327"></a>
+<span class="sourceLineNo">328</span>    Set&lt;TableName&gt; tableSet = 
backupManager.getIncrementalBackupTableSet();<a name="line.328"></a>
+<span class="sourceLineNo">329</span>    // filter missing files out (they 
have been copied by previous backups)<a name="line.329"></a>
+<span class="sourceLineNo">330</span>    incrBackupFileList = 
filterMissingFiles(incrBackupFileList);<a name="line.330"></a>
+<span class="sourceLineNo">331</span>    for (TableName table : tableSet) {<a 
name="line.331"></a>
+<span class="sourceLineNo">332</span>      // Check if table exists<a 
name="line.332"></a>
+<span class="sourceLineNo">333</span>      if (tableExists(table, conn)) {<a 
name="line.333"></a>
+<span class="sourceLineNo">334</span>        walToHFiles(incrBackupFileList, 
table);<a name="line.334"></a>
+<span class="sourceLineNo">335</span>      } else {<a name="line.335"></a>
+<span class="sourceLineNo">336</span>        LOG.warn("Table " + table + " 
does not exists. Skipping in WAL converter");<a name="line.336"></a>
+<span class="sourceLineNo">337</span>      }<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    }<a name="line.338"></a>
+<span class="sourceLineNo">339</span>  }<a name="line.339"></a>
+<span class="sourceLineNo">340</span><a name="line.340"></a>
+<span class="sourceLineNo">341</span><a name="line.341"></a>
+<span class="sourceLineNo">342</span>  protected boolean tableExists(TableName 
table, Connection conn) throws IOException {<a name="line.342"></a>
+<span class="sourceLineNo">343</span>    try (Admin admin = conn.getAdmin();) 
{<a name="line.343"></a>
+<span class="sourceLineNo">344</span>      return admin.tableExists(table);<a 
name="line.344"></a>
+<span class="sourceLineNo">345</span>    }<a name="line.345"></a>
+<span class="sourceLineNo">346</span>  }<a name="line.346"></a>
 <span class="sourceLineNo">347</span><a name="line.347"></a>
-<span class="sourceLineNo">348</span>    try {<a name="line.348"></a>
-<span class="sourceLineNo">349</span>      player.setConf(conf);<a 
name="line.349"></a>
-<span class="sourceLineNo">350</span>      int result = 
player.run(playerArgs);<a name="line.350"></a>
-<span class="sourceLineNo">351</span>      if(result != 0) {<a 
name="line.351"></a>
-<span class="sourceLineNo">352</span>        throw new IOException("WAL Player 
failed");<a name="line.352"></a>
-<span class="sourceLineNo">353</span>      }<a name="line.353"></a>
-<span class="sourceLineNo">354</span>      
conf.unset(WALPlayer.INPUT_FILES_SEPARATOR_KEY);<a name="line.354"></a>
-<span class="sourceLineNo">355</span>    } catch (IOException e) {<a 
name="line.355"></a>
-<span class="sourceLineNo">356</span>      throw e;<a name="line.356"></a>
-<span class="sourceLineNo">357</span>    } catch (Exception ee) {<a 
name="line.357"></a>
-<span class="sourceLineNo">358</span>      throw new IOException("Can not 
convert from directory " + dirs<a name="line.358"></a>
-<span class="sourceLineNo">359</span>          + " (check Hadoop, HBase and 
WALPlayer M/R job logs) ", ee);<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>
-<span class="sourceLineNo">362</span><a name="line.362"></a>
-<span class="sourceLineNo">363</span>  protected Path 
getBulkOutputDirForTable(TableName table) {<a name="line.363"></a>
-<span class="sourceLineNo">364</span>    Path tablePath = 
getBulkOutputDir();<a name="line.364"></a>
-<span class="sourceLineNo">365</span>    tablePath = new Path(tablePath, 
table.getNamespaceAsString());<a name="line.365"></a>
-<span class="sourceLineNo">366</span>    tablePath = new Path(tablePath, 
table.getQualifierAsString());<a name="line.366"></a>
-<span class="sourceLineNo">367</span>    return new Path(tablePath, "data");<a 
name="line.367"></a>
-<span class="sourceLineNo">368</span>  }<a name="line.368"></a>
-<span class="sourceLineNo">369</span><a name="line.369"></a>
-<span class="sourceLineNo">370</span>  protected Path getBulkOutputDir() {<a 
name="line.370"></a>
-<span class="sourceLineNo">371</span>    String backupId = 
backupInfo.getBackupId();<a name="line.371"></a>
-<span class="sourceLineNo">372</span>    Path path = new 
Path(backupInfo.getBackupRootDir());<a name="line.372"></a>
-<span class="sourceLineNo">373</span>    path = new Path(path, ".tmp");<a 
name="line.373"></a>
-<span class="sourceLineNo">374</span>    path = new Path(path, backupId);<a 
name="line.374"></a>
-<span class="sourceLineNo">375</span>    return path;<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>}<a name="line.378"></a>
+<span class="sourceLineNo">348</span>  protected void 
walToHFiles(List&lt;String&gt; dirPaths, TableName tableName) throws 
IOException {<a name="line.348"></a>
+<span class="sourceLineNo">349</span><a name="line.349"></a>
+<span class="sourceLineNo">350</span>    Tool player = new WALPlayer();<a 
name="line.350"></a>
+<span class="sourceLineNo">351</span><a name="line.351"></a>
+<span class="sourceLineNo">352</span>    // Player reads all files in 
arbitrary directory structure and creates<a name="line.352"></a>
+<span class="sourceLineNo">353</span>    // a Map task for each file. We use 
';' as separator<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    // because WAL file names contains 
','<a name="line.354"></a>
+<span class="sourceLineNo">355</span>    String dirs = 
StringUtils.join(dirPaths, ';');<a name="line.355"></a>
+<span class="sourceLineNo">356</span><a name="line.356"></a>
+<span class="sourceLineNo">357</span>    Path bulkOutputPath = 
getBulkOutputDirForTable(tableName);<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    
conf.set(WALPlayer.BULK_OUTPUT_CONF_KEY, bulkOutputPath.toString());<a 
name="line.358"></a>
+<span class="sourceLineNo">359</span>    
conf.set(WALPlayer.INPUT_FILES_SEPARATOR_KEY, ";");<a name="line.359"></a>
+<span class="sourceLineNo">360</span>    String[] playerArgs = { dirs, 
tableName.getNameAsString() };<a name="line.360"></a>
+<span class="sourceLineNo">361</span><a name="line.361"></a>
+<span class="sourceLineNo">362</span>    try {<a name="line.362"></a>
+<span class="sourceLineNo">363</span>      player.setConf(conf);<a 
name="line.363"></a>
+<span class="sourceLineNo">364</span>      int result = 
player.run(playerArgs);<a name="line.364"></a>
+<span class="sourceLineNo">365</span>      if(result != 0) {<a 
name="line.365"></a>
+<span class="sourceLineNo">366</span>        throw new IOException("WAL Player 
failed");<a name="line.366"></a>
+<span class="sourceLineNo">367</span>      }<a name="line.367"></a>
+<span class="sourceLineNo">368</span>      
conf.unset(WALPlayer.INPUT_FILES_SEPARATOR_KEY);<a name="line.368"></a>
+<span class="sourceLineNo">369</span>    } catch (IOException e) {<a 
name="line.369"></a>
+<span class="sourceLineNo">370</span>      throw e;<a name="line.370"></a>
+<span class="sourceLineNo">371</span>    } catch (Exception ee) {<a 
name="line.371"></a>
+<span class="sourceLineNo">372</span>      throw new IOException("Can not 
convert from directory " + dirs<a name="line.372"></a>
+<span class="sourceLineNo">373</span>          + " (check Hadoop, HBase and 
WALPlayer M/R job logs) ", ee);<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>  protected Path 
getBulkOutputDirForTable(TableName table) {<a name="line.377"></a>
+<span class="sourceLineNo">378</span>    Path tablePath = 
getBulkOutputDir();<a name="line.378"></a>
+<span class="sourceLineNo">379</span>    tablePath = new Path(tablePath, 
table.getNamespaceAsString());<a name="line.379"></a>
+<span class="sourceLineNo">380</span>    tablePath = new Path(tablePath, 
table.getQualifierAsString());<a name="line.380"></a>
+<span class="sourceLineNo">381</span>    return new Path(tablePath, "data");<a 
name="line.381"></a>
+<span class="sourceLineNo">382</span>  }<a name="line.382"></a>
+<span class="sourceLineNo">383</span><a name="line.383"></a>
+<span class="sourceLineNo">384</span>  protected Path getBulkOutputDir() {<a 
name="line.384"></a>
+<span class="sourceLineNo">385</span>    String backupId = 
backupInfo.getBackupId();<a name="line.385"></a>
+<span class="sourceLineNo">386</span>    Path path = new 
Path(backupInfo.getBackupRootDir());<a name="line.386"></a>
+<span class="sourceLineNo">387</span>    path = new Path(path, ".tmp");<a 
name="line.387"></a>
+<span class="sourceLineNo">388</span>    path = new Path(path, backupId);<a 
name="line.388"></a>
+<span class="sourceLineNo">389</span>    return path;<a name="line.389"></a>
+<span class="sourceLineNo">390</span>  }<a name="line.390"></a>
+<span class="sourceLineNo">391</span><a name="line.391"></a>
+<span class="sourceLineNo">392</span>}<a name="line.392"></a>
 
 
 

Reply via email to