Interface KastSink

  • All Superinterfaces:
    Serializable

    public interface KastSink
    extends Serializable
    Implement this interface to provide your own sink function.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void close()
      Tear-down method for the user code (ex: clean resources from open).
      void initializeState()
      This method is called when the parallel function instance is created during distributed execution.
      void invoke​(KastRow row)
      Trigger operation for each stream input.
      default void open​(Map<String,​String> configuration, org.apache.avro.Schema schema)
      Initialization method for the function.
      default void open​(Map<String,​String> configuration, org.apache.avro.Schema schema, Map<String,​Object> meta)
      Initialization method for the function.
      void snapshotState()
      This method is called when a snapshot for a checkpoint is requested.
    • Method Detail

      • open

        default void open​(Map<String,​String> configuration,
                          org.apache.avro.Schema schema)
                   throws Exception
        Initialization method for the function.
        Parameters:
        configuration - The configuration containing the parameters attached to the contract
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • open

        default void open​(Map<String,​String> configuration,
                          org.apache.avro.Schema schema,
                          Map<String,​Object> meta)
                   throws Exception
        Initialization method for the function.
        Parameters:
        configuration - The configuration containing the parameters attached to the contract
        schema - the input row schema
        meta - the udf configuration parameters
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • invoke

        void invoke​(KastRow row)
             throws Exception
        Trigger operation for each stream input.
        Parameters:
        row - row element coming from an upstream task
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • close

        default void close()
                    throws Exception
        Tear-down method for the user code (ex: clean resources from open).
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • snapshotState

        void snapshotState()
                    throws Exception
        This method is called when a snapshot for a checkpoint is requested.
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • initializeState

        void initializeState()
                      throws Exception
        This method is called when the parallel function instance is created during distributed execution. Functions typically set up their state storing data structures in this method.
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.