hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jamal B <jm151...@gmail.com>
Subject Weird ColumnPaginationFilter Results
Date Thu, 19 Jan 2012 13:18:29 GMT
Hi, I was hoping that someone would be able to help me out with this weird
behavior.  I have some code which attempts to page through a set of columns
in the same column family, making N number of get requests to retrieve 32
columns at a time.  I noticed that for some reason, the data being returned
from the get request does't match my expected behavior.  So I created a
simple unit test like beow to figure out what's going on with my code. The
simple test code is:

@Test
public void getPage() throws IOException{

int limit = 5, start =0;
byte[] rowKey = Bytes
                .toBytes("row1");
        HTable table = new HTable(TABLE_NAME);

             Get get = new Get(rowKey);
get.addFamily(COLUMN_FAMILY_NAME_BYTES);

              Filter filter = new ColumnPaginationFilter(limit, start);
              get.setFilter(filter);

              Result result = table.get(get);

              NavigableMap<byte[], byte[]> map = result
              .getFamilyMap(COLUMN_FAMILY_NAME_BYTES);
              LOG.info("size: " + map.size());
              Iterator<byte[]> iter = map.keySet().iterator();

             while (iter.hasNext())
                 LOG.info("qual:" + Bytes.toString(iter.next()));


              table.close();
             Assert.assertTrue(map.size() == 5);
}

When I run this test code against a test table where row1 contains 12
columns in the column family, I don't receive the expected 5 columns, but
instead I only receive 3.  If I re-run this test, adjusting the limit
higher & higher (5,6, 7, 8, etc..) I receive more columns being returned
which is weird.  It almost seems as if there is some position index being
used by the client???

Any ideas as to what I need to do in my code, or configuration to
consistently retrieve a batch of columns?  Am I using the
ColumnPaginationFilter correctly?

Any help would be greatly appreciated.

Thanks

I am using hbase 0.90.4 & apache hadoop 0.20.205.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message