hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [50/51] [partial] hbase-site git commit: Published site at 52fd70500e0a00e273e2ec0c09d7c914b89432ce.
Date Thu, 24 Mar 2016 15:55:30 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f30982bd/apidocs/src-html/org/apache/hadoop/hbase/filter/TimestampsFilter.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/filter/TimestampsFilter.html b/apidocs/src-html/org/apache/hadoop/hbase/filter/TimestampsFilter.html
index 37f1302..a5616d0 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/filter/TimestampsFilter.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/filter/TimestampsFilter.html
@@ -31,163 +31,214 @@
 <span class="sourceLineNo">023</span>import java.util.TreeSet;<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.classification.InterfaceStability;<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.protobuf.generated.FilterProtos;<a name="line.29"></a>
-<span class="sourceLineNo">030</span><a name="line.30"></a>
-<span class="sourceLineNo">031</span>import com.google.common.base.Preconditions;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import com.google.protobuf.InvalidProtocolBufferException;<a name="line.32"></a>
-<span class="sourceLineNo">033</span><a name="line.33"></a>
-<span class="sourceLineNo">034</span>/**<a name="line.34"></a>
-<span class="sourceLineNo">035</span> * Filter that returns only cells whose timestamp (version) is<a name="line.35"></a>
-<span class="sourceLineNo">036</span> * in the specified list of timestamps (versions).<a name="line.36"></a>
-<span class="sourceLineNo">037</span> * &lt;p&gt;<a name="line.37"></a>
-<span class="sourceLineNo">038</span> * Note: Use of this filter overrides any time range/time stamp<a name="line.38"></a>
-<span class="sourceLineNo">039</span> * options specified using {@link org.apache.hadoop.hbase.client.Get#setTimeRange(long, long)},<a name="line.39"></a>
-<span class="sourceLineNo">040</span> * {@link org.apache.hadoop.hbase.client.Scan#setTimeRange(long, long)}, {@link org.apache.hadoop.hbase.client.Get#setTimeStamp(long)},<a name="line.40"></a>
-<span class="sourceLineNo">041</span> * or {@link org.apache.hadoop.hbase.client.Scan#setTimeStamp(long)}.<a name="line.41"></a>
-<span class="sourceLineNo">042</span> */<a name="line.42"></a>
-<span class="sourceLineNo">043</span>@InterfaceAudience.Public<a name="line.43"></a>
-<span class="sourceLineNo">044</span>@InterfaceStability.Stable<a name="line.44"></a>
-<span class="sourceLineNo">045</span>public class TimestampsFilter extends FilterBase {<a name="line.45"></a>
-<span class="sourceLineNo">046</span><a name="line.46"></a>
-<span class="sourceLineNo">047</span>  TreeSet&lt;Long&gt; timestamps;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>  private static final int MAX_LOG_TIMESTAMPS = 5;<a name="line.48"></a>
-<span class="sourceLineNo">049</span><a name="line.49"></a>
-<span class="sourceLineNo">050</span>  // Used during scans to hint the scan to stop early<a name="line.50"></a>
-<span class="sourceLineNo">051</span>  // once the timestamps fall below the minTimeStamp.<a name="line.51"></a>
-<span class="sourceLineNo">052</span>  long minTimeStamp = Long.MAX_VALUE;<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>   * Constructor for filter that retains only those<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   * cells whose timestamp (version) is in the specified<a name="line.56"></a>
-<span class="sourceLineNo">057</span>   * list of timestamps.<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   *<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   * @param timestamps<a name="line.59"></a>
-<span class="sourceLineNo">060</span>   */<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  public TimestampsFilter(List&lt;Long&gt; timestamps) {<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    for (Long timestamp : timestamps) {<a name="line.62"></a>
-<span class="sourceLineNo">063</span>      Preconditions.checkArgument(timestamp &gt;= 0, "must be positive %s", timestamp);<a name="line.63"></a>
-<span class="sourceLineNo">064</span>    }<a name="line.64"></a>
-<span class="sourceLineNo">065</span>    this.timestamps = new TreeSet&lt;Long&gt;(timestamps);<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    init();<a name="line.66"></a>
-<span class="sourceLineNo">067</span>  }<a name="line.67"></a>
-<span class="sourceLineNo">068</span><a name="line.68"></a>
-<span class="sourceLineNo">069</span>  /**<a name="line.69"></a>
-<span class="sourceLineNo">070</span>   * @return the list of timestamps<a name="line.70"></a>
-<span class="sourceLineNo">071</span>   */<a name="line.71"></a>
-<span class="sourceLineNo">072</span>  public List&lt;Long&gt; getTimestamps() {<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    List&lt;Long&gt; list = new ArrayList&lt;Long&gt;(timestamps.size());<a name="line.73"></a>
-<span class="sourceLineNo">074</span>    list.addAll(timestamps);<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    return list;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>  }<a name="line.76"></a>
-<span class="sourceLineNo">077</span><a name="line.77"></a>
-<span class="sourceLineNo">078</span>  private void init() {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    if (this.timestamps.size() &gt; 0) {<a name="line.79"></a>
-<span class="sourceLineNo">080</span>      minTimeStamp = this.timestamps.first();<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    }<a name="line.81"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.CellUtil;<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.classification.InterfaceStability;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.exceptions.DeserializationException;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.protobuf.generated.FilterProtos;<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>import com.google.common.base.Preconditions;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import com.google.protobuf.InvalidProtocolBufferException;<a name="line.33"></a>
+<span class="sourceLineNo">034</span><a name="line.34"></a>
+<span class="sourceLineNo">035</span>/**<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * Filter that returns only cells whose timestamp (version) is<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * in the specified list of timestamps (versions).<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * &lt;p&gt;<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * Note: Use of this filter overrides any time range/time stamp<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * options specified using {@link org.apache.hadoop.hbase.client.Get#setTimeRange(long, long)},<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * {@link org.apache.hadoop.hbase.client.Scan#setTimeRange(long, long)}, {@link org.apache.hadoop.hbase.client.Get#setTimeStamp(long)},<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * or {@link org.apache.hadoop.hbase.client.Scan#setTimeStamp(long)}.<a name="line.42"></a>
+<span class="sourceLineNo">043</span> */<a name="line.43"></a>
+<span class="sourceLineNo">044</span>@InterfaceAudience.Public<a name="line.44"></a>
+<span class="sourceLineNo">045</span>@InterfaceStability.Stable<a name="line.45"></a>
+<span class="sourceLineNo">046</span>public class TimestampsFilter extends FilterBase {<a name="line.46"></a>
+<span class="sourceLineNo">047</span><a name="line.47"></a>
+<span class="sourceLineNo">048</span>  private final boolean canHint;<a name="line.48"></a>
+<span class="sourceLineNo">049</span>  TreeSet&lt;Long&gt; timestamps;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>  private static final int MAX_LOG_TIMESTAMPS = 5;<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span>  // Used during scans to hint the scan to stop early<a name="line.52"></a>
+<span class="sourceLineNo">053</span>  // once the timestamps fall below the minTimeStamp.<a name="line.53"></a>
+<span class="sourceLineNo">054</span>  long minTimeStamp = Long.MAX_VALUE;<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>  /**<a name="line.56"></a>
+<span class="sourceLineNo">057</span>   * Constructor for filter that retains only the specified timestamps in the list.<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   * @param timestamps<a name="line.58"></a>
+<span class="sourceLineNo">059</span>   */<a name="line.59"></a>
+<span class="sourceLineNo">060</span>  public TimestampsFilter(List&lt;Long&gt; timestamps) {<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    this(timestamps, false);<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  }<a name="line.62"></a>
+<span class="sourceLineNo">063</span><a name="line.63"></a>
+<span class="sourceLineNo">064</span>  /**<a name="line.64"></a>
+<span class="sourceLineNo">065</span>   * Constructor for filter that retains only those<a name="line.65"></a>
+<span class="sourceLineNo">066</span>   * cells whose timestamp (version) is in the specified<a name="line.66"></a>
+<span class="sourceLineNo">067</span>   * list of timestamps.<a name="line.67"></a>
+<span class="sourceLineNo">068</span>   *<a name="line.68"></a>
+<span class="sourceLineNo">069</span>   * @param timestamps list of timestamps that are wanted.<a name="line.69"></a>
+<span class="sourceLineNo">070</span>   * @param canHint should the filter provide a seek hint? This can skip<a name="line.70"></a>
+<span class="sourceLineNo">071</span>   *                past delete tombstones, so it should only be used when that<a name="line.71"></a>
+<span class="sourceLineNo">072</span>   *                is not an issue ( no deletes, or don't care if data<a name="line.72"></a>
+<span class="sourceLineNo">073</span>   *                becomes visible)<a name="line.73"></a>
+<span class="sourceLineNo">074</span>   */<a name="line.74"></a>
+<span class="sourceLineNo">075</span>  public TimestampsFilter(List&lt;Long&gt; timestamps, boolean canHint) {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    for (Long timestamp : timestamps) {<a name="line.76"></a>
+<span class="sourceLineNo">077</span>      Preconditions.checkArgument(timestamp &gt;= 0, "must be positive %s", timestamp);<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    }<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    this.canHint = canHint;<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    this.timestamps = new TreeSet&lt;Long&gt;(timestamps);<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    init();<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>   * Gets the minimum timestamp requested by filter.<a name="line.85"></a>
-<span class="sourceLineNo">086</span>   * @return  minimum timestamp requested by filter.<a name="line.86"></a>
-<span class="sourceLineNo">087</span>   */<a name="line.87"></a>
-<span class="sourceLineNo">088</span>  public long getMin() {<a name="line.88"></a>
-<span class="sourceLineNo">089</span>    return minTimeStamp;<a name="line.89"></a>
-<span class="sourceLineNo">090</span>  }<a name="line.90"></a>
-<span class="sourceLineNo">091</span><a name="line.91"></a>
-<span class="sourceLineNo">092</span>  @Override<a name="line.92"></a>
-<span class="sourceLineNo">093</span>  public boolean filterRowKey(Cell cell) throws IOException {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>    // Impl in FilterBase might do unnecessary copy for Off heap backed Cells.<a name="line.94"></a>
-<span class="sourceLineNo">095</span>    return false;<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>  @Override<a name="line.98"></a>
-<span class="sourceLineNo">099</span>  public ReturnCode filterKeyValue(Cell v) {<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    if (this.timestamps.contains(v.getTimestamp())) {<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      return ReturnCode.INCLUDE;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    } else if (v.getTimestamp() &lt; minTimeStamp) {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>      // The remaining versions of this column are guaranteed<a name="line.103"></a>
-<span class="sourceLineNo">104</span>      // to be lesser than all of the other values.<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      return ReturnCode.NEXT_COL;<a name="line.105"></a>
-<span class="sourceLineNo">106</span>    }<a name="line.106"></a>
-<span class="sourceLineNo">107</span>    return ReturnCode.SKIP;<a name="line.107"></a>
-<span class="sourceLineNo">108</span>  }<a name="line.108"></a>
-<span class="sourceLineNo">109</span><a name="line.109"></a>
-<span class="sourceLineNo">110</span>  public static Filter createFilterFromArguments(ArrayList&lt;byte []&gt; filterArguments) {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    ArrayList&lt;Long&gt; timestamps = new ArrayList&lt;Long&gt;();<a name="line.111"></a>
-<span class="sourceLineNo">112</span>    for (int i = 0; i&lt;filterArguments.size(); i++) {<a name="line.112"></a>
-<span class="sourceLineNo">113</span>      long timestamp = ParseFilter.convertByteArrayToLong(filterArguments.get(i));<a name="line.113"></a>
-<span class="sourceLineNo">114</span>      timestamps.add(timestamp);<a name="line.114"></a>
-<span class="sourceLineNo">115</span>    }<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    return new TimestampsFilter(timestamps);<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  }<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  /**<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   * @return The filter serialized using pb<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   */<a name="line.121"></a>
-<span class="sourceLineNo">122</span>  public byte [] toByteArray() {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>    FilterProtos.TimestampsFilter.Builder builder =<a name="line.123"></a>
-<span class="sourceLineNo">124</span>      FilterProtos.TimestampsFilter.newBuilder();<a name="line.124"></a>
-<span class="sourceLineNo">125</span>    builder.addAllTimestamps(this.timestamps);<a name="line.125"></a>
-<span class="sourceLineNo">126</span>    return builder.build().toByteArray();<a name="line.126"></a>
-<span class="sourceLineNo">127</span>  }<a name="line.127"></a>
-<span class="sourceLineNo">128</span><a name="line.128"></a>
-<span class="sourceLineNo">129</span>  /**<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   * @param pbBytes A pb serialized {@link TimestampsFilter} instance<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * @return An instance of {@link TimestampsFilter} made from &lt;code&gt;bytes&lt;/code&gt;<a name="line.131"></a>
-<span class="sourceLineNo">132</span>   * @throws DeserializationException<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   * @see #toByteArray<a name="line.133"></a>
-<span class="sourceLineNo">134</span>   */<a name="line.134"></a>
-<span class="sourceLineNo">135</span>  public static TimestampsFilter parseFrom(final byte [] pbBytes)<a name="line.135"></a>
-<span class="sourceLineNo">136</span>  throws DeserializationException {<a name="line.136"></a>
-<span class="sourceLineNo">137</span>    FilterProtos.TimestampsFilter proto;<a name="line.137"></a>
-<span class="sourceLineNo">138</span>    try {<a name="line.138"></a>
-<span class="sourceLineNo">139</span>      proto = FilterProtos.TimestampsFilter.parseFrom(pbBytes);<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    } catch (InvalidProtocolBufferException e) {<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      throw new DeserializationException(e);<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    }<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    return new TimestampsFilter(proto.getTimestampsList());<a name="line.143"></a>
-<span class="sourceLineNo">144</span>  }<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>   * @param other<a name="line.147"></a>
-<span class="sourceLineNo">148</span>   * @return true if and only if the fields of the filter that are serialized<a name="line.148"></a>
-<span class="sourceLineNo">149</span>   * are equal to the corresponding fields in other.  Used for testing.<a name="line.149"></a>
-<span class="sourceLineNo">150</span>   */<a name="line.150"></a>
-<span class="sourceLineNo">151</span>  boolean areSerializedFieldsEqual(Filter o) {<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    if (o == this) return true;<a name="line.152"></a>
-<span class="sourceLineNo">153</span>    if (!(o instanceof TimestampsFilter)) return false;<a name="line.153"></a>
-<span class="sourceLineNo">154</span><a name="line.154"></a>
-<span class="sourceLineNo">155</span>    TimestampsFilter other = (TimestampsFilter)o;<a name="line.155"></a>
-<span class="sourceLineNo">156</span>    return this.getTimestamps().equals(other.getTimestamps());<a name="line.156"></a>
+<span class="sourceLineNo">085</span>   * @return the list of timestamps<a name="line.85"></a>
+<span class="sourceLineNo">086</span>   */<a name="line.86"></a>
+<span class="sourceLineNo">087</span>  public List&lt;Long&gt; getTimestamps() {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    List&lt;Long&gt; list = new ArrayList&lt;Long&gt;(timestamps.size());<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    list.addAll(timestamps);<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    return list;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  }<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>  private void init() {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    if (this.timestamps.size() &gt; 0) {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      minTimeStamp = this.timestamps.first();<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><a name="line.98"></a>
+<span class="sourceLineNo">099</span>  /**<a name="line.99"></a>
+<span class="sourceLineNo">100</span>   * Gets the minimum timestamp requested by filter.<a name="line.100"></a>
+<span class="sourceLineNo">101</span>   * @return  minimum timestamp requested by filter.<a name="line.101"></a>
+<span class="sourceLineNo">102</span>   */<a name="line.102"></a>
+<span class="sourceLineNo">103</span>  public long getMin() {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    return minTimeStamp;<a name="line.104"></a>
+<span class="sourceLineNo">105</span>  }<a name="line.105"></a>
+<span class="sourceLineNo">106</span><a name="line.106"></a>
+<span class="sourceLineNo">107</span>  @Override<a name="line.107"></a>
+<span class="sourceLineNo">108</span>  public boolean filterRowKey(Cell cell) throws IOException {<a name="line.108"></a>
+<span class="sourceLineNo">109</span>    // Impl in FilterBase might do unnecessary copy for Off heap backed Cells.<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    return false;<a name="line.110"></a>
+<span class="sourceLineNo">111</span>  }<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 ReturnCode filterKeyValue(Cell v) {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    if (this.timestamps.contains(v.getTimestamp())) {<a name="line.115"></a>
+<span class="sourceLineNo">116</span>      return ReturnCode.INCLUDE;<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    } else if (v.getTimestamp() &lt; minTimeStamp) {<a name="line.117"></a>
+<span class="sourceLineNo">118</span>      // The remaining versions of this column are guaranteed<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      // to be lesser than all of the other values.<a name="line.119"></a>
+<span class="sourceLineNo">120</span>      return ReturnCode.NEXT_COL;<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    }<a name="line.121"></a>
+<span class="sourceLineNo">122</span>    return canHint ? ReturnCode.SEEK_NEXT_USING_HINT : ReturnCode.SKIP;<a name="line.122"></a>
+<span class="sourceLineNo">123</span>  }<a name="line.123"></a>
+<span class="sourceLineNo">124</span><a name="line.124"></a>
+<span class="sourceLineNo">125</span><a name="line.125"></a>
+<span class="sourceLineNo">126</span>  /**<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   * Pick the next cell that the scanner should seek to. Since this can skip any number of cells<a name="line.127"></a>
+<span class="sourceLineNo">128</span>   * any of which can be a delete this can resurect old data.<a name="line.128"></a>
+<span class="sourceLineNo">129</span>   *<a name="line.129"></a>
+<span class="sourceLineNo">130</span>   * The method will only be used if canHint was set to true while creating the filter.<a name="line.130"></a>
+<span class="sourceLineNo">131</span>   *<a name="line.131"></a>
+<span class="sourceLineNo">132</span>   * @throws IOException This will never happen.<a name="line.132"></a>
+<span class="sourceLineNo">133</span>   */<a name="line.133"></a>
+<span class="sourceLineNo">134</span>  public Cell getNextCellHint(Cell currentCell) throws IOException {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>    if (!canHint) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>      return null;<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>    Long nextTimestampObject = timestamps.lower(currentCell.getTimestamp());<a name="line.139"></a>
+<span class="sourceLineNo">140</span><a name="line.140"></a>
+<span class="sourceLineNo">141</span>    if (nextTimestampObject == null) {<a name="line.141"></a>
+<span class="sourceLineNo">142</span>      // This should only happen if the current column's<a name="line.142"></a>
+<span class="sourceLineNo">143</span>      // timestamp is below the last one in the list.<a name="line.143"></a>
+<span class="sourceLineNo">144</span>      //<a name="line.144"></a>
+<span class="sourceLineNo">145</span>      // It should never happen as the filterKeyValue should return NEXT_COL<a name="line.145"></a>
+<span class="sourceLineNo">146</span>      // but it's always better to be extra safe and protect against future<a name="line.146"></a>
+<span class="sourceLineNo">147</span>      // behavioral changes.<a name="line.147"></a>
+<span class="sourceLineNo">148</span><a name="line.148"></a>
+<span class="sourceLineNo">149</span>      return CellUtil.createLastOnRowCol(currentCell);<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>    // Since we know the nextTimestampObject isn't null here there must still be<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    // timestamps that can be included. Cast the Long to a long and return the<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    // a cell with the current row/cf/col and the next found timestamp.<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    long nextTimestamp = nextTimestampObject;<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    return CellUtil.createFirstOnRowColTS(currentCell, nextTimestamp);<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>  @Override<a name="line.159"></a>
-<span class="sourceLineNo">160</span>  public String toString() {<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    return toString(MAX_LOG_TIMESTAMPS);<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>  protected String toString(int maxTimestamps) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    StringBuilder tsList = new StringBuilder();<a name="line.165"></a>
-<span class="sourceLineNo">166</span><a name="line.166"></a>
-<span class="sourceLineNo">167</span>    int count = 0;<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    for (Long ts : this.timestamps) {<a name="line.168"></a>
-<span class="sourceLineNo">169</span>      if (count &gt;= maxTimestamps) {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>        break;<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      }<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      ++count;<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      tsList.append(ts.toString());<a name="line.173"></a>
-<span class="sourceLineNo">174</span>      if (count &lt; this.timestamps.size() &amp;&amp; count &lt; maxTimestamps) {<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        tsList.append(", ");<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      }<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    }<a name="line.177"></a>
+<span class="sourceLineNo">159</span>  public static Filter createFilterFromArguments(ArrayList&lt;byte []&gt; filterArguments) {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    ArrayList&lt;Long&gt; timestamps = new ArrayList&lt;Long&gt;();<a name="line.160"></a>
+<span class="sourceLineNo">161</span>    for (int i = 0; i&lt;filterArguments.size(); i++) {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>      long timestamp = ParseFilter.convertByteArrayToLong(filterArguments.get(i));<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      timestamps.add(timestamp);<a name="line.163"></a>
+<span class="sourceLineNo">164</span>    }<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    return new TimestampsFilter(timestamps);<a name="line.165"></a>
+<span class="sourceLineNo">166</span>  }<a name="line.166"></a>
+<span class="sourceLineNo">167</span><a name="line.167"></a>
+<span class="sourceLineNo">168</span>  /**<a name="line.168"></a>
+<span class="sourceLineNo">169</span>   * @return The filter serialized using pb<a name="line.169"></a>
+<span class="sourceLineNo">170</span>   */<a name="line.170"></a>
+<span class="sourceLineNo">171</span>  public byte[] toByteArray() {<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    FilterProtos.TimestampsFilter.Builder builder =<a name="line.172"></a>
+<span class="sourceLineNo">173</span>        FilterProtos.TimestampsFilter.newBuilder();<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    builder.addAllTimestamps(this.timestamps);<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    builder.setCanHint(canHint);<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    return builder.build().toByteArray();<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>    return String.format("%s (%d/%d): [%s]", this.getClass().getSimpleName(),<a name="line.179"></a>
-<span class="sourceLineNo">180</span>        count, this.timestamps.size(), tsList.toString());<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">179</span>  /**<a name="line.179"></a>
+<span class="sourceLineNo">180</span>   * @param pbBytes A pb serialized {@link TimestampsFilter} instance<a name="line.180"></a>
+<span class="sourceLineNo">181</span>   *<a name="line.181"></a>
+<span class="sourceLineNo">182</span>   * @return An instance of {@link TimestampsFilter} made from &lt;code&gt;bytes&lt;/code&gt;<a name="line.182"></a>
+<span class="sourceLineNo">183</span>   * @see #toByteArray<a name="line.183"></a>
+<span class="sourceLineNo">184</span>   */<a name="line.184"></a>
+<span class="sourceLineNo">185</span>  public static TimestampsFilter parseFrom(final byte[] pbBytes)<a name="line.185"></a>
+<span class="sourceLineNo">186</span>      throws DeserializationException {<a name="line.186"></a>
+<span class="sourceLineNo">187</span>    FilterProtos.TimestampsFilter proto;<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    try {<a name="line.188"></a>
+<span class="sourceLineNo">189</span>      proto = FilterProtos.TimestampsFilter.parseFrom(pbBytes);<a name="line.189"></a>
+<span class="sourceLineNo">190</span>    } catch (InvalidProtocolBufferException e) {<a name="line.190"></a>
+<span class="sourceLineNo">191</span>      throw new DeserializationException(e);<a name="line.191"></a>
+<span class="sourceLineNo">192</span>    }<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    return new TimestampsFilter(proto.getTimestampsList(),<a name="line.193"></a>
+<span class="sourceLineNo">194</span>        proto.hasCanHint() &amp;&amp; proto.getCanHint());<a name="line.194"></a>
+<span class="sourceLineNo">195</span>  }<a name="line.195"></a>
+<span class="sourceLineNo">196</span><a name="line.196"></a>
+<span class="sourceLineNo">197</span>  /**<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   * @param other<a name="line.198"></a>
+<span class="sourceLineNo">199</span>   * @return true if and only if the fields of the filter that are serialized<a name="line.199"></a>
+<span class="sourceLineNo">200</span>   * are equal to the corresponding fields in other.  Used for testing.<a name="line.200"></a>
+<span class="sourceLineNo">201</span>   */<a name="line.201"></a>
+<span class="sourceLineNo">202</span>  boolean areSerializedFieldsEqual(Filter o) {<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    if (o == this) return true;<a name="line.203"></a>
+<span class="sourceLineNo">204</span>    if (!(o instanceof TimestampsFilter)) return false;<a name="line.204"></a>
+<span class="sourceLineNo">205</span><a name="line.205"></a>
+<span class="sourceLineNo">206</span>    TimestampsFilter other = (TimestampsFilter)o;<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    return this.getTimestamps().equals(other.getTimestamps());<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>  @Override<a name="line.210"></a>
+<span class="sourceLineNo">211</span>  public String toString() {<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    return toString(MAX_LOG_TIMESTAMPS);<a name="line.212"></a>
+<span class="sourceLineNo">213</span>  }<a name="line.213"></a>
+<span class="sourceLineNo">214</span><a name="line.214"></a>
+<span class="sourceLineNo">215</span>  protected String toString(int maxTimestamps) {<a name="line.215"></a>
+<span class="sourceLineNo">216</span>    StringBuilder tsList = new StringBuilder();<a name="line.216"></a>
+<span class="sourceLineNo">217</span><a name="line.217"></a>
+<span class="sourceLineNo">218</span>    int count = 0;<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    for (Long ts : this.timestamps) {<a name="line.219"></a>
+<span class="sourceLineNo">220</span>      if (count &gt;= maxTimestamps) {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>        break;<a name="line.221"></a>
+<span class="sourceLineNo">222</span>      }<a name="line.222"></a>
+<span class="sourceLineNo">223</span>      ++count;<a name="line.223"></a>
+<span class="sourceLineNo">224</span>      tsList.append(ts.toString());<a name="line.224"></a>
+<span class="sourceLineNo">225</span>      if (count &lt; this.timestamps.size() &amp;&amp; count &lt; maxTimestamps) {<a name="line.225"></a>
+<span class="sourceLineNo">226</span>        tsList.append(", ");<a name="line.226"></a>
+<span class="sourceLineNo">227</span>      }<a name="line.227"></a>
+<span class="sourceLineNo">228</span>    }<a name="line.228"></a>
+<span class="sourceLineNo">229</span><a name="line.229"></a>
+<span class="sourceLineNo">230</span>    return String.format("%s (%d/%d): [%s] canHint: [%b]", this.getClass().getSimpleName(),<a name="line.230"></a>
+<span class="sourceLineNo">231</span>        count, this.timestamps.size(), tsList.toString(), canHint);<a name="line.231"></a>
+<span class="sourceLineNo">232</span>  }<a name="line.232"></a>
+<span class="sourceLineNo">233</span>}<a name="line.233"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f30982bd/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
index 14327de..0a8e897 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/ExportSnapshot.html
@@ -1065,11 +1065,11 @@
 <span class="sourceLineNo">1057</span>    System.err.println("  -bandwidth              Limit bandwidth to this value in MB/second.");<a name="line.1057"></a>
 <span class="sourceLineNo">1058</span>    System.err.println();<a name="line.1058"></a>
 <span class="sourceLineNo">1059</span>    System.err.println("Examples:");<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>    System.err.println("  hbase " + getClass().getName() + " \\");<a name="line.1060"></a>
+<span class="sourceLineNo">1060</span>    System.err.println("  hbase snapshot export \\");<a name="line.1060"></a>
 <span class="sourceLineNo">1061</span>    System.err.println("    -snapshot MySnapshot -copy-to hdfs://srv2:8082/hbase \\");<a name="line.1061"></a>
 <span class="sourceLineNo">1062</span>    System.err.println("    -chuser MyUser -chgroup MyGroup -chmod 700 -mappers 16");<a name="line.1062"></a>
 <span class="sourceLineNo">1063</span>    System.err.println();<a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>    System.err.println("  hbase " + getClass().getName() + " \\");<a name="line.1064"></a>
+<span class="sourceLineNo">1064</span>    System.err.println("  hbase snapshot export \\");<a name="line.1064"></a>
 <span class="sourceLineNo">1065</span>    System.err.println("    -snapshot MySnapshot -copy-from hdfs://srv2:8082/hbase \\");<a name="line.1065"></a>
 <span class="sourceLineNo">1066</span>    System.err.println("    -copy-to hdfs://srv1:50070/hbase \\");<a name="line.1066"></a>
 <span class="sourceLineNo">1067</span>    System.exit(1);<a name="line.1067"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f30982bd/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html
index dc0de15..2662234 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/snapshot/SnapshotInfo.html
@@ -475,7 +475,7 @@
 <span class="sourceLineNo">467</span>  }<a name="line.467"></a>
 <span class="sourceLineNo">468</span><a name="line.468"></a>
 <span class="sourceLineNo">469</span>  private void printUsageAndExit() {<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    System.err.printf("Usage: bin/hbase %s [options]%n", getClass().getName());<a name="line.470"></a>
+<span class="sourceLineNo">470</span>    System.err.printf("Usage: bin/hbase snapshot info [options]%n");<a name="line.470"></a>
 <span class="sourceLineNo">471</span>    System.err.println(" where [options] are:");<a name="line.471"></a>
 <span class="sourceLineNo">472</span>    System.err.println("  -h|-help                Show this help and exit.");<a name="line.472"></a>
 <span class="sourceLineNo">473</span>    System.err.println("  -remote-dir             Root directory that contains the snapshots.");<a name="line.473"></a>
@@ -487,7 +487,7 @@
 <span class="sourceLineNo">479</span>    System.err.println("  -schema                 Describe the snapshotted table.");<a name="line.479"></a>
 <span class="sourceLineNo">480</span>    System.err.println();<a name="line.480"></a>
 <span class="sourceLineNo">481</span>    System.err.println("Examples:");<a name="line.481"></a>
-<span class="sourceLineNo">482</span>    System.err.println("  hbase " + getClass() + " \\");<a name="line.482"></a>
+<span class="sourceLineNo">482</span>    System.err.println("  hbase snapshot info \\");<a name="line.482"></a>
 <span class="sourceLineNo">483</span>    System.err.println("    -snapshot MySnapshot -files");<a name="line.483"></a>
 <span class="sourceLineNo">484</span>    System.exit(1);<a name="line.484"></a>
 <span class="sourceLineNo">485</span>  }<a name="line.485"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f30982bd/book.html
----------------------------------------------------------------------
diff --git a/book.html b/book.html
index bcc451c..9893165 100644
--- a/book.html
+++ b/book.html
@@ -33282,7 +33282,7 @@ The server will return cellblocks compressed using this same compressor as long
 <div id="footer">
 <div id="footer-text">
 Version 2.0.0-SNAPSHOT<br>
-Last updated 2016-03-23 14:32:09 UTC
+Last updated 2016-03-24 14:43:42 UTC
 </div>
 </div>
 </body>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f30982bd/bulk-loads.html
----------------------------------------------------------------------
diff --git a/bulk-loads.html b/bulk-loads.html
index 08f910a..b7e5c24 100644
--- a/bulk-loads.html
+++ b/bulk-loads.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20160323" />
+    <meta name="Date-Revision-yyyymmdd" content="20160324" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013;  
       Bulk Loads in Apache HBase (TM)
@@ -305,7 +305,7 @@ under the License. -->
                         <a href="http://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2016-03-23</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2016-03-24</li>
             </p>
                 </div>
 


Mime
View raw message