'This is filter for testing "in-memory HBase".
This method is called from scan() when \'QualifierFilter\' is found in
the \'filter\' argument'

@staticmethod
def QualifierFilter(args, rows):

    op = args[0]
    value = args[1]
    is_regex = False
    if value.startswith('binaryprefix:'):
        value = value[len('binaryprefix:'):]
    if value.startswith('regexstring:'):
        value = value[len('regexstring:'):]
        is_regex = True
    column = ('f:' + value)
    r = {}
    for row in rows:
        data = rows[row]
        r_data = {}
        for key in data:
            if (((op == '=') and key.startswith(column)) or ((op == '>=') and (key >= column)) or ((op == '<=') and (key <= column)) or ((op == '>') and (key > column)) or ((op == '<') and (key < column)) or (is_regex and re.search(value, key))):
                r_data[key] = data[key]
            else:
                raise ceilometer.NotImplementedError(("In-memory    QualifierFilter    doesn't    support    the    %s    operation    yet" % op))
        if r_data:
            r[row] = r_data
    return r
