hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [38/51] [partial] hbase-site git commit: Published site at 4bf6f8379d7f85413b914dddf607d016780d40ce.
Date Thu, 21 Jan 2016 17:22:57 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/75eda567/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatBase.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatBase.html b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatBase.html
index cf443ff..1adf99a 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatBase.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatBase.html
@@ -118,195 +118,191 @@
 <span class="sourceLineNo">110</span>        @Override<a name="line.110"></a>
 <span class="sourceLineNo">111</span>        public void close() throws IOException {<a name="line.111"></a>
 <span class="sourceLineNo">112</span>          trr.close();<a name="line.112"></a>
-<span class="sourceLineNo">113</span>          if (connection != null) {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>            connection.close();<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><a name="line.117"></a>
-<span class="sourceLineNo">118</span>        @Override<a name="line.118"></a>
-<span class="sourceLineNo">119</span>        public ImmutableBytesWritable getCurrentKey() throws IOException, InterruptedException {<a name="line.119"></a>
-<span class="sourceLineNo">120</span>          return trr.getCurrentKey();<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">123</span>        @Override<a name="line.123"></a>
-<span class="sourceLineNo">124</span>        public Result getCurrentValue() throws IOException, InterruptedException {<a name="line.124"></a>
-<span class="sourceLineNo">125</span>          return trr.getCurrentValue();<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>        @Override<a name="line.128"></a>
-<span class="sourceLineNo">129</span>        public float getProgress() throws IOException, InterruptedException {<a name="line.129"></a>
-<span class="sourceLineNo">130</span>          return trr.getProgress();<a name="line.130"></a>
-<span class="sourceLineNo">131</span>        }<a name="line.131"></a>
-<span class="sourceLineNo">132</span><a name="line.132"></a>
-<span class="sourceLineNo">133</span>        @Override<a name="line.133"></a>
-<span class="sourceLineNo">134</span>        public void initialize(InputSplit inputsplit, TaskAttemptContext context)<a name="line.134"></a>
-<span class="sourceLineNo">135</span>            throws IOException, InterruptedException {<a name="line.135"></a>
-<span class="sourceLineNo">136</span>          trr.initialize(inputsplit, context);<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>        @Override<a name="line.139"></a>
-<span class="sourceLineNo">140</span>        public boolean nextKeyValue() throws IOException, InterruptedException {<a name="line.140"></a>
-<span class="sourceLineNo">141</span>          return trr.nextKeyValue();<a name="line.141"></a>
-<span class="sourceLineNo">142</span>        }<a name="line.142"></a>
-<span class="sourceLineNo">143</span>      };<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    } catch (IOException ioe) {<a name="line.144"></a>
-<span class="sourceLineNo">145</span>      // If there is an exception make sure that all<a name="line.145"></a>
-<span class="sourceLineNo">146</span>      // resources are closed and released.<a name="line.146"></a>
-<span class="sourceLineNo">147</span>      trr.close();<a name="line.147"></a>
-<span class="sourceLineNo">148</span>      if (connection != null) {<a name="line.148"></a>
-<span class="sourceLineNo">149</span>        connection.close();<a name="line.149"></a>
-<span class="sourceLineNo">150</span>      }<a name="line.150"></a>
-<span class="sourceLineNo">151</span>      throw ioe;<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    }<a name="line.152"></a>
-<span class="sourceLineNo">153</span>  }<a name="line.153"></a>
-<span class="sourceLineNo">154</span><a name="line.154"></a>
-<span class="sourceLineNo">155</span>  /**<a name="line.155"></a>
-<span class="sourceLineNo">156</span>   * Calculates the splits that will serve as input for the map tasks. The<a name="line.156"></a>
-<span class="sourceLineNo">157</span>   * number of splits matches the number of regions in a table.<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   *<a name="line.158"></a>
-<span class="sourceLineNo">159</span>   * @param context The current job context.<a name="line.159"></a>
-<span class="sourceLineNo">160</span>   * @return The list of input splits.<a name="line.160"></a>
-<span class="sourceLineNo">161</span>   * @throws IOException When creating the list of splits fails.<a name="line.161"></a>
-<span class="sourceLineNo">162</span>   * @see org.apache.hadoop.mapreduce.InputFormat#getSplits(org.apache.hadoop.mapreduce.JobContext)<a name="line.162"></a>
-<span class="sourceLineNo">163</span>   */<a name="line.163"></a>
-<span class="sourceLineNo">164</span>  @Override<a name="line.164"></a>
-<span class="sourceLineNo">165</span>  public List&lt;InputSplit&gt; getSplits(JobContext context) throws IOException {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    if (scans.isEmpty()) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>      throw new IOException("No scans were provided.");<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>    Map&lt;TableName, List&lt;Scan&gt;&gt; tableMaps = new HashMap&lt;TableName, List&lt;Scan&gt;&gt;();<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    for (Scan scan : scans) {<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      byte[] tableNameBytes = scan.getAttribute(Scan.SCAN_ATTRIBUTES_TABLE_NAME);<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      if (tableNameBytes == null)<a name="line.173"></a>
-<span class="sourceLineNo">174</span>        throw new IOException("A scan object did not have a table name");<a name="line.174"></a>
-<span class="sourceLineNo">175</span><a name="line.175"></a>
-<span class="sourceLineNo">176</span>      TableName tableName = TableName.valueOf(tableNameBytes);<a name="line.176"></a>
-<span class="sourceLineNo">177</span><a name="line.177"></a>
-<span class="sourceLineNo">178</span>      List&lt;Scan&gt; scanList = tableMaps.get(tableName);<a name="line.178"></a>
-<span class="sourceLineNo">179</span>      if (scanList == null) {<a name="line.179"></a>
-<span class="sourceLineNo">180</span>        scanList = new ArrayList&lt;Scan&gt;();<a name="line.180"></a>
-<span class="sourceLineNo">181</span>        tableMaps.put(tableName, scanList);<a name="line.181"></a>
-<span class="sourceLineNo">182</span>      }<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      scanList.add(scan);<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>    List&lt;InputSplit&gt; splits = new ArrayList&lt;InputSplit&gt;();<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    Iterator iter = tableMaps.entrySet().iterator();<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    while (iter.hasNext()) {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>      Map.Entry&lt;TableName, List&lt;Scan&gt;&gt; entry = (Map.Entry&lt;TableName, List&lt;Scan&gt;&gt;) iter.next();<a name="line.189"></a>
-<span class="sourceLineNo">190</span>      TableName tableName = entry.getKey();<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      List&lt;Scan&gt; scanList = entry.getValue();<a name="line.191"></a>
-<span class="sourceLineNo">192</span><a name="line.192"></a>
-<span class="sourceLineNo">193</span>      try (Connection conn = ConnectionFactory.createConnection(context.getConfiguration());<a name="line.193"></a>
-<span class="sourceLineNo">194</span>        Table table = conn.getTable(tableName);<a name="line.194"></a>
-<span class="sourceLineNo">195</span>        RegionLocator regionLocator = conn.getRegionLocator(tableName)) {<a name="line.195"></a>
-<span class="sourceLineNo">196</span>        RegionSizeCalculator sizeCalculator = new RegionSizeCalculator(<a name="line.196"></a>
-<span class="sourceLineNo">197</span>                regionLocator, conn.getAdmin());<a name="line.197"></a>
-<span class="sourceLineNo">198</span>        Pair&lt;byte[][], byte[][]&gt; keys = regionLocator.getStartEndKeys();<a name="line.198"></a>
-<span class="sourceLineNo">199</span>        for (Scan scan : scanList) {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>          if (keys == null || keys.getFirst() == null || keys.getFirst().length == 0) {<a name="line.200"></a>
-<span class="sourceLineNo">201</span>            throw new IOException("Expecting at least one region for table : "<a name="line.201"></a>
-<span class="sourceLineNo">202</span>                    + tableName.getNameAsString());<a name="line.202"></a>
-<span class="sourceLineNo">203</span>          }<a name="line.203"></a>
-<span class="sourceLineNo">204</span>          int count = 0;<a name="line.204"></a>
-<span class="sourceLineNo">205</span><a name="line.205"></a>
-<span class="sourceLineNo">206</span>          byte[] startRow = scan.getStartRow();<a name="line.206"></a>
-<span class="sourceLineNo">207</span>          byte[] stopRow = scan.getStopRow();<a name="line.207"></a>
-<span class="sourceLineNo">208</span><a name="line.208"></a>
-<span class="sourceLineNo">209</span>          for (int i = 0; i &lt; keys.getFirst().length; i++) {<a name="line.209"></a>
-<span class="sourceLineNo">210</span>            if (!includeRegionInSplit(keys.getFirst()[i], keys.getSecond()[i])) {<a name="line.210"></a>
-<span class="sourceLineNo">211</span>              continue;<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>            if ((startRow.length == 0 || keys.getSecond()[i].length == 0 ||<a name="line.214"></a>
-<span class="sourceLineNo">215</span>                    Bytes.compareTo(startRow, keys.getSecond()[i]) &lt; 0) &amp;&amp;<a name="line.215"></a>
-<span class="sourceLineNo">216</span>                    (stopRow.length == 0 || Bytes.compareTo(stopRow,<a name="line.216"></a>
-<span class="sourceLineNo">217</span>                            keys.getFirst()[i]) &gt; 0)) {<a name="line.217"></a>
-<span class="sourceLineNo">218</span>              byte[] splitStart = startRow.length == 0 ||<a name="line.218"></a>
-<span class="sourceLineNo">219</span>                      Bytes.compareTo(keys.getFirst()[i], startRow) &gt;= 0 ?<a name="line.219"></a>
-<span class="sourceLineNo">220</span>                      keys.getFirst()[i] : startRow;<a name="line.220"></a>
-<span class="sourceLineNo">221</span>              byte[] splitStop = (stopRow.length == 0 ||<a name="line.221"></a>
-<span class="sourceLineNo">222</span>                      Bytes.compareTo(keys.getSecond()[i], stopRow) &lt;= 0) &amp;&amp;<a name="line.222"></a>
-<span class="sourceLineNo">223</span>                      keys.getSecond()[i].length &gt; 0 ?<a name="line.223"></a>
-<span class="sourceLineNo">224</span>                      keys.getSecond()[i] : stopRow;<a name="line.224"></a>
-<span class="sourceLineNo">225</span><a name="line.225"></a>
-<span class="sourceLineNo">226</span>              HRegionLocation hregionLocation = regionLocator.getRegionLocation(<a name="line.226"></a>
-<span class="sourceLineNo">227</span>                      keys.getFirst()[i], false);<a name="line.227"></a>
-<span class="sourceLineNo">228</span>              String regionHostname = hregionLocation.getHostname();<a name="line.228"></a>
-<span class="sourceLineNo">229</span>              HRegionInfo regionInfo = hregionLocation.getRegionInfo();<a name="line.229"></a>
-<span class="sourceLineNo">230</span>              long regionSize = sizeCalculator.getRegionSize(<a name="line.230"></a>
-<span class="sourceLineNo">231</span>                      regionInfo.getRegionName());<a name="line.231"></a>
-<span class="sourceLineNo">232</span><a name="line.232"></a>
-<span class="sourceLineNo">233</span>              TableSplit split = new TableSplit(table.getName(),<a name="line.233"></a>
-<span class="sourceLineNo">234</span>                      scan, splitStart, splitStop, regionHostname, regionSize);<a name="line.234"></a>
-<span class="sourceLineNo">235</span><a name="line.235"></a>
-<span class="sourceLineNo">236</span>              splits.add(split);<a name="line.236"></a>
-<span class="sourceLineNo">237</span><a name="line.237"></a>
-<span class="sourceLineNo">238</span>              if (LOG.isDebugEnabled())<a name="line.238"></a>
-<span class="sourceLineNo">239</span>                LOG.debug("getSplits: split -&gt; " + (count++) + " -&gt; " + split);<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>      }<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>    return splits;<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">249</span>  /**<a name="line.249"></a>
-<span class="sourceLineNo">250</span>   * Test if the given region is to be included in the InputSplit while<a name="line.250"></a>
-<span class="sourceLineNo">251</span>   * splitting the regions of a table.<a name="line.251"></a>
-<span class="sourceLineNo">252</span>   * &lt;p&gt;<a name="line.252"></a>
-<span class="sourceLineNo">253</span>   * This optimization is effective when there is a specific reasoning to<a name="line.253"></a>
-<span class="sourceLineNo">254</span>   * exclude an entire region from the M-R job, (and hence, not contributing to<a name="line.254"></a>
-<span class="sourceLineNo">255</span>   * the InputSplit), given the start and end keys of the same. &lt;br&gt;<a name="line.255"></a>
-<span class="sourceLineNo">256</span>   * Useful when we need to remember the last-processed top record and revisit<a name="line.256"></a>
-<span class="sourceLineNo">257</span>   * the [last, current) interval for M-R processing, continuously. In addition<a name="line.257"></a>
-<span class="sourceLineNo">258</span>   * to reducing InputSplits, reduces the load on the region server as well, due<a name="line.258"></a>
-<span class="sourceLineNo">259</span>   * to the ordering of the keys. &lt;br&gt;<a name="line.259"></a>
-<span class="sourceLineNo">260</span>   * &lt;br&gt;<a name="line.260"></a>
-<span class="sourceLineNo">261</span>   * Note: It is possible that &lt;code&gt;endKey.length() == 0 &lt;/code&gt; , for the last<a name="line.261"></a>
-<span class="sourceLineNo">262</span>   * (recent) region. &lt;br&gt;<a name="line.262"></a>
-<span class="sourceLineNo">263</span>   * Override this method, if you want to bulk exclude regions altogether from<a name="line.263"></a>
-<span class="sourceLineNo">264</span>   * M-R. By default, no region is excluded( i.e. all regions are included).<a name="line.264"></a>
-<span class="sourceLineNo">265</span>   *<a name="line.265"></a>
-<span class="sourceLineNo">266</span>   * @param startKey Start key of the region<a name="line.266"></a>
-<span class="sourceLineNo">267</span>   * @param endKey End key of the region<a name="line.267"></a>
-<span class="sourceLineNo">268</span>   * @return true, if this region needs to be included as part of the input<a name="line.268"></a>
-<span class="sourceLineNo">269</span>   *         (default).<a name="line.269"></a>
-<span class="sourceLineNo">270</span>   */<a name="line.270"></a>
-<span class="sourceLineNo">271</span>  protected boolean includeRegionInSplit(final byte[] startKey,<a name="line.271"></a>
-<span class="sourceLineNo">272</span>      final byte[] endKey) {<a name="line.272"></a>
-<span class="sourceLineNo">273</span>    return true;<a name="line.273"></a>
-<span class="sourceLineNo">274</span>  }<a name="line.274"></a>
-<span class="sourceLineNo">275</span><a name="line.275"></a>
-<span class="sourceLineNo">276</span>  /**<a name="line.276"></a>
-<span class="sourceLineNo">277</span>   * Allows subclasses to get the list of {@link Scan} objects.<a name="line.277"></a>
-<span class="sourceLineNo">278</span>   */<a name="line.278"></a>
-<span class="sourceLineNo">279</span>  protected List&lt;Scan&gt; getScans() {<a name="line.279"></a>
-<span class="sourceLineNo">280</span>    return this.scans;<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">284</span>   * Allows subclasses to set the list of {@link Scan} objects.<a name="line.284"></a>
-<span class="sourceLineNo">285</span>   *<a name="line.285"></a>
-<span class="sourceLineNo">286</span>   * @param scans The list of {@link Scan} used to define the input<a name="line.286"></a>
-<span class="sourceLineNo">287</span>   */<a name="line.287"></a>
-<span class="sourceLineNo">288</span>  protected void setScans(List&lt;Scan&gt; scans) {<a name="line.288"></a>
-<span class="sourceLineNo">289</span>    this.scans = scans;<a name="line.289"></a>
-<span class="sourceLineNo">290</span>  }<a name="line.290"></a>
-<span class="sourceLineNo">291</span><a name="line.291"></a>
-<span class="sourceLineNo">292</span>  /**<a name="line.292"></a>
-<span class="sourceLineNo">293</span>   * Allows subclasses to set the {@link TableRecordReader}.<a name="line.293"></a>
-<span class="sourceLineNo">294</span>   *<a name="line.294"></a>
-<span class="sourceLineNo">295</span>   * @param tableRecordReader A different {@link TableRecordReader}<a name="line.295"></a>
-<span class="sourceLineNo">296</span>   *          implementation.<a name="line.296"></a>
-<span class="sourceLineNo">297</span>   */<a name="line.297"></a>
-<span class="sourceLineNo">298</span>  protected void setTableRecordReader(TableRecordReader tableRecordReader) {<a name="line.298"></a>
-<span class="sourceLineNo">299</span>    this.tableRecordReader = tableRecordReader;<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">113</span>          connection.close();<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>        @Override<a name="line.116"></a>
+<span class="sourceLineNo">117</span>        public ImmutableBytesWritable getCurrentKey() throws IOException, InterruptedException {<a name="line.117"></a>
+<span class="sourceLineNo">118</span>          return trr.getCurrentKey();<a name="line.118"></a>
+<span class="sourceLineNo">119</span>        }<a name="line.119"></a>
+<span class="sourceLineNo">120</span><a name="line.120"></a>
+<span class="sourceLineNo">121</span>        @Override<a name="line.121"></a>
+<span class="sourceLineNo">122</span>        public Result getCurrentValue() throws IOException, InterruptedException {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>          return trr.getCurrentValue();<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>        @Override<a name="line.126"></a>
+<span class="sourceLineNo">127</span>        public float getProgress() throws IOException, InterruptedException {<a name="line.127"></a>
+<span class="sourceLineNo">128</span>          return trr.getProgress();<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>        @Override<a name="line.131"></a>
+<span class="sourceLineNo">132</span>        public void initialize(InputSplit inputsplit, TaskAttemptContext context)<a name="line.132"></a>
+<span class="sourceLineNo">133</span>            throws IOException, InterruptedException {<a name="line.133"></a>
+<span class="sourceLineNo">134</span>          trr.initialize(inputsplit, context);<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>        @Override<a name="line.137"></a>
+<span class="sourceLineNo">138</span>        public boolean nextKeyValue() throws IOException, InterruptedException {<a name="line.138"></a>
+<span class="sourceLineNo">139</span>          return trr.nextKeyValue();<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        }<a name="line.140"></a>
+<span class="sourceLineNo">141</span>      };<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    } catch (IOException ioe) {<a name="line.142"></a>
+<span class="sourceLineNo">143</span>      // If there is an exception make sure that all<a name="line.143"></a>
+<span class="sourceLineNo">144</span>      // resources are closed and released.<a name="line.144"></a>
+<span class="sourceLineNo">145</span>      trr.close();<a name="line.145"></a>
+<span class="sourceLineNo">146</span>      connection.close();<a name="line.146"></a>
+<span class="sourceLineNo">147</span>      throw ioe;<a name="line.147"></a>
+<span class="sourceLineNo">148</span>    }<a name="line.148"></a>
+<span class="sourceLineNo">149</span>  }<a name="line.149"></a>
+<span class="sourceLineNo">150</span><a name="line.150"></a>
+<span class="sourceLineNo">151</span>  /**<a name="line.151"></a>
+<span class="sourceLineNo">152</span>   * Calculates the splits that will serve as input for the map tasks. The<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   * number of splits matches the number of regions in a table.<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   *<a name="line.154"></a>
+<span class="sourceLineNo">155</span>   * @param context The current job context.<a name="line.155"></a>
+<span class="sourceLineNo">156</span>   * @return The list of input splits.<a name="line.156"></a>
+<span class="sourceLineNo">157</span>   * @throws IOException When creating the list of splits fails.<a name="line.157"></a>
+<span class="sourceLineNo">158</span>   * @see org.apache.hadoop.mapreduce.InputFormat#getSplits(org.apache.hadoop.mapreduce.JobContext)<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   */<a name="line.159"></a>
+<span class="sourceLineNo">160</span>  @Override<a name="line.160"></a>
+<span class="sourceLineNo">161</span>  public List&lt;InputSplit&gt; getSplits(JobContext context) throws IOException {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>    if (scans.isEmpty()) {<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      throw new IOException("No scans were provided.");<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>    Map&lt;TableName, List&lt;Scan&gt;&gt; tableMaps = new HashMap&lt;TableName, List&lt;Scan&gt;&gt;();<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    for (Scan scan : scans) {<a name="line.167"></a>
+<span class="sourceLineNo">168</span>      byte[] tableNameBytes = scan.getAttribute(Scan.SCAN_ATTRIBUTES_TABLE_NAME);<a name="line.168"></a>
+<span class="sourceLineNo">169</span>      if (tableNameBytes == null)<a name="line.169"></a>
+<span class="sourceLineNo">170</span>        throw new IOException("A scan object did not have a table name");<a name="line.170"></a>
+<span class="sourceLineNo">171</span><a name="line.171"></a>
+<span class="sourceLineNo">172</span>      TableName tableName = TableName.valueOf(tableNameBytes);<a name="line.172"></a>
+<span class="sourceLineNo">173</span><a name="line.173"></a>
+<span class="sourceLineNo">174</span>      List&lt;Scan&gt; scanList = tableMaps.get(tableName);<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      if (scanList == null) {<a name="line.175"></a>
+<span class="sourceLineNo">176</span>        scanList = new ArrayList&lt;Scan&gt;();<a name="line.176"></a>
+<span class="sourceLineNo">177</span>        tableMaps.put(tableName, scanList);<a name="line.177"></a>
+<span class="sourceLineNo">178</span>      }<a name="line.178"></a>
+<span class="sourceLineNo">179</span>      scanList.add(scan);<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    }<a name="line.180"></a>
+<span class="sourceLineNo">181</span><a name="line.181"></a>
+<span class="sourceLineNo">182</span>    List&lt;InputSplit&gt; splits = new ArrayList&lt;InputSplit&gt;();<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    Iterator iter = tableMaps.entrySet().iterator();<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    while (iter.hasNext()) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>      Map.Entry&lt;TableName, List&lt;Scan&gt;&gt; entry = (Map.Entry&lt;TableName, List&lt;Scan&gt;&gt;) iter.next();<a name="line.185"></a>
+<span class="sourceLineNo">186</span>      TableName tableName = entry.getKey();<a name="line.186"></a>
+<span class="sourceLineNo">187</span>      List&lt;Scan&gt; scanList = entry.getValue();<a name="line.187"></a>
+<span class="sourceLineNo">188</span><a name="line.188"></a>
+<span class="sourceLineNo">189</span>      try (Connection conn = ConnectionFactory.createConnection(context.getConfiguration());<a name="line.189"></a>
+<span class="sourceLineNo">190</span>        Table table = conn.getTable(tableName);<a name="line.190"></a>
+<span class="sourceLineNo">191</span>        RegionLocator regionLocator = conn.getRegionLocator(tableName)) {<a name="line.191"></a>
+<span class="sourceLineNo">192</span>        RegionSizeCalculator sizeCalculator = new RegionSizeCalculator(<a name="line.192"></a>
+<span class="sourceLineNo">193</span>                regionLocator, conn.getAdmin());<a name="line.193"></a>
+<span class="sourceLineNo">194</span>        Pair&lt;byte[][], byte[][]&gt; keys = regionLocator.getStartEndKeys();<a name="line.194"></a>
+<span class="sourceLineNo">195</span>        for (Scan scan : scanList) {<a name="line.195"></a>
+<span class="sourceLineNo">196</span>          if (keys == null || keys.getFirst() == null || keys.getFirst().length == 0) {<a name="line.196"></a>
+<span class="sourceLineNo">197</span>            throw new IOException("Expecting at least one region for table : "<a name="line.197"></a>
+<span class="sourceLineNo">198</span>                    + tableName.getNameAsString());<a name="line.198"></a>
+<span class="sourceLineNo">199</span>          }<a name="line.199"></a>
+<span class="sourceLineNo">200</span>          int count = 0;<a name="line.200"></a>
+<span class="sourceLineNo">201</span><a name="line.201"></a>
+<span class="sourceLineNo">202</span>          byte[] startRow = scan.getStartRow();<a name="line.202"></a>
+<span class="sourceLineNo">203</span>          byte[] stopRow = scan.getStopRow();<a name="line.203"></a>
+<span class="sourceLineNo">204</span><a name="line.204"></a>
+<span class="sourceLineNo">205</span>          for (int i = 0; i &lt; keys.getFirst().length; i++) {<a name="line.205"></a>
+<span class="sourceLineNo">206</span>            if (!includeRegionInSplit(keys.getFirst()[i], keys.getSecond()[i])) {<a name="line.206"></a>
+<span class="sourceLineNo">207</span>              continue;<a name="line.207"></a>
+<span class="sourceLineNo">208</span>            }<a name="line.208"></a>
+<span class="sourceLineNo">209</span><a name="line.209"></a>
+<span class="sourceLineNo">210</span>            if ((startRow.length == 0 || keys.getSecond()[i].length == 0 ||<a name="line.210"></a>
+<span class="sourceLineNo">211</span>                    Bytes.compareTo(startRow, keys.getSecond()[i]) &lt; 0) &amp;&amp;<a name="line.211"></a>
+<span class="sourceLineNo">212</span>                    (stopRow.length == 0 || Bytes.compareTo(stopRow,<a name="line.212"></a>
+<span class="sourceLineNo">213</span>                            keys.getFirst()[i]) &gt; 0)) {<a name="line.213"></a>
+<span class="sourceLineNo">214</span>              byte[] splitStart = startRow.length == 0 ||<a name="line.214"></a>
+<span class="sourceLineNo">215</span>                      Bytes.compareTo(keys.getFirst()[i], startRow) &gt;= 0 ?<a name="line.215"></a>
+<span class="sourceLineNo">216</span>                      keys.getFirst()[i] : startRow;<a name="line.216"></a>
+<span class="sourceLineNo">217</span>              byte[] splitStop = (stopRow.length == 0 ||<a name="line.217"></a>
+<span class="sourceLineNo">218</span>                      Bytes.compareTo(keys.getSecond()[i], stopRow) &lt;= 0) &amp;&amp;<a name="line.218"></a>
+<span class="sourceLineNo">219</span>                      keys.getSecond()[i].length &gt; 0 ?<a name="line.219"></a>
+<span class="sourceLineNo">220</span>                      keys.getSecond()[i] : stopRow;<a name="line.220"></a>
+<span class="sourceLineNo">221</span><a name="line.221"></a>
+<span class="sourceLineNo">222</span>              HRegionLocation hregionLocation = regionLocator.getRegionLocation(<a name="line.222"></a>
+<span class="sourceLineNo">223</span>                      keys.getFirst()[i], false);<a name="line.223"></a>
+<span class="sourceLineNo">224</span>              String regionHostname = hregionLocation.getHostname();<a name="line.224"></a>
+<span class="sourceLineNo">225</span>              HRegionInfo regionInfo = hregionLocation.getRegionInfo();<a name="line.225"></a>
+<span class="sourceLineNo">226</span>              long regionSize = sizeCalculator.getRegionSize(<a name="line.226"></a>
+<span class="sourceLineNo">227</span>                      regionInfo.getRegionName());<a name="line.227"></a>
+<span class="sourceLineNo">228</span><a name="line.228"></a>
+<span class="sourceLineNo">229</span>              TableSplit split = new TableSplit(table.getName(),<a name="line.229"></a>
+<span class="sourceLineNo">230</span>                      scan, splitStart, splitStop, regionHostname, regionSize);<a name="line.230"></a>
+<span class="sourceLineNo">231</span><a name="line.231"></a>
+<span class="sourceLineNo">232</span>              splits.add(split);<a name="line.232"></a>
+<span class="sourceLineNo">233</span><a name="line.233"></a>
+<span class="sourceLineNo">234</span>              if (LOG.isDebugEnabled())<a name="line.234"></a>
+<span class="sourceLineNo">235</span>                LOG.debug("getSplits: split -&gt; " + (count++) + " -&gt; " + split);<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>        }<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>    return splits;<a name="line.242"></a>
+<span class="sourceLineNo">243</span>  }<a name="line.243"></a>
+<span class="sourceLineNo">244</span><a name="line.244"></a>
+<span class="sourceLineNo">245</span>  /**<a name="line.245"></a>
+<span class="sourceLineNo">246</span>   * Test if the given region is to be included in the InputSplit while<a name="line.246"></a>
+<span class="sourceLineNo">247</span>   * splitting the regions of a table.<a name="line.247"></a>
+<span class="sourceLineNo">248</span>   * &lt;p&gt;<a name="line.248"></a>
+<span class="sourceLineNo">249</span>   * This optimization is effective when there is a specific reasoning to<a name="line.249"></a>
+<span class="sourceLineNo">250</span>   * exclude an entire region from the M-R job, (and hence, not contributing to<a name="line.250"></a>
+<span class="sourceLineNo">251</span>   * the InputSplit), given the start and end keys of the same. &lt;br&gt;<a name="line.251"></a>
+<span class="sourceLineNo">252</span>   * Useful when we need to remember the last-processed top record and revisit<a name="line.252"></a>
+<span class="sourceLineNo">253</span>   * the [last, current) interval for M-R processing, continuously. In addition<a name="line.253"></a>
+<span class="sourceLineNo">254</span>   * to reducing InputSplits, reduces the load on the region server as well, due<a name="line.254"></a>
+<span class="sourceLineNo">255</span>   * to the ordering of the keys. &lt;br&gt;<a name="line.255"></a>
+<span class="sourceLineNo">256</span>   * &lt;br&gt;<a name="line.256"></a>
+<span class="sourceLineNo">257</span>   * Note: It is possible that &lt;code&gt;endKey.length() == 0 &lt;/code&gt; , for the last<a name="line.257"></a>
+<span class="sourceLineNo">258</span>   * (recent) region. &lt;br&gt;<a name="line.258"></a>
+<span class="sourceLineNo">259</span>   * Override this method, if you want to bulk exclude regions altogether from<a name="line.259"></a>
+<span class="sourceLineNo">260</span>   * M-R. By default, no region is excluded( i.e. all regions are included).<a name="line.260"></a>
+<span class="sourceLineNo">261</span>   *<a name="line.261"></a>
+<span class="sourceLineNo">262</span>   * @param startKey Start key of the region<a name="line.262"></a>
+<span class="sourceLineNo">263</span>   * @param endKey End key of the region<a name="line.263"></a>
+<span class="sourceLineNo">264</span>   * @return true, if this region needs to be included as part of the input<a name="line.264"></a>
+<span class="sourceLineNo">265</span>   *         (default).<a name="line.265"></a>
+<span class="sourceLineNo">266</span>   */<a name="line.266"></a>
+<span class="sourceLineNo">267</span>  protected boolean includeRegionInSplit(final byte[] startKey,<a name="line.267"></a>
+<span class="sourceLineNo">268</span>      final byte[] endKey) {<a name="line.268"></a>
+<span class="sourceLineNo">269</span>    return true;<a name="line.269"></a>
+<span class="sourceLineNo">270</span>  }<a name="line.270"></a>
+<span class="sourceLineNo">271</span><a name="line.271"></a>
+<span class="sourceLineNo">272</span>  /**<a name="line.272"></a>
+<span class="sourceLineNo">273</span>   * Allows subclasses to get the list of {@link Scan} objects.<a name="line.273"></a>
+<span class="sourceLineNo">274</span>   */<a name="line.274"></a>
+<span class="sourceLineNo">275</span>  protected List&lt;Scan&gt; getScans() {<a name="line.275"></a>
+<span class="sourceLineNo">276</span>    return this.scans;<a name="line.276"></a>
+<span class="sourceLineNo">277</span>  }<a name="line.277"></a>
+<span class="sourceLineNo">278</span><a name="line.278"></a>
+<span class="sourceLineNo">279</span>  /**<a name="line.279"></a>
+<span class="sourceLineNo">280</span>   * Allows subclasses to set the list of {@link Scan} objects.<a name="line.280"></a>
+<span class="sourceLineNo">281</span>   *<a name="line.281"></a>
+<span class="sourceLineNo">282</span>   * @param scans The list of {@link Scan} used to define the input<a name="line.282"></a>
+<span class="sourceLineNo">283</span>   */<a name="line.283"></a>
+<span class="sourceLineNo">284</span>  protected void setScans(List&lt;Scan&gt; scans) {<a name="line.284"></a>
+<span class="sourceLineNo">285</span>    this.scans = scans;<a name="line.285"></a>
+<span class="sourceLineNo">286</span>  }<a name="line.286"></a>
+<span class="sourceLineNo">287</span><a name="line.287"></a>
+<span class="sourceLineNo">288</span>  /**<a name="line.288"></a>
+<span class="sourceLineNo">289</span>   * Allows subclasses to set the {@link TableRecordReader}.<a name="line.289"></a>
+<span class="sourceLineNo">290</span>   *<a name="line.290"></a>
+<span class="sourceLineNo">291</span>   * @param tableRecordReader A different {@link TableRecordReader}<a name="line.291"></a>
+<span class="sourceLineNo">292</span>   *          implementation.<a name="line.292"></a>
+<span class="sourceLineNo">293</span>   */<a name="line.293"></a>
+<span class="sourceLineNo">294</span>  protected void setTableRecordReader(TableRecordReader tableRecordReader) {<a name="line.294"></a>
+<span class="sourceLineNo">295</span>    this.tableRecordReader = tableRecordReader;<a name="line.295"></a>
+<span class="sourceLineNo">296</span>  }<a name="line.296"></a>
+<span class="sourceLineNo">297</span>}<a name="line.297"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/75eda567/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/TableInputFormat.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/TableInputFormat.html b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/TableInputFormat.html
index 79ac839..4c12385 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/TableInputFormat.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/TableInputFormat.html
@@ -119,170 +119,172 @@
 <span class="sourceLineNo">111</span>   *   org.apache.hadoop.conf.Configuration)<a name="line.111"></a>
 <span class="sourceLineNo">112</span>   */<a name="line.112"></a>
 <span class="sourceLineNo">113</span>  @Override<a name="line.113"></a>
-<span class="sourceLineNo">114</span>  public void setConf(Configuration configuration) {<a name="line.114"></a>
-<span class="sourceLineNo">115</span>    this.conf = configuration;<a name="line.115"></a>
-<span class="sourceLineNo">116</span><a name="line.116"></a>
-<span class="sourceLineNo">117</span>    Scan scan = null;<a name="line.117"></a>
+<span class="sourceLineNo">114</span>  @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="REC_CATCH_EXCEPTION",<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    justification="Intentional")<a name="line.115"></a>
+<span class="sourceLineNo">116</span>  public void setConf(Configuration configuration) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    this.conf = configuration;<a name="line.117"></a>
 <span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>    if (conf.get(SCAN) != null) {<a name="line.119"></a>
-<span class="sourceLineNo">120</span>      try {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>        scan = TableMapReduceUtil.convertStringToScan(conf.get(SCAN));<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      } catch (IOException e) {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>        LOG.error("An error occurred.", e);<a name="line.123"></a>
-<span class="sourceLineNo">124</span>      }<a name="line.124"></a>
-<span class="sourceLineNo">125</span>    } else {<a name="line.125"></a>
-<span class="sourceLineNo">126</span>      try {<a name="line.126"></a>
-<span class="sourceLineNo">127</span>        scan = new Scan();<a name="line.127"></a>
-<span class="sourceLineNo">128</span><a name="line.128"></a>
-<span class="sourceLineNo">129</span>        if (conf.get(SCAN_ROW_START) != null) {<a name="line.129"></a>
-<span class="sourceLineNo">130</span>          scan.setStartRow(Bytes.toBytes(conf.get(SCAN_ROW_START)));<a name="line.130"></a>
-<span class="sourceLineNo">131</span>        }<a name="line.131"></a>
-<span class="sourceLineNo">132</span><a name="line.132"></a>
-<span class="sourceLineNo">133</span>        if (conf.get(SCAN_ROW_STOP) != null) {<a name="line.133"></a>
-<span class="sourceLineNo">134</span>          scan.setStopRow(Bytes.toBytes(conf.get(SCAN_ROW_STOP)));<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>        if (conf.get(SCAN_COLUMNS) != null) {<a name="line.137"></a>
-<span class="sourceLineNo">138</span>          addColumns(scan, conf.get(SCAN_COLUMNS));<a name="line.138"></a>
-<span class="sourceLineNo">139</span>        }<a name="line.139"></a>
-<span class="sourceLineNo">140</span><a name="line.140"></a>
-<span class="sourceLineNo">141</span>        if (conf.get(SCAN_COLUMN_FAMILY) != null) {<a name="line.141"></a>
-<span class="sourceLineNo">142</span>          scan.addFamily(Bytes.toBytes(conf.get(SCAN_COLUMN_FAMILY)));<a name="line.142"></a>
-<span class="sourceLineNo">143</span>        }<a name="line.143"></a>
-<span class="sourceLineNo">144</span><a name="line.144"></a>
-<span class="sourceLineNo">145</span>        if (conf.get(SCAN_TIMESTAMP) != null) {<a name="line.145"></a>
-<span class="sourceLineNo">146</span>          scan.setTimeStamp(Long.parseLong(conf.get(SCAN_TIMESTAMP)));<a name="line.146"></a>
-<span class="sourceLineNo">147</span>        }<a name="line.147"></a>
-<span class="sourceLineNo">148</span><a name="line.148"></a>
-<span class="sourceLineNo">149</span>        if (conf.get(SCAN_TIMERANGE_START) != null &amp;&amp; conf.get(SCAN_TIMERANGE_END) != null) {<a name="line.149"></a>
-<span class="sourceLineNo">150</span>          scan.setTimeRange(<a name="line.150"></a>
-<span class="sourceLineNo">151</span>              Long.parseLong(conf.get(SCAN_TIMERANGE_START)),<a name="line.151"></a>
-<span class="sourceLineNo">152</span>              Long.parseLong(conf.get(SCAN_TIMERANGE_END)));<a name="line.152"></a>
-<span class="sourceLineNo">153</span>        }<a name="line.153"></a>
-<span class="sourceLineNo">154</span><a name="line.154"></a>
-<span class="sourceLineNo">155</span>        if (conf.get(SCAN_MAXVERSIONS) != null) {<a name="line.155"></a>
-<span class="sourceLineNo">156</span>          scan.setMaxVersions(Integer.parseInt(conf.get(SCAN_MAXVERSIONS)));<a name="line.156"></a>
-<span class="sourceLineNo">157</span>        }<a name="line.157"></a>
-<span class="sourceLineNo">158</span><a name="line.158"></a>
-<span class="sourceLineNo">159</span>        if (conf.get(SCAN_CACHEDROWS) != null) {<a name="line.159"></a>
-<span class="sourceLineNo">160</span>          scan.setCaching(Integer.parseInt(conf.get(SCAN_CACHEDROWS)));<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 (conf.get(SCAN_BATCHSIZE) != null) {<a name="line.163"></a>
-<span class="sourceLineNo">164</span>          scan.setBatch(Integer.parseInt(conf.get(SCAN_BATCHSIZE)));<a name="line.164"></a>
-<span class="sourceLineNo">165</span>        }<a name="line.165"></a>
-<span class="sourceLineNo">166</span><a name="line.166"></a>
-<span class="sourceLineNo">167</span>        // false by default, full table scans generate too much BC churn<a name="line.167"></a>
-<span class="sourceLineNo">168</span>        scan.setCacheBlocks((conf.getBoolean(SCAN_CACHEBLOCKS, false)));<a name="line.168"></a>
-<span class="sourceLineNo">169</span>      } catch (Exception e) {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>          LOG.error(StringUtils.stringifyException(e));<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      }<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    }<a name="line.172"></a>
-<span class="sourceLineNo">173</span><a name="line.173"></a>
-<span class="sourceLineNo">174</span>    setScan(scan);<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>  @Override<a name="line.177"></a>
-<span class="sourceLineNo">178</span>  protected void initialize(JobContext context) throws IOException {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    // Do we have to worry about mis-matches between the Configuration from setConf and the one<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    // in this context?<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    TableName tableName = TableName.valueOf(conf.get(INPUT_TABLE));<a name="line.181"></a>
-<span class="sourceLineNo">182</span>    try {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      initializeTable(ConnectionFactory.createConnection(new Configuration(conf)), tableName);<a name="line.183"></a>
-<span class="sourceLineNo">184</span>    } catch (Exception e) {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>      LOG.error(StringUtils.stringifyException(e));<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>   * Parses a combined family and qualifier and adds either both or just the<a name="line.190"></a>
-<span class="sourceLineNo">191</span>   * family in case there is no qualifier. This assumes the older colon<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   * divided notation, e.g. "family:qualifier".<a name="line.192"></a>
-<span class="sourceLineNo">193</span>   *<a name="line.193"></a>
-<span class="sourceLineNo">194</span>   * @param scan The Scan to update.<a name="line.194"></a>
-<span class="sourceLineNo">195</span>   * @param familyAndQualifier family and qualifier<a name="line.195"></a>
-<span class="sourceLineNo">196</span>   * @throws IllegalArgumentException When familyAndQualifier is invalid.<a name="line.196"></a>
-<span class="sourceLineNo">197</span>   */<a name="line.197"></a>
-<span class="sourceLineNo">198</span>  private static void addColumn(Scan scan, byte[] familyAndQualifier) {<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    byte [][] fq = KeyValue.parseColumn(familyAndQualifier);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    if (fq.length == 1) {<a name="line.200"></a>
-<span class="sourceLineNo">201</span>      scan.addFamily(fq[0]);<a name="line.201"></a>
-<span class="sourceLineNo">202</span>    } else if (fq.length == 2) {<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      scan.addColumn(fq[0], fq[1]);<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    } else {<a name="line.204"></a>
-<span class="sourceLineNo">205</span>      throw new IllegalArgumentException("Invalid familyAndQualifier provided.");<a name="line.205"></a>
-<span class="sourceLineNo">206</span>    }<a name="line.206"></a>
-<span class="sourceLineNo">207</span>  }<a name="line.207"></a>
-<span class="sourceLineNo">208</span><a name="line.208"></a>
-<span class="sourceLineNo">209</span>  /**<a name="line.209"></a>
-<span class="sourceLineNo">210</span>   * Adds an array of columns specified using old format, family:qualifier.<a name="line.210"></a>
-<span class="sourceLineNo">211</span>   * &lt;p&gt;<a name="line.211"></a>
-<span class="sourceLineNo">212</span>   * Overrides previous calls to {@link Scan#addColumn(byte[], byte[])}for any families in the<a name="line.212"></a>
-<span class="sourceLineNo">213</span>   * input.<a name="line.213"></a>
-<span class="sourceLineNo">214</span>   *<a name="line.214"></a>
-<span class="sourceLineNo">215</span>   * @param scan The Scan to update.<a name="line.215"></a>
-<span class="sourceLineNo">216</span>   * @param columns array of columns, formatted as &lt;code&gt;family:qualifier&lt;/code&gt;<a name="line.216"></a>
-<span class="sourceLineNo">217</span>   * @see Scan#addColumn(byte[], byte[])<a name="line.217"></a>
-<span class="sourceLineNo">218</span>   */<a name="line.218"></a>
-<span class="sourceLineNo">219</span>  public static void addColumns(Scan scan, byte [][] columns) {<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    for (byte[] column : columns) {<a name="line.220"></a>
-<span class="sourceLineNo">221</span>      addColumn(scan, column);<a name="line.221"></a>
-<span class="sourceLineNo">222</span>    }<a name="line.222"></a>
-<span class="sourceLineNo">223</span>  }<a name="line.223"></a>
-<span class="sourceLineNo">224</span><a name="line.224"></a>
-<span class="sourceLineNo">225</span>  /**<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   * Calculates the splits that will serve as input for the map tasks. The<a name="line.226"></a>
-<span class="sourceLineNo">227</span>   * number of splits matches the number of regions in a table. Splits are shuffled if<a name="line.227"></a>
-<span class="sourceLineNo">228</span>   * required.<a name="line.228"></a>
-<span class="sourceLineNo">229</span>   * @param context  The current job context.<a name="line.229"></a>
-<span class="sourceLineNo">230</span>   * @return The list of input splits.<a name="line.230"></a>
-<span class="sourceLineNo">231</span>   * @throws IOException When creating the list of splits fails.<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   * @see org.apache.hadoop.mapreduce.InputFormat#getSplits(<a name="line.232"></a>
-<span class="sourceLineNo">233</span>   *   org.apache.hadoop.mapreduce.JobContext)<a name="line.233"></a>
-<span class="sourceLineNo">234</span>   */<a name="line.234"></a>
-<span class="sourceLineNo">235</span>  @Override<a name="line.235"></a>
-<span class="sourceLineNo">236</span>  public List&lt;InputSplit&gt; getSplits(JobContext context) throws IOException {<a name="line.236"></a>
-<span class="sourceLineNo">237</span>    List&lt;InputSplit&gt; splits = super.getSplits(context);<a name="line.237"></a>
-<span class="sourceLineNo">238</span>    if ((conf.get(SHUFFLE_MAPS) != null) &amp;&amp; "true".equals(conf.get(SHUFFLE_MAPS).toLowerCase())) {<a name="line.238"></a>
-<span class="sourceLineNo">239</span>      Collections.shuffle(splits);<a name="line.239"></a>
-<span class="sourceLineNo">240</span>    }<a name="line.240"></a>
-<span class="sourceLineNo">241</span>    return splits;<a name="line.241"></a>
-<span class="sourceLineNo">242</span>  }<a name="line.242"></a>
-<span class="sourceLineNo">243</span><a name="line.243"></a>
-<span class="sourceLineNo">244</span>  /**<a name="line.244"></a>
-<span class="sourceLineNo">245</span>   * Convenience method to parse a string representation of an array of column specifiers.<a name="line.245"></a>
-<span class="sourceLineNo">246</span>   *<a name="line.246"></a>
-<span class="sourceLineNo">247</span>   * @param scan The Scan to update.<a name="line.247"></a>
-<span class="sourceLineNo">248</span>   * @param columns  The columns to parse.<a name="line.248"></a>
-<span class="sourceLineNo">249</span>   */<a name="line.249"></a>
-<span class="sourceLineNo">250</span>  private static void addColumns(Scan scan, String columns) {<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    String[] cols = columns.split(" ");<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    for (String col : cols) {<a name="line.252"></a>
-<span class="sourceLineNo">253</span>      addColumn(scan, Bytes.toBytes(col));<a name="line.253"></a>
-<span class="sourceLineNo">254</span>    }<a name="line.254"></a>
-<span class="sourceLineNo">255</span>  }<a name="line.255"></a>
-<span class="sourceLineNo">256</span><a name="line.256"></a>
-<span class="sourceLineNo">257</span>  @Override<a name="line.257"></a>
-<span class="sourceLineNo">258</span>  protected Pair&lt;byte[][], byte[][]&gt; getStartEndKeys() throws IOException {<a name="line.258"></a>
-<span class="sourceLineNo">259</span>    if (conf.get(SPLIT_TABLE) != null) {<a name="line.259"></a>
-<span class="sourceLineNo">260</span>      TableName splitTableName = TableName.valueOf(conf.get(SPLIT_TABLE));<a name="line.260"></a>
-<span class="sourceLineNo">261</span>      try (Connection conn = ConnectionFactory.createConnection(getConf())) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>        try (RegionLocator rl = conn.getRegionLocator(splitTableName)) {<a name="line.262"></a>
-<span class="sourceLineNo">263</span>          return rl.getStartEndKeys();<a name="line.263"></a>
-<span class="sourceLineNo">264</span>        }<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><a name="line.267"></a>
-<span class="sourceLineNo">268</span>    return super.getStartEndKeys();<a name="line.268"></a>
-<span class="sourceLineNo">269</span>  }<a name="line.269"></a>
-<span class="sourceLineNo">270</span><a name="line.270"></a>
-<span class="sourceLineNo">271</span>  /**<a name="line.271"></a>
-<span class="sourceLineNo">272</span>   * Sets split table in map-reduce job.<a name="line.272"></a>
-<span class="sourceLineNo">273</span>   */<a name="line.273"></a>
-<span class="sourceLineNo">274</span>  public static void configureSplitTable(Job job, TableName tableName) {<a name="line.274"></a>
-<span class="sourceLineNo">275</span>    job.getConfiguration().set(SPLIT_TABLE, tableName.getNameAsString());<a name="line.275"></a>
-<span class="sourceLineNo">276</span>  }<a name="line.276"></a>
-<span class="sourceLineNo">277</span>}<a name="line.277"></a>
+<span class="sourceLineNo">119</span>    Scan scan = null;<a name="line.119"></a>
+<span class="sourceLineNo">120</span><a name="line.120"></a>
+<span class="sourceLineNo">121</span>    if (conf.get(SCAN) != null) {<a name="line.121"></a>
+<span class="sourceLineNo">122</span>      try {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>        scan = TableMapReduceUtil.convertStringToScan(conf.get(SCAN));<a name="line.123"></a>
+<span class="sourceLineNo">124</span>      } catch (IOException e) {<a name="line.124"></a>
+<span class="sourceLineNo">125</span>        LOG.error("An error occurred.", e);<a name="line.125"></a>
+<span class="sourceLineNo">126</span>      }<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    } else {<a name="line.127"></a>
+<span class="sourceLineNo">128</span>      try {<a name="line.128"></a>
+<span class="sourceLineNo">129</span>        scan = new Scan();<a name="line.129"></a>
+<span class="sourceLineNo">130</span><a name="line.130"></a>
+<span class="sourceLineNo">131</span>        if (conf.get(SCAN_ROW_START) != null) {<a name="line.131"></a>
+<span class="sourceLineNo">132</span>          scan.setStartRow(Bytes.toBytes(conf.get(SCAN_ROW_START)));<a name="line.132"></a>
+<span class="sourceLineNo">133</span>        }<a name="line.133"></a>
+<span class="sourceLineNo">134</span><a name="line.134"></a>
+<span class="sourceLineNo">135</span>        if (conf.get(SCAN_ROW_STOP) != null) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>          scan.setStopRow(Bytes.toBytes(conf.get(SCAN_ROW_STOP)));<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>        if (conf.get(SCAN_COLUMNS) != null) {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>          addColumns(scan, conf.get(SCAN_COLUMNS));<a name="line.140"></a>
+<span class="sourceLineNo">141</span>        }<a name="line.141"></a>
+<span class="sourceLineNo">142</span><a name="line.142"></a>
+<span class="sourceLineNo">143</span>        if (conf.get(SCAN_COLUMN_FAMILY) != null) {<a name="line.143"></a>
+<span class="sourceLineNo">144</span>          scan.addFamily(Bytes.toBytes(conf.get(SCAN_COLUMN_FAMILY)));<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        }<a name="line.145"></a>
+<span class="sourceLineNo">146</span><a name="line.146"></a>
+<span class="sourceLineNo">147</span>        if (conf.get(SCAN_TIMESTAMP) != null) {<a name="line.147"></a>
+<span class="sourceLineNo">148</span>          scan.setTimeStamp(Long.parseLong(conf.get(SCAN_TIMESTAMP)));<a name="line.148"></a>
+<span class="sourceLineNo">149</span>        }<a name="line.149"></a>
+<span class="sourceLineNo">150</span><a name="line.150"></a>
+<span class="sourceLineNo">151</span>        if (conf.get(SCAN_TIMERANGE_START) != null &amp;&amp; conf.get(SCAN_TIMERANGE_END) != null) {<a name="line.151"></a>
+<span class="sourceLineNo">152</span>          scan.setTimeRange(<a name="line.152"></a>
+<span class="sourceLineNo">153</span>              Long.parseLong(conf.get(SCAN_TIMERANGE_START)),<a name="line.153"></a>
+<span class="sourceLineNo">154</span>              Long.parseLong(conf.get(SCAN_TIMERANGE_END)));<a name="line.154"></a>
+<span class="sourceLineNo">155</span>        }<a name="line.155"></a>
+<span class="sourceLineNo">156</span><a name="line.156"></a>
+<span class="sourceLineNo">157</span>        if (conf.get(SCAN_MAXVERSIONS) != null) {<a name="line.157"></a>
+<span class="sourceLineNo">158</span>          scan.setMaxVersions(Integer.parseInt(conf.get(SCAN_MAXVERSIONS)));<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 (conf.get(SCAN_CACHEDROWS) != null) {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>          scan.setCaching(Integer.parseInt(conf.get(SCAN_CACHEDROWS)));<a name="line.162"></a>
+<span class="sourceLineNo">163</span>        }<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>        if (conf.get(SCAN_BATCHSIZE) != null) {<a name="line.165"></a>
+<span class="sourceLineNo">166</span>          scan.setBatch(Integer.parseInt(conf.get(SCAN_BATCHSIZE)));<a name="line.166"></a>
+<span class="sourceLineNo">167</span>        }<a name="line.167"></a>
+<span class="sourceLineNo">168</span><a name="line.168"></a>
+<span class="sourceLineNo">169</span>        // false by default, full table scans generate too much BC churn<a name="line.169"></a>
+<span class="sourceLineNo">170</span>        scan.setCacheBlocks((conf.getBoolean(SCAN_CACHEBLOCKS, false)));<a name="line.170"></a>
+<span class="sourceLineNo">171</span>      } catch (Exception e) {<a name="line.171"></a>
+<span class="sourceLineNo">172</span>          LOG.error(StringUtils.stringifyException(e));<a name="line.172"></a>
+<span class="sourceLineNo">173</span>      }<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>    setScan(scan);<a name="line.176"></a>
+<span class="sourceLineNo">177</span>  }<a name="line.177"></a>
+<span class="sourceLineNo">178</span><a name="line.178"></a>
+<span class="sourceLineNo">179</span>  @Override<a name="line.179"></a>
+<span class="sourceLineNo">180</span>  protected void initialize(JobContext context) throws IOException {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    // Do we have to worry about mis-matches between the Configuration from setConf and the one<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    // in this context?<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    TableName tableName = TableName.valueOf(conf.get(INPUT_TABLE));<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    try {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>      initializeTable(ConnectionFactory.createConnection(new Configuration(conf)), tableName);<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    } catch (Exception e) {<a name="line.186"></a>
+<span class="sourceLineNo">187</span>      LOG.error(StringUtils.stringifyException(e));<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    }<a name="line.188"></a>
+<span class="sourceLineNo">189</span>  }<a name="line.189"></a>
+<span class="sourceLineNo">190</span><a name="line.190"></a>
+<span class="sourceLineNo">191</span>  /**<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   * Parses a combined family and qualifier and adds either both or just the<a name="line.192"></a>
+<span class="sourceLineNo">193</span>   * family in case there is no qualifier. This assumes the older colon<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   * divided notation, e.g. "family:qualifier".<a name="line.194"></a>
+<span class="sourceLineNo">195</span>   *<a name="line.195"></a>
+<span class="sourceLineNo">196</span>   * @param scan The Scan to update.<a name="line.196"></a>
+<span class="sourceLineNo">197</span>   * @param familyAndQualifier family and qualifier<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   * @throws IllegalArgumentException When familyAndQualifier is invalid.<a name="line.198"></a>
+<span class="sourceLineNo">199</span>   */<a name="line.199"></a>
+<span class="sourceLineNo">200</span>  private static void addColumn(Scan scan, byte[] familyAndQualifier) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>    byte [][] fq = KeyValue.parseColumn(familyAndQualifier);<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    if (fq.length == 1) {<a name="line.202"></a>
+<span class="sourceLineNo">203</span>      scan.addFamily(fq[0]);<a name="line.203"></a>
+<span class="sourceLineNo">204</span>    } else if (fq.length == 2) {<a name="line.204"></a>
+<span class="sourceLineNo">205</span>      scan.addColumn(fq[0], fq[1]);<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    } else {<a name="line.206"></a>
+<span class="sourceLineNo">207</span>      throw new IllegalArgumentException("Invalid familyAndQualifier provided.");<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    }<a name="line.208"></a>
+<span class="sourceLineNo">209</span>  }<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>   * Adds an array of columns specified using old format, family:qualifier.<a name="line.212"></a>
+<span class="sourceLineNo">213</span>   * &lt;p&gt;<a name="line.213"></a>
+<span class="sourceLineNo">214</span>   * Overrides previous calls to {@link Scan#addColumn(byte[], byte[])}for any families in the<a name="line.214"></a>
+<span class="sourceLineNo">215</span>   * input.<a name="line.215"></a>
+<span class="sourceLineNo">216</span>   *<a name="line.216"></a>
+<span class="sourceLineNo">217</span>   * @param scan The Scan to update.<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   * @param columns array of columns, formatted as &lt;code&gt;family:qualifier&lt;/code&gt;<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   * @see Scan#addColumn(byte[], byte[])<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   */<a name="line.220"></a>
+<span class="sourceLineNo">221</span>  public static void addColumns(Scan scan, byte [][] columns) {<a name="line.221"></a>
+<span class="sourceLineNo">222</span>    for (byte[] column : columns) {<a name="line.222"></a>
+<span class="sourceLineNo">223</span>      addColumn(scan, column);<a name="line.223"></a>
+<span class="sourceLineNo">224</span>    }<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>   * Calculates the splits that will serve as input for the map tasks. The<a name="line.228"></a>
+<span class="sourceLineNo">229</span>   * number of splits matches the number of regions in a table. Splits are shuffled if<a name="line.229"></a>
+<span class="sourceLineNo">230</span>   * required.<a name="line.230"></a>
+<span class="sourceLineNo">231</span>   * @param context  The current job context.<a name="line.231"></a>
+<span class="sourceLineNo">232</span>   * @return The list of input splits.<a name="line.232"></a>
+<span class="sourceLineNo">233</span>   * @throws IOException When creating the list of splits fails.<a name="line.233"></a>
+<span class="sourceLineNo">234</span>   * @see org.apache.hadoop.mapreduce.InputFormat#getSplits(<a name="line.234"></a>
+<span class="sourceLineNo">235</span>   *   org.apache.hadoop.mapreduce.JobContext)<a name="line.235"></a>
+<span class="sourceLineNo">236</span>   */<a name="line.236"></a>
+<span class="sourceLineNo">237</span>  @Override<a name="line.237"></a>
+<span class="sourceLineNo">238</span>  public List&lt;InputSplit&gt; getSplits(JobContext context) throws IOException {<a name="line.238"></a>
+<span class="sourceLineNo">239</span>    List&lt;InputSplit&gt; splits = super.getSplits(context);<a name="line.239"></a>
+<span class="sourceLineNo">240</span>    if ((conf.get(SHUFFLE_MAPS) != null) &amp;&amp; "true".equals(conf.get(SHUFFLE_MAPS).toLowerCase())) {<a name="line.240"></a>
+<span class="sourceLineNo">241</span>      Collections.shuffle(splits);<a name="line.241"></a>
+<span class="sourceLineNo">242</span>    }<a name="line.242"></a>
+<span class="sourceLineNo">243</span>    return splits;<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>  /**<a name="line.246"></a>
+<span class="sourceLineNo">247</span>   * Convenience method to parse a string representation of an array of column specifiers.<a name="line.247"></a>
+<span class="sourceLineNo">248</span>   *<a name="line.248"></a>
+<span class="sourceLineNo">249</span>   * @param scan The Scan to update.<a name="line.249"></a>
+<span class="sourceLineNo">250</span>   * @param columns  The columns to parse.<a name="line.250"></a>
+<span class="sourceLineNo">251</span>   */<a name="line.251"></a>
+<span class="sourceLineNo">252</span>  private static void addColumns(Scan scan, String columns) {<a name="line.252"></a>
+<span class="sourceLineNo">253</span>    String[] cols = columns.split(" ");<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    for (String col : cols) {<a name="line.254"></a>
+<span class="sourceLineNo">255</span>      addColumn(scan, Bytes.toBytes(col));<a name="line.255"></a>
+<span class="sourceLineNo">256</span>    }<a name="line.256"></a>
+<span class="sourceLineNo">257</span>  }<a name="line.257"></a>
+<span class="sourceLineNo">258</span><a name="line.258"></a>
+<span class="sourceLineNo">259</span>  @Override<a name="line.259"></a>
+<span class="sourceLineNo">260</span>  protected Pair&lt;byte[][], byte[][]&gt; getStartEndKeys() throws IOException {<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    if (conf.get(SPLIT_TABLE) != null) {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>      TableName splitTableName = TableName.valueOf(conf.get(SPLIT_TABLE));<a name="line.262"></a>
+<span class="sourceLineNo">263</span>      try (Connection conn = ConnectionFactory.createConnection(getConf())) {<a name="line.263"></a>
+<span class="sourceLineNo">264</span>        try (RegionLocator rl = conn.getRegionLocator(splitTableName)) {<a name="line.264"></a>
+<span class="sourceLineNo">265</span>          return rl.getStartEndKeys();<a name="line.265"></a>
+<span class="sourceLineNo">266</span>        }<a name="line.266"></a>
+<span class="sourceLineNo">267</span>      }<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    }<a name="line.268"></a>
+<span class="sourceLineNo">269</span><a name="line.269"></a>
+<span class="sourceLineNo">270</span>    return super.getStartEndKeys();<a name="line.270"></a>
+<span class="sourceLineNo">271</span>  }<a name="line.271"></a>
+<span class="sourceLineNo">272</span><a name="line.272"></a>
+<span class="sourceLineNo">273</span>  /**<a name="line.273"></a>
+<span class="sourceLineNo">274</span>   * Sets split table in map-reduce job.<a name="line.274"></a>
+<span class="sourceLineNo">275</span>   */<a name="line.275"></a>
+<span class="sourceLineNo">276</span>  public static void configureSplitTable(Job job, TableName tableName) {<a name="line.276"></a>
+<span class="sourceLineNo">277</span>    job.getConfiguration().set(SPLIT_TABLE, tableName.getNameAsString());<a name="line.277"></a>
+<span class="sourceLineNo">278</span>  }<a name="line.278"></a>
+<span class="sourceLineNo">279</span>}<a name="line.279"></a>
 
 
 


Mime
View raw message