hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [13/52] [partial] hbase-site git commit: Published site at 61220e4d7c8d7e5fb8ed3bbe2469bc86632c48de.
Date Wed, 07 Dec 2016 18:24:19 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/d9f3c819/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/WALPlayer.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/WALPlayer.html b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/WALPlayer.html
index 391d476..8803754 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/WALPlayer.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/WALPlayer.html
@@ -88,278 +88,275 @@
 <span class="sourceLineNo">080</span>    Configuration.addDeprecation("hlog.bulk.output", BULK_OUTPUT_CONF_KEY);<a name="line.80"></a>
 <span class="sourceLineNo">081</span>    Configuration.addDeprecation("hlog.input.tables", TABLES_KEY);<a name="line.81"></a>
 <span class="sourceLineNo">082</span>    Configuration.addDeprecation("hlog.input.tablesmap", TABLE_MAP_KEY);<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    Configuration.addDeprecation(HLogInputFormat.START_TIME_KEY, WALInputFormat.START_TIME_KEY);<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    Configuration.addDeprecation(HLogInputFormat.END_TIME_KEY, WALInputFormat.END_TIME_KEY);<a name="line.84"></a>
-<span class="sourceLineNo">085</span>  }<a name="line.85"></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>  private final static String JOB_NAME_CONF_KEY = "mapreduce.job.name";<a name="line.85"></a>
 <span class="sourceLineNo">086</span><a name="line.86"></a>
-<span class="sourceLineNo">087</span>  private final static String JOB_NAME_CONF_KEY = "mapreduce.job.name";<a name="line.87"></a>
-<span class="sourceLineNo">088</span><a name="line.88"></a>
-<span class="sourceLineNo">089</span>  protected WALPlayer(final Configuration c) {<a name="line.89"></a>
-<span class="sourceLineNo">090</span>    super(c);<a name="line.90"></a>
-<span class="sourceLineNo">091</span>  }<a name="line.91"></a>
-<span class="sourceLineNo">092</span><a name="line.92"></a>
-<span class="sourceLineNo">093</span>  /**<a name="line.93"></a>
-<span class="sourceLineNo">094</span>   * A mapper that just writes out KeyValues.<a name="line.94"></a>
-<span class="sourceLineNo">095</span>   * This one can be used together with {@link KeyValueSortReducer}<a name="line.95"></a>
-<span class="sourceLineNo">096</span>   */<a name="line.96"></a>
-<span class="sourceLineNo">097</span>  static class WALKeyValueMapper<a name="line.97"></a>
-<span class="sourceLineNo">098</span>  extends Mapper&lt;WALKey, WALEdit, ImmutableBytesWritable, KeyValue&gt; {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    private byte[] table;<a name="line.99"></a>
-<span class="sourceLineNo">100</span><a name="line.100"></a>
-<span class="sourceLineNo">101</span>    @Override<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    public void map(WALKey key, WALEdit value,<a name="line.102"></a>
-<span class="sourceLineNo">103</span>      Context context)<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    throws IOException {<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      try {<a name="line.105"></a>
-<span class="sourceLineNo">106</span>        // skip all other tables<a name="line.106"></a>
-<span class="sourceLineNo">107</span>        if (Bytes.equals(table, key.getTablename().getName())) {<a name="line.107"></a>
-<span class="sourceLineNo">108</span>          for (Cell cell : value.getCells()) {<a name="line.108"></a>
-<span class="sourceLineNo">109</span>            KeyValue kv = KeyValueUtil.ensureKeyValue(cell);<a name="line.109"></a>
-<span class="sourceLineNo">110</span>            if (WALEdit.isMetaEditFamily(kv)) continue;<a name="line.110"></a>
-<span class="sourceLineNo">111</span>            context.write(new ImmutableBytesWritable(CellUtil.cloneRow(kv)), kv);<a name="line.111"></a>
-<span class="sourceLineNo">112</span>          }<a name="line.112"></a>
-<span class="sourceLineNo">113</span>        }<a name="line.113"></a>
-<span class="sourceLineNo">114</span>      } catch (InterruptedException e) {<a name="line.114"></a>
-<span class="sourceLineNo">115</span>        e.printStackTrace();<a name="line.115"></a>
-<span class="sourceLineNo">116</span>      }<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    }<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>    @Override<a name="line.119"></a>
-<span class="sourceLineNo">120</span>    public void setup(Context context) throws IOException {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>      // only a single table is supported when HFiles are generated with HFileOutputFormat<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      String[] tables = context.getConfiguration().getStrings(TABLES_KEY);<a name="line.122"></a>
-<span class="sourceLineNo">123</span>      if (tables == null || tables.length != 1) {<a name="line.123"></a>
-<span class="sourceLineNo">124</span>        // this can only happen when WALMapper is used directly by a class other than WALPlayer<a name="line.124"></a>
-<span class="sourceLineNo">125</span>        throw new IOException("Exactly one table must be specified for bulk HFile case.");<a name="line.125"></a>
-<span class="sourceLineNo">126</span>      }<a name="line.126"></a>
-<span class="sourceLineNo">127</span>      table = Bytes.toBytes(tables[0]);<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><a name="line.130"></a>
-<span class="sourceLineNo">131</span>  /**<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * A mapper that writes out {@link Mutation} to be directly applied to<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   * a running HBase instance.<a name="line.133"></a>
-<span class="sourceLineNo">134</span>   */<a name="line.134"></a>
-<span class="sourceLineNo">135</span>  protected static class WALMapper<a name="line.135"></a>
-<span class="sourceLineNo">136</span>  extends Mapper&lt;WALKey, WALEdit, ImmutableBytesWritable, Mutation&gt; {<a name="line.136"></a>
-<span class="sourceLineNo">137</span>    private Map&lt;TableName, TableName&gt; tables = new TreeMap&lt;TableName, TableName&gt;();<a name="line.137"></a>
-<span class="sourceLineNo">138</span><a name="line.138"></a>
-<span class="sourceLineNo">139</span>    @Override<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    public void map(WALKey key, WALEdit value, Context context)<a name="line.140"></a>
-<span class="sourceLineNo">141</span>    throws IOException {<a name="line.141"></a>
-<span class="sourceLineNo">142</span>      try {<a name="line.142"></a>
-<span class="sourceLineNo">143</span>        if (tables.isEmpty() || tables.containsKey(key.getTablename())) {<a name="line.143"></a>
-<span class="sourceLineNo">144</span>          TableName targetTable = tables.isEmpty() ?<a name="line.144"></a>
-<span class="sourceLineNo">145</span>                key.getTablename() :<a name="line.145"></a>
-<span class="sourceLineNo">146</span>                tables.get(key.getTablename());<a name="line.146"></a>
-<span class="sourceLineNo">147</span>          ImmutableBytesWritable tableOut = new ImmutableBytesWritable(targetTable.getName());<a name="line.147"></a>
-<span class="sourceLineNo">148</span>          Put put = null;<a name="line.148"></a>
-<span class="sourceLineNo">149</span>          Delete del = null;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>          Cell lastCell = null;<a name="line.150"></a>
-<span class="sourceLineNo">151</span>          for (Cell cell : value.getCells()) {<a name="line.151"></a>
-<span class="sourceLineNo">152</span>            // filtering WAL meta entries<a name="line.152"></a>
-<span class="sourceLineNo">153</span>            if (WALEdit.isMetaEditFamily(cell)) continue;<a name="line.153"></a>
-<span class="sourceLineNo">154</span><a name="line.154"></a>
-<span class="sourceLineNo">155</span>            // Allow a subclass filter out this cell.<a name="line.155"></a>
-<span class="sourceLineNo">156</span>            if (filter(context, cell)) {<a name="line.156"></a>
-<span class="sourceLineNo">157</span>              // A WALEdit may contain multiple operations (HBASE-3584) and/or<a name="line.157"></a>
-<span class="sourceLineNo">158</span>              // multiple rows (HBASE-5229).<a name="line.158"></a>
-<span class="sourceLineNo">159</span>              // Aggregate as much as possible into a single Put/Delete<a name="line.159"></a>
-<span class="sourceLineNo">160</span>              // operation before writing to the context.<a name="line.160"></a>
-<span class="sourceLineNo">161</span>              if (lastCell == null || lastCell.getTypeByte() != cell.getTypeByte()<a name="line.161"></a>
-<span class="sourceLineNo">162</span>                  || !CellUtil.matchingRow(lastCell, cell)) {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>                // row or type changed, write out aggregate KVs.<a name="line.163"></a>
-<span class="sourceLineNo">164</span>                if (put != null) context.write(tableOut, put);<a name="line.164"></a>
-<span class="sourceLineNo">165</span>                if (del != null) context.write(tableOut, del);<a name="line.165"></a>
-<span class="sourceLineNo">166</span>                if (CellUtil.isDelete(cell)) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>                  del = new Delete(CellUtil.cloneRow(cell));<a name="line.167"></a>
-<span class="sourceLineNo">168</span>                } else {<a name="line.168"></a>
-<span class="sourceLineNo">169</span>                  put = new Put(CellUtil.cloneRow(cell));<a name="line.169"></a>
-<span class="sourceLineNo">170</span>                }<a name="line.170"></a>
-<span class="sourceLineNo">171</span>              }<a name="line.171"></a>
-<span class="sourceLineNo">172</span>              if (CellUtil.isDelete(cell)) {<a name="line.172"></a>
-<span class="sourceLineNo">173</span>                del.addDeleteMarker(cell);<a name="line.173"></a>
-<span class="sourceLineNo">174</span>              } else {<a name="line.174"></a>
-<span class="sourceLineNo">175</span>                put.add(cell);<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>            lastCell = cell;<a name="line.178"></a>
-<span class="sourceLineNo">179</span>          }<a name="line.179"></a>
-<span class="sourceLineNo">180</span>          // write residual KVs<a name="line.180"></a>
-<span class="sourceLineNo">181</span>          if (put != null) context.write(tableOut, put);<a name="line.181"></a>
-<span class="sourceLineNo">182</span>          if (del != null) context.write(tableOut, del);<a name="line.182"></a>
-<span class="sourceLineNo">183</span>        }<a name="line.183"></a>
-<span class="sourceLineNo">184</span>      } catch (InterruptedException e) {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>        e.printStackTrace();<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>    /**<a name="line.189"></a>
-<span class="sourceLineNo">190</span>     * @param cell<a name="line.190"></a>
-<span class="sourceLineNo">191</span>     * @return Return true if we are to emit this cell.<a name="line.191"></a>
-<span class="sourceLineNo">192</span>     */<a name="line.192"></a>
-<span class="sourceLineNo">193</span>    protected boolean filter(Context context, final Cell cell) {<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      return true;<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    }<a name="line.195"></a>
-<span class="sourceLineNo">196</span><a name="line.196"></a>
-<span class="sourceLineNo">197</span>    @Override<a name="line.197"></a>
-<span class="sourceLineNo">198</span>    public void setup(Context context) throws IOException {<a name="line.198"></a>
-<span class="sourceLineNo">199</span>      String[] tableMap = context.getConfiguration().getStrings(TABLE_MAP_KEY);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>      String[] tablesToUse = context.getConfiguration().getStrings(TABLES_KEY);<a name="line.200"></a>
-<span class="sourceLineNo">201</span>      if (tablesToUse == null &amp;&amp; tableMap == null) {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>        // Then user wants all tables.<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      } else if (tablesToUse == null || tableMap == null || tablesToUse.length != tableMap.length) {<a name="line.203"></a>
-<span class="sourceLineNo">204</span>        // this can only happen when WALMapper is used directly by a class other than WALPlayer<a name="line.204"></a>
-<span class="sourceLineNo">205</span>        throw new IOException("No tables or incorrect table mapping specified.");<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      }<a name="line.206"></a>
-<span class="sourceLineNo">207</span>      int i = 0;<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      if (tablesToUse != null) {<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        for (String table : tablesToUse) {<a name="line.209"></a>
-<span class="sourceLineNo">210</span>          tables.put(TableName.valueOf(table),<a name="line.210"></a>
-<span class="sourceLineNo">211</span>            TableName.valueOf(tableMap[i++]));<a name="line.211"></a>
-<span class="sourceLineNo">212</span>        }<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      }<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>  }<a name="line.215"></a>
-<span class="sourceLineNo">216</span><a name="line.216"></a>
-<span class="sourceLineNo">217</span>  void setupTime(Configuration conf, String option) throws IOException {<a name="line.217"></a>
-<span class="sourceLineNo">218</span>    String val = conf.get(option);<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    if (null == val) return;<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    long ms;<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    try {<a name="line.221"></a>
-<span class="sourceLineNo">222</span>      // first try to parse in user friendly form<a name="line.222"></a>
-<span class="sourceLineNo">223</span>      ms = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS").parse(val).getTime();<a name="line.223"></a>
-<span class="sourceLineNo">224</span>    } catch (ParseException pe) {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>      try {<a name="line.225"></a>
-<span class="sourceLineNo">226</span>        // then see if just a number of ms's was specified<a name="line.226"></a>
-<span class="sourceLineNo">227</span>        ms = Long.parseLong(val);<a name="line.227"></a>
-<span class="sourceLineNo">228</span>      } catch (NumberFormatException nfe) {<a name="line.228"></a>
-<span class="sourceLineNo">229</span>        throw new IOException(option<a name="line.229"></a>
-<span class="sourceLineNo">230</span>            + " must be specified either in the form 2001-02-20T16:35:06.99 "<a name="line.230"></a>
-<span class="sourceLineNo">231</span>            + "or as number of milliseconds");<a name="line.231"></a>
-<span class="sourceLineNo">232</span>      }<a name="line.232"></a>
-<span class="sourceLineNo">233</span>    }<a name="line.233"></a>
-<span class="sourceLineNo">234</span>    conf.setLong(option, ms);<a name="line.234"></a>
-<span class="sourceLineNo">235</span>  }<a name="line.235"></a>
-<span class="sourceLineNo">236</span><a name="line.236"></a>
-<span class="sourceLineNo">237</span>  /**<a name="line.237"></a>
-<span class="sourceLineNo">238</span>   * Sets up the actual job.<a name="line.238"></a>
-<span class="sourceLineNo">239</span>   *<a name="line.239"></a>
-<span class="sourceLineNo">240</span>   * @param args  The command line parameters.<a name="line.240"></a>
-<span class="sourceLineNo">241</span>   * @return The newly created job.<a name="line.241"></a>
-<span class="sourceLineNo">242</span>   * @throws IOException When setting up the job fails.<a name="line.242"></a>
-<span class="sourceLineNo">243</span>   */<a name="line.243"></a>
-<span class="sourceLineNo">244</span>  public Job createSubmittableJob(String[] args)<a name="line.244"></a>
-<span class="sourceLineNo">245</span>  throws IOException {<a name="line.245"></a>
-<span class="sourceLineNo">246</span>    Configuration conf = getConf();<a name="line.246"></a>
-<span class="sourceLineNo">247</span>    setupTime(conf, HLogInputFormat.START_TIME_KEY);<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    setupTime(conf, HLogInputFormat.END_TIME_KEY);<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    Path inputDir = new Path(args[0]);<a name="line.249"></a>
-<span class="sourceLineNo">250</span>    String[] tables = args[1].split(",");<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    String[] tableMap;<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    if (args.length &gt; 2) {<a name="line.252"></a>
-<span class="sourceLineNo">253</span>      tableMap = args[2].split(",");<a name="line.253"></a>
-<span class="sourceLineNo">254</span>      if (tableMap.length != tables.length) {<a name="line.254"></a>
-<span class="sourceLineNo">255</span>        throw new IOException("The same number of tables and mapping must be provided.");<a name="line.255"></a>
-<span class="sourceLineNo">256</span>      }<a name="line.256"></a>
-<span class="sourceLineNo">257</span>    } else {<a name="line.257"></a>
-<span class="sourceLineNo">258</span>      // if not mapping is specified map each table to itself<a name="line.258"></a>
-<span class="sourceLineNo">259</span>      tableMap = tables;<a name="line.259"></a>
-<span class="sourceLineNo">260</span>    }<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    conf.setStrings(TABLES_KEY, tables);<a name="line.261"></a>
-<span class="sourceLineNo">262</span>    conf.setStrings(TABLE_MAP_KEY, tableMap);<a name="line.262"></a>
-<span class="sourceLineNo">263</span>    Job job = Job.getInstance(conf, conf.get(JOB_NAME_CONF_KEY, NAME + "_" + inputDir));<a name="line.263"></a>
-<span class="sourceLineNo">264</span>    job.setJarByClass(WALPlayer.class);<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    FileInputFormat.setInputPaths(job, inputDir);<a name="line.265"></a>
-<span class="sourceLineNo">266</span>    job.setInputFormatClass(WALInputFormat.class);<a name="line.266"></a>
-<span class="sourceLineNo">267</span>    job.setMapOutputKeyClass(ImmutableBytesWritable.class);<a name="line.267"></a>
-<span class="sourceLineNo">268</span>    String hfileOutPath = conf.get(BULK_OUTPUT_CONF_KEY);<a name="line.268"></a>
-<span class="sourceLineNo">269</span>    if (hfileOutPath != null) {<a name="line.269"></a>
-<span class="sourceLineNo">270</span>      // the bulk HFile case<a name="line.270"></a>
-<span class="sourceLineNo">271</span>      if (tables.length != 1) {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>        throw new IOException("Exactly one table must be specified for the bulk export option");<a name="line.272"></a>
-<span class="sourceLineNo">273</span>      }<a name="line.273"></a>
-<span class="sourceLineNo">274</span>      TableName tableName = TableName.valueOf(tables[0]);<a name="line.274"></a>
-<span class="sourceLineNo">275</span>      job.setMapperClass(WALKeyValueMapper.class);<a name="line.275"></a>
-<span class="sourceLineNo">276</span>      job.setReducerClass(KeyValueSortReducer.class);<a name="line.276"></a>
-<span class="sourceLineNo">277</span>      Path outputDir = new Path(hfileOutPath);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>      FileOutputFormat.setOutputPath(job, outputDir);<a name="line.278"></a>
-<span class="sourceLineNo">279</span>      job.setMapOutputValueClass(KeyValue.class);<a name="line.279"></a>
-<span class="sourceLineNo">280</span>      try (Connection conn = ConnectionFactory.createConnection(conf);<a name="line.280"></a>
-<span class="sourceLineNo">281</span>          Table table = conn.getTable(tableName);<a name="line.281"></a>
-<span class="sourceLineNo">282</span>          RegionLocator regionLocator = conn.getRegionLocator(tableName)) {<a name="line.282"></a>
-<span class="sourceLineNo">283</span>        HFileOutputFormat2.configureIncrementalLoad(job, table.getTableDescriptor(), regionLocator);<a name="line.283"></a>
-<span class="sourceLineNo">284</span>      }<a name="line.284"></a>
-<span class="sourceLineNo">285</span>      TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(),<a name="line.285"></a>
-<span class="sourceLineNo">286</span>          com.google.common.base.Preconditions.class);<a name="line.286"></a>
-<span class="sourceLineNo">287</span>    } else {<a name="line.287"></a>
-<span class="sourceLineNo">288</span>      // output to live cluster<a name="line.288"></a>
-<span class="sourceLineNo">289</span>      job.setMapperClass(WALMapper.class);<a name="line.289"></a>
-<span class="sourceLineNo">290</span>      job.setOutputFormatClass(MultiTableOutputFormat.class);<a name="line.290"></a>
-<span class="sourceLineNo">291</span>      TableMapReduceUtil.addDependencyJars(job);<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      TableMapReduceUtil.initCredentials(job);<a name="line.292"></a>
-<span class="sourceLineNo">293</span>      // No reducers.<a name="line.293"></a>
-<span class="sourceLineNo">294</span>      job.setNumReduceTasks(0);<a name="line.294"></a>
-<span class="sourceLineNo">295</span>    }<a name="line.295"></a>
-<span class="sourceLineNo">296</span>    String codecCls = WALCellCodec.getWALCellCodecClass(conf);<a name="line.296"></a>
-<span class="sourceLineNo">297</span>    try {<a name="line.297"></a>
-<span class="sourceLineNo">298</span>      TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(), Class.forName(codecCls));<a name="line.298"></a>
-<span class="sourceLineNo">299</span>    } catch (Exception e) {<a name="line.299"></a>
-<span class="sourceLineNo">300</span>      throw new IOException("Cannot determine wal codec class " + codecCls, e);<a name="line.300"></a>
-<span class="sourceLineNo">301</span>    }<a name="line.301"></a>
-<span class="sourceLineNo">302</span>    return job;<a name="line.302"></a>
-<span class="sourceLineNo">303</span>  }<a name="line.303"></a>
-<span class="sourceLineNo">304</span><a name="line.304"></a>
-<span class="sourceLineNo">305</span>  /*<a name="line.305"></a>
-<span class="sourceLineNo">306</span>   * @param errorMsg Error message.  Can be null.<a name="line.306"></a>
-<span class="sourceLineNo">307</span>   */<a name="line.307"></a>
-<span class="sourceLineNo">308</span>  private void usage(final String errorMsg) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>    if (errorMsg != null &amp;&amp; errorMsg.length() &gt; 0) {<a name="line.309"></a>
-<span class="sourceLineNo">310</span>      System.err.println("ERROR: " + errorMsg);<a name="line.310"></a>
-<span class="sourceLineNo">311</span>    }<a name="line.311"></a>
-<span class="sourceLineNo">312</span>    System.err.println("Usage: " + NAME + " [options] &lt;wal inputdir&gt; &lt;tables&gt; [&lt;tableMappings&gt;]");<a name="line.312"></a>
-<span class="sourceLineNo">313</span>    System.err.println("Read all WAL entries for &lt;tables&gt;.");<a name="line.313"></a>
-<span class="sourceLineNo">314</span>    System.err.println("If no tables (\"\") are specific, all tables are imported.");<a name="line.314"></a>
-<span class="sourceLineNo">315</span>    System.err.println("(Careful, even -ROOT- and hbase:meta entries will be imported in that case.)");<a name="line.315"></a>
-<span class="sourceLineNo">316</span>    System.err.println("Otherwise &lt;tables&gt; is a comma separated list of tables.\n");<a name="line.316"></a>
-<span class="sourceLineNo">317</span>    System.err.println("The WAL entries can be mapped to new set of tables via &lt;tableMapping&gt;.");<a name="line.317"></a>
-<span class="sourceLineNo">318</span>    System.err.println("&lt;tableMapping&gt; is a command separated list of targettables.");<a name="line.318"></a>
-<span class="sourceLineNo">319</span>    System.err.println("If specified, each table in &lt;tables&gt; must have a mapping.\n");<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    System.err.println("By default " + NAME + " will load data directly into HBase.");<a name="line.320"></a>
-<span class="sourceLineNo">321</span>    System.err.println("To generate HFiles for a bulk data load instead, pass the option:");<a name="line.321"></a>
-<span class="sourceLineNo">322</span>    System.err.println("  -D" + BULK_OUTPUT_CONF_KEY + "=/path/for/output");<a name="line.322"></a>
-<span class="sourceLineNo">323</span>    System.err.println("  (Only one table can be specified, and no mapping is allowed!)");<a name="line.323"></a>
-<span class="sourceLineNo">324</span>    System.err.println("Other options: (specify time range to WAL edit to consider)");<a name="line.324"></a>
-<span class="sourceLineNo">325</span>    System.err.println("  -D" + WALInputFormat.START_TIME_KEY + "=[date|ms]");<a name="line.325"></a>
-<span class="sourceLineNo">326</span>    System.err.println("  -D" + WALInputFormat.END_TIME_KEY + "=[date|ms]");<a name="line.326"></a>
-<span class="sourceLineNo">327</span>    System.err.println("   -D " + JOB_NAME_CONF_KEY<a name="line.327"></a>
-<span class="sourceLineNo">328</span>        + "=jobName - use the specified mapreduce job name for the wal player");<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    System.err.println("For performance also consider the following options:\n"<a name="line.329"></a>
-<span class="sourceLineNo">330</span>        + "  -Dmapreduce.map.speculative=false\n"<a name="line.330"></a>
-<span class="sourceLineNo">331</span>        + "  -Dmapreduce.reduce.speculative=false");<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>  /**<a name="line.334"></a>
-<span class="sourceLineNo">335</span>   * Main entry point.<a name="line.335"></a>
-<span class="sourceLineNo">336</span>   *<a name="line.336"></a>
-<span class="sourceLineNo">337</span>   * @param args  The command line parameters.<a name="line.337"></a>
-<span class="sourceLineNo">338</span>   * @throws Exception When running the job fails.<a name="line.338"></a>
-<span class="sourceLineNo">339</span>   */<a name="line.339"></a>
-<span class="sourceLineNo">340</span>  public static void main(String[] args) throws Exception {<a name="line.340"></a>
-<span class="sourceLineNo">341</span>    int ret = ToolRunner.run(new WALPlayer(HBaseConfiguration.create()), args);<a name="line.341"></a>
-<span class="sourceLineNo">342</span>    System.exit(ret);<a name="line.342"></a>
-<span class="sourceLineNo">343</span>  }<a name="line.343"></a>
-<span class="sourceLineNo">344</span><a name="line.344"></a>
-<span class="sourceLineNo">345</span>  @Override<a name="line.345"></a>
-<span class="sourceLineNo">346</span>  public int run(String[] args) throws Exception {<a name="line.346"></a>
-<span class="sourceLineNo">347</span>    if (args.length &lt; 2) {<a name="line.347"></a>
-<span class="sourceLineNo">348</span>      usage("Wrong number of arguments: " + args.length);<a name="line.348"></a>
-<span class="sourceLineNo">349</span>      System.exit(-1);<a name="line.349"></a>
-<span class="sourceLineNo">350</span>    }<a name="line.350"></a>
-<span class="sourceLineNo">351</span>    Job job = createSubmittableJob(args);<a name="line.351"></a>
-<span class="sourceLineNo">352</span>    return job.waitForCompletion(true) ? 0 : 1;<a name="line.352"></a>
-<span class="sourceLineNo">353</span>  }<a name="line.353"></a>
-<span class="sourceLineNo">354</span>}<a name="line.354"></a>
+<span class="sourceLineNo">087</span>  protected WALPlayer(final Configuration c) {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    super(c);<a name="line.88"></a>
+<span class="sourceLineNo">089</span>  }<a name="line.89"></a>
+<span class="sourceLineNo">090</span><a name="line.90"></a>
+<span class="sourceLineNo">091</span>  /**<a name="line.91"></a>
+<span class="sourceLineNo">092</span>   * A mapper that just writes out KeyValues.<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   * This one can be used together with {@link KeyValueSortReducer}<a name="line.93"></a>
+<span class="sourceLineNo">094</span>   */<a name="line.94"></a>
+<span class="sourceLineNo">095</span>  static class WALKeyValueMapper<a name="line.95"></a>
+<span class="sourceLineNo">096</span>  extends Mapper&lt;WALKey, WALEdit, ImmutableBytesWritable, KeyValue&gt; {<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    private byte[] table;<a name="line.97"></a>
+<span class="sourceLineNo">098</span><a name="line.98"></a>
+<span class="sourceLineNo">099</span>    @Override<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    public void map(WALKey key, WALEdit value,<a name="line.100"></a>
+<span class="sourceLineNo">101</span>      Context context)<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    throws IOException {<a name="line.102"></a>
+<span class="sourceLineNo">103</span>      try {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>        // skip all other tables<a name="line.104"></a>
+<span class="sourceLineNo">105</span>        if (Bytes.equals(table, key.getTablename().getName())) {<a name="line.105"></a>
+<span class="sourceLineNo">106</span>          for (Cell cell : value.getCells()) {<a name="line.106"></a>
+<span class="sourceLineNo">107</span>            KeyValue kv = KeyValueUtil.ensureKeyValue(cell);<a name="line.107"></a>
+<span class="sourceLineNo">108</span>            if (WALEdit.isMetaEditFamily(kv)) continue;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>            context.write(new ImmutableBytesWritable(CellUtil.cloneRow(kv)), kv);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>          }<a name="line.110"></a>
+<span class="sourceLineNo">111</span>        }<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      } catch (InterruptedException e) {<a name="line.112"></a>
+<span class="sourceLineNo">113</span>        e.printStackTrace();<a name="line.113"></a>
+<span class="sourceLineNo">114</span>      }<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    }<a name="line.115"></a>
+<span class="sourceLineNo">116</span><a name="line.116"></a>
+<span class="sourceLineNo">117</span>    @Override<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    public void setup(Context context) throws IOException {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      // only a single table is supported when HFiles are generated with HFileOutputFormat<a name="line.119"></a>
+<span class="sourceLineNo">120</span>      String[] tables = context.getConfiguration().getStrings(TABLES_KEY);<a name="line.120"></a>
+<span class="sourceLineNo">121</span>      if (tables == null || tables.length != 1) {<a name="line.121"></a>
+<span class="sourceLineNo">122</span>        // this can only happen when WALMapper is used directly by a class other than WALPlayer<a name="line.122"></a>
+<span class="sourceLineNo">123</span>        throw new IOException("Exactly one table must be specified for bulk HFile case.");<a name="line.123"></a>
+<span class="sourceLineNo">124</span>      }<a name="line.124"></a>
+<span class="sourceLineNo">125</span>      table = Bytes.toBytes(tables[0]);<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>   * A mapper that writes out {@link Mutation} to be directly applied to<a name="line.130"></a>
+<span class="sourceLineNo">131</span>   * a running HBase instance.<a name="line.131"></a>
+<span class="sourceLineNo">132</span>   */<a name="line.132"></a>
+<span class="sourceLineNo">133</span>  protected static class WALMapper<a name="line.133"></a>
+<span class="sourceLineNo">134</span>  extends Mapper&lt;WALKey, WALEdit, ImmutableBytesWritable, Mutation&gt; {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>    private Map&lt;TableName, TableName&gt; tables = new TreeMap&lt;TableName, TableName&gt;();<a name="line.135"></a>
+<span class="sourceLineNo">136</span><a name="line.136"></a>
+<span class="sourceLineNo">137</span>    @Override<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    public void map(WALKey key, WALEdit value, Context context)<a name="line.138"></a>
+<span class="sourceLineNo">139</span>    throws IOException {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>      try {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>        if (tables.isEmpty() || tables.containsKey(key.getTablename())) {<a name="line.141"></a>
+<span class="sourceLineNo">142</span>          TableName targetTable = tables.isEmpty() ?<a name="line.142"></a>
+<span class="sourceLineNo">143</span>                key.getTablename() :<a name="line.143"></a>
+<span class="sourceLineNo">144</span>                tables.get(key.getTablename());<a name="line.144"></a>
+<span class="sourceLineNo">145</span>          ImmutableBytesWritable tableOut = new ImmutableBytesWritable(targetTable.getName());<a name="line.145"></a>
+<span class="sourceLineNo">146</span>          Put put = null;<a name="line.146"></a>
+<span class="sourceLineNo">147</span>          Delete del = null;<a name="line.147"></a>
+<span class="sourceLineNo">148</span>          Cell lastCell = null;<a name="line.148"></a>
+<span class="sourceLineNo">149</span>          for (Cell cell : value.getCells()) {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>            // filtering WAL meta entries<a name="line.150"></a>
+<span class="sourceLineNo">151</span>            if (WALEdit.isMetaEditFamily(cell)) continue;<a name="line.151"></a>
+<span class="sourceLineNo">152</span><a name="line.152"></a>
+<span class="sourceLineNo">153</span>            // Allow a subclass filter out this cell.<a name="line.153"></a>
+<span class="sourceLineNo">154</span>            if (filter(context, cell)) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>              // A WALEdit may contain multiple operations (HBASE-3584) and/or<a name="line.155"></a>
+<span class="sourceLineNo">156</span>              // multiple rows (HBASE-5229).<a name="line.156"></a>
+<span class="sourceLineNo">157</span>              // Aggregate as much as possible into a single Put/Delete<a name="line.157"></a>
+<span class="sourceLineNo">158</span>              // operation before writing to the context.<a name="line.158"></a>
+<span class="sourceLineNo">159</span>              if (lastCell == null || lastCell.getTypeByte() != cell.getTypeByte()<a name="line.159"></a>
+<span class="sourceLineNo">160</span>                  || !CellUtil.matchingRow(lastCell, cell)) {<a name="line.160"></a>
+<span class="sourceLineNo">161</span>                // row or type changed, write out aggregate KVs.<a name="line.161"></a>
+<span class="sourceLineNo">162</span>                if (put != null) context.write(tableOut, put);<a name="line.162"></a>
+<span class="sourceLineNo">163</span>                if (del != null) context.write(tableOut, del);<a name="line.163"></a>
+<span class="sourceLineNo">164</span>                if (CellUtil.isDelete(cell)) {<a name="line.164"></a>
+<span class="sourceLineNo">165</span>                  del = new Delete(CellUtil.cloneRow(cell));<a name="line.165"></a>
+<span class="sourceLineNo">166</span>                } else {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>                  put = new Put(CellUtil.cloneRow(cell));<a name="line.167"></a>
+<span class="sourceLineNo">168</span>                }<a name="line.168"></a>
+<span class="sourceLineNo">169</span>              }<a name="line.169"></a>
+<span class="sourceLineNo">170</span>              if (CellUtil.isDelete(cell)) {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>                del.addDeleteMarker(cell);<a name="line.171"></a>
+<span class="sourceLineNo">172</span>              } else {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>                put.add(cell);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>              }<a name="line.174"></a>
+<span class="sourceLineNo">175</span>            }<a name="line.175"></a>
+<span class="sourceLineNo">176</span>            lastCell = cell;<a name="line.176"></a>
+<span class="sourceLineNo">177</span>          }<a name="line.177"></a>
+<span class="sourceLineNo">178</span>          // write residual KVs<a name="line.178"></a>
+<span class="sourceLineNo">179</span>          if (put != null) context.write(tableOut, put);<a name="line.179"></a>
+<span class="sourceLineNo">180</span>          if (del != null) context.write(tableOut, del);<a name="line.180"></a>
+<span class="sourceLineNo">181</span>        }<a name="line.181"></a>
+<span class="sourceLineNo">182</span>      } catch (InterruptedException e) {<a name="line.182"></a>
+<span class="sourceLineNo">183</span>        e.printStackTrace();<a name="line.183"></a>
+<span class="sourceLineNo">184</span>      }<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    }<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>     * @param cell<a name="line.188"></a>
+<span class="sourceLineNo">189</span>     * @return Return true if we are to emit this cell.<a name="line.189"></a>
+<span class="sourceLineNo">190</span>     */<a name="line.190"></a>
+<span class="sourceLineNo">191</span>    protected boolean filter(Context context, final Cell cell) {<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      return true;<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    }<a name="line.193"></a>
+<span class="sourceLineNo">194</span><a name="line.194"></a>
+<span class="sourceLineNo">195</span>    @Override<a name="line.195"></a>
+<span class="sourceLineNo">196</span>    public void setup(Context context) throws IOException {<a name="line.196"></a>
+<span class="sourceLineNo">197</span>      String[] tableMap = context.getConfiguration().getStrings(TABLE_MAP_KEY);<a name="line.197"></a>
+<span class="sourceLineNo">198</span>      String[] tablesToUse = context.getConfiguration().getStrings(TABLES_KEY);<a name="line.198"></a>
+<span class="sourceLineNo">199</span>      if (tablesToUse == null &amp;&amp; tableMap == null) {<a name="line.199"></a>
+<span class="sourceLineNo">200</span>        // Then user wants all tables.<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      } else if (tablesToUse == null || tableMap == null || tablesToUse.length != tableMap.length) {<a name="line.201"></a>
+<span class="sourceLineNo">202</span>        // this can only happen when WALMapper is used directly by a class other than WALPlayer<a name="line.202"></a>
+<span class="sourceLineNo">203</span>        throw new IOException("No tables or incorrect table mapping specified.");<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      }<a name="line.204"></a>
+<span class="sourceLineNo">205</span>      int i = 0;<a name="line.205"></a>
+<span class="sourceLineNo">206</span>      if (tablesToUse != null) {<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        for (String table : tablesToUse) {<a name="line.207"></a>
+<span class="sourceLineNo">208</span>          tables.put(TableName.valueOf(table),<a name="line.208"></a>
+<span class="sourceLineNo">209</span>            TableName.valueOf(tableMap[i++]));<a name="line.209"></a>
+<span class="sourceLineNo">210</span>        }<a name="line.210"></a>
+<span class="sourceLineNo">211</span>      }<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    }<a name="line.212"></a>
+<span class="sourceLineNo">213</span>  }<a name="line.213"></a>
+<span class="sourceLineNo">214</span><a name="line.214"></a>
+<span class="sourceLineNo">215</span>  void setupTime(Configuration conf, String option) throws IOException {<a name="line.215"></a>
+<span class="sourceLineNo">216</span>    String val = conf.get(option);<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    if (null == val) return;<a name="line.217"></a>
+<span class="sourceLineNo">218</span>    long ms;<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    try {<a name="line.219"></a>
+<span class="sourceLineNo">220</span>      // first try to parse in user friendly form<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      ms = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS").parse(val).getTime();<a name="line.221"></a>
+<span class="sourceLineNo">222</span>    } catch (ParseException pe) {<a name="line.222"></a>
+<span class="sourceLineNo">223</span>      try {<a name="line.223"></a>
+<span class="sourceLineNo">224</span>        // then see if just a number of ms's was specified<a name="line.224"></a>
+<span class="sourceLineNo">225</span>        ms = Long.parseLong(val);<a name="line.225"></a>
+<span class="sourceLineNo">226</span>      } catch (NumberFormatException nfe) {<a name="line.226"></a>
+<span class="sourceLineNo">227</span>        throw new IOException(option<a name="line.227"></a>
+<span class="sourceLineNo">228</span>            + " must be specified either in the form 2001-02-20T16:35:06.99 "<a name="line.228"></a>
+<span class="sourceLineNo">229</span>            + "or as number of milliseconds");<a name="line.229"></a>
+<span class="sourceLineNo">230</span>      }<a name="line.230"></a>
+<span class="sourceLineNo">231</span>    }<a name="line.231"></a>
+<span class="sourceLineNo">232</span>    conf.setLong(option, ms);<a name="line.232"></a>
+<span class="sourceLineNo">233</span>  }<a name="line.233"></a>
+<span class="sourceLineNo">234</span><a name="line.234"></a>
+<span class="sourceLineNo">235</span>  /**<a name="line.235"></a>
+<span class="sourceLineNo">236</span>   * Sets up the actual job.<a name="line.236"></a>
+<span class="sourceLineNo">237</span>   *<a name="line.237"></a>
+<span class="sourceLineNo">238</span>   * @param args  The command line parameters.<a name="line.238"></a>
+<span class="sourceLineNo">239</span>   * @return The newly created job.<a name="line.239"></a>
+<span class="sourceLineNo">240</span>   * @throws IOException When setting up the job fails.<a name="line.240"></a>
+<span class="sourceLineNo">241</span>   */<a name="line.241"></a>
+<span class="sourceLineNo">242</span>  public Job createSubmittableJob(String[] args) throws IOException {<a name="line.242"></a>
+<span class="sourceLineNo">243</span>    Configuration conf = getConf();<a name="line.243"></a>
+<span class="sourceLineNo">244</span>    setupTime(conf, WALInputFormat.START_TIME_KEY);<a name="line.244"></a>
+<span class="sourceLineNo">245</span>    setupTime(conf, WALInputFormat.END_TIME_KEY);<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    Path inputDir = new Path(args[0]);<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    String[] tables = args[1].split(",");<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    String[] tableMap;<a name="line.248"></a>
+<span class="sourceLineNo">249</span>    if (args.length &gt; 2) {<a name="line.249"></a>
+<span class="sourceLineNo">250</span>      tableMap = args[2].split(",");<a name="line.250"></a>
+<span class="sourceLineNo">251</span>      if (tableMap.length != tables.length) {<a name="line.251"></a>
+<span class="sourceLineNo">252</span>        throw new IOException("The same number of tables and mapping must be provided.");<a name="line.252"></a>
+<span class="sourceLineNo">253</span>      }<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    } else {<a name="line.254"></a>
+<span class="sourceLineNo">255</span>      // if not mapping is specified map each table to itself<a name="line.255"></a>
+<span class="sourceLineNo">256</span>      tableMap = tables;<a name="line.256"></a>
+<span class="sourceLineNo">257</span>    }<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    conf.setStrings(TABLES_KEY, tables);<a name="line.258"></a>
+<span class="sourceLineNo">259</span>    conf.setStrings(TABLE_MAP_KEY, tableMap);<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    Job job = Job.getInstance(conf, conf.get(JOB_NAME_CONF_KEY, NAME + "_" + inputDir));<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    job.setJarByClass(WALPlayer.class);<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    FileInputFormat.setInputPaths(job, inputDir);<a name="line.262"></a>
+<span class="sourceLineNo">263</span>    job.setInputFormatClass(WALInputFormat.class);<a name="line.263"></a>
+<span class="sourceLineNo">264</span>    job.setMapOutputKeyClass(ImmutableBytesWritable.class);<a name="line.264"></a>
+<span class="sourceLineNo">265</span>    String hfileOutPath = conf.get(BULK_OUTPUT_CONF_KEY);<a name="line.265"></a>
+<span class="sourceLineNo">266</span>    if (hfileOutPath != null) {<a name="line.266"></a>
+<span class="sourceLineNo">267</span>      // the bulk HFile case<a name="line.267"></a>
+<span class="sourceLineNo">268</span>      if (tables.length != 1) {<a name="line.268"></a>
+<span class="sourceLineNo">269</span>        throw new IOException("Exactly one table must be specified for the bulk export option");<a name="line.269"></a>
+<span class="sourceLineNo">270</span>      }<a name="line.270"></a>
+<span class="sourceLineNo">271</span>      TableName tableName = TableName.valueOf(tables[0]);<a name="line.271"></a>
+<span class="sourceLineNo">272</span>      job.setMapperClass(WALKeyValueMapper.class);<a name="line.272"></a>
+<span class="sourceLineNo">273</span>      job.setReducerClass(KeyValueSortReducer.class);<a name="line.273"></a>
+<span class="sourceLineNo">274</span>      Path outputDir = new Path(hfileOutPath);<a name="line.274"></a>
+<span class="sourceLineNo">275</span>      FileOutputFormat.setOutputPath(job, outputDir);<a name="line.275"></a>
+<span class="sourceLineNo">276</span>      job.setMapOutputValueClass(KeyValue.class);<a name="line.276"></a>
+<span class="sourceLineNo">277</span>      try (Connection conn = ConnectionFactory.createConnection(conf);<a name="line.277"></a>
+<span class="sourceLineNo">278</span>          Table table = conn.getTable(tableName);<a name="line.278"></a>
+<span class="sourceLineNo">279</span>          RegionLocator regionLocator = conn.getRegionLocator(tableName)) {<a name="line.279"></a>
+<span class="sourceLineNo">280</span>        HFileOutputFormat2.configureIncrementalLoad(job, table.getTableDescriptor(), regionLocator);<a name="line.280"></a>
+<span class="sourceLineNo">281</span>      }<a name="line.281"></a>
+<span class="sourceLineNo">282</span>      TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(),<a name="line.282"></a>
+<span class="sourceLineNo">283</span>          com.google.common.base.Preconditions.class);<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    } else {<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      // output to live cluster<a name="line.285"></a>
+<span class="sourceLineNo">286</span>      job.setMapperClass(WALMapper.class);<a name="line.286"></a>
+<span class="sourceLineNo">287</span>      job.setOutputFormatClass(MultiTableOutputFormat.class);<a name="line.287"></a>
+<span class="sourceLineNo">288</span>      TableMapReduceUtil.addDependencyJars(job);<a name="line.288"></a>
+<span class="sourceLineNo">289</span>      TableMapReduceUtil.initCredentials(job);<a name="line.289"></a>
+<span class="sourceLineNo">290</span>      // No reducers.<a name="line.290"></a>
+<span class="sourceLineNo">291</span>      job.setNumReduceTasks(0);<a name="line.291"></a>
+<span class="sourceLineNo">292</span>    }<a name="line.292"></a>
+<span class="sourceLineNo">293</span>    String codecCls = WALCellCodec.getWALCellCodecClass(conf);<a name="line.293"></a>
+<span class="sourceLineNo">294</span>    try {<a name="line.294"></a>
+<span class="sourceLineNo">295</span>      TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(), Class.forName(codecCls));<a name="line.295"></a>
+<span class="sourceLineNo">296</span>    } catch (Exception e) {<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      throw new IOException("Cannot determine wal codec class " + codecCls, e);<a name="line.297"></a>
+<span class="sourceLineNo">298</span>    }<a name="line.298"></a>
+<span class="sourceLineNo">299</span>    return job;<a name="line.299"></a>
+<span class="sourceLineNo">300</span>  }<a name="line.300"></a>
+<span class="sourceLineNo">301</span><a name="line.301"></a>
+<span class="sourceLineNo">302</span>  /*<a name="line.302"></a>
+<span class="sourceLineNo">303</span>   * @param errorMsg Error message.  Can be null.<a name="line.303"></a>
+<span class="sourceLineNo">304</span>   */<a name="line.304"></a>
+<span class="sourceLineNo">305</span>  private void usage(final String errorMsg) {<a name="line.305"></a>
+<span class="sourceLineNo">306</span>    if (errorMsg != null &amp;&amp; errorMsg.length() &gt; 0) {<a name="line.306"></a>
+<span class="sourceLineNo">307</span>      System.err.println("ERROR: " + errorMsg);<a name="line.307"></a>
+<span class="sourceLineNo">308</span>    }<a name="line.308"></a>
+<span class="sourceLineNo">309</span>    System.err.println("Usage: " + NAME + " [options] &lt;wal inputdir&gt; &lt;tables&gt; [&lt;tableMappings&gt;]");<a name="line.309"></a>
+<span class="sourceLineNo">310</span>    System.err.println("Read all WAL entries for &lt;tables&gt;.");<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    System.err.println("If no tables (\"\") are specific, all tables are imported.");<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    System.err.println("(Careful, even -ROOT- and hbase:meta entries will be imported in that case.)");<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    System.err.println("Otherwise &lt;tables&gt; is a comma separated list of tables.\n");<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    System.err.println("The WAL entries can be mapped to new set of tables via &lt;tableMapping&gt;.");<a name="line.314"></a>
+<span class="sourceLineNo">315</span>    System.err.println("&lt;tableMapping&gt; is a command separated list of targettables.");<a name="line.315"></a>
+<span class="sourceLineNo">316</span>    System.err.println("If specified, each table in &lt;tables&gt; must have a mapping.\n");<a name="line.316"></a>
+<span class="sourceLineNo">317</span>    System.err.println("By default " + NAME + " will load data directly into HBase.");<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    System.err.println("To generate HFiles for a bulk data load instead, pass the option:");<a name="line.318"></a>
+<span class="sourceLineNo">319</span>    System.err.println("  -D" + BULK_OUTPUT_CONF_KEY + "=/path/for/output");<a name="line.319"></a>
+<span class="sourceLineNo">320</span>    System.err.println("  (Only one table can be specified, and no mapping is allowed!)");<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    System.err.println("Other options: (specify time range to WAL edit to consider)");<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    System.err.println("  -D" + WALInputFormat.START_TIME_KEY + "=[date|ms]");<a name="line.322"></a>
+<span class="sourceLineNo">323</span>    System.err.println("  -D" + WALInputFormat.END_TIME_KEY + "=[date|ms]");<a name="line.323"></a>
+<span class="sourceLineNo">324</span>    System.err.println("   -D " + JOB_NAME_CONF_KEY<a name="line.324"></a>
+<span class="sourceLineNo">325</span>        + "=jobName - use the specified mapreduce job name for the wal player");<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    System.err.println("For performance also consider the following options:\n"<a name="line.326"></a>
+<span class="sourceLineNo">327</span>        + "  -Dmapreduce.map.speculative=false\n"<a name="line.327"></a>
+<span class="sourceLineNo">328</span>        + "  -Dmapreduce.reduce.speculative=false");<a name="line.328"></a>
+<span class="sourceLineNo">329</span>  }<a name="line.329"></a>
+<span class="sourceLineNo">330</span><a name="line.330"></a>
+<span class="sourceLineNo">331</span>  /**<a name="line.331"></a>
+<span class="sourceLineNo">332</span>   * Main entry point.<a name="line.332"></a>
+<span class="sourceLineNo">333</span>   *<a name="line.333"></a>
+<span class="sourceLineNo">334</span>   * @param args  The command line parameters.<a name="line.334"></a>
+<span class="sourceLineNo">335</span>   * @throws Exception When running the job fails.<a name="line.335"></a>
+<span class="sourceLineNo">336</span>   */<a name="line.336"></a>
+<span class="sourceLineNo">337</span>  public static void main(String[] args) throws Exception {<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    int ret = ToolRunner.run(new WALPlayer(HBaseConfiguration.create()), args);<a name="line.338"></a>
+<span class="sourceLineNo">339</span>    System.exit(ret);<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>  @Override<a name="line.342"></a>
+<span class="sourceLineNo">343</span>  public int run(String[] args) throws Exception {<a name="line.343"></a>
+<span class="sourceLineNo">344</span>    if (args.length &lt; 2) {<a name="line.344"></a>
+<span class="sourceLineNo">345</span>      usage("Wrong number of arguments: " + args.length);<a name="line.345"></a>
+<span class="sourceLineNo">346</span>      System.exit(-1);<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    }<a name="line.347"></a>
+<span class="sourceLineNo">348</span>    Job job = createSubmittableJob(args);<a name="line.348"></a>
+<span class="sourceLineNo">349</span>    return job.waitForCompletion(true) ? 0 : 1;<a name="line.349"></a>
+<span class="sourceLineNo">350</span>  }<a name="line.350"></a>
+<span class="sourceLineNo">351</span>}<a name="line.351"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/d9f3c819/apidocs/src-html/org/apache/hadoop/hbase/mob/MobConstants.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/mob/MobConstants.html b/apidocs/src-html/org/apache/hadoop/hbase/mob/MobConstants.html
index 62fba34..fc3f864 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/mob/MobConstants.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/mob/MobConstants.html
@@ -56,78 +56,61 @@
 <span class="sourceLineNo">048</span>  public static final String MOB_CLEANER_PERIOD = "hbase.master.mob.ttl.cleaner.period";<a name="line.48"></a>
 <span class="sourceLineNo">049</span>  public static final int DEFAULT_MOB_CLEANER_PERIOD = 24 * 60 * 60; // one day<a name="line.49"></a>
 <span class="sourceLineNo">050</span><a name="line.50"></a>
-<span class="sourceLineNo">051</span>  public static final String MOB_SWEEP_TOOL_COMPACTION_START_DATE =<a name="line.51"></a>
-<span class="sourceLineNo">052</span>      "hbase.mob.sweep.tool.compaction.start.date";<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  public static final String MOB_SWEEP_TOOL_COMPACTION_RATIO =<a name="line.53"></a>
-<span class="sourceLineNo">054</span>      "hbase.mob.sweep.tool.compaction.ratio";<a name="line.54"></a>
-<span class="sourceLineNo">055</span>  public static final String MOB_SWEEP_TOOL_COMPACTION_MERGEABLE_SIZE =<a name="line.55"></a>
-<span class="sourceLineNo">056</span>      "hbase.mob.sweep.tool.compaction.mergeable.size";<a name="line.56"></a>
-<span class="sourceLineNo">057</span><a name="line.57"></a>
-<span class="sourceLineNo">058</span>  public static final float DEFAULT_SWEEP_TOOL_MOB_COMPACTION_RATIO = 0.5f;<a name="line.58"></a>
-<span class="sourceLineNo">059</span>  public static final long DEFAULT_SWEEP_TOOL_MOB_COMPACTION_MERGEABLE_SIZE = 128 * 1024 * 1024;<a name="line.59"></a>
-<span class="sourceLineNo">060</span><a name="line.60"></a>
-<span class="sourceLineNo">061</span>  public static final String MOB_SWEEP_TOOL_COMPACTION_TEMP_DIR_NAME = "mobcompaction";<a name="line.61"></a>
-<span class="sourceLineNo">062</span><a name="line.62"></a>
-<span class="sourceLineNo">063</span>  public static final String MOB_SWEEP_TOOL_COMPACTION_MEMSTORE_FLUSH_SIZE =<a name="line.63"></a>
-<span class="sourceLineNo">064</span>      "hbase.mob.sweep.tool.compaction.memstore.flush.size";<a name="line.64"></a>
-<span class="sourceLineNo">065</span>  public static final long DEFAULT_MOB_SWEEP_TOOL_COMPACTION_MEMSTORE_FLUSH_SIZE =<a name="line.65"></a>
-<span class="sourceLineNo">066</span>      1024 * 1024 * 128; // 128M<a name="line.66"></a>
-<span class="sourceLineNo">067</span><a name="line.67"></a>
-<span class="sourceLineNo">068</span>  public static final String MOB_CACHE_EVICT_PERIOD = "hbase.mob.cache.evict.period";<a name="line.68"></a>
-<span class="sourceLineNo">069</span>  public static final String MOB_CACHE_EVICT_REMAIN_RATIO = "hbase.mob.cache.evict.remain.ratio";<a name="line.69"></a>
-<span class="sourceLineNo">070</span>  public static final Tag MOB_REF_TAG = new ArrayBackedTag(TagType.MOB_REFERENCE_TAG_TYPE,<a name="line.70"></a>
-<span class="sourceLineNo">071</span>      HConstants.EMPTY_BYTE_ARRAY);<a name="line.71"></a>
-<span class="sourceLineNo">072</span><a name="line.72"></a>
-<span class="sourceLineNo">073</span>  public static final float DEFAULT_EVICT_REMAIN_RATIO = 0.5f;<a name="line.73"></a>
-<span class="sourceLineNo">074</span>  public static final long DEFAULT_MOB_CACHE_EVICT_PERIOD = 3600L;<a name="line.74"></a>
-<span class="sourceLineNo">075</span><a name="line.75"></a>
-<span class="sourceLineNo">076</span>  public final static String TEMP_DIR_NAME = ".tmp";<a name="line.76"></a>
-<span class="sourceLineNo">077</span>  public final static String BULKLOAD_DIR_NAME = ".bulkload";<a name="line.77"></a>
-<span class="sourceLineNo">078</span>  public final static byte[] MOB_TABLE_LOCK_SUFFIX = Bytes.toBytes(".mobLock");<a name="line.78"></a>
-<span class="sourceLineNo">079</span>  public final static String EMPTY_STRING = "";<a name="line.79"></a>
-<span class="sourceLineNo">080</span>  /**<a name="line.80"></a>
-<span class="sourceLineNo">081</span>   * If the size of a mob file is less than this value, it's regarded as a small file and needs to<a name="line.81"></a>
-<span class="sourceLineNo">082</span>   * be merged in mob compaction. The default value is 192MB.<a name="line.82"></a>
+<span class="sourceLineNo">051</span>  public static final String MOB_CACHE_EVICT_PERIOD = "hbase.mob.cache.evict.period";<a name="line.51"></a>
+<span class="sourceLineNo">052</span>  public static final String MOB_CACHE_EVICT_REMAIN_RATIO = "hbase.mob.cache.evict.remain.ratio";<a name="line.52"></a>
+<span class="sourceLineNo">053</span>  public static final Tag MOB_REF_TAG = new ArrayBackedTag(TagType.MOB_REFERENCE_TAG_TYPE,<a name="line.53"></a>
+<span class="sourceLineNo">054</span>      HConstants.EMPTY_BYTE_ARRAY);<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>  public static final float DEFAULT_EVICT_REMAIN_RATIO = 0.5f;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>  public static final long DEFAULT_MOB_CACHE_EVICT_PERIOD = 3600L;<a name="line.57"></a>
+<span class="sourceLineNo">058</span><a name="line.58"></a>
+<span class="sourceLineNo">059</span>  public final static String TEMP_DIR_NAME = ".tmp";<a name="line.59"></a>
+<span class="sourceLineNo">060</span>  public final static String BULKLOAD_DIR_NAME = ".bulkload";<a name="line.60"></a>
+<span class="sourceLineNo">061</span>  public final static byte[] MOB_TABLE_LOCK_SUFFIX = Bytes.toBytes(".mobLock");<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  public final static String EMPTY_STRING = "";<a name="line.62"></a>
+<span class="sourceLineNo">063</span>  /**<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   * If the size of a mob file is less than this value, it's regarded as a small file and needs to<a name="line.64"></a>
+<span class="sourceLineNo">065</span>   * be merged in mob compaction. The default value is 1280MB.<a name="line.65"></a>
+<span class="sourceLineNo">066</span>   */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  public static final String MOB_COMPACTION_MERGEABLE_THRESHOLD =<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    "hbase.mob.compaction.mergeable.threshold";<a name="line.68"></a>
+<span class="sourceLineNo">069</span>  public static final long DEFAULT_MOB_COMPACTION_MERGEABLE_THRESHOLD = 10 * 128 * 1024 * 1024;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>  /**<a name="line.70"></a>
+<span class="sourceLineNo">071</span>   * The max number of del files that is allowed in the mob file compaction. In the mob<a name="line.71"></a>
+<span class="sourceLineNo">072</span>   * compaction, when the number of existing del files is larger than this value, they are merged<a name="line.72"></a>
+<span class="sourceLineNo">073</span>   * until number of del files is not larger this value. The default value is 3.<a name="line.73"></a>
+<span class="sourceLineNo">074</span>   */<a name="line.74"></a>
+<span class="sourceLineNo">075</span>  public static final String MOB_DELFILE_MAX_COUNT = "hbase.mob.delfile.max.count";<a name="line.75"></a>
+<span class="sourceLineNo">076</span>  public static final int DEFAULT_MOB_DELFILE_MAX_COUNT = 3;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>  /**<a name="line.77"></a>
+<span class="sourceLineNo">078</span>   * The max number of the mob files that is allowed in a batch of the mob compaction.<a name="line.78"></a>
+<span class="sourceLineNo">079</span>   * The mob compaction merges the small mob files to bigger ones. If the number of the<a name="line.79"></a>
+<span class="sourceLineNo">080</span>   * small files is very large, it could lead to a "too many opened file handlers" in the merge.<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   * And the merge has to be split into batches. This value limits the number of mob files<a name="line.81"></a>
+<span class="sourceLineNo">082</span>   * that are selected in a batch of the mob compaction. The default value is 100.<a name="line.82"></a>
 <span class="sourceLineNo">083</span>   */<a name="line.83"></a>
-<span class="sourceLineNo">084</span>  public static final String MOB_COMPACTION_MERGEABLE_THRESHOLD =<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    "hbase.mob.compaction.mergeable.threshold";<a name="line.85"></a>
-<span class="sourceLineNo">086</span>  public static final long DEFAULT_MOB_COMPACTION_MERGEABLE_THRESHOLD = 192 * 1024 * 1024;<a name="line.86"></a>
+<span class="sourceLineNo">084</span>  public static final String MOB_COMPACTION_BATCH_SIZE =<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    "hbase.mob.compaction.batch.size";<a name="line.85"></a>
+<span class="sourceLineNo">086</span>  public static final int DEFAULT_MOB_COMPACTION_BATCH_SIZE = 100;<a name="line.86"></a>
 <span class="sourceLineNo">087</span>  /**<a name="line.87"></a>
-<span class="sourceLineNo">088</span>   * The max number of del files that is allowed in the mob file compaction. In the mob<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   * compaction, when the number of existing del files is larger than this value, they are merged<a name="line.89"></a>
-<span class="sourceLineNo">090</span>   * until number of del files is not larger this value. The default value is 3.<a name="line.90"></a>
-<span class="sourceLineNo">091</span>   */<a name="line.91"></a>
-<span class="sourceLineNo">092</span>  public static final String MOB_DELFILE_MAX_COUNT = "hbase.mob.delfile.max.count";<a name="line.92"></a>
-<span class="sourceLineNo">093</span>  public static final int DEFAULT_MOB_DELFILE_MAX_COUNT = 3;<a name="line.93"></a>
-<span class="sourceLineNo">094</span>  /**<a name="line.94"></a>
-<span class="sourceLineNo">095</span>   * The max number of the mob files that is allowed in a batch of the mob compaction.<a name="line.95"></a>
-<span class="sourceLineNo">096</span>   * The mob compaction merges the small mob files to bigger ones. If the number of the<a name="line.96"></a>
-<span class="sourceLineNo">097</span>   * small files is very large, it could lead to a "too many opened file handlers" in the merge.<a name="line.97"></a>
-<span class="sourceLineNo">098</span>   * And the merge has to be split into batches. This value limits the number of mob files<a name="line.98"></a>
-<span class="sourceLineNo">099</span>   * that are selected in a batch of the mob compaction. The default value is 100.<a name="line.99"></a>
-<span class="sourceLineNo">100</span>   */<a name="line.100"></a>
-<span class="sourceLineNo">101</span>  public static final String MOB_COMPACTION_BATCH_SIZE =<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    "hbase.mob.compaction.batch.size";<a name="line.102"></a>
-<span class="sourceLineNo">103</span>  public static final int DEFAULT_MOB_COMPACTION_BATCH_SIZE = 100;<a name="line.103"></a>
-<span class="sourceLineNo">104</span>  /**<a name="line.104"></a>
-<span class="sourceLineNo">105</span>   * The period that MobCompactionChore runs. The unit is second.<a name="line.105"></a>
-<span class="sourceLineNo">106</span>   * The default value is one week.<a name="line.106"></a>
-<span class="sourceLineNo">107</span>   */<a name="line.107"></a>
-<span class="sourceLineNo">108</span>  public static final String MOB_COMPACTION_CHORE_PERIOD =<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    "hbase.mob.compaction.chore.period";<a name="line.109"></a>
-<span class="sourceLineNo">110</span>  public static final int DEFAULT_MOB_COMPACTION_CHORE_PERIOD =<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    24 * 60 * 60 * 7; // a week<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  public static final String MOB_COMPACTOR_CLASS_KEY = "hbase.mob.compactor.class";<a name="line.112"></a>
-<span class="sourceLineNo">113</span>  /**<a name="line.113"></a>
-<span class="sourceLineNo">114</span>   * The max number of threads used in MobCompactor.<a name="line.114"></a>
-<span class="sourceLineNo">115</span>   */<a name="line.115"></a>
-<span class="sourceLineNo">116</span>  public static final String MOB_COMPACTION_THREADS_MAX =<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    "hbase.mob.compaction.threads.max";<a name="line.117"></a>
-<span class="sourceLineNo">118</span>  public static final int DEFAULT_MOB_COMPACTION_THREADS_MAX = 1;<a name="line.118"></a>
-<span class="sourceLineNo">119</span>  private MobConstants() {<a name="line.119"></a>
-<span class="sourceLineNo">120</span><a name="line.120"></a>
-<span class="sourceLineNo">121</span>  }<a name="line.121"></a>
-<span class="sourceLineNo">122</span>}<a name="line.122"></a>
+<span class="sourceLineNo">088</span>   * The period that MobCompactionChore runs. The unit is second.<a name="line.88"></a>
+<span class="sourceLineNo">089</span>   * The default value is one week.<a name="line.89"></a>
+<span class="sourceLineNo">090</span>   */<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  public static final String MOB_COMPACTION_CHORE_PERIOD =<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    "hbase.mob.compaction.chore.period";<a name="line.92"></a>
+<span class="sourceLineNo">093</span>  public static final int DEFAULT_MOB_COMPACTION_CHORE_PERIOD =<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    24 * 60 * 60 * 7; // a week<a name="line.94"></a>
+<span class="sourceLineNo">095</span>  public static final String MOB_COMPACTOR_CLASS_KEY = "hbase.mob.compactor.class";<a name="line.95"></a>
+<span class="sourceLineNo">096</span>  /**<a name="line.96"></a>
+<span class="sourceLineNo">097</span>   * The max number of threads used in MobCompactor.<a name="line.97"></a>
+<span class="sourceLineNo">098</span>   */<a name="line.98"></a>
+<span class="sourceLineNo">099</span>  public static final String MOB_COMPACTION_THREADS_MAX =<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    "hbase.mob.compaction.threads.max";<a name="line.100"></a>
+<span class="sourceLineNo">101</span>  public static final int DEFAULT_MOB_COMPACTION_THREADS_MAX = 1;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>  private MobConstants() {<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>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/d9f3c819/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
index 3355b2e..9c509cf 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
@@ -1095,28 +1095,27 @@
 <span class="sourceLineNo">1087</span>        + "  hbase snapshot export \\\n"<a name="line.1087"></a>
 <span class="sourceLineNo">1088</span>        + "    --snapshot MySnapshot --copy-from hdfs://srv2:8082/hbase \\\n"<a name="line.1088"></a>
 <span class="sourceLineNo">1089</span>        + "    --copy-to hdfs://srv1:50070/hbase");<a name="line.1089"></a>
-<span class="sourceLineNo">1090</span>    System.exit(1);<a name="line.1090"></a>
-<span class="sourceLineNo">1091</span>  }<a name="line.1091"></a>
-<span class="sourceLineNo">1092</span><a name="line.1092"></a>
-<span class="sourceLineNo">1093</span>  @Override protected void addOptions() {<a name="line.1093"></a>
-<span class="sourceLineNo">1094</span>    addRequiredOption(Options.SNAPSHOT);<a name="line.1094"></a>
-<span class="sourceLineNo">1095</span>    addOption(Options.COPY_TO);<a name="line.1095"></a>
-<span class="sourceLineNo">1096</span>    addOption(Options.COPY_FROM);<a name="line.1096"></a>
-<span class="sourceLineNo">1097</span>    addOption(Options.TARGET_NAME);<a name="line.1097"></a>
-<span class="sourceLineNo">1098</span>    addOption(Options.NO_CHECKSUM_VERIFY);<a name="line.1098"></a>
-<span class="sourceLineNo">1099</span>    addOption(Options.NO_TARGET_VERIFY);<a name="line.1099"></a>
-<span class="sourceLineNo">1100</span>    addOption(Options.OVERWRITE);<a name="line.1100"></a>
-<span class="sourceLineNo">1101</span>    addOption(Options.CHUSER);<a name="line.1101"></a>
-<span class="sourceLineNo">1102</span>    addOption(Options.CHGROUP);<a name="line.1102"></a>
-<span class="sourceLineNo">1103</span>    addOption(Options.CHMOD);<a name="line.1103"></a>
-<span class="sourceLineNo">1104</span>    addOption(Options.MAPPERS);<a name="line.1104"></a>
-<span class="sourceLineNo">1105</span>    addOption(Options.BANDWIDTH);<a name="line.1105"></a>
-<span class="sourceLineNo">1106</span>  }<a name="line.1106"></a>
-<span class="sourceLineNo">1107</span><a name="line.1107"></a>
-<span class="sourceLineNo">1108</span>  public static void main(String[] args) {<a name="line.1108"></a>
-<span class="sourceLineNo">1109</span>    new ExportSnapshot().doStaticMain(args);<a name="line.1109"></a>
-<span class="sourceLineNo">1110</span>  }<a name="line.1110"></a>
-<span class="sourceLineNo">1111</span>}<a name="line.1111"></a>
+<span class="sourceLineNo">1090</span>  }<a name="line.1090"></a>
+<span class="sourceLineNo">1091</span><a name="line.1091"></a>
+<span class="sourceLineNo">1092</span>  @Override protected void addOptions() {<a name="line.1092"></a>
+<span class="sourceLineNo">1093</span>    addRequiredOption(Options.SNAPSHOT);<a name="line.1093"></a>
+<span class="sourceLineNo">1094</span>    addOption(Options.COPY_TO);<a name="line.1094"></a>
+<span class="sourceLineNo">1095</span>    addOption(Options.COPY_FROM);<a name="line.1095"></a>
+<span class="sourceLineNo">1096</span>    addOption(Options.TARGET_NAME);<a name="line.1096"></a>
+<span class="sourceLineNo">1097</span>    addOption(Options.NO_CHECKSUM_VERIFY);<a name="line.1097"></a>
+<span class="sourceLineNo">1098</span>    addOption(Options.NO_TARGET_VERIFY);<a name="line.1098"></a>
+<span class="sourceLineNo">1099</span>    addOption(Options.OVERWRITE);<a name="line.1099"></a>
+<span class="sourceLineNo">1100</span>    addOption(Options.CHUSER);<a name="line.1100"></a>
+<span class="sourceLineNo">1101</span>    addOption(Options.CHGROUP);<a name="line.1101"></a>
+<span class="sourceLineNo">1102</span>    addOption(Options.CHMOD);<a name="line.1102"></a>
+<span class="sourceLineNo">1103</span>    addOption(Options.MAPPERS);<a name="line.1103"></a>
+<span class="sourceLineNo">1104</span>    addOption(Options.BANDWIDTH);<a name="line.1104"></a>
+<span class="sourceLineNo">1105</span>  }<a name="line.1105"></a>
+<span class="sourceLineNo">1106</span><a name="line.1106"></a>
+<span class="sourceLineNo">1107</span>  public static void main(String[] args) {<a name="line.1107"></a>
+<span class="sourceLineNo">1108</span>    new ExportSnapshot().doStaticMain(args);<a name="line.1108"></a>
+<span class="sourceLineNo">1109</span>  }<a name="line.1109"></a>
+<span class="sourceLineNo">1110</span>}<a name="line.1110"></a>
 
 
 


Mime
View raw message