Gaffer
Gaffer copied to clipboard
Add ability to filter each GetElements input based on group
Currently, Elements or ElementSeeds can be used as GetElements inputs. Elements allow you to set the group, whereas ElementSeeds do not. When these groups are set in the input, they do not change any of the filtering in the GetElements handler, as this is all done using Views. This seems counterintuitive; the group for each input could be used to filter out groups for that input. Usually a View would be used to filter on groups, but this filtering applies to the whole input, rather than being able to set a group filter per input.
In the following example, I would expect input1 (source1->dest1) to be filtered to only return edges of group1. I would expect input2 (source2->dest2) to only return edges of group2. However, it will currently return edges of all groups for both inputs:
{
"class": "uk.gov.gchq.gaffer.operation.impl.get.GetElements",
"input": [
{
"class": "uk.gov.gchq.gaffer.data.element.Edge",
"directed": "true",
"group": "group1",
"source": "source1",
"destination": "dest1"
},
{
"class": "uk.gov.gchq.gaffer.data.element.Edge",
"directed": "true",
"group": "group2",
"source": "source2",
"destination": "dest2"
}
]
}
Each Accumulo Range could be bound by the groups.
After some local testing, this feature is possible but would require a decent amount of refactoring of the Accumulo key packages, and would fundamentally change how Gaffer filtering is done. More work could be done to change Gaffer to benefit from this new functionality, for example, the group could be included in the ElementSeeds also. On the other hand, this group filtering could contradict information in the View, and is not easily integrated into Gaffer Views. I think more discussion should be had on this potential feature.