title: Fetch fixed rows with filters in Hbase using Java
body: <p>In my application, I need to fetch the data from Hbase and I need to apply filters on that data and I need to have a limit on the number of records to be fetched. Below is the code that I have written:</p>
  
  <pre><code>ResultScanner scanner = null;
  HTable table = null;
  Configuration config = HBaseConfiguration.create();
              config.set("hbase.zookeeper.quorum", hbaseServer);
              config.set("hbase.zookeeper.property.clientPort", hbasePort);
          FilterList list = new FilterList(FilterList.Operator.MUST_PASS_ALL);
          table = new HTable(config, "TableName");
  SingleColumnValueFilter filter = new SingleColumnValueFilter(Bytes.toBytes("ColumnName"),
                      Bytes.toBytes("ColumnName"), CompareFilter.CompareOp.EQUAL,
                      new BinaryComparator(Bytes.toBytes(String.valueOf("FilterValue"))));
              SingleColumnValueFilter filter1 = new SingleColumnValueFilter(Bytes.toBytes("ColumnName2"),
                      Bytes.toBytes("ColumnName2"), CompareFilter.CompareOp.EQUAL,
                      new BinaryComparator(Bytes.toBytes(String.valueOf("FilterValue2"))));
              list.addFilter(filter);
              list.addFilter(filter1);
   Scan scan = new Scan();
   scan.setFilter(list);
   scan.setFilter(new PageFilter(10));
   scanner = table.getScanner(scan);
  </code></pre>
  
  <p>The filters are working perfectly fine but I am getting the complete dataset. 
  scan.setFilter(new PageFilter(10)) is not working. I need to pull only top 10 records that are matching the filters provided. I have also tried:</p>
  
  <pre><code>scan.setMaxResultSize(10);
  scan.setMaxResultsPerColumnFamily(10);
  </code></pre>
  
  <p>But none of these are also working. What could be the issue with the above code?</p>