hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [24/51] [partial] hbase-site git commit: Published site at .
Date Sat, 09 Sep 2017 15:14:16 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1490b3ab/apidocs/src-html/org/apache/hadoop/hbase/filter/ValueFilter.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/filter/ValueFilter.html b/apidocs/src-html/org/apache/hadoop/hbase/filter/ValueFilter.html
index 8e53392..22ad865 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/filter/ValueFilter.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/filter/ValueFilter.html
@@ -31,103 +31,116 @@
 <span class="sourceLineNo">023</span>import java.util.ArrayList;<a name="line.23"></a>
 <span class="sourceLineNo">024</span><a name="line.24"></a>
 <span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.Cell;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.exceptions.DeserializationException;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException;<a name="line.30"></a>
-<span class="sourceLineNo">031</span><a name="line.31"></a>
-<span class="sourceLineNo">032</span>/**<a name="line.32"></a>
-<span class="sourceLineNo">033</span> * This filter is used to filter based on column value. It takes an<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * operator (equal, greater, not equal, etc) and a byte [] comparator for the<a name="line.34"></a>
-<span class="sourceLineNo">035</span> * cell value.<a name="line.35"></a>
-<span class="sourceLineNo">036</span> * &lt;p&gt;<a name="line.36"></a>
-<span class="sourceLineNo">037</span> * This filter can be wrapped with {@link WhileMatchFilter} and {@link SkipFilter}<a name="line.37"></a>
-<span class="sourceLineNo">038</span> * to add more control.<a name="line.38"></a>
-<span class="sourceLineNo">039</span> * &lt;p&gt;<a name="line.39"></a>
-<span class="sourceLineNo">040</span> * Multiple filters can be combined using {@link FilterList}.<a name="line.40"></a>
-<span class="sourceLineNo">041</span> * &lt;p&gt;<a name="line.41"></a>
-<span class="sourceLineNo">042</span> * To test the value of a single qualifier when scanning multiple qualifiers,<a name="line.42"></a>
-<span class="sourceLineNo">043</span> * use {@link SingleColumnValueFilter}.<a name="line.43"></a>
-<span class="sourceLineNo">044</span> */<a name="line.44"></a>
-<span class="sourceLineNo">045</span>@InterfaceAudience.Public<a name="line.45"></a>
-<span class="sourceLineNo">046</span>public class ValueFilter extends CompareFilter {<a name="line.46"></a>
-<span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>  /**<a name="line.48"></a>
-<span class="sourceLineNo">049</span>   * Constructor.<a name="line.49"></a>
-<span class="sourceLineNo">050</span>   * @param valueCompareOp the compare op for value matching<a name="line.50"></a>
-<span class="sourceLineNo">051</span>   * @param valueComparator the comparator for value matching<a name="line.51"></a>
-<span class="sourceLineNo">052</span>   */<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  public ValueFilter(final CompareOp valueCompareOp,<a name="line.53"></a>
-<span class="sourceLineNo">054</span>      final ByteArrayComparable valueComparator) {<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    super(valueCompareOp, valueComparator);<a name="line.55"></a>
-<span class="sourceLineNo">056</span>  }<a name="line.56"></a>
-<span class="sourceLineNo">057</span><a name="line.57"></a>
-<span class="sourceLineNo">058</span>  @Override<a name="line.58"></a>
-<span class="sourceLineNo">059</span>  public ReturnCode filterKeyValue(Cell v) {<a name="line.59"></a>
-<span class="sourceLineNo">060</span>    if (compareValue(this.compareOp, this.comparator, v)) {<a name="line.60"></a>
-<span class="sourceLineNo">061</span>      return ReturnCode.SKIP;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    return ReturnCode.INCLUDE;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>  }<a name="line.64"></a>
-<span class="sourceLineNo">065</span><a name="line.65"></a>
-<span class="sourceLineNo">066</span>  public static Filter createFilterFromArguments(ArrayList&lt;byte []&gt; filterArguments) {<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    @SuppressWarnings("rawtypes")  // for arguments<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    ArrayList arguments = CompareFilter.extractArguments(filterArguments);<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    CompareOp compareOp = (CompareOp)arguments.get(0);<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    return new ValueFilter(compareOp, comparator);<a name="line.71"></a>
-<span class="sourceLineNo">072</span>  }<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>  /**<a name="line.74"></a>
-<span class="sourceLineNo">075</span>   * @return The filter serialized using pb<a name="line.75"></a>
-<span class="sourceLineNo">076</span>   */<a name="line.76"></a>
-<span class="sourceLineNo">077</span>  public byte [] toByteArray() {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>    FilterProtos.ValueFilter.Builder builder =<a name="line.78"></a>
-<span class="sourceLineNo">079</span>      FilterProtos.ValueFilter.newBuilder();<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    builder.setCompareFilter(super.convert());<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    return builder.build().toByteArray();<a name="line.81"></a>
-<span class="sourceLineNo">082</span>  }<a name="line.82"></a>
-<span class="sourceLineNo">083</span><a name="line.83"></a>
-<span class="sourceLineNo">084</span>  /**<a name="line.84"></a>
-<span class="sourceLineNo">085</span>   * @param pbBytes A pb serialized {@link ValueFilter} instance<a name="line.85"></a>
-<span class="sourceLineNo">086</span>   * @return An instance of {@link ValueFilter} made from &lt;code&gt;bytes&lt;/code&gt;<a name="line.86"></a>
-<span class="sourceLineNo">087</span>   * @throws DeserializationException<a name="line.87"></a>
-<span class="sourceLineNo">088</span>   * @see #toByteArray<a name="line.88"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.CompareOperator;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.exceptions.DeserializationException;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException;<a name="line.31"></a>
+<span class="sourceLineNo">032</span><a name="line.32"></a>
+<span class="sourceLineNo">033</span>/**<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * This filter is used to filter based on column value. It takes an<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * operator (equal, greater, not equal, etc) and a byte [] comparator for the<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * cell value.<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * &lt;p&gt;<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * This filter can be wrapped with {@link WhileMatchFilter} and {@link SkipFilter}<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * to add more control.<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * &lt;p&gt;<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * Multiple filters can be combined using {@link FilterList}.<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * &lt;p&gt;<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * To test the value of a single qualifier when scanning multiple qualifiers,<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * use {@link SingleColumnValueFilter}.<a name="line.44"></a>
+<span class="sourceLineNo">045</span> */<a name="line.45"></a>
+<span class="sourceLineNo">046</span>@InterfaceAudience.Public<a name="line.46"></a>
+<span class="sourceLineNo">047</span>public class ValueFilter extends CompareFilter {<a name="line.47"></a>
+<span class="sourceLineNo">048</span><a name="line.48"></a>
+<span class="sourceLineNo">049</span>  /**<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   * Constructor.<a name="line.50"></a>
+<span class="sourceLineNo">051</span>   * @param valueCompareOp the compare op for value matching<a name="line.51"></a>
+<span class="sourceLineNo">052</span>   * @param valueComparator the comparator for value matching<a name="line.52"></a>
+<span class="sourceLineNo">053</span>   * @deprecated Since 2.0.0. Will be removed in 3.0.0.<a name="line.53"></a>
+<span class="sourceLineNo">054</span>   * Use {@link #ValueFilter(CompareOperator, ByteArrayComparable)}<a name="line.54"></a>
+<span class="sourceLineNo">055</span>   */<a name="line.55"></a>
+<span class="sourceLineNo">056</span>  public ValueFilter(final CompareOp valueCompareOp,<a name="line.56"></a>
+<span class="sourceLineNo">057</span>      final ByteArrayComparable valueComparator) {<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    super(valueCompareOp, valueComparator);<a name="line.58"></a>
+<span class="sourceLineNo">059</span>  }<a name="line.59"></a>
+<span class="sourceLineNo">060</span><a name="line.60"></a>
+<span class="sourceLineNo">061</span>  /**<a name="line.61"></a>
+<span class="sourceLineNo">062</span>   * Constructor.<a name="line.62"></a>
+<span class="sourceLineNo">063</span>   * @param valueCompareOp the compare op for value matching<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   * @param valueComparator the comparator for value matching<a name="line.64"></a>
+<span class="sourceLineNo">065</span>   */<a name="line.65"></a>
+<span class="sourceLineNo">066</span>  public ValueFilter(final CompareOperator valueCompareOp,<a name="line.66"></a>
+<span class="sourceLineNo">067</span>                     final ByteArrayComparable valueComparator) {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    super(valueCompareOp, valueComparator);<a name="line.68"></a>
+<span class="sourceLineNo">069</span>  }<a name="line.69"></a>
+<span class="sourceLineNo">070</span><a name="line.70"></a>
+<span class="sourceLineNo">071</span>  @Override<a name="line.71"></a>
+<span class="sourceLineNo">072</span>  public ReturnCode filterKeyValue(Cell v) {<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    if (compareValue(getCompareOperator(), this.comparator, v)) {<a name="line.73"></a>
+<span class="sourceLineNo">074</span>      return ReturnCode.SKIP;<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    }<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    return ReturnCode.INCLUDE;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>  }<a name="line.77"></a>
+<span class="sourceLineNo">078</span><a name="line.78"></a>
+<span class="sourceLineNo">079</span>  public static Filter createFilterFromArguments(ArrayList&lt;byte []&gt; filterArguments) {<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    @SuppressWarnings("rawtypes")  // for arguments<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    ArrayList arguments = CompareFilter.extractArguments(filterArguments);<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    CompareOperator compareOp = (CompareOperator)arguments.get(0);<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    return new ValueFilter(compareOp, comparator);<a name="line.84"></a>
+<span class="sourceLineNo">085</span>  }<a name="line.85"></a>
+<span class="sourceLineNo">086</span><a name="line.86"></a>
+<span class="sourceLineNo">087</span>  /**<a name="line.87"></a>
+<span class="sourceLineNo">088</span>   * @return The filter serialized using pb<a name="line.88"></a>
 <span class="sourceLineNo">089</span>   */<a name="line.89"></a>
-<span class="sourceLineNo">090</span>  public static ValueFilter parseFrom(final byte [] pbBytes)<a name="line.90"></a>
-<span class="sourceLineNo">091</span>  throws DeserializationException {<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    FilterProtos.ValueFilter proto;<a name="line.92"></a>
-<span class="sourceLineNo">093</span>    try {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>      proto = FilterProtos.ValueFilter.parseFrom(pbBytes);<a name="line.94"></a>
-<span class="sourceLineNo">095</span>    } catch (InvalidProtocolBufferException e) {<a name="line.95"></a>
-<span class="sourceLineNo">096</span>      throw new DeserializationException(e);<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    }<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    final CompareOp valueCompareOp =<a name="line.98"></a>
-<span class="sourceLineNo">099</span>      CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    ByteArrayComparable valueComparator = null;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>    try {<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      if (proto.getCompareFilter().hasComparator()) {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>        valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());<a name="line.103"></a>
-<span class="sourceLineNo">104</span>      }<a name="line.104"></a>
-<span class="sourceLineNo">105</span>    } catch (IOException ioe) {<a name="line.105"></a>
-<span class="sourceLineNo">106</span>      throw new DeserializationException(ioe);<a name="line.106"></a>
-<span class="sourceLineNo">107</span>    }<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    return new ValueFilter(valueCompareOp,valueComparator);<a name="line.108"></a>
-<span class="sourceLineNo">109</span>  }<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>   * @param other<a name="line.112"></a>
-<span class="sourceLineNo">113</span>   * @return true if and only if the fields of the filter that are serialized<a name="line.113"></a>
-<span class="sourceLineNo">114</span>   * are equal to the corresponding fields in other.  Used for testing.<a name="line.114"></a>
-<span class="sourceLineNo">115</span>   */<a name="line.115"></a>
-<span class="sourceLineNo">116</span>  boolean areSerializedFieldsEqual(Filter o) {<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    if (o == this) return true;<a name="line.117"></a>
-<span class="sourceLineNo">118</span>    if (!(o instanceof ValueFilter)) return false;<a name="line.118"></a>
-<span class="sourceLineNo">119</span><a name="line.119"></a>
-<span class="sourceLineNo">120</span>    return super.areSerializedFieldsEqual(o);<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">090</span>  public byte [] toByteArray() {<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    FilterProtos.ValueFilter.Builder builder =<a name="line.91"></a>
+<span class="sourceLineNo">092</span>      FilterProtos.ValueFilter.newBuilder();<a name="line.92"></a>
+<span class="sourceLineNo">093</span>    builder.setCompareFilter(super.convert());<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    return builder.build().toByteArray();<a name="line.94"></a>
+<span class="sourceLineNo">095</span>  }<a name="line.95"></a>
+<span class="sourceLineNo">096</span><a name="line.96"></a>
+<span class="sourceLineNo">097</span>  /**<a name="line.97"></a>
+<span class="sourceLineNo">098</span>   * @param pbBytes A pb serialized {@link ValueFilter} instance<a name="line.98"></a>
+<span class="sourceLineNo">099</span>   * @return An instance of {@link ValueFilter} made from &lt;code&gt;bytes&lt;/code&gt;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>   * @throws DeserializationException<a name="line.100"></a>
+<span class="sourceLineNo">101</span>   * @see #toByteArray<a name="line.101"></a>
+<span class="sourceLineNo">102</span>   */<a name="line.102"></a>
+<span class="sourceLineNo">103</span>  public static ValueFilter parseFrom(final byte [] pbBytes)<a name="line.103"></a>
+<span class="sourceLineNo">104</span>  throws DeserializationException {<a name="line.104"></a>
+<span class="sourceLineNo">105</span>    FilterProtos.ValueFilter proto;<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    try {<a name="line.106"></a>
+<span class="sourceLineNo">107</span>      proto = FilterProtos.ValueFilter.parseFrom(pbBytes);<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    } catch (InvalidProtocolBufferException e) {<a name="line.108"></a>
+<span class="sourceLineNo">109</span>      throw new DeserializationException(e);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    }<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    final CompareOperator valueCompareOp =<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      CompareOperator.valueOf(proto.getCompareFilter().getCompareOp().name());<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    ByteArrayComparable valueComparator = null;<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    try {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>      if (proto.getCompareFilter().hasComparator()) {<a name="line.115"></a>
+<span class="sourceLineNo">116</span>        valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());<a name="line.116"></a>
+<span class="sourceLineNo">117</span>      }<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    } catch (IOException ioe) {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      throw new DeserializationException(ioe);<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    }<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    return new ValueFilter(valueCompareOp,valueComparator);<a name="line.121"></a>
+<span class="sourceLineNo">122</span>  }<a name="line.122"></a>
+<span class="sourceLineNo">123</span><a name="line.123"></a>
+<span class="sourceLineNo">124</span>  /**<a name="line.124"></a>
+<span class="sourceLineNo">125</span><a name="line.125"></a>
+<span class="sourceLineNo">126</span>   * @return true if and only if the fields of the filter that are serialized<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   * are equal to the corresponding fields in other.  Used for testing.<a name="line.127"></a>
+<span class="sourceLineNo">128</span>   */<a name="line.128"></a>
+<span class="sourceLineNo">129</span>  boolean areSerializedFieldsEqual(Filter o) {<a name="line.129"></a>
+<span class="sourceLineNo">130</span>    if (o == this) return true;<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    if (!(o instanceof ValueFilter)) return false;<a name="line.131"></a>
+<span class="sourceLineNo">132</span><a name="line.132"></a>
+<span class="sourceLineNo">133</span>    return super.areSerializedFieldsEqual(o);<a name="line.133"></a>
+<span class="sourceLineNo">134</span>  }<a name="line.134"></a>
+<span class="sourceLineNo">135</span>}<a name="line.135"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1490b3ab/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/CellCounter.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/CellCounter.html b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/CellCounter.html
index f4cf3f0..19f5f8f 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/CellCounter.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/CellCounter.html
@@ -30,315 +30,314 @@
 <span class="sourceLineNo">022</span><a name="line.22"></a>
 <span class="sourceLineNo">023</span>import org.apache.commons.logging.Log;<a name="line.23"></a>
 <span class="sourceLineNo">024</span>import org.apache.commons.logging.LogFactory;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.HConstants;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.conf.Configuration;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.conf.Configured;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.fs.Path;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.Cell;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.CellUtil;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.HBaseConfiguration;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.client.Result;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.client.Scan;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.filter.CompareFilter;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.filter.Filter;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.filter.PrefixFilter;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.filter.RegexStringComparator;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.filter.RowFilter;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.io.ImmutableBytesWritable;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import org.apache.hadoop.io.IntWritable;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import org.apache.hadoop.io.Text;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>import org.apache.hadoop.mapreduce.Job;<a name="line.44"></a>
-<span class="sourceLineNo">045</span>import org.apache.hadoop.mapreduce.Reducer;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;<a name="line.46"></a>
-<span class="sourceLineNo">047</span>import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>import org.apache.hadoop.util.Tool;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>import org.apache.hadoop.util.ToolRunner;<a name="line.49"></a>
-<span class="sourceLineNo">050</span><a name="line.50"></a>
-<span class="sourceLineNo">051</span>import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;<a name="line.51"></a>
-<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.CompareOperator;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.HConstants;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.conf.Configuration;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.conf.Configured;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.fs.Path;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.Cell;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.CellUtil;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.HBaseConfiguration;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.client.Result;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.client.Scan;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.filter.CompareFilter;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.filter.Filter;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.filter.PrefixFilter;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.filter.RegexStringComparator;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.filter.RowFilter;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>import org.apache.hadoop.hbase.io.ImmutableBytesWritable;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>import org.apache.hadoop.io.IntWritable;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>import org.apache.hadoop.io.Text;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>import org.apache.hadoop.mapreduce.Job;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>import org.apache.hadoop.mapreduce.Reducer;<a name="line.46"></a>
+<span class="sourceLineNo">047</span>import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;<a name="line.48"></a>
+<span class="sourceLineNo">049</span>import org.apache.hadoop.util.Tool;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>import org.apache.hadoop.util.ToolRunner;<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span>import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;<a name="line.52"></a>
 <span class="sourceLineNo">053</span><a name="line.53"></a>
-<span class="sourceLineNo">054</span>/**<a name="line.54"></a>
-<span class="sourceLineNo">055</span> * A job with a a map and reduce phase to count cells in a table.<a name="line.55"></a>
-<span class="sourceLineNo">056</span> * The counter lists the following stats for a given table:<a name="line.56"></a>
-<span class="sourceLineNo">057</span> * &lt;pre&gt;<a name="line.57"></a>
-<span class="sourceLineNo">058</span> * 1. Total number of rows in the table<a name="line.58"></a>
-<span class="sourceLineNo">059</span> * 2. Total number of CFs across all rows<a name="line.59"></a>
-<span class="sourceLineNo">060</span> * 3. Total qualifiers across all rows<a name="line.60"></a>
-<span class="sourceLineNo">061</span> * 4. Total occurrence of each CF<a name="line.61"></a>
-<span class="sourceLineNo">062</span> * 5. Total occurrence  of each qualifier<a name="line.62"></a>
-<span class="sourceLineNo">063</span> * 6. Total number of versions of each qualifier.<a name="line.63"></a>
-<span class="sourceLineNo">064</span> * &lt;/pre&gt;<a name="line.64"></a>
-<span class="sourceLineNo">065</span> *<a name="line.65"></a>
-<span class="sourceLineNo">066</span> * The cellcounter can take optional parameters to use a user<a name="line.66"></a>
-<span class="sourceLineNo">067</span> * supplied row/family/qualifier string to use in the report and<a name="line.67"></a>
-<span class="sourceLineNo">068</span> * second a regex based or prefix based row filter to restrict the<a name="line.68"></a>
-<span class="sourceLineNo">069</span> * count operation to a limited subset of rows from the table or a<a name="line.69"></a>
-<span class="sourceLineNo">070</span> * start time and/or end time to limit the count to a time range.<a name="line.70"></a>
-<span class="sourceLineNo">071</span> */<a name="line.71"></a>
-<span class="sourceLineNo">072</span>@InterfaceAudience.Public<a name="line.72"></a>
-<span class="sourceLineNo">073</span>public class CellCounter extends Configured implements Tool {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>  private static final Log LOG =<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    LogFactory.getLog(CellCounter.class.getName());<a name="line.75"></a>
-<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>/**<a name="line.55"></a>
+<span class="sourceLineNo">056</span> * A job with a a map and reduce phase to count cells in a table.<a name="line.56"></a>
+<span class="sourceLineNo">057</span> * The counter lists the following stats for a given table:<a name="line.57"></a>
+<span class="sourceLineNo">058</span> * &lt;pre&gt;<a name="line.58"></a>
+<span class="sourceLineNo">059</span> * 1. Total number of rows in the table<a name="line.59"></a>
+<span class="sourceLineNo">060</span> * 2. Total number of CFs across all rows<a name="line.60"></a>
+<span class="sourceLineNo">061</span> * 3. Total qualifiers across all rows<a name="line.61"></a>
+<span class="sourceLineNo">062</span> * 4. Total occurrence of each CF<a name="line.62"></a>
+<span class="sourceLineNo">063</span> * 5. Total occurrence  of each qualifier<a name="line.63"></a>
+<span class="sourceLineNo">064</span> * 6. Total number of versions of each qualifier.<a name="line.64"></a>
+<span class="sourceLineNo">065</span> * &lt;/pre&gt;<a name="line.65"></a>
+<span class="sourceLineNo">066</span> *<a name="line.66"></a>
+<span class="sourceLineNo">067</span> * The cellcounter can take optional parameters to use a user<a name="line.67"></a>
+<span class="sourceLineNo">068</span> * supplied row/family/qualifier string to use in the report and<a name="line.68"></a>
+<span class="sourceLineNo">069</span> * second a regex based or prefix based row filter to restrict the<a name="line.69"></a>
+<span class="sourceLineNo">070</span> * count operation to a limited subset of rows from the table or a<a name="line.70"></a>
+<span class="sourceLineNo">071</span> * start time and/or end time to limit the count to a time range.<a name="line.71"></a>
+<span class="sourceLineNo">072</span> */<a name="line.72"></a>
+<span class="sourceLineNo">073</span>@InterfaceAudience.Public<a name="line.73"></a>
+<span class="sourceLineNo">074</span>public class CellCounter extends Configured implements Tool {<a name="line.74"></a>
+<span class="sourceLineNo">075</span>  private static final Log LOG =<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    LogFactory.getLog(CellCounter.class.getName());<a name="line.76"></a>
 <span class="sourceLineNo">077</span><a name="line.77"></a>
-<span class="sourceLineNo">078</span>  /**<a name="line.78"></a>
-<span class="sourceLineNo">079</span>   * Name of this 'program'.<a name="line.79"></a>
-<span class="sourceLineNo">080</span>   */<a name="line.80"></a>
-<span class="sourceLineNo">081</span>  static final String NAME = "CellCounter";<a name="line.81"></a>
-<span class="sourceLineNo">082</span><a name="line.82"></a>
-<span class="sourceLineNo">083</span>  private final static String JOB_NAME_CONF_KEY = "mapreduce.job.name";<a name="line.83"></a>
-<span class="sourceLineNo">084</span><a name="line.84"></a>
-<span class="sourceLineNo">085</span>  /**<a name="line.85"></a>
-<span class="sourceLineNo">086</span>   * Mapper that runs the count.<a name="line.86"></a>
-<span class="sourceLineNo">087</span>   */<a name="line.87"></a>
-<span class="sourceLineNo">088</span>  static class CellCounterMapper<a name="line.88"></a>
-<span class="sourceLineNo">089</span>  extends TableMapper&lt;Text, IntWritable&gt; {<a name="line.89"></a>
-<span class="sourceLineNo">090</span>    /**<a name="line.90"></a>
-<span class="sourceLineNo">091</span>     * Counter enumeration to count the actual rows.<a name="line.91"></a>
-<span class="sourceLineNo">092</span>     */<a name="line.92"></a>
-<span class="sourceLineNo">093</span>    public static enum Counters {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>      ROWS,<a name="line.94"></a>
-<span class="sourceLineNo">095</span>      CELLS<a name="line.95"></a>
-<span class="sourceLineNo">096</span>    }<a name="line.96"></a>
-<span class="sourceLineNo">097</span><a name="line.97"></a>
-<span class="sourceLineNo">098</span>    private Configuration conf;<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    private String separator;<a name="line.99"></a>
-<span class="sourceLineNo">100</span><a name="line.100"></a>
-<span class="sourceLineNo">101</span>    // state of current row, family, column needs to persist across map() invocations<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    // in order to properly handle scanner batching, where a single qualifier may have too<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    // many versions for a single map() call<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    private byte[] lastRow;<a name="line.104"></a>
-<span class="sourceLineNo">105</span>    private String currentRowKey;<a name="line.105"></a>
-<span class="sourceLineNo">106</span>    byte[] currentFamily = null;<a name="line.106"></a>
-<span class="sourceLineNo">107</span>    String currentFamilyName = null;<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    byte[] currentQualifier = null;<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    // family + qualifier<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    String currentQualifierName = null;<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    // rowkey + family + qualifier<a name="line.111"></a>
-<span class="sourceLineNo">112</span>    String currentRowQualifierName = null;<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>    @Override<a name="line.114"></a>
-<span class="sourceLineNo">115</span>    protected void setup(Context context) throws IOException, InterruptedException {<a name="line.115"></a>
-<span class="sourceLineNo">116</span>      conf = context.getConfiguration();<a name="line.116"></a>
-<span class="sourceLineNo">117</span>      separator = conf.get("ReportSeparator",":");<a name="line.117"></a>
-<span class="sourceLineNo">118</span>    }<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>     * Maps the data.<a name="line.121"></a>
-<span class="sourceLineNo">122</span>     *<a name="line.122"></a>
-<span class="sourceLineNo">123</span>     * @param row     The current table row key.<a name="line.123"></a>
-<span class="sourceLineNo">124</span>     * @param values  The columns.<a name="line.124"></a>
-<span class="sourceLineNo">125</span>     * @param context The current context.<a name="line.125"></a>
-<span class="sourceLineNo">126</span>     * @throws IOException When something is broken with the data.<a name="line.126"></a>
-<span class="sourceLineNo">127</span>     * @see org.apache.hadoop.mapreduce.Mapper#map(KEYIN, VALUEIN,<a name="line.127"></a>
-<span class="sourceLineNo">128</span>     *      org.apache.hadoop.mapreduce.Mapper.Context)<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>    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="NP_NULL_ON_SOME_PATH",<a name="line.132"></a>
-<span class="sourceLineNo">133</span>      justification="Findbugs is blind to the Precondition null check")<a name="line.133"></a>
-<span class="sourceLineNo">134</span>    public void map(ImmutableBytesWritable row, Result values,<a name="line.134"></a>
-<span class="sourceLineNo">135</span>                    Context context)<a name="line.135"></a>
-<span class="sourceLineNo">136</span>        throws IOException {<a name="line.136"></a>
-<span class="sourceLineNo">137</span>      Preconditions.checkState(values != null,<a name="line.137"></a>
-<span class="sourceLineNo">138</span>          "values passed to the map is null");<a name="line.138"></a>
-<span class="sourceLineNo">139</span><a name="line.139"></a>
-<span class="sourceLineNo">140</span>      try {<a name="line.140"></a>
-<span class="sourceLineNo">141</span>        byte[] currentRow = values.getRow();<a name="line.141"></a>
-<span class="sourceLineNo">142</span>        if (lastRow == null || !Bytes.equals(lastRow, currentRow)) {<a name="line.142"></a>
-<span class="sourceLineNo">143</span>          lastRow = currentRow;<a name="line.143"></a>
-<span class="sourceLineNo">144</span>          currentRowKey = Bytes.toStringBinary(currentRow);<a name="line.144"></a>
-<span class="sourceLineNo">145</span>          currentFamily = null;<a name="line.145"></a>
-<span class="sourceLineNo">146</span>          currentQualifier = null;<a name="line.146"></a>
-<span class="sourceLineNo">147</span>          context.getCounter(Counters.ROWS).increment(1);<a name="line.147"></a>
-<span class="sourceLineNo">148</span>          context.write(new Text("Total ROWS"), new IntWritable(1));<a name="line.148"></a>
-<span class="sourceLineNo">149</span>        }<a name="line.149"></a>
-<span class="sourceLineNo">150</span>        if (!values.isEmpty()) {<a name="line.150"></a>
-<span class="sourceLineNo">151</span>          int cellCount = 0;<a name="line.151"></a>
-<span class="sourceLineNo">152</span>          for (Cell value : values.listCells()) {<a name="line.152"></a>
-<span class="sourceLineNo">153</span>            cellCount++;<a name="line.153"></a>
-<span class="sourceLineNo">154</span>            if (currentFamily == null || !CellUtil.matchingFamily(value, currentFamily)) {<a name="line.154"></a>
-<span class="sourceLineNo">155</span>              currentFamily = CellUtil.cloneFamily(value);<a name="line.155"></a>
-<span class="sourceLineNo">156</span>              currentFamilyName = Bytes.toStringBinary(currentFamily);<a name="line.156"></a>
-<span class="sourceLineNo">157</span>              currentQualifier = null;<a name="line.157"></a>
-<span class="sourceLineNo">158</span>              context.getCounter("CF", currentFamilyName).increment(1);<a name="line.158"></a>
-<span class="sourceLineNo">159</span>              if (1 == context.getCounter("CF", currentFamilyName).getValue()) {<a name="line.159"></a>
-<span class="sourceLineNo">160</span>                context.write(new Text("Total Families Across all Rows"), new IntWritable(1));<a name="line.160"></a>
-<span class="sourceLineNo">161</span>                context.write(new Text(currentFamily), new IntWritable(1));<a name="line.161"></a>
-<span class="sourceLineNo">162</span>              }<a name="line.162"></a>
-<span class="sourceLineNo">163</span>            }<a name="line.163"></a>
-<span class="sourceLineNo">164</span>            if (currentQualifier == null || !CellUtil.matchingQualifier(value, currentQualifier)) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>              currentQualifier = CellUtil.cloneQualifier(value);<a name="line.165"></a>
-<span class="sourceLineNo">166</span>              currentQualifierName = currentFamilyName + separator +<a name="line.166"></a>
-<span class="sourceLineNo">167</span>                  Bytes.toStringBinary(currentQualifier);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>              currentRowQualifierName = currentRowKey + separator + currentQualifierName;<a name="line.168"></a>
-<span class="sourceLineNo">169</span><a name="line.169"></a>
-<span class="sourceLineNo">170</span>              context.write(new Text("Total Qualifiers across all Rows"),<a name="line.170"></a>
-<span class="sourceLineNo">171</span>                  new IntWritable(1));<a name="line.171"></a>
-<span class="sourceLineNo">172</span>              context.write(new Text(currentQualifierName), new IntWritable(1));<a name="line.172"></a>
-<span class="sourceLineNo">173</span>            }<a name="line.173"></a>
-<span class="sourceLineNo">174</span>            // Increment versions<a name="line.174"></a>
-<span class="sourceLineNo">175</span>            context.write(new Text(currentRowQualifierName + "_Versions"), new IntWritable(1));<a name="line.175"></a>
-<span class="sourceLineNo">176</span>          }<a name="line.176"></a>
-<span class="sourceLineNo">177</span>          context.getCounter(Counters.CELLS).increment(cellCount);<a name="line.177"></a>
-<span class="sourceLineNo">178</span>        }<a name="line.178"></a>
-<span class="sourceLineNo">179</span>      } catch (InterruptedException e) {<a name="line.179"></a>
-<span class="sourceLineNo">180</span>        e.printStackTrace();<a name="line.180"></a>
-<span class="sourceLineNo">181</span>      }<a name="line.181"></a>
-<span class="sourceLineNo">182</span>    }<a name="line.182"></a>
-<span class="sourceLineNo">183</span>  }<a name="line.183"></a>
-<span class="sourceLineNo">184</span><a name="line.184"></a>
-<span class="sourceLineNo">185</span>  static class IntSumReducer&lt;Key&gt; extends Reducer&lt;Key, IntWritable,<a name="line.185"></a>
-<span class="sourceLineNo">186</span>      Key, IntWritable&gt; {<a name="line.186"></a>
-<span class="sourceLineNo">187</span><a name="line.187"></a>
-<span class="sourceLineNo">188</span>    private IntWritable result = new IntWritable();<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    public void reduce(Key key, Iterable&lt;IntWritable&gt; values,<a name="line.189"></a>
-<span class="sourceLineNo">190</span>      Context context)<a name="line.190"></a>
-<span class="sourceLineNo">191</span>    throws IOException, InterruptedException {<a name="line.191"></a>
-<span class="sourceLineNo">192</span>      int sum = 0;<a name="line.192"></a>
-<span class="sourceLineNo">193</span>      for (IntWritable val : values) {<a name="line.193"></a>
-<span class="sourceLineNo">194</span>        sum += val.get();<a name="line.194"></a>
-<span class="sourceLineNo">195</span>      }<a name="line.195"></a>
-<span class="sourceLineNo">196</span>      result.set(sum);<a name="line.196"></a>
-<span class="sourceLineNo">197</span>      context.write(key, result);<a name="line.197"></a>
-<span class="sourceLineNo">198</span>    }<a name="line.198"></a>
-<span class="sourceLineNo">199</span>  }<a name="line.199"></a>
-<span class="sourceLineNo">200</span><a name="line.200"></a>
-<span class="sourceLineNo">201</span>  /**<a name="line.201"></a>
-<span class="sourceLineNo">202</span>   * Sets up the actual job.<a name="line.202"></a>
-<span class="sourceLineNo">203</span>   *<a name="line.203"></a>
-<span class="sourceLineNo">204</span>   * @param conf The current configuration.<a name="line.204"></a>
-<span class="sourceLineNo">205</span>   * @param args The command line parameters.<a name="line.205"></a>
-<span class="sourceLineNo">206</span>   * @return The newly created job.<a name="line.206"></a>
-<span class="sourceLineNo">207</span>   * @throws IOException When setting up the job fails.<a name="line.207"></a>
-<span class="sourceLineNo">208</span>   */<a name="line.208"></a>
-<span class="sourceLineNo">209</span>  public static Job createSubmittableJob(Configuration conf, String[] args)<a name="line.209"></a>
-<span class="sourceLineNo">210</span>      throws IOException {<a name="line.210"></a>
-<span class="sourceLineNo">211</span>    String tableName = args[0];<a name="line.211"></a>
-<span class="sourceLineNo">212</span>    Path outputDir = new Path(args[1]);<a name="line.212"></a>
-<span class="sourceLineNo">213</span>    String reportSeparatorString = (args.length &gt; 2) ? args[2]: ":";<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    conf.set("ReportSeparator", reportSeparatorString);<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    Job job = Job.getInstance(conf, conf.get(JOB_NAME_CONF_KEY, NAME + "_" + tableName));<a name="line.215"></a>
-<span class="sourceLineNo">216</span>    job.setJarByClass(CellCounter.class);<a name="line.216"></a>
-<span class="sourceLineNo">217</span>    Scan scan = getConfiguredScanForJob(conf, args);<a name="line.217"></a>
-<span class="sourceLineNo">218</span>    TableMapReduceUtil.initTableMapperJob(tableName, scan,<a name="line.218"></a>
-<span class="sourceLineNo">219</span>        CellCounterMapper.class, ImmutableBytesWritable.class, Result.class, job);<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    job.setNumReduceTasks(1);<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    job.setMapOutputKeyClass(Text.class);<a name="line.221"></a>
-<span class="sourceLineNo">222</span>    job.setMapOutputValueClass(IntWritable.class);<a name="line.222"></a>
-<span class="sourceLineNo">223</span>    job.setOutputFormatClass(TextOutputFormat.class);<a name="line.223"></a>
-<span class="sourceLineNo">224</span>    job.setOutputKeyClass(Text.class);<a name="line.224"></a>
-<span class="sourceLineNo">225</span>    job.setOutputValueClass(IntWritable.class);<a name="line.225"></a>
-<span class="sourceLineNo">226</span>    FileOutputFormat.setOutputPath(job, outputDir);<a name="line.226"></a>
-<span class="sourceLineNo">227</span>    job.setReducerClass(IntSumReducer.class);<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    return job;<a name="line.228"></a>
-<span class="sourceLineNo">229</span>  }<a name="line.229"></a>
-<span class="sourceLineNo">230</span><a name="line.230"></a>
-<span class="sourceLineNo">231</span>  private static Scan getConfiguredScanForJob(Configuration conf, String[] args)<a name="line.231"></a>
-<span class="sourceLineNo">232</span>      throws IOException {<a name="line.232"></a>
-<span class="sourceLineNo">233</span>    // create scan with any properties set from TableInputFormat<a name="line.233"></a>
-<span class="sourceLineNo">234</span>    Scan s = TableInputFormat.createScanFromConfiguration(conf);<a name="line.234"></a>
-<span class="sourceLineNo">235</span>    // Set Scan Versions<a name="line.235"></a>
-<span class="sourceLineNo">236</span>    if (conf.get(TableInputFormat.SCAN_MAXVERSIONS) == null) {<a name="line.236"></a>
-<span class="sourceLineNo">237</span>      // default to all versions unless explicitly set<a name="line.237"></a>
-<span class="sourceLineNo">238</span>      s.setMaxVersions(Integer.MAX_VALUE);<a name="line.238"></a>
-<span class="sourceLineNo">239</span>    }<a name="line.239"></a>
-<span class="sourceLineNo">240</span>    s.setCacheBlocks(false);<a name="line.240"></a>
-<span class="sourceLineNo">241</span>    // Set RowFilter or Prefix Filter if applicable.<a name="line.241"></a>
-<span class="sourceLineNo">242</span>    Filter rowFilter = getRowFilter(args);<a name="line.242"></a>
-<span class="sourceLineNo">243</span>    if (rowFilter!= null) {<a name="line.243"></a>
-<span class="sourceLineNo">244</span>      LOG.info("Setting Row Filter for counter.");<a name="line.244"></a>
-<span class="sourceLineNo">245</span>      s.setFilter(rowFilter);<a name="line.245"></a>
-<span class="sourceLineNo">246</span>    }<a name="line.246"></a>
-<span class="sourceLineNo">247</span>    // Set TimeRange if defined<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    long timeRange[] = getTimeRange(args);<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    if (timeRange != null) {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>      LOG.info("Setting TimeRange for counter.");<a name="line.250"></a>
-<span class="sourceLineNo">251</span>      s.setTimeRange(timeRange[0], timeRange[1]);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    }<a name="line.252"></a>
-<span class="sourceLineNo">253</span>    return s;<a name="line.253"></a>
-<span class="sourceLineNo">254</span>  }<a name="line.254"></a>
+<span class="sourceLineNo">078</span><a name="line.78"></a>
+<span class="sourceLineNo">079</span>  /**<a name="line.79"></a>
+<span class="sourceLineNo">080</span>   * Name of this 'program'.<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   */<a name="line.81"></a>
+<span class="sourceLineNo">082</span>  static final String NAME = "CellCounter";<a name="line.82"></a>
+<span class="sourceLineNo">083</span><a name="line.83"></a>
+<span class="sourceLineNo">084</span>  private final static String JOB_NAME_CONF_KEY = "mapreduce.job.name";<a name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>  /**<a name="line.86"></a>
+<span class="sourceLineNo">087</span>   * Mapper that runs the count.<a name="line.87"></a>
+<span class="sourceLineNo">088</span>   */<a name="line.88"></a>
+<span class="sourceLineNo">089</span>  static class CellCounterMapper<a name="line.89"></a>
+<span class="sourceLineNo">090</span>  extends TableMapper&lt;Text, IntWritable&gt; {<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    /**<a name="line.91"></a>
+<span class="sourceLineNo">092</span>     * Counter enumeration to count the actual rows.<a name="line.92"></a>
+<span class="sourceLineNo">093</span>     */<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    public static enum Counters {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      ROWS,<a name="line.95"></a>
+<span class="sourceLineNo">096</span>      CELLS<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    }<a name="line.97"></a>
+<span class="sourceLineNo">098</span><a name="line.98"></a>
+<span class="sourceLineNo">099</span>    private Configuration conf;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    private String separator;<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span>    // state of current row, family, column needs to persist across map() invocations<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    // in order to properly handle scanner batching, where a single qualifier may have too<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    // many versions for a single map() call<a name="line.104"></a>
+<span class="sourceLineNo">105</span>    private byte[] lastRow;<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    private String currentRowKey;<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    byte[] currentFamily = null;<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    String currentFamilyName = null;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>    byte[] currentQualifier = null;<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    // family + qualifier<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    String currentQualifierName = null;<a name="line.111"></a>
+<span class="sourceLineNo">112</span>    // rowkey + family + qualifier<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    String currentRowQualifierName = null;<a name="line.113"></a>
+<span class="sourceLineNo">114</span><a name="line.114"></a>
+<span class="sourceLineNo">115</span>    @Override<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    protected void setup(Context context) throws IOException, InterruptedException {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>      conf = context.getConfiguration();<a name="line.117"></a>
+<span class="sourceLineNo">118</span>      separator = conf.get("ReportSeparator",":");<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>    /**<a name="line.121"></a>
+<span class="sourceLineNo">122</span>     * Maps the data.<a name="line.122"></a>
+<span class="sourceLineNo">123</span>     *<a name="line.123"></a>
+<span class="sourceLineNo">124</span>     * @param row     The current table row key.<a name="line.124"></a>
+<span class="sourceLineNo">125</span>     * @param values  The columns.<a name="line.125"></a>
+<span class="sourceLineNo">126</span>     * @param context The current context.<a name="line.126"></a>
+<span class="sourceLineNo">127</span>     * @throws IOException When something is broken with the data.<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>    @Override<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="NP_NULL_ON_SOME_PATH",<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      justification="Findbugs is blind to the Precondition null check")<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    public void map(ImmutableBytesWritable row, Result values,<a name="line.133"></a>
+<span class="sourceLineNo">134</span>                    Context context)<a name="line.134"></a>
+<span class="sourceLineNo">135</span>        throws IOException {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>      Preconditions.checkState(values != null,<a name="line.136"></a>
+<span class="sourceLineNo">137</span>          "values passed to the map is null");<a name="line.137"></a>
+<span class="sourceLineNo">138</span><a name="line.138"></a>
+<span class="sourceLineNo">139</span>      try {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        byte[] currentRow = values.getRow();<a name="line.140"></a>
+<span class="sourceLineNo">141</span>        if (lastRow == null || !Bytes.equals(lastRow, currentRow)) {<a name="line.141"></a>
+<span class="sourceLineNo">142</span>          lastRow = currentRow;<a name="line.142"></a>
+<span class="sourceLineNo">143</span>          currentRowKey = Bytes.toStringBinary(currentRow);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>          currentFamily = null;<a name="line.144"></a>
+<span class="sourceLineNo">145</span>          currentQualifier = null;<a name="line.145"></a>
+<span class="sourceLineNo">146</span>          context.getCounter(Counters.ROWS).increment(1);<a name="line.146"></a>
+<span class="sourceLineNo">147</span>          context.write(new Text("Total ROWS"), new IntWritable(1));<a name="line.147"></a>
+<span class="sourceLineNo">148</span>        }<a name="line.148"></a>
+<span class="sourceLineNo">149</span>        if (!values.isEmpty()) {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>          int cellCount = 0;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>          for (Cell value : values.listCells()) {<a name="line.151"></a>
+<span class="sourceLineNo">152</span>            cellCount++;<a name="line.152"></a>
+<span class="sourceLineNo">153</span>            if (currentFamily == null || !CellUtil.matchingFamily(value, currentFamily)) {<a name="line.153"></a>
+<span class="sourceLineNo">154</span>              currentFamily = CellUtil.cloneFamily(value);<a name="line.154"></a>
+<span class="sourceLineNo">155</span>              currentFamilyName = Bytes.toStringBinary(currentFamily);<a name="line.155"></a>
+<span class="sourceLineNo">156</span>              currentQualifier = null;<a name="line.156"></a>
+<span class="sourceLineNo">157</span>              context.getCounter("CF", currentFamilyName).increment(1);<a name="line.157"></a>
+<span class="sourceLineNo">158</span>              if (1 == context.getCounter("CF", currentFamilyName).getValue()) {<a name="line.158"></a>
+<span class="sourceLineNo">159</span>                context.write(new Text("Total Families Across all Rows"), new IntWritable(1));<a name="line.159"></a>
+<span class="sourceLineNo">160</span>                context.write(new Text(currentFamily), new IntWritable(1));<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 (currentQualifier == null || !CellUtil.matchingQualifier(value, currentQualifier)) {<a name="line.163"></a>
+<span class="sourceLineNo">164</span>              currentQualifier = CellUtil.cloneQualifier(value);<a name="line.164"></a>
+<span class="sourceLineNo">165</span>              currentQualifierName = currentFamilyName + separator +<a name="line.165"></a>
+<span class="sourceLineNo">166</span>                  Bytes.toStringBinary(currentQualifier);<a name="line.166"></a>
+<span class="sourceLineNo">167</span>              currentRowQualifierName = currentRowKey + separator + currentQualifierName;<a name="line.167"></a>
+<span class="sourceLineNo">168</span><a name="line.168"></a>
+<span class="sourceLineNo">169</span>              context.write(new Text("Total Qualifiers across all Rows"),<a name="line.169"></a>
+<span class="sourceLineNo">170</span>                  new IntWritable(1));<a name="line.170"></a>
+<span class="sourceLineNo">171</span>              context.write(new Text(currentQualifierName), new IntWritable(1));<a name="line.171"></a>
+<span class="sourceLineNo">172</span>            }<a name="line.172"></a>
+<span class="sourceLineNo">173</span>            // Increment versions<a name="line.173"></a>
+<span class="sourceLineNo">174</span>            context.write(new Text(currentRowQualifierName + "_Versions"), new IntWritable(1));<a name="line.174"></a>
+<span class="sourceLineNo">175</span>          }<a name="line.175"></a>
+<span class="sourceLineNo">176</span>          context.getCounter(Counters.CELLS).increment(cellCount);<a name="line.176"></a>
+<span class="sourceLineNo">177</span>        }<a name="line.177"></a>
+<span class="sourceLineNo">178</span>      } catch (InterruptedException e) {<a name="line.178"></a>
+<span class="sourceLineNo">179</span>        e.printStackTrace();<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>  }<a name="line.182"></a>
+<span class="sourceLineNo">183</span><a name="line.183"></a>
+<span class="sourceLineNo">184</span>  static class IntSumReducer&lt;Key&gt; extends Reducer&lt;Key, IntWritable,<a name="line.184"></a>
+<span class="sourceLineNo">185</span>      Key, IntWritable&gt; {<a name="line.185"></a>
+<span class="sourceLineNo">186</span><a name="line.186"></a>
+<span class="sourceLineNo">187</span>    private IntWritable result = new IntWritable();<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    public void reduce(Key key, Iterable&lt;IntWritable&gt; values,<a name="line.188"></a>
+<span class="sourceLineNo">189</span>      Context context)<a name="line.189"></a>
+<span class="sourceLineNo">190</span>    throws IOException, InterruptedException {<a name="line.190"></a>
+<span class="sourceLineNo">191</span>      int sum = 0;<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      for (IntWritable val : values) {<a name="line.192"></a>
+<span class="sourceLineNo">193</span>        sum += val.get();<a name="line.193"></a>
+<span class="sourceLineNo">194</span>      }<a name="line.194"></a>
+<span class="sourceLineNo">195</span>      result.set(sum);<a name="line.195"></a>
+<span class="sourceLineNo">196</span>      context.write(key, result);<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    }<a name="line.197"></a>
+<span class="sourceLineNo">198</span>  }<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span>  /**<a name="line.200"></a>
+<span class="sourceLineNo">201</span>   * Sets up the actual job.<a name="line.201"></a>
+<span class="sourceLineNo">202</span>   *<a name="line.202"></a>
+<span class="sourceLineNo">203</span>   * @param conf The current configuration.<a name="line.203"></a>
+<span class="sourceLineNo">204</span>   * @param args The command line parameters.<a name="line.204"></a>
+<span class="sourceLineNo">205</span>   * @return The newly created job.<a name="line.205"></a>
+<span class="sourceLineNo">206</span>   * @throws IOException When setting up the job fails.<a name="line.206"></a>
+<span class="sourceLineNo">207</span>   */<a name="line.207"></a>
+<span class="sourceLineNo">208</span>  public static Job createSubmittableJob(Configuration conf, String[] args)<a name="line.208"></a>
+<span class="sourceLineNo">209</span>      throws IOException {<a name="line.209"></a>
+<span class="sourceLineNo">210</span>    String tableName = args[0];<a name="line.210"></a>
+<span class="sourceLineNo">211</span>    Path outputDir = new Path(args[1]);<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    String reportSeparatorString = (args.length &gt; 2) ? args[2]: ":";<a name="line.212"></a>
+<span class="sourceLineNo">213</span>    conf.set("ReportSeparator", reportSeparatorString);<a name="line.213"></a>
+<span class="sourceLineNo">214</span>    Job job = Job.getInstance(conf, conf.get(JOB_NAME_CONF_KEY, NAME + "_" + tableName));<a name="line.214"></a>
+<span class="sourceLineNo">215</span>    job.setJarByClass(CellCounter.class);<a name="line.215"></a>
+<span class="sourceLineNo">216</span>    Scan scan = getConfiguredScanForJob(conf, args);<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    TableMapReduceUtil.initTableMapperJob(tableName, scan,<a name="line.217"></a>
+<span class="sourceLineNo">218</span>        CellCounterMapper.class, ImmutableBytesWritable.class, Result.class, job);<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    job.setNumReduceTasks(1);<a name="line.219"></a>
+<span class="sourceLineNo">220</span>    job.setMapOutputKeyClass(Text.class);<a name="line.220"></a>
+<span class="sourceLineNo">221</span>    job.setMapOutputValueClass(IntWritable.class);<a name="line.221"></a>
+<span class="sourceLineNo">222</span>    job.setOutputFormatClass(TextOutputFormat.class);<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    job.setOutputKeyClass(Text.class);<a name="line.223"></a>
+<span class="sourceLineNo">224</span>    job.setOutputValueClass(IntWritable.class);<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    FileOutputFormat.setOutputPath(job, outputDir);<a name="line.225"></a>
+<span class="sourceLineNo">226</span>    job.setReducerClass(IntSumReducer.class);<a name="line.226"></a>
+<span class="sourceLineNo">227</span>    return job;<a name="line.227"></a>
+<span class="sourceLineNo">228</span>  }<a name="line.228"></a>
+<span class="sourceLineNo">229</span><a name="line.229"></a>
+<span class="sourceLineNo">230</span>  private static Scan getConfiguredScanForJob(Configuration conf, String[] args)<a name="line.230"></a>
+<span class="sourceLineNo">231</span>      throws IOException {<a name="line.231"></a>
+<span class="sourceLineNo">232</span>    // create scan with any properties set from TableInputFormat<a name="line.232"></a>
+<span class="sourceLineNo">233</span>    Scan s = TableInputFormat.createScanFromConfiguration(conf);<a name="line.233"></a>
+<span class="sourceLineNo">234</span>    // Set Scan Versions<a name="line.234"></a>
+<span class="sourceLineNo">235</span>    if (conf.get(TableInputFormat.SCAN_MAXVERSIONS) == null) {<a name="line.235"></a>
+<span class="sourceLineNo">236</span>      // default to all versions unless explicitly set<a name="line.236"></a>
+<span class="sourceLineNo">237</span>      s.setMaxVersions(Integer.MAX_VALUE);<a name="line.237"></a>
+<span class="sourceLineNo">238</span>    }<a name="line.238"></a>
+<span class="sourceLineNo">239</span>    s.setCacheBlocks(false);<a name="line.239"></a>
+<span class="sourceLineNo">240</span>    // Set RowFilter or Prefix Filter if applicable.<a name="line.240"></a>
+<span class="sourceLineNo">241</span>    Filter rowFilter = getRowFilter(args);<a name="line.241"></a>
+<span class="sourceLineNo">242</span>    if (rowFilter!= null) {<a name="line.242"></a>
+<span class="sourceLineNo">243</span>      LOG.info("Setting Row Filter for counter.");<a name="line.243"></a>
+<span class="sourceLineNo">244</span>      s.setFilter(rowFilter);<a name="line.244"></a>
+<span class="sourceLineNo">245</span>    }<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    // Set TimeRange if defined<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    long timeRange[] = getTimeRange(args);<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    if (timeRange != null) {<a name="line.248"></a>
+<span class="sourceLineNo">249</span>      LOG.info("Setting TimeRange for counter.");<a name="line.249"></a>
+<span class="sourceLineNo">250</span>      s.setTimeRange(timeRange[0], timeRange[1]);<a name="line.250"></a>
+<span class="sourceLineNo">251</span>    }<a name="line.251"></a>
+<span class="sourceLineNo">252</span>    return s;<a name="line.252"></a>
+<span class="sourceLineNo">253</span>  }<a name="line.253"></a>
+<span class="sourceLineNo">254</span><a name="line.254"></a>
 <span class="sourceLineNo">255</span><a name="line.255"></a>
-<span class="sourceLineNo">256</span><a name="line.256"></a>
-<span class="sourceLineNo">257</span>  private static Filter getRowFilter(String[] args) {<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    Filter rowFilter = null;<a name="line.258"></a>
-<span class="sourceLineNo">259</span>    String filterCriteria = (args.length &gt; 3) ? args[3]: null;<a name="line.259"></a>
-<span class="sourceLineNo">260</span>    if (filterCriteria == null) return null;<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    if (filterCriteria.startsWith("^")) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>      String regexPattern = filterCriteria.substring(1, filterCriteria.length());<a name="line.262"></a>
-<span class="sourceLineNo">263</span>      rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, new RegexStringComparator(regexPattern));<a name="line.263"></a>
-<span class="sourceLineNo">264</span>    } else {<a name="line.264"></a>
-<span class="sourceLineNo">265</span>      rowFilter = new PrefixFilter(Bytes.toBytesBinary(filterCriteria));<a name="line.265"></a>
-<span class="sourceLineNo">266</span>    }<a name="line.266"></a>
-<span class="sourceLineNo">267</span>    return rowFilter;<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>  private static long[] getTimeRange(String[] args) throws IOException {<a name="line.270"></a>
-<span class="sourceLineNo">271</span>    final String startTimeArgKey = "--starttime=";<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    final String endTimeArgKey = "--endtime=";<a name="line.272"></a>
-<span class="sourceLineNo">273</span>    long startTime = 0L;<a name="line.273"></a>
-<span class="sourceLineNo">274</span>    long endTime = 0L;<a name="line.274"></a>
-<span class="sourceLineNo">275</span><a name="line.275"></a>
-<span class="sourceLineNo">276</span>    for (int i = 1; i &lt; args.length; i++) {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>      System.out.println("i:" + i + "arg[i]" + args[i]);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>      if (args[i].startsWith(startTimeArgKey)) {<a name="line.278"></a>
-<span class="sourceLineNo">279</span>        startTime = Long.parseLong(args[i].substring(startTimeArgKey.length()));<a name="line.279"></a>
-<span class="sourceLineNo">280</span>      }<a name="line.280"></a>
-<span class="sourceLineNo">281</span>      if (args[i].startsWith(endTimeArgKey)) {<a name="line.281"></a>
-<span class="sourceLineNo">282</span>        endTime = Long.parseLong(args[i].substring(endTimeArgKey.length()));<a name="line.282"></a>
-<span class="sourceLineNo">283</span>      }<a name="line.283"></a>
-<span class="sourceLineNo">284</span>    }<a name="line.284"></a>
-<span class="sourceLineNo">285</span><a name="line.285"></a>
-<span class="sourceLineNo">286</span>    if (startTime == 0 &amp;&amp; endTime == 0)<a name="line.286"></a>
-<span class="sourceLineNo">287</span>      return null;<a name="line.287"></a>
-<span class="sourceLineNo">288</span><a name="line.288"></a>
-<span class="sourceLineNo">289</span>    endTime = endTime == 0 ? HConstants.LATEST_TIMESTAMP : endTime;<a name="line.289"></a>
-<span class="sourceLineNo">290</span>    return new long [] {startTime, endTime};<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>  @Override<a name="line.293"></a>
-<span class="sourceLineNo">294</span>  public int run(String[] args) throws Exception {<a name="line.294"></a>
-<span class="sourceLineNo">295</span>    if (args.length &lt; 2) {<a name="line.295"></a>
-<span class="sourceLineNo">296</span>      System.err.println("ERROR: Wrong number of parameters: " + args.length);<a name="line.296"></a>
-<span class="sourceLineNo">297</span>      System.err.println("Usage: CellCounter ");<a name="line.297"></a>
-<span class="sourceLineNo">298</span>      System.err.println("       &lt;tablename&gt; &lt;outputDir&gt; &lt;reportSeparator&gt; [^[regex pattern] or " +<a name="line.298"></a>
-<span class="sourceLineNo">299</span>        "[Prefix] for row filter]] --starttime=[starttime] --endtime=[endtime]");<a name="line.299"></a>
-<span class="sourceLineNo">300</span>      System.err.println("  Note: -D properties will be applied to the conf used. ");<a name="line.300"></a>
-<span class="sourceLineNo">301</span>      System.err.println("  Additionally, all of the SCAN properties from TableInputFormat");<a name="line.301"></a>
-<span class="sourceLineNo">302</span>      System.err.println("  can be specified to get fine grained control on what is counted..");<a name="line.302"></a>
-<span class="sourceLineNo">303</span>      System.err.println("   -D " + TableInputFormat.SCAN_ROW_START + "=&lt;rowkey&gt;");<a name="line.303"></a>
-<span class="sourceLineNo">304</span>      System.err.println("   -D " + TableInputFormat.SCAN_ROW_STOP + "=&lt;rowkey&gt;");<a name="line.304"></a>
-<span class="sourceLineNo">305</span>      System.err.println("   -D " + TableInputFormat.SCAN_COLUMNS + "=\"&lt;col1&gt; &lt;col2&gt;...\"");<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      System.err.println("   -D " + TableInputFormat.SCAN_COLUMN_FAMILY + "=&lt;family1&gt;,&lt;family2&gt;, ...");<a name="line.306"></a>
-<span class="sourceLineNo">307</span>      System.err.println("   -D " + TableInputFormat.SCAN_TIMESTAMP + "=&lt;timestamp&gt;");<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      System.err.println("   -D " + TableInputFormat.SCAN_TIMERANGE_START + "=&lt;timestamp&gt;");<a name="line.308"></a>
-<span class="sourceLineNo">309</span>      System.err.println("   -D " + TableInputFormat.SCAN_TIMERANGE_END + "=&lt;timestamp&gt;");<a name="line.309"></a>
-<span class="sourceLineNo">310</span>      System.err.println("   -D " + TableInputFormat.SCAN_MAXVERSIONS + "=&lt;count&gt;");<a name="line.310"></a>
-<span class="sourceLineNo">311</span>      System.err.println("   -D " + TableInputFormat.SCAN_CACHEDROWS + "=&lt;count&gt;");<a name="line.311"></a>
-<span class="sourceLineNo">312</span>      System.err.println("   -D " + TableInputFormat.SCAN_BATCHSIZE + "=&lt;count&gt;");<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      System.err.println(" &lt;reportSeparator&gt; parameter can be used to override the default report separator " +<a name="line.313"></a>
-<span class="sourceLineNo">314</span>          "string : used to separate the rowId/column family name and qualifier name.");<a name="line.314"></a>
-<span class="sourceLineNo">315</span>      System.err.println(" [^[regex pattern] or [Prefix] parameter can be used to limit the cell counter count " +<a name="line.315"></a>
-<span class="sourceLineNo">316</span>          "operation to a limited subset of rows from the table based on regex or prefix pattern.");<a name="line.316"></a>
-<span class="sourceLineNo">317</span>      return -1;<a name="line.317"></a>
-<span class="sourceLineNo">318</span>    }<a name="line.318"></a>
-<span class="sourceLineNo">319</span>    Job job = createSubmittableJob(getConf(), args);<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    return (job.waitForCompletion(true) ? 0 : 1);<a name="line.320"></a>
-<span class="sourceLineNo">321</span>  }<a name="line.321"></a>
-<span class="sourceLineNo">322</span><a name="line.322"></a>
-<span class="sourceLineNo">323</span>  /**<a name="line.323"></a>
-<span class="sourceLineNo">324</span>   * Main entry point.<a name="line.324"></a>
-<span class="sourceLineNo">325</span>   * @param args The command line parameters.<a name="line.325"></a>
-<span class="sourceLineNo">326</span>   * @throws Exception When running the job fails.<a name="line.326"></a>
-<span class="sourceLineNo">327</span>   */<a name="line.327"></a>
-<span class="sourceLineNo">328</span>  public static void main(String[] args) throws Exception {<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    int errCode = ToolRunner.run(HBaseConfiguration.create(), new CellCounter(), args);<a name="line.329"></a>
-<span class="sourceLineNo">330</span>    System.exit(errCode);<a name="line.330"></a>
-<span class="sourceLineNo">331</span>  }<a name="line.331"></a>
-<span class="sourceLineNo">332</span><a name="line.332"></a>
-<span class="sourceLineNo">333</span>}<a name="line.333"></a>
+<span class="sourceLineNo">256</span>  private static Filter getRowFilter(String[] args) {<a name="line.256"></a>
+<span class="sourceLineNo">257</span>    Filter rowFilter = null;<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    String filterCriteria = (args.length &gt; 3) ? args[3]: null;<a name="line.258"></a>
+<span class="sourceLineNo">259</span>    if (filterCriteria == null) return null;<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    if (filterCriteria.startsWith("^")) {<a name="line.260"></a>
+<span class="sourceLineNo">261</span>      String regexPattern = filterCriteria.substring(1, filterCriteria.length());<a name="line.261"></a>
+<span class="sourceLineNo">262</span>      rowFilter = new RowFilter(CompareOperator.EQUAL, new RegexStringComparator(regexPattern));<a name="line.262"></a>
+<span class="sourceLineNo">263</span>    } else {<a name="line.263"></a>
+<span class="sourceLineNo">264</span>      rowFilter = new PrefixFilter(Bytes.toBytesBinary(filterCriteria));<a name="line.264"></a>
+<span class="sourceLineNo">265</span>    }<a name="line.265"></a>
+<span class="sourceLineNo">266</span>    return rowFilter;<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>  private static long[] getTimeRange(String[] args) throws IOException {<a name="line.269"></a>
+<span class="sourceLineNo">270</span>    final String startTimeArgKey = "--starttime=";<a name="line.270"></a>
+<span class="sourceLineNo">271</span>    final String endTimeArgKey = "--endtime=";<a name="line.271"></a>
+<span class="sourceLineNo">272</span>    long startTime = 0L;<a name="line.272"></a>
+<span class="sourceLineNo">273</span>    long endTime = 0L;<a name="line.273"></a>
+<span class="sourceLineNo">274</span><a name="line.274"></a>
+<span class="sourceLineNo">275</span>    for (int i = 1; i &lt; args.length; i++) {<a name="line.275"></a>
+<span class="sourceLineNo">276</span>      System.out.println("i:" + i + "arg[i]" + args[i]);<a name="line.276"></a>
+<span class="sourceLineNo">277</span>      if (args[i].startsWith(startTimeArgKey)) {<a name="line.277"></a>
+<span class="sourceLineNo">278</span>        startTime = Long.parseLong(args[i].substring(startTimeArgKey.length()));<a name="line.278"></a>
+<span class="sourceLineNo">279</span>      }<a name="line.279"></a>
+<span class="sourceLineNo">280</span>      if (args[i].startsWith(endTimeArgKey)) {<a name="line.280"></a>
+<span class="sourceLineNo">281</span>        endTime = Long.parseLong(args[i].substring(endTimeArgKey.length()));<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><a name="line.284"></a>
+<span class="sourceLineNo">285</span>    if (startTime == 0 &amp;&amp; endTime == 0)<a name="line.285"></a>
+<span class="sourceLineNo">286</span>      return null;<a name="line.286"></a>
+<span class="sourceLineNo">287</span><a name="line.287"></a>
+<span class="sourceLineNo">288</span>    endTime = endTime == 0 ? HConstants.LATEST_TIMESTAMP : endTime;<a name="line.288"></a>
+<span class="sourceLineNo">289</span>    return new long [] {startTime, endTime};<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>  @Override<a name="line.292"></a>
+<span class="sourceLineNo">293</span>  public int run(String[] args) throws Exception {<a name="line.293"></a>
+<span class="sourceLineNo">294</span>    if (args.length &lt; 2) {<a name="line.294"></a>
+<span class="sourceLineNo">295</span>      System.err.println("ERROR: Wrong number of parameters: " + args.length);<a name="line.295"></a>
+<span class="sourceLineNo">296</span>      System.err.println("Usage: CellCounter ");<a name="line.296"></a>
+<span class="sourceLineNo">297</span>      System.err.println("       &lt;tablename&gt; &lt;outputDir&gt; &lt;reportSeparator&gt; [^[regex pattern] or " +<a name="line.297"></a>
+<span class="sourceLineNo">298</span>        "[Prefix] for row filter]] --starttime=[starttime] --endtime=[endtime]");<a name="line.298"></a>
+<span class="sourceLineNo">299</span>      System.err.println("  Note: -D properties will be applied to the conf used. ");<a name="line.299"></a>
+<span class="sourceLineNo">300</span>      System.err.println("  Additionally, all of the SCAN properties from TableInputFormat");<a name="line.300"></a>
+<span class="sourceLineNo">301</span>      System.err.println("  can be specified to get fine grained control on what is counted..");<a name="line.301"></a>
+<span class="sourceLineNo">302</span>      System.err.println("   -D " + TableInputFormat.SCAN_ROW_START + "=&lt;rowkey&gt;");<a name="line.302"></a>
+<span class="sourceLineNo">303</span>      System.err.println("   -D " + TableInputFormat.SCAN_ROW_STOP + "=&lt;rowkey&gt;");<a name="line.303"></a>
+<span class="sourceLineNo">304</span>      System.err.println("   -D " + TableInputFormat.SCAN_COLUMNS + "=\"&lt;col1&gt; &lt;col2&gt;...\"");<a name="line.304"></a>
+<span class="sourceLineNo">305</span>      System.err.println("   -D " + TableInputFormat.SCAN_COLUMN_FAMILY + "=&lt;family1&gt;,&lt;family2&gt;, ...");<a name="line.305"></a>
+<span class="sourceLineNo">306</span>      System.err.println("   -D " + TableInputFormat.SCAN_TIMESTAMP + "=&lt;timestamp&gt;");<a name="line.306"></a>
+<span class="sourceLineNo">307</span>      System.err.println("   -D " + TableInputFormat.SCAN_TIMERANGE_START + "=&lt;timestamp&gt;");<a name="line.307"></a>
+<span class="sourceLineNo">308</span>      System.err.println("   -D " + TableInputFormat.SCAN_TIMERANGE_END + "=&lt;timestamp&gt;");<a name="line.308"></a>
+<span class="sourceLineNo">309</span>      System.err.println("   -D " + TableInputFormat.SCAN_MAXVERSIONS + "=&lt;count&gt;");<a name="line.309"></a>
+<span class="sourceLineNo">310</span>      System.err.println("   -D " + TableInputFormat.SCAN_CACHEDROWS + "=&lt;count&gt;");<a name="line.310"></a>
+<span class="sourceLineNo">311</span>      System.err.println("   -D " + TableInputFormat.SCAN_BATCHSIZE + "=&lt;count&gt;");<a name="line.311"></a>
+<span class="sourceLineNo">312</span>      System.err.println(" &lt;reportSeparator&gt; parameter can be used to override the default report separator " +<a name="line.312"></a>
+<span class="sourceLineNo">313</span>          "string : used to separate the rowId/column family name and qualifier name.");<a name="line.313"></a>
+<span class="sourceLineNo">314</span>      System.err.println(" [^[regex pattern] or [Prefix] parameter can be used to limit the cell counter count " +<a name="line.314"></a>
+<span class="sourceLineNo">315</span>          "operation to a limited subset of rows from the table based on regex or prefix pattern.");<a name="line.315"></a>
+<span class="sourceLineNo">316</span>      return -1;<a name="line.316"></a>
+<span class="sourceLineNo">317</span>    }<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    Job job = createSubmittableJob(getConf(), args);<a name="line.318"></a>
+<span class="sourceLineNo">319</span>    return (job.waitForCompletion(true) ? 0 : 1);<a name="line.319"></a>
+<span class="sourceLineNo">320</span>  }<a name="line.320"></a>
+<span class="sourceLineNo">321</span><a name="line.321"></a>
+<span class="sourceLineNo">322</span>  /**<a name="line.322"></a>
+<span class="sourceLineNo">323</span>   * Main entry point.<a name="line.323"></a>
+<span class="sourceLineNo">324</span>   * @param args The command line parameters.<a name="line.324"></a>
+<span class="sourceLineNo">325</span>   * @throws Exception When running the job fails.<a name="line.325"></a>
+<span class="sourceLineNo">326</span>   */<a name="line.326"></a>
+<span class="sourceLineNo">327</span>  public static void main(String[] args) throws Exception {<a name="line.327"></a>
+<span class="sourceLineNo">328</span>    int errCode = ToolRunner.run(HBaseConfiguration.create(), new CellCounter(), args);<a name="line.328"></a>
+<span class="sourceLineNo">329</span>    System.exit(errCode);<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>}<a name="line.332"></a>
 
 
 


Mime
View raw message