use of uk.gov.gchq.gaffer.accumulostore.operation.impl.GetElementsBetweenSets in project Gaffer by gchq.
the class AccumuloIDBetweenSetsRetrieverTest method shouldStillApplyOtherFilter.
private void shouldStillApplyOtherFilter(final boolean loadIntoMemory, final AccumuloStore store) throws StoreException {
// Query for all edges between the set {A0} and the set {A23}
final AbstractAccumuloTwoSetSeededOperation<EntitySeed, Element> op = new GetElementsBetweenSets<>(AccumuloTestData.SEED_A0_SET, AccumuloTestData.SEED_A23_SET, defaultView);
// Set graph to give us edges only
op.setIncludeEdges(IncludeEdgeType.ALL);
op.setIncludeEntities(false);
final Set<Element> results = returnElementsFromOperation(store, op, new User(), loadIntoMemory);
assertThat(results, IsCollectionContaining.hasItem(AccumuloTestData.EDGE_A0_A23));
// Set graph to return entities only
final AbstractAccumuloTwoSetSeededOperation<EntitySeed, Element> secondOp = new GetElementsBetweenSets<>(AccumuloTestData.SEED_A0_SET, AccumuloTestData.SEED_A23_SET, defaultView);
secondOp.setIncludeEdges(IncludeEdgeType.NONE);
secondOp.setIncludeEntities(true);
// Query for all edges in set {A0, A23}, should get the entity for A0
final Set<Element> secondResults = returnElementsFromOperation(store, secondOp, new User(), loadIntoMemory);
assertThat(secondResults, IsCollectionContaining.hasItem(AccumuloTestData.A0_ENTITY));
// Set graph to return both entities and edges again, and to only return summary type "X" (which will result
// in no data).
final View view = new View.Builder().edge("edgeX").entity("entityX").build();
final AbstractAccumuloTwoSetSeededOperation<EntitySeed, Element> thirdOp = new GetElementsBetweenSets<>(AccumuloTestData.SEED_A0_SET, AccumuloTestData.SEED_A23_SET, view);
thirdOp.setIncludeEdges(IncludeEdgeType.ALL);
thirdOp.setIncludeEntities(true);
final Set<Element> thirdResults = returnElementsFromOperation(store, thirdOp, new User(), loadIntoMemory);
assertEquals(0, thirdResults.size());
}
Aggregations