@Override
public boolean filterRowKey(byte[] buffer, int offset, int length) {
final StructRowKey structRowKey = indexDefinition.asStructRowKey();
structRowKey.iterateOver(buffer, offset);
final StructIterator fieldsIterator = structRowKey.iterator();
final List<IndexFieldDefinition> fieldDefinitions = indexDefinition.getFields();
// for all defined field definitions
for (IndexFieldDefinition field : fieldDefinitions) {
// check if the field should be filtered
if (indexFilter.getFields().contains(field.getName())) {
final Object nextField = fieldsIterator.next();
if (indexFilter.filterField(field.getName(), nextField)) {
return true; // this result is ignored
}
} else {
try {
fieldsIterator.skip();
} catch (IOException e) {
throw new RuntimeException("failed to skip, index inconsistency?", e);
}
}
}