Class ExtractionAwareDeltaFunction<DATA,TO>
java.lang.Object
org.apache.flink.streaming.api.functions.windowing.delta.ExtractionAwareDeltaFunction<DATA,TO>
- Type Parameters:
DATA- The input data type. The input of this type will be passed to the extractor which will transform into a TO-object. The delta function then runs on this TO-object.TO- The type on which the delta function runs. (The type of the delta function)
- All Implemented Interfaces:
Serializable,DeltaFunction<DATA>
- Direct Known Subclasses:
CosineDistance,EuclideanDistance
@PublicEvolving
public abstract class ExtractionAwareDeltaFunction<DATA,TO>
extends Object
implements DeltaFunction<DATA>
Extend this abstract class to implement a delta function which is aware of extracting the data on
which the delta is calculated from a more complex data structure. For example in case you want to
be able to run a delta only on one field of a Tuple type or only on some fields from an array.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleThis method takes the two data point and runs the set extractor on it.abstract doublegetNestedDelta(TO oldDataPoint, TO newDataPoint) This method is exactly the same asDeltaFunction.getDelta(Object, Object)except that it gets the result of the previously done extractions as input.
-
Constructor Details
-
ExtractionAwareDeltaFunction
-
-
Method Details
-
getDelta
This method takes the two data point and runs the set extractor on it. The delta function implemented atgetNestedDelta(TO, TO)is then called with the extracted data. In case no extractor is set the input data gets passes togetNestedDelta(TO, TO)as-is. The return value is just forwarded fromgetNestedDelta(TO, TO).- Specified by:
getDeltain interfaceDeltaFunction<DATA>- Parameters:
oldDataPoint- the older data point as raw data (before extraction).newDataPoint- the new data point as raw data (before extraction).- Returns:
- the delta between the two points.
-
getNestedDelta
This method is exactly the same asDeltaFunction.getDelta(Object, Object)except that it gets the result of the previously done extractions as input. Therefore, this method only does the actual calculation of the delta but no data extraction or conversion.- Parameters:
oldDataPoint- the older data point.newDataPoint- the new data point.- Returns:
- the delta between the two points.
-