Database Reference
In-Depth Information
The following implementation shows the custom ilter created for comparing the
cell value with a speciied value:
public class CustomFilterImpl extends FilterBase {
private byte[] value = null;
private boolean filterRow = true;
public CustomFilterImpl() {
super();
}
// Set the value to compare
public CustomFilterImpl(byte[] value) {
this.value = value;
}
// Reset filter flag for each row
@Override
public void reset() {
this.filterRow = true;
}
@SuppressWarnings("deprecation")
@Override
public ReturnCode filterKeyValue(Cell cell) {
// When there is a matching value, then let the row pass.
if (Bytes.compareTo(value, cell.getValue()) == 0) {
filterRow = false;
}
// Always use include.
return ReturnCode.INCLUDE;
}
// Method for decision making based on the flag.
@Override
public boolean filterRow()
{
return filterRow;
}
 
Search WWH ::




Custom Search