I
- input typeO
- output typepublic static class GraphUtils.MapTo<I,O> extends Object implements MapFunction<I,O>, ResultTypeQueryable<O>, TranslateFunction<I,O>
Constructor and Description |
---|
MapTo(O value)
Map each element to the given object.
|
Modifier and Type | Method and Description |
---|---|
TypeInformation<O> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
O |
map(I input)
The mapping method.
|
O |
translate(I input,
O reuse)
The translating method.
|
public MapTo(O value)
value
- the object to emit for each elementpublic O map(I input) throws Exception
MapFunction
map
in interface MapFunction<I,O>
input
- The input value.Exception
- This method may throw exceptions. Throwing an exception will cause the operation
to fail and may trigger recovery.public O translate(I input, O reuse) throws Exception
TranslateFunction
translate
in interface TranslateFunction<I,O>
input
- input value.reuse
- value which may be reused for output; if reuse is null then a new output object
must be instantiated and returnedException
- This method may throw exceptions. Throwing an exception will cause the operation
to fail and may trigger recovery.public TypeInformation<O> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<O>
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.