Hi,
I have posted this same question at stackoverflow also, but still did not get a reply for that. Can someone please give me an idea of this?
I have plugged in Spring for Hadoop and it works well. Later I wanted to use a filter with a
object to scan the data from HBase like I have shown below.
There are rows in the Hbase table. But the returned list from above statement is always zero. When I debug the code, debug pointer did not come to the TestMapper class, My TestMapper class is below.
Why I'am getting zero records each and every time. Is this not the way how I should use the
object?
I have posted this same question at stackoverflow also, but still did not get a reply for that. Can someone please give me an idea of this?
I have plugged in Spring for Hadoop and it works well. Later I wanted to use a filter with a
Code:
org.apache.hadoop.hbase.client.Scan
Code:
String regEx = "^" + "Tom Hanks";
Filter regExFilter = new RowFilter(CompareFilter.CompareOp.EQUAL,
new RegexStringComparator(regEx));
Scan scanner = new Scan();
scanner.setFilter(regExFilter);
scanner.addColumn(Bytes.toBytes(dto.ColumnFamily()),
Bytes.toBytes(dto.getQualifier()));
scanner.addColumn(Bytes.toBytes(dto.ColumnFamily()),
Bytes.toBytes(dto.getQualifier()));
List<Object> list = hTemplate.find(dto.getableName(), scanner,
new TestMapper());
Code:
public class TestMapper implements RowMapper<Object> {
@Override
public Object mapRow(Result result, int arg1) throws Exception {
Test dto = Util.getDto();
SmallDto smallDto = new SmallDto();
int value = Util.getIntValue(result.getValue(
Bytes.toBytes(dto.getColumnFamily()),
Bytes.toBytes(dto.getCigaretteQual())));
smallDto.setValueCount(value);
return smallDto;
}
}
Code:
Scan