protected void initialize(JobConf job, String table) throws IOException {
      Connection connection = ConnectionFactory.createConnection(HBaseConfiguration.create(job));
      TableName tableName = TableName.valueOf(table);
      // mandatory
      initializeTable(connection, tableName);
      byte[][] inputColumns = new byte[][] { Bytes.toBytes("columnA"), Bytes.toBytes("columnB") };
      // mandatory
      setInputColumns(inputColumns);
      Filter exampleFilter =
        new RowFilter(CompareOperator.EQUAL, new RegexStringComparator("aa.*"));
      // optional
      setRowFilter(exampleFilter);
    }
Verify the example we present in javadocs on TableInputFormatBase
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java