Class AsyncMLPredictFunction

  • All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction, org.apache.flink.streaming.api.functions.async.AsyncFunction<Map<String,​Object>,​Double>

    public class AsyncMLPredictFunction
    extends org.apache.flink.streaming.api.functions.async.RichAsyncFunction<Map<String,​Object>,​Double>
    Async function for non-blocking inference.
    Since:
    1.0.0
    Author:
    Nestor Martourez, Sr Software and Data Streaming Engineer @ CodedStreams
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void asyncInvoke​(Map<String,​Object> input, org.apache.flink.streaming.api.functions.async.ResultFuture<Double> resultFuture)  
      void close()  
      void open​(org.apache.flink.configuration.Configuration parameters)  
      • Methods inherited from class org.apache.flink.streaming.api.functions.async.RichAsyncFunction

        setRuntimeContext
      • Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction

        getIterationRuntimeContext, getRuntimeContext
      • Methods inherited from interface org.apache.flink.streaming.api.functions.async.AsyncFunction

        timeout
    • Constructor Detail

      • AsyncMLPredictFunction

        public AsyncMLPredictFunction​(String modelName)
    • Method Detail

      • open

        public void open​(org.apache.flink.configuration.Configuration parameters)
                  throws Exception
        Specified by:
        open in interface org.apache.flink.api.common.functions.RichFunction
        Overrides:
        open in class org.apache.flink.api.common.functions.AbstractRichFunction
        Throws:
        Exception
      • asyncInvoke

        public void asyncInvoke​(Map<String,​Object> input,
                                org.apache.flink.streaming.api.functions.async.ResultFuture<Double> resultFuture)
        Specified by:
        asyncInvoke in interface org.apache.flink.streaming.api.functions.async.AsyncFunction<Map<String,​Object>,​Double>
        Specified by:
        asyncInvoke in class org.apache.flink.streaming.api.functions.async.RichAsyncFunction<Map<String,​Object>,​Double>
      • close

        public void close()
                   throws Exception
        Specified by:
        close in interface org.apache.flink.api.common.functions.RichFunction
        Overrides:
        close in class org.apache.flink.api.common.functions.AbstractRichFunction
        Throws:
        Exception