@FunctionalInterface public interface Reducer
Reducer object is used in a MapReduce job (see
RDFProcessors.mapReduce(Mapper, Reducer, boolean)) to process a partition of statements
associated to a certain
Value key produced by a
Mapper in a previous map phase
(e.g., all the statements having a specific subject).
Implementations of this interface should be thread-safe, as multiple reduce jobs can be fired
in parallel with method
reduce() being invoked concurrently by different threads on
different statement partitions.
|Modifier and Type||Field and Description|
The identity reducer that emits all the quads of a partition unchanged.
|Modifier and Type||Method and Description|
Returns a filtered version of the input reducer that operates only on partitions satisfying the existential and forall predicates supplied.
Processes the statement partition associated to a certain key, emitting output statements to the supplied
static final Reducer IDENTITY
static Reducer filter(Reducer reducer, @Nullable Predicate<org.openrdf.model.Statement> existsPredicate, @Nullable Predicate<org.openrdf.model.Statement> forallPredicate)
reducer- the reducer to filter
existsPredicate- the exists predicate, that must be satisfied by at least a partition quad in order for the partition to be processed; if null no existential filtering is done
forallPredicate- the forall predicate, that must be satisfied by all the quads of a partition in order for it to be processed; if null, no forall filtering is applied
Reducerthat emits the output of multiple reductions on the same quad partition.
reducers- the reducers whose output has to be concatenated
Reducerout of the supplied expression string. The expression must be a
expression- the expression to parse
void reduce(@Nullable org.openrdf.model.Value key, org.openrdf.model.Statement statements, org.openrdf.rio.RDFHandler handler) throws org.openrdf.rio.RDFHandlerException
key- the partition key, possibly null
statements- a modifiable array with the statements belonging to the partition, not null
RDFHandlerwhere to emit output statements, not null
org.openrdf.rio.RDFHandlerException- on error
Copyright © 2015–2016 FBK-irst. All rights reserved.