use of uk.gov.gchq.gaffer.data.element.id.DirectedType in project Gaffer by gchq.
the class ClassicIteratorSettingsFactory method getEdgeEntityDirectionFilterIteratorSetting.
@Override
public IteratorSetting getEdgeEntityDirectionFilterIteratorSetting(final GraphFilters operation) {
final boolean includeEntities = operation.getView().hasEntities();
final boolean includeEdges = operation.getView().hasEdges();
final DirectedType directedType = operation.getDirectedType();
final IncludeIncomingOutgoingType inOutType;
if (operation instanceof SeededGraphFilters) {
inOutType = ((SeededGraphFilters) operation).getIncludeIncomingOutGoing();
} else {
inOutType = IncludeIncomingOutgoingType.OUTGOING;
}
final boolean deduplicateUndirectedEdges = operation instanceof GetAllElements;
if ((null == inOutType || inOutType == IncludeIncomingOutgoingType.EITHER) && includeEdges && (DirectedType.isEither(directedType)) && !deduplicateUndirectedEdges) {
LOGGER.debug("Returning null from getEdgeEntityDirectionFilterIteratorSetting (" + "inOutType = {}, includeEdges = {}, directedType = {}, deduplicateUndirectedEdges = {})", inOutType, includeEdges, directedType, deduplicateUndirectedEdges);
return null;
}
final IteratorSetting is = new IteratorSettingBuilder(AccumuloStoreConstants.EDGE_ENTITY_DIRECTED_UNDIRECTED_INCOMING_OUTGOING_FILTER_ITERATOR_PRIORITY, AccumuloStoreConstants.EDGE_ENTITY_DIRECTED_UNDIRECTED_INCOMING_OUTGOING_FILTER_ITERATOR_NAME, EDGE_DIRECTED_UNDIRECTED_FILTER).includeIncomingOutgoing(inOutType).directedType(directedType).includeEdges(includeEdges).includeEntities(includeEntities).deduplicateUndirectedEdges(deduplicateUndirectedEdges).build();
LOGGER.debug("Creating IteratorSetting for iterator class {} with " + "priority = {}, includeIncomingOutgoing = {}, directedType = {}, " + "includeEdges = {}, includeEntities = {}, deduplicateUndirectedEdges = {}", EDGE_DIRECTED_UNDIRECTED_FILTER, AccumuloStoreConstants.EDGE_ENTITY_DIRECTED_UNDIRECTED_INCOMING_OUTGOING_FILTER_ITERATOR_PRIORITY, inOutType, directedType, includeEdges, includeEntities, deduplicateUndirectedEdges);
return is;
}
Aggregations