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(Configuration parameters)
Reads the centroid values from a broadcast variable into a collection.
|
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public void open(Configuration parameters) throws Exception
open
in interface RichFunction
open
in class AbstractRichFunction
parameters
- The configuration containing the parameters attached to the contract.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.Configuration
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–2018 The Apache Software Foundation. All rights reserved.