public static final class KMeans.SelectNearestCenter extends RichMapFunction<KMeans.Point,Tuple2<Integer,KMeans.Point>>
Constructor and Description |
---|
SelectNearestCenter() |
Modifier and Type | Method and Description |
---|---|
Tuple2<Integer,KMeans.Point> |
map(KMeans.Point p)
The mapping method.
|
void |
open(OpenContext openContext)
Reads the centroid values from a broadcast variable into a collection.
|
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
public void open(OpenContext openContext) throws Exception
openContext
- The context containing information about the context in which the function
is opened.Exception
- Implementations may forward exceptions, which are caught by the runtime.
When the runtime catches an exception, it aborts the task and lets the fail-over logic
decide whether to retry the task execution.public Tuple2<Integer,KMeans.Point> map(KMeans.Point p) throws Exception
MapFunction
map
in interface MapFunction<KMeans.Point,Tuple2<Integer,KMeans.Point>>
map
in class RichMapFunction<KMeans.Point,Tuple2<Integer,KMeans.Point>>
p
- The input value.Exception
- This method may throw exceptions. Throwing an exception will cause the
operation to fail and may trigger recovery.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.