Search in sources :

Example 1 with AreIn

use of uk.gov.gchq.gaffer.function.filter.AreIn in project Gaffer by gchq.

the class GafferResultCacheExporter method get.

public CloseableIterable<?> get(final String key) throws OperationException {
    final GetEdges<EdgeSeed> getEdges = new GetEdges.Builder<EdgeSeed>().addSeed(new EdgeSeed(jobId, key, true)).view(new View.Builder().edge("result", new ViewElementDefinition.Builder().preAggregationFilter(new ElementFilter.Builder().select("opAuths").execute(new AreIn(userOpAuths)).build()).build()).build()).build();
    final CloseableIterable<Edge> edges = resultCache.execute(getEdges, user);
    if (null == edges) {
        return new WrappedCloseableIterable<>(Collections.emptyList());
    }
    return new TransformJsonResult(edges, jsonSerialiser);
}
Also used : AreIn(uk.gov.gchq.gaffer.function.filter.AreIn) WrappedCloseableIterable(uk.gov.gchq.gaffer.commonutil.iterable.WrappedCloseableIterable) GetEdges(uk.gov.gchq.gaffer.operation.impl.get.GetEdges) EdgeSeed(uk.gov.gchq.gaffer.operation.data.EdgeSeed) ElementFilter(uk.gov.gchq.gaffer.data.element.function.ElementFilter) Edge(uk.gov.gchq.gaffer.data.element.Edge)

Example 2 with AreIn

use of uk.gov.gchq.gaffer.function.filter.AreIn in project Gaffer by gchq.

the class AreInExample method areInSet.

public void areInSet() {
    // ---------------------------------------------------------
    final AreIn function = new AreIn(1, 2, 3);
    // ---------------------------------------------------------
    runExample(function, createSet(1, 2, 3), createSet(1, 2, 3, 4), createSet(1, 4), createSet(1, 2), createSet());
}
Also used : AreIn(uk.gov.gchq.gaffer.function.filter.AreIn)

Aggregations

AreIn (uk.gov.gchq.gaffer.function.filter.AreIn)2 WrappedCloseableIterable (uk.gov.gchq.gaffer.commonutil.iterable.WrappedCloseableIterable)1 Edge (uk.gov.gchq.gaffer.data.element.Edge)1 ElementFilter (uk.gov.gchq.gaffer.data.element.function.ElementFilter)1 EdgeSeed (uk.gov.gchq.gaffer.operation.data.EdgeSeed)1 GetEdges (uk.gov.gchq.gaffer.operation.impl.get.GetEdges)1