Class KMeans.SelectNearestCenter
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.api.common.functions.RichMapFunction<KMeans.Point,org.apache.flink.api.java.tuple.Tuple2<Integer,KMeans.Point>>
-
- org.apache.flink.examples.java.clustering.KMeans.SelectNearestCenter
-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.functions.MapFunction<KMeans.Point,org.apache.flink.api.java.tuple.Tuple2<Integer,KMeans.Point>>,org.apache.flink.api.common.functions.RichFunction
- Enclosing class:
- KMeans
public static final class KMeans.SelectNearestCenter extends org.apache.flink.api.common.functions.RichMapFunction<KMeans.Point,org.apache.flink.api.java.tuple.Tuple2<Integer,KMeans.Point>>
Determines the closest cluster center for a data point.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SelectNearestCenter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.api.java.tuple.Tuple2<Integer,KMeans.Point>map(KMeans.Point p)voidopen(org.apache.flink.api.common.functions.OpenContext openContext)Reads the centroid values from a broadcast variable into a collection.
-
-
-
Method Detail
-
open
public void open(org.apache.flink.api.common.functions.OpenContext openContext) throws ExceptionReads the centroid values from a broadcast variable into a collection.- Throws:
Exception
-
map
public org.apache.flink.api.java.tuple.Tuple2<Integer,KMeans.Point> map(KMeans.Point p) throws Exception
- Specified by:
mapin interfaceorg.apache.flink.api.common.functions.MapFunction<KMeans.Point,org.apache.flink.api.java.tuple.Tuple2<Integer,KMeans.Point>>- Specified by:
mapin classorg.apache.flink.api.common.functions.RichMapFunction<KMeans.Point,org.apache.flink.api.java.tuple.Tuple2<Integer,KMeans.Point>>- Throws:
Exception
-
-