hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Marc Spaggiari (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-9782) ColumnPaginationFilter doesn't return the expected versions.
Date Wed, 16 Oct 2013 18:35:43 GMT

    [ https://issues.apache.org/jira/browse/HBASE-9782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13797090#comment-13797090
] 

Jean-Marc Spaggiari commented on HBASE-9782:
--------------------------------------------

The code below creates 10K version of the same cell then try to get the 25 first versions,
then the 25 next.

The first get call will only return 12 cells, and the 2nd one nothing. I will have expected
to get the 25 cells each time.

Tried on 0.94.12.

{code}
import java.io.IOException;
import java.util.ArrayList;

import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.ColumnPaginationFilter;
import org.apache.hadoop.hbase.util.Bytes;

public class TestPut {

  public static final byte[] CF = Bytes.toBytes("f1");
  public static final byte[] C = Bytes.toBytes("c");

  public static void main(String[] args) {
    HTable table;
    try {
      table = new HTable(HBaseConfiguration.create(),Bytes.toBytes("t1"));
      ArrayList<Put> puts = new ArrayList<Put>(10000);
      long time = System.currentTimeMillis();
      for (int i = 0; i < 10000; i++) {
        Put put  = new Put (Bytes.toBytes("rowid"));
        put.add(CF, C, time+i, Bytes.toBytes(i));
        puts.add(put);
      }
      table.put(puts);

      Get get = new Get (Bytes.toBytes("rowid"));
      get.setFilter(new ColumnPaginationFilter(25, 0));
      get.addColumn(CF, C);
      get.setMaxVersions(99999);
      Result result = table.get(get); 
      System.out.println(result.toString());
      for (KeyValue kv : result.list() ) {
              System.out.println( Bytes.toString( kv.getQualifier() ) + " : " + Bytes.toInt(
kv.getValue() ) );
      } 

      get = new Get (Bytes.toBytes("rowid"));
      get.setFilter(new ColumnPaginationFilter(25, 25));
      get.addColumn(CF, C);
      get.setMaxVersions(99999);
      result = table.get(get); 
      System.out.println(result.toString());
      for (KeyValue kv : result.list() ) {
              System.out.println( Bytes.toString( kv.getQualifier() ) + " : " + Bytes.toInt(
kv.getValue() ) );
      } 

      table.close();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
}
{code}

> ColumnPaginationFilter doesn't return the expected versions.
> ------------------------------------------------------------
>
>                 Key: HBASE-9782
>                 URL: https://issues.apache.org/jira/browse/HBASE-9782
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Jean-Marc Spaggiari
>            Assignee: Jean-Marc Spaggiari
>
> When ColumnPaginationFilter is used to paginate over the versions of a single row, it's
not returning the exected cells.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message