public final class IdentityFunction extends Object implements VortexFunction<Integer,Integer>
Constructor and Description |
---|
IdentityFunction() |
Modifier and Type | Method and Description |
---|---|
Integer |
call(Integer input)
Outputs input.
|
Codec<Integer> |
getInputCodec()
Users must define codec for the input.
|
Codec<Integer> |
getOutputCodec()
Users must define codec for the output.
|
public IdentityFunction()
public Integer call(Integer input) throws Exception
call
in interface VortexFunction<Integer,Integer>
input
- of the functionException
- thrown here will bubble up in VortexFuture#get as ExecutionException
Exception should be thrown only after all resources are released as they cannot be cleared by Vortex
For example if threads are spawned here, shut them down before throwing an exceptionpublic Codec<Integer> getInputCodec()
VortexFunction
VoidCodec
can be used if the input is
empty, and SerializableCodec
can be used for (Serializable
input.
MatMulInputCodec
is an example of codec for the custom input.getInputCodec
in interface VortexFunction<Integer,Integer>
public Codec<Integer> getOutputCodec()
VortexFunction
VoidCodec
can be used if the output is
empty, and SerializableCodec
can be used for (Serializable
output.
MatMulOutputCodec
is an example of codec for the custom output.getOutputCodec
in interface VortexFunction<Integer,Integer>
Copyright © 2016 The Apache Software Foundation. All rights reserved.