hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [31/47] hbase-site git commit: Published site at .
Date Sat, 13 Jan 2018 15:32:20 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/554d61c6/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.html b/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.html
index 6d76f98..9baf566 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.html
@@ -29,158 +29,158 @@
 <span class="sourceLineNo">021</span>import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.JOB_NAME_CONF_KEY;<a name="line.21"></a>
 <span class="sourceLineNo">022</span><a name="line.22"></a>
 <span class="sourceLineNo">023</span>import java.io.IOException;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import java.nio.ByteBuffer;<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.Arrays;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import java.util.HashMap;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import java.util.HashSet;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import java.util.List;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import java.util.Map;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import java.util.Set;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import java.util.TreeSet;<a name="line.32"></a>
-<span class="sourceLineNo">033</span><a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.apache.commons.lang3.StringUtils;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.apache.hadoop.conf.Configuration;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.hadoop.fs.Path;<a name="line.36"></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.HashSet;<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.Set;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import java.util.TreeSet;<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.hadoop.conf.Configuration;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.fs.FileSystem;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.hadoop.fs.LocatedFileStatus;<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.fs.RemoteIterator;<a name="line.36"></a>
 <span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.TableName;<a name="line.37"></a>
 <span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.backup.BackupType;<a name="line.38"></a>
 <span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.backup.HBackupFileSystem;<a name="line.39"></a>
 <span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.backup.RestoreRequest;<a name="line.40"></a>
 <span class="sourceLineNo">041</span>import org.apache.hadoop.hbase.backup.impl.BackupManifest.BackupImage;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.backup.util.BackupUtils;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import org.apache.hadoop.hbase.backup.util.RestoreTool;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>import org.apache.yetus.audience.InterfaceAudience;<a name="line.44"></a>
-<span class="sourceLineNo">045</span>import org.slf4j.Logger;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>import org.slf4j.LoggerFactory;<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.tool.LoadIncrementalHFiles;<a name="line.49"></a>
-<span class="sourceLineNo">050</span>import org.apache.hadoop.hbase.tool.LoadIncrementalHFiles.LoadQueueItem;<a name="line.50"></a>
-<span class="sourceLineNo">051</span><a name="line.51"></a>
-<span class="sourceLineNo">052</span>/**<a name="line.52"></a>
-<span class="sourceLineNo">053</span> * Restore table implementation<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>@InterfaceAudience.Private<a name="line.56"></a>
-<span class="sourceLineNo">057</span>public class RestoreTablesClient {<a name="line.57"></a>
-<span class="sourceLineNo">058</span>  private static final Logger LOG = LoggerFactory.getLogger(RestoreTablesClient.class);<a name="line.58"></a>
-<span class="sourceLineNo">059</span><a name="line.59"></a>
-<span class="sourceLineNo">060</span>  private Configuration conf;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  private Connection conn;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>  private String backupId;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>  private TableName[] sTableArray;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>  private TableName[] tTableArray;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>  private String targetRootDir;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>  private boolean isOverwrite;<a name="line.66"></a>
-<span class="sourceLineNo">067</span><a name="line.67"></a>
-<span class="sourceLineNo">068</span>  public RestoreTablesClient(Connection conn, RestoreRequest request) throws IOException {<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    this.targetRootDir = request.getBackupRootDir();<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    this.backupId = request.getBackupId();<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    this.sTableArray = request.getFromTables();<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    this.tTableArray = request.getToTables();<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    if (tTableArray == null || tTableArray.length == 0) {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>      this.tTableArray = sTableArray;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    }<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    this.isOverwrite = request.isOverwrite();<a name="line.76"></a>
-<span class="sourceLineNo">077</span>    this.conn = conn;<a name="line.77"></a>
-<span class="sourceLineNo">078</span>    this.conf = conn.getConfiguration();<a name="line.78"></a>
+<span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.backup.util.RestoreTool;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>import org.apache.hadoop.hbase.client.Admin;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>import org.apache.hadoop.hbase.client.Connection;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>import org.apache.hadoop.hbase.io.hfile.HFile;<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.slf4j.Logger;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>import org.slf4j.LoggerFactory;<a name="line.48"></a>
+<span class="sourceLineNo">049</span><a name="line.49"></a>
+<span class="sourceLineNo">050</span>/**<a name="line.50"></a>
+<span class="sourceLineNo">051</span> * Restore table implementation<a name="line.51"></a>
+<span class="sourceLineNo">052</span> *<a name="line.52"></a>
+<span class="sourceLineNo">053</span> */<a name="line.53"></a>
+<span class="sourceLineNo">054</span>@InterfaceAudience.Private<a name="line.54"></a>
+<span class="sourceLineNo">055</span>public class RestoreTablesClient {<a name="line.55"></a>
+<span class="sourceLineNo">056</span>  private static final Logger LOG = LoggerFactory.getLogger(RestoreTablesClient.class);<a name="line.56"></a>
+<span class="sourceLineNo">057</span><a name="line.57"></a>
+<span class="sourceLineNo">058</span>  private Configuration conf;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>  private Connection conn;<a name="line.59"></a>
+<span class="sourceLineNo">060</span>  private String backupId;<a name="line.60"></a>
+<span class="sourceLineNo">061</span>  private TableName[] sTableArray;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  private TableName[] tTableArray;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>  private String targetRootDir;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>  private boolean isOverwrite;<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>  public RestoreTablesClient(Connection conn, RestoreRequest request) throws IOException {<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    this.targetRootDir = request.getBackupRootDir();<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    this.backupId = request.getBackupId();<a name="line.68"></a>
+<span class="sourceLineNo">069</span>    this.sTableArray = request.getFromTables();<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    this.tTableArray = request.getToTables();<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    if (tTableArray == null || tTableArray.length == 0) {<a name="line.71"></a>
+<span class="sourceLineNo">072</span>      this.tTableArray = sTableArray;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    }<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    this.isOverwrite = request.isOverwrite();<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    this.conn = conn;<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    this.conf = conn.getConfiguration();<a name="line.76"></a>
+<span class="sourceLineNo">077</span><a name="line.77"></a>
+<span class="sourceLineNo">078</span>  }<a name="line.78"></a>
 <span class="sourceLineNo">079</span><a name="line.79"></a>
-<span class="sourceLineNo">080</span>  }<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>   * Validate target tables<a name="line.83"></a>
-<span class="sourceLineNo">084</span>   * @param conn connection<a name="line.84"></a>
-<span class="sourceLineNo">085</span>   * @param mgr table state manager<a name="line.85"></a>
-<span class="sourceLineNo">086</span>   * @param tTableArray: target tables<a name="line.86"></a>
-<span class="sourceLineNo">087</span>   * @param isOverwrite overwrite existing table<a name="line.87"></a>
-<span class="sourceLineNo">088</span>   * @throws IOException exception<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   */<a name="line.89"></a>
-<span class="sourceLineNo">090</span>  private void checkTargetTables(TableName[] tTableArray, boolean isOverwrite) throws IOException {<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    ArrayList&lt;TableName&gt; existTableList = new ArrayList&lt;&gt;();<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    ArrayList&lt;TableName&gt; disabledTableList = new ArrayList&lt;&gt;();<a name="line.92"></a>
-<span class="sourceLineNo">093</span><a name="line.93"></a>
-<span class="sourceLineNo">094</span>    // check if the tables already exist<a name="line.94"></a>
-<span class="sourceLineNo">095</span>    try (Admin admin = conn.getAdmin()) {<a name="line.95"></a>
-<span class="sourceLineNo">096</span>      for (TableName tableName : tTableArray) {<a name="line.96"></a>
-<span class="sourceLineNo">097</span>        if (admin.tableExists(tableName)) {<a name="line.97"></a>
-<span class="sourceLineNo">098</span>          existTableList.add(tableName);<a name="line.98"></a>
-<span class="sourceLineNo">099</span>          if (admin.isTableDisabled(tableName)) {<a name="line.99"></a>
-<span class="sourceLineNo">100</span>            disabledTableList.add(tableName);<a name="line.100"></a>
-<span class="sourceLineNo">101</span>          }<a name="line.101"></a>
-<span class="sourceLineNo">102</span>        } else {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>          LOG.info("HBase table " + tableName<a name="line.103"></a>
-<span class="sourceLineNo">104</span>              + " does not exist. It will be created during restore process");<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><a name="line.108"></a>
-<span class="sourceLineNo">109</span>    if (existTableList.size() &gt; 0) {<a name="line.109"></a>
-<span class="sourceLineNo">110</span>      if (!isOverwrite) {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>        LOG.error("Existing table (" + existTableList<a name="line.111"></a>
-<span class="sourceLineNo">112</span>            + ") found in the restore target, please add "<a name="line.112"></a>
-<span class="sourceLineNo">113</span>            + "\"-o\" as overwrite option in the command if you mean"<a name="line.113"></a>
-<span class="sourceLineNo">114</span>            + " to restore to these existing tables");<a name="line.114"></a>
-<span class="sourceLineNo">115</span>        throw new IOException("Existing table found in target while no \"-o\" "<a name="line.115"></a>
-<span class="sourceLineNo">116</span>            + "as overwrite option found");<a name="line.116"></a>
-<span class="sourceLineNo">117</span>      } else {<a name="line.117"></a>
-<span class="sourceLineNo">118</span>        if (disabledTableList.size() &gt; 0) {<a name="line.118"></a>
-<span class="sourceLineNo">119</span>          LOG.error("Found offline table in the restore target, "<a name="line.119"></a>
-<span class="sourceLineNo">120</span>              + "please enable them before restore with \"-overwrite\" option");<a name="line.120"></a>
-<span class="sourceLineNo">121</span>          LOG.info("Offline table list in restore target: " + disabledTableList);<a name="line.121"></a>
-<span class="sourceLineNo">122</span>          throw new IOException(<a name="line.122"></a>
-<span class="sourceLineNo">123</span>              "Found offline table in the target when restore with \"-overwrite\" option");<a name="line.123"></a>
-<span class="sourceLineNo">124</span>        }<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>  }<a name="line.127"></a>
-<span class="sourceLineNo">128</span><a name="line.128"></a>
-<span class="sourceLineNo">129</span>  /**<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   * Restore operation handle each backupImage in array<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * @param svc: master services<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * @param images: array BackupImage<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   * @param sTable: table to be restored<a name="line.133"></a>
-<span class="sourceLineNo">134</span>   * @param tTable: table to be restored to<a name="line.134"></a>
-<span class="sourceLineNo">135</span>   * @param truncateIfExists: truncate table<a name="line.135"></a>
-<span class="sourceLineNo">136</span>   * @throws IOException exception<a name="line.136"></a>
-<span class="sourceLineNo">137</span>   */<a name="line.137"></a>
-<span class="sourceLineNo">138</span><a name="line.138"></a>
-<span class="sourceLineNo">139</span>  private void restoreImages(BackupImage[] images, TableName sTable, TableName tTable,<a name="line.139"></a>
-<span class="sourceLineNo">140</span>      boolean truncateIfExists) throws IOException {<a name="line.140"></a>
-<span class="sourceLineNo">141</span><a name="line.141"></a>
-<span class="sourceLineNo">142</span>    // First image MUST be image of a FULL backup<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    BackupImage image = images[0];<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    String rootDir = image.getRootDir();<a name="line.144"></a>
-<span class="sourceLineNo">145</span>    String backupId = image.getBackupId();<a name="line.145"></a>
-<span class="sourceLineNo">146</span>    Path backupRoot = new Path(rootDir);<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    RestoreTool restoreTool = new RestoreTool(conf, backupRoot, backupId);<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    Path tableBackupPath = HBackupFileSystem.getTableBackupPath(sTable, backupRoot, backupId);<a name="line.148"></a>
-<span class="sourceLineNo">149</span>    String lastIncrBackupId = images.length == 1 ? null : images[images.length - 1].getBackupId();<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    // We need hFS only for full restore (see the code)<a name="line.150"></a>
-<span class="sourceLineNo">151</span>    BackupManifest manifest = HBackupFileSystem.getManifest(conf, backupRoot, backupId);<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    if (manifest.getType() == BackupType.FULL) {<a name="line.152"></a>
-<span class="sourceLineNo">153</span>      LOG.info("Restoring '" + sTable + "' to '" + tTable + "' from full" + " backup image "<a name="line.153"></a>
-<span class="sourceLineNo">154</span>          + tableBackupPath.toString());<a name="line.154"></a>
-<span class="sourceLineNo">155</span>      conf.set(JOB_NAME_CONF_KEY, "Full_Restore-" + backupId + "-" + tTable);<a name="line.155"></a>
-<span class="sourceLineNo">156</span>      restoreTool.fullRestoreTable(conn, tableBackupPath, sTable, tTable, truncateIfExists,<a name="line.156"></a>
-<span class="sourceLineNo">157</span>        lastIncrBackupId);<a name="line.157"></a>
-<span class="sourceLineNo">158</span>      conf.unset(JOB_NAME_CONF_KEY);<a name="line.158"></a>
-<span class="sourceLineNo">159</span>    } else { // incremental Backup<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      throw new IOException("Unexpected backup type " + image.getType());<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    }<a name="line.161"></a>
-<span class="sourceLineNo">162</span><a name="line.162"></a>
-<span class="sourceLineNo">163</span>    if (images.length == 1) {<a name="line.163"></a>
-<span class="sourceLineNo">164</span>      // full backup restore done<a name="line.164"></a>
-<span class="sourceLineNo">165</span>      return;<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>    List&lt;Path&gt; dirList = new ArrayList&lt;Path&gt;();<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    // add full backup path<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    // full backup path comes first<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    for (int i = 1; i &lt; images.length; i++) {<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      BackupImage im = images[i];<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      String fileBackupDir =<a name="line.173"></a>
-<span class="sourceLineNo">174</span>          HBackupFileSystem.getTableBackupDataDir(im.getRootDir(), im.getBackupId(), sTable);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>      dirList.add(new Path(fileBackupDir));<a name="line.175"></a>
+<span class="sourceLineNo">080</span>  /**<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   * Validate target tables<a name="line.81"></a>
+<span class="sourceLineNo">082</span>   * @param conn connection<a name="line.82"></a>
+<span class="sourceLineNo">083</span>   * @param mgr table state manager<a name="line.83"></a>
+<span class="sourceLineNo">084</span>   * @param tTableArray: target tables<a name="line.84"></a>
+<span class="sourceLineNo">085</span>   * @param isOverwrite overwrite existing table<a name="line.85"></a>
+<span class="sourceLineNo">086</span>   * @throws IOException exception<a name="line.86"></a>
+<span class="sourceLineNo">087</span>   */<a name="line.87"></a>
+<span class="sourceLineNo">088</span>  private void checkTargetTables(TableName[] tTableArray, boolean isOverwrite) throws IOException {<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    ArrayList&lt;TableName&gt; existTableList = new ArrayList&lt;&gt;();<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    ArrayList&lt;TableName&gt; disabledTableList = new ArrayList&lt;&gt;();<a name="line.90"></a>
+<span class="sourceLineNo">091</span><a name="line.91"></a>
+<span class="sourceLineNo">092</span>    // check if the tables already exist<a name="line.92"></a>
+<span class="sourceLineNo">093</span>    try (Admin admin = conn.getAdmin()) {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      for (TableName tableName : tTableArray) {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>        if (admin.tableExists(tableName)) {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>          existTableList.add(tableName);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>          if (admin.isTableDisabled(tableName)) {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>            disabledTableList.add(tableName);<a name="line.98"></a>
+<span class="sourceLineNo">099</span>          }<a name="line.99"></a>
+<span class="sourceLineNo">100</span>        } else {<a name="line.100"></a>
+<span class="sourceLineNo">101</span>          LOG.info("HBase table " + tableName<a name="line.101"></a>
+<span class="sourceLineNo">102</span>              + " does not exist. It will be created during restore process");<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><a name="line.106"></a>
+<span class="sourceLineNo">107</span>    if (existTableList.size() &gt; 0) {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>      if (!isOverwrite) {<a name="line.108"></a>
+<span class="sourceLineNo">109</span>        LOG.error("Existing table (" + existTableList<a name="line.109"></a>
+<span class="sourceLineNo">110</span>            + ") found in the restore target, please add "<a name="line.110"></a>
+<span class="sourceLineNo">111</span>            + "\"-o\" as overwrite option in the command if you mean"<a name="line.111"></a>
+<span class="sourceLineNo">112</span>            + " to restore to these existing tables");<a name="line.112"></a>
+<span class="sourceLineNo">113</span>        throw new IOException("Existing table found in target while no \"-o\" "<a name="line.113"></a>
+<span class="sourceLineNo">114</span>            + "as overwrite option found");<a name="line.114"></a>
+<span class="sourceLineNo">115</span>      } else {<a name="line.115"></a>
+<span class="sourceLineNo">116</span>        if (disabledTableList.size() &gt; 0) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>          LOG.error("Found offline table in the restore target, "<a name="line.117"></a>
+<span class="sourceLineNo">118</span>              + "please enable them before restore with \"-overwrite\" option");<a name="line.118"></a>
+<span class="sourceLineNo">119</span>          LOG.info("Offline table list in restore target: " + disabledTableList);<a name="line.119"></a>
+<span class="sourceLineNo">120</span>          throw new IOException(<a name="line.120"></a>
+<span class="sourceLineNo">121</span>              "Found offline table in the target when restore with \"-overwrite\" option");<a name="line.121"></a>
+<span class="sourceLineNo">122</span>        }<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>  }<a name="line.125"></a>
+<span class="sourceLineNo">126</span><a name="line.126"></a>
+<span class="sourceLineNo">127</span>  /**<a name="line.127"></a>
+<span class="sourceLineNo">128</span>   * Restore operation handle each backupImage in array<a name="line.128"></a>
+<span class="sourceLineNo">129</span>   * @param svc: master services<a name="line.129"></a>
+<span class="sourceLineNo">130</span>   * @param images: array BackupImage<a name="line.130"></a>
+<span class="sourceLineNo">131</span>   * @param sTable: table to be restored<a name="line.131"></a>
+<span class="sourceLineNo">132</span>   * @param tTable: table to be restored to<a name="line.132"></a>
+<span class="sourceLineNo">133</span>   * @param truncateIfExists: truncate table<a name="line.133"></a>
+<span class="sourceLineNo">134</span>   * @throws IOException exception<a name="line.134"></a>
+<span class="sourceLineNo">135</span>   */<a name="line.135"></a>
+<span class="sourceLineNo">136</span><a name="line.136"></a>
+<span class="sourceLineNo">137</span>  private void restoreImages(BackupImage[] images, TableName sTable, TableName tTable,<a name="line.137"></a>
+<span class="sourceLineNo">138</span>      boolean truncateIfExists) throws IOException {<a name="line.138"></a>
+<span class="sourceLineNo">139</span><a name="line.139"></a>
+<span class="sourceLineNo">140</span>    // First image MUST be image of a FULL backup<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    BackupImage image = images[0];<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    String rootDir = image.getRootDir();<a name="line.142"></a>
+<span class="sourceLineNo">143</span>    String backupId = image.getBackupId();<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    Path backupRoot = new Path(rootDir);<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    RestoreTool restoreTool = new RestoreTool(conf, backupRoot, backupId);<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    Path tableBackupPath = HBackupFileSystem.getTableBackupPath(sTable, backupRoot, backupId);<a name="line.146"></a>
+<span class="sourceLineNo">147</span>    String lastIncrBackupId = images.length == 1 ? null : images[images.length - 1].getBackupId();<a name="line.147"></a>
+<span class="sourceLineNo">148</span>    // We need hFS only for full restore (see the code)<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    BackupManifest manifest = HBackupFileSystem.getManifest(conf, backupRoot, backupId);<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    if (manifest.getType() == BackupType.FULL) {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>      LOG.info("Restoring '" + sTable + "' to '" + tTable + "' from full" + " backup image "<a name="line.151"></a>
+<span class="sourceLineNo">152</span>          + tableBackupPath.toString());<a name="line.152"></a>
+<span class="sourceLineNo">153</span>      conf.set(JOB_NAME_CONF_KEY, "Full_Restore-" + backupId + "-" + tTable);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>      restoreTool.fullRestoreTable(conn, tableBackupPath, sTable, tTable, truncateIfExists,<a name="line.154"></a>
+<span class="sourceLineNo">155</span>        lastIncrBackupId);<a name="line.155"></a>
+<span class="sourceLineNo">156</span>      conf.unset(JOB_NAME_CONF_KEY);<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    } else { // incremental Backup<a name="line.157"></a>
+<span class="sourceLineNo">158</span>      throw new IOException("Unexpected backup type " + image.getType());<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    }<a name="line.159"></a>
+<span class="sourceLineNo">160</span><a name="line.160"></a>
+<span class="sourceLineNo">161</span>    if (images.length == 1) {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>      // full backup restore done<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      return;<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>    List&lt;Path&gt; dirList = new ArrayList&lt;Path&gt;();<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    // add full backup path<a name="line.167"></a>
+<span class="sourceLineNo">168</span>    // full backup path comes first<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    for (int i = 1; i &lt; images.length; i++) {<a name="line.169"></a>
+<span class="sourceLineNo">170</span>      BackupImage im = images[i];<a name="line.170"></a>
+<span class="sourceLineNo">171</span>      String fileBackupDir =<a name="line.171"></a>
+<span class="sourceLineNo">172</span>         HBackupFileSystem.getTableBackupDir(im.getRootDir(), im.getBackupId(), sTable);<a name="line.172"></a>
+<span class="sourceLineNo">173</span>      List&lt;Path&gt; list = getFilesRecursively(fileBackupDir);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>      dirList.addAll(list);<a name="line.174"></a>
+<span class="sourceLineNo">175</span><a name="line.175"></a>
 <span class="sourceLineNo">176</span>    }<a name="line.176"></a>
 <span class="sourceLineNo">177</span><a name="line.177"></a>
 <span class="sourceLineNo">178</span>    String dirs = StringUtils.join(dirList, ",");<a name="line.178"></a>
@@ -193,102 +193,95 @@
 <span class="sourceLineNo">185</span>    LOG.info(sTable + " has been successfully restored to " + tTable);<a name="line.185"></a>
 <span class="sourceLineNo">186</span>  }<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>   * Restore operation. Stage 2: resolved Backup Image dependency<a name="line.189"></a>
-<span class="sourceLineNo">190</span>   * @param backupManifestMap : tableName, Manifest<a name="line.190"></a>
-<span class="sourceLineNo">191</span>   * @param sTableArray The array of tables to be restored<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   * @param tTableArray The array of mapping tables to restore to<a name="line.192"></a>
-<span class="sourceLineNo">193</span>   * @return set of BackupImages restored<a name="line.193"></a>
-<span class="sourceLineNo">194</span>   * @throws IOException exception<a name="line.194"></a>
-<span class="sourceLineNo">195</span>   */<a name="line.195"></a>
-<span class="sourceLineNo">196</span>  private void restore(HashMap&lt;TableName, BackupManifest&gt; backupManifestMap,<a name="line.196"></a>
-<span class="sourceLineNo">197</span>      TableName[] sTableArray, TableName[] tTableArray, boolean isOverwrite) throws IOException {<a name="line.197"></a>
-<span class="sourceLineNo">198</span>    TreeSet&lt;BackupImage&gt; restoreImageSet = new TreeSet&lt;BackupImage&gt;();<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    boolean truncateIfExists = isOverwrite;<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    Set&lt;String&gt; backupIdSet = new HashSet&lt;&gt;();<a name="line.200"></a>
+<span class="sourceLineNo">188</span>  private List&lt;Path&gt; getFilesRecursively(String fileBackupDir)<a name="line.188"></a>
+<span class="sourceLineNo">189</span>      throws IllegalArgumentException, IOException {<a name="line.189"></a>
+<span class="sourceLineNo">190</span>    FileSystem fs = FileSystem.get((new Path(fileBackupDir)).toUri(), new Configuration());<a name="line.190"></a>
+<span class="sourceLineNo">191</span>    List&lt;Path&gt; list = new ArrayList&lt;Path&gt;();<a name="line.191"></a>
+<span class="sourceLineNo">192</span>    RemoteIterator&lt;LocatedFileStatus&gt; it = fs.listFiles(new Path(fileBackupDir), true);<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    while (it.hasNext()) {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>      Path p = it.next().getPath();<a name="line.194"></a>
+<span class="sourceLineNo">195</span>      if (HFile.isHFileFormat(fs, p)) {<a name="line.195"></a>
+<span class="sourceLineNo">196</span>        list.add(p);<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>    return list;<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>    for (int i = 0; i &lt; sTableArray.length; i++) {<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      TableName table = sTableArray[i];<a name="line.203"></a>
-<span class="sourceLineNo">204</span><a name="line.204"></a>
-<span class="sourceLineNo">205</span>      BackupManifest manifest = backupManifestMap.get(table);<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      // Get the image list of this backup for restore in time order from old<a name="line.206"></a>
-<span class="sourceLineNo">207</span>      // to new.<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      List&lt;BackupImage&gt; list = new ArrayList&lt;BackupImage&gt;();<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      list.add(manifest.getBackupImage());<a name="line.209"></a>
-<span class="sourceLineNo">210</span>      TreeSet&lt;BackupImage&gt; set = new TreeSet&lt;BackupImage&gt;(list);<a name="line.210"></a>
-<span class="sourceLineNo">211</span>      List&lt;BackupImage&gt; depList = manifest.getDependentListByTable(table);<a name="line.211"></a>
-<span class="sourceLineNo">212</span>      set.addAll(depList);<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      BackupImage[] arr = new BackupImage[set.size()];<a name="line.213"></a>
-<span class="sourceLineNo">214</span>      set.toArray(arr);<a name="line.214"></a>
-<span class="sourceLineNo">215</span>      restoreImages(arr, table, tTableArray[i], truncateIfExists);<a name="line.215"></a>
-<span class="sourceLineNo">216</span>      restoreImageSet.addAll(list);<a name="line.216"></a>
-<span class="sourceLineNo">217</span>      if (restoreImageSet != null &amp;&amp; !restoreImageSet.isEmpty()) {<a name="line.217"></a>
-<span class="sourceLineNo">218</span>        LOG.info("Restore includes the following image(s):");<a name="line.218"></a>
-<span class="sourceLineNo">219</span>        for (BackupImage image : restoreImageSet) {<a name="line.219"></a>
-<span class="sourceLineNo">220</span>          LOG.info("Backup: " + image.getBackupId() + " "<a name="line.220"></a>
-<span class="sourceLineNo">221</span>              + HBackupFileSystem.getTableBackupDir(image.getRootDir(), image.getBackupId(), table));<a name="line.221"></a>
-<span class="sourceLineNo">222</span>          if (image.getType() == BackupType.INCREMENTAL) {<a name="line.222"></a>
-<span class="sourceLineNo">223</span>            backupIdSet.add(image.getBackupId());<a name="line.223"></a>
-<span class="sourceLineNo">224</span>            LOG.debug("adding " + image.getBackupId() + " for bulk load");<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>      }<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    }<a name="line.228"></a>
-<span class="sourceLineNo">229</span>    try (BackupSystemTable table = new BackupSystemTable(conn)) {<a name="line.229"></a>
-<span class="sourceLineNo">230</span>      List&lt;TableName&gt; sTableList = Arrays.asList(sTableArray);<a name="line.230"></a>
-<span class="sourceLineNo">231</span>      for (String id : backupIdSet) {<a name="line.231"></a>
-<span class="sourceLineNo">232</span>        LOG.debug("restoring bulk load for " + id);<a name="line.232"></a>
-<span class="sourceLineNo">233</span>        Map&lt;byte[], List&lt;Path&gt;&gt;[] mapForSrc = table.readBulkLoadedFiles(id, sTableList);<a name="line.233"></a>
-<span class="sourceLineNo">234</span>        Map&lt;LoadQueueItem, ByteBuffer&gt; loaderResult;<a name="line.234"></a>
-<span class="sourceLineNo">235</span>        conf.setBoolean(LoadIncrementalHFiles.ALWAYS_COPY_FILES, true);<a name="line.235"></a>
-<span class="sourceLineNo">236</span>        LoadIncrementalHFiles loader = BackupUtils.createLoader(conf);<a name="line.236"></a>
-<span class="sourceLineNo">237</span>        for (int i = 0; i &lt; sTableList.size(); i++) {<a name="line.237"></a>
-<span class="sourceLineNo">238</span>          if (mapForSrc[i] != null &amp;&amp; !mapForSrc[i].isEmpty()) {<a name="line.238"></a>
-<span class="sourceLineNo">239</span>            loaderResult = loader.run(mapForSrc[i], tTableArray[i]);<a name="line.239"></a>
-<span class="sourceLineNo">240</span>            LOG.debug("bulk loading " + sTableList.get(i) + " to " + tTableArray[i]);<a name="line.240"></a>
-<span class="sourceLineNo">241</span>            if (loaderResult.isEmpty()) {<a name="line.241"></a>
-<span class="sourceLineNo">242</span>              String msg = "Couldn't bulk load for " + sTableList.get(i) + " to " + tTableArray[i];<a name="line.242"></a>
-<span class="sourceLineNo">243</span>              LOG.error(msg);<a name="line.243"></a>
-<span class="sourceLineNo">244</span>              throw new IOException(msg);<a name="line.244"></a>
-<span class="sourceLineNo">245</span>            }<a name="line.245"></a>
-<span class="sourceLineNo">246</span>          }<a name="line.246"></a>
-<span class="sourceLineNo">247</span>        }<a name="line.247"></a>
-<span class="sourceLineNo">248</span>      }<a name="line.248"></a>
+<span class="sourceLineNo">202</span>  /**<a name="line.202"></a>
+<span class="sourceLineNo">203</span>   * Restore operation. Stage 2: resolved Backup Image dependency<a name="line.203"></a>
+<span class="sourceLineNo">204</span>   * @param backupManifestMap : tableName, Manifest<a name="line.204"></a>
+<span class="sourceLineNo">205</span>   * @param sTableArray The array of tables to be restored<a name="line.205"></a>
+<span class="sourceLineNo">206</span>   * @param tTableArray The array of mapping tables to restore to<a name="line.206"></a>
+<span class="sourceLineNo">207</span>   * @return set of BackupImages restored<a name="line.207"></a>
+<span class="sourceLineNo">208</span>   * @throws IOException exception<a name="line.208"></a>
+<span class="sourceLineNo">209</span>   */<a name="line.209"></a>
+<span class="sourceLineNo">210</span>  private void restore(HashMap&lt;TableName, BackupManifest&gt; backupManifestMap,<a name="line.210"></a>
+<span class="sourceLineNo">211</span>      TableName[] sTableArray, TableName[] tTableArray, boolean isOverwrite) throws IOException {<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    TreeSet&lt;BackupImage&gt; restoreImageSet = new TreeSet&lt;BackupImage&gt;();<a name="line.212"></a>
+<span class="sourceLineNo">213</span>    boolean truncateIfExists = isOverwrite;<a name="line.213"></a>
+<span class="sourceLineNo">214</span>    Set&lt;String&gt; backupIdSet = new HashSet&lt;&gt;();<a name="line.214"></a>
+<span class="sourceLineNo">215</span><a name="line.215"></a>
+<span class="sourceLineNo">216</span>    for (int i = 0; i &lt; sTableArray.length; i++) {<a name="line.216"></a>
+<span class="sourceLineNo">217</span>      TableName table = sTableArray[i];<a name="line.217"></a>
+<span class="sourceLineNo">218</span><a name="line.218"></a>
+<span class="sourceLineNo">219</span>      BackupManifest manifest = backupManifestMap.get(table);<a name="line.219"></a>
+<span class="sourceLineNo">220</span>      // Get the image list of this backup for restore in time order from old<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      // to new.<a name="line.221"></a>
+<span class="sourceLineNo">222</span>      List&lt;BackupImage&gt; list = new ArrayList&lt;BackupImage&gt;();<a name="line.222"></a>
+<span class="sourceLineNo">223</span>      list.add(manifest.getBackupImage());<a name="line.223"></a>
+<span class="sourceLineNo">224</span>      TreeSet&lt;BackupImage&gt; set = new TreeSet&lt;BackupImage&gt;(list);<a name="line.224"></a>
+<span class="sourceLineNo">225</span>      List&lt;BackupImage&gt; depList = manifest.getDependentListByTable(table);<a name="line.225"></a>
+<span class="sourceLineNo">226</span>      set.addAll(depList);<a name="line.226"></a>
+<span class="sourceLineNo">227</span>      BackupImage[] arr = new BackupImage[set.size()];<a name="line.227"></a>
+<span class="sourceLineNo">228</span>      set.toArray(arr);<a name="line.228"></a>
+<span class="sourceLineNo">229</span>      restoreImages(arr, table, tTableArray[i], truncateIfExists);<a name="line.229"></a>
+<span class="sourceLineNo">230</span>      restoreImageSet.addAll(list);<a name="line.230"></a>
+<span class="sourceLineNo">231</span>      if (restoreImageSet != null &amp;&amp; !restoreImageSet.isEmpty()) {<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        LOG.info("Restore includes the following image(s):");<a name="line.232"></a>
+<span class="sourceLineNo">233</span>        for (BackupImage image : restoreImageSet) {<a name="line.233"></a>
+<span class="sourceLineNo">234</span>          LOG.info("Backup: " + image.getBackupId() + " "<a name="line.234"></a>
+<span class="sourceLineNo">235</span>              + HBackupFileSystem.getTableBackupDir(image.getRootDir(), image.getBackupId(), table));<a name="line.235"></a>
+<span class="sourceLineNo">236</span>          if (image.getType() == BackupType.INCREMENTAL) {<a name="line.236"></a>
+<span class="sourceLineNo">237</span>            backupIdSet.add(image.getBackupId());<a name="line.237"></a>
+<span class="sourceLineNo">238</span>            LOG.debug("adding " + image.getBackupId() + " for bulk load");<a name="line.238"></a>
+<span class="sourceLineNo">239</span>          }<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        }<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>    LOG.debug("restoreStage finished");<a name="line.243"></a>
+<span class="sourceLineNo">244</span>  }<a name="line.244"></a>
+<span class="sourceLineNo">245</span><a name="line.245"></a>
+<span class="sourceLineNo">246</span>  static long getTsFromBackupId(String backupId) {<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    if (backupId == null) {<a name="line.247"></a>
+<span class="sourceLineNo">248</span>      return 0;<a name="line.248"></a>
 <span class="sourceLineNo">249</span>    }<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    LOG.debug("restoreStage finished");<a name="line.250"></a>
+<span class="sourceLineNo">250</span>    return Long.parseLong(backupId.substring(backupId.lastIndexOf("_") + 1));<a name="line.250"></a>
 <span class="sourceLineNo">251</span>  }<a name="line.251"></a>
 <span class="sourceLineNo">252</span><a name="line.252"></a>
-<span class="sourceLineNo">253</span>  static long getTsFromBackupId(String backupId) {<a name="line.253"></a>
-<span class="sourceLineNo">254</span>    if (backupId == null) {<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      return 0;<a name="line.255"></a>
+<span class="sourceLineNo">253</span>  static boolean withinRange(long a, long lower, long upper) {<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    if (a &lt; lower || a &gt; upper) {<a name="line.254"></a>
+<span class="sourceLineNo">255</span>      return false;<a name="line.255"></a>
 <span class="sourceLineNo">256</span>    }<a name="line.256"></a>
-<span class="sourceLineNo">257</span>    return Long.parseLong(backupId.substring(backupId.lastIndexOf("_") + 1));<a name="line.257"></a>
+<span class="sourceLineNo">257</span>    return true;<a name="line.257"></a>
 <span class="sourceLineNo">258</span>  }<a name="line.258"></a>
 <span class="sourceLineNo">259</span><a name="line.259"></a>
-<span class="sourceLineNo">260</span>  static boolean withinRange(long a, long lower, long upper) {<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    if (a &lt; lower || a &gt; upper) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>      return false;<a name="line.262"></a>
-<span class="sourceLineNo">263</span>    }<a name="line.263"></a>
-<span class="sourceLineNo">264</span>    return true;<a name="line.264"></a>
-<span class="sourceLineNo">265</span>  }<a name="line.265"></a>
-<span class="sourceLineNo">266</span><a name="line.266"></a>
-<span class="sourceLineNo">267</span>  public void execute() throws IOException {<a name="line.267"></a>
-<span class="sourceLineNo">268</span><a name="line.268"></a>
-<span class="sourceLineNo">269</span>    // case VALIDATION:<a name="line.269"></a>
-<span class="sourceLineNo">270</span>    // check the target tables<a name="line.270"></a>
-<span class="sourceLineNo">271</span>    checkTargetTables(tTableArray, isOverwrite);<a name="line.271"></a>
+<span class="sourceLineNo">260</span>  public void execute() throws IOException {<a name="line.260"></a>
+<span class="sourceLineNo">261</span><a name="line.261"></a>
+<span class="sourceLineNo">262</span>    // case VALIDATION:<a name="line.262"></a>
+<span class="sourceLineNo">263</span>    // check the target tables<a name="line.263"></a>
+<span class="sourceLineNo">264</span>    checkTargetTables(tTableArray, isOverwrite);<a name="line.264"></a>
+<span class="sourceLineNo">265</span><a name="line.265"></a>
+<span class="sourceLineNo">266</span>    // case RESTORE_IMAGES:<a name="line.266"></a>
+<span class="sourceLineNo">267</span>    HashMap&lt;TableName, BackupManifest&gt; backupManifestMap = new HashMap&lt;&gt;();<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    // check and load backup image manifest for the tables<a name="line.268"></a>
+<span class="sourceLineNo">269</span>    Path rootPath = new Path(targetRootDir);<a name="line.269"></a>
+<span class="sourceLineNo">270</span>    HBackupFileSystem.checkImageManifestExist(backupManifestMap, sTableArray, conf, rootPath,<a name="line.270"></a>
+<span class="sourceLineNo">271</span>      backupId);<a name="line.271"></a>
 <span class="sourceLineNo">272</span><a name="line.272"></a>
-<span class="sourceLineNo">273</span>    // case RESTORE_IMAGES:<a name="line.273"></a>
-<span class="sourceLineNo">274</span>    HashMap&lt;TableName, BackupManifest&gt; backupManifestMap = new HashMap&lt;&gt;();<a name="line.274"></a>
-<span class="sourceLineNo">275</span>    // check and load backup image manifest for the tables<a name="line.275"></a>
-<span class="sourceLineNo">276</span>    Path rootPath = new Path(targetRootDir);<a name="line.276"></a>
-<span class="sourceLineNo">277</span>    HBackupFileSystem.checkImageManifestExist(backupManifestMap, sTableArray, conf, rootPath,<a name="line.277"></a>
-<span class="sourceLineNo">278</span>      backupId);<a name="line.278"></a>
-<span class="sourceLineNo">279</span><a name="line.279"></a>
-<span class="sourceLineNo">280</span>    restore(backupManifestMap, sTableArray, tTableArray, isOverwrite);<a name="line.280"></a>
-<span class="sourceLineNo">281</span>  }<a name="line.281"></a>
-<span class="sourceLineNo">282</span><a name="line.282"></a>
-<span class="sourceLineNo">283</span>}<a name="line.283"></a>
+<span class="sourceLineNo">273</span>    restore(backupManifestMap, sTableArray, tTableArray, isOverwrite);<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>
 
 
 


Mime
View raw message