public class LimitFilterFunction<T> extends RichFilterFunction<T>
Constructor and Description |
---|
LimitFilterFunction(long limitStart,
long limitEnd,
String broadcastName) |
Modifier and Type | Method and Description |
---|---|
long[] |
countList() |
long |
elementCount() |
boolean |
filter(T value)
The filter function that evaluates the predicate.
|
void |
open(Configuration config)
Initialization method for the function.
|
int |
partitionIndex() |
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public LimitFilterFunction(long limitStart, long limitEnd, String broadcastName)
public int partitionIndex()
public long elementCount()
public long[] countList()
public void open(Configuration config)
RichFunction
The configuration object passed to the function can be used for configuration and initialization. The configuration contains all parameters that were configured on the function in the program composition.
public class MyMapper extends FilterFunction<String> {
private String searchString;
public void open(Configuration parameters) {
this.searchString = parameters.getString("foo");
}
public boolean filter(String value) {
return value.equals(searchString);
}
}
By default, this method does nothing.
open
in interface RichFunction
open
in class AbstractRichFunction
config
- The configuration containing the parameters attached to the contract.Configuration
public boolean filter(T value)
FilterFunction
IMPORTANT: The system assumes that the function does not modify the elements on which the predicate is applied. Violating this assumption can lead to incorrect results.
filter
in interface FilterFunction<T>
filter
in class RichFilterFunction<T>
value
- The value to be filtered.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.