hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Koch <ogd...@googlemail.com>
Subject Modifying SingleColumnValueFilter to not include matched KV
Date Wed, 23 Jan 2013 23:47:30 GMT

As part of some custom filter building I took the source
of SingleColumnValueFilter (HBase 0.92.1) [1] and wanted to tweak it to NOT
return the matched column - thus essentially make it
equivalent SingleColumnValueExcludeFilter. I thought it must be trivial but
for some reason I cannot get it to work. The filter always includes the
matched KV pair.

The only change I made is in the filterKeyValue(<KeyValue>) method by
editing the last statement (see below):

public ReturnCode filterKeyValue(KeyValue keyValue) {
    if (this.matchedColumn) {
      // We already found and matched the single column, all keys now pass
      return ReturnCode.INCLUDE;
    } else if (this.latestVersionOnly && this.foundColumn) {
      // We found but did not match the single column, skip to next row
      return ReturnCode.NEXT_ROW;
    if (!keyValue.matchingColumn(this.columnFamily, this.columnQualifier)) {
      return ReturnCode.INCLUDE;
    foundColumn = true;
    if (filterColumnValue(keyValue.getBuffer(),
        keyValue.getValueOffset(), keyValue.getValueLength())) {
      return this.latestVersionOnly? ReturnCode.NEXT_ROW:
    this.matchedColumn = true;
    // Commented line below to NOT include matched column
    // return ReturnCode.INCLUDE;
    return ReturnCode.SKIP;

Is this expected behavior? What am I overlooking here? By the way - how can
I sensibly debug filters. I tried using the Log instance but the output
does not show up in the region server's output.

Thank you,



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