Class Function


  • public abstract class Function
    extends Node
    Functions can be used for implementing processing or sink nodes.

    By inheriting this class, you have access to the following class fields:

    Author:
    dimi
    • Field Detail

      • metricContext

        protected MetricContext metricContext
        The metric context to create prometheus gauges, histograms and counters.
      • persistentId

        protected String persistentId
        A persistent identifier. This identifier will be the same after a restart.
    • Constructor Detail

      • Function

        public Function()
    • Method Detail

      • execute

        public abstract void execute​(Row row)
        Implement this method to prepare yourself. As a source, as a function or as a sink you may have to set up some context.

        In case of problem, throw a RuntimeException. This will interrupt the punchline and will make it exit with error code 1.

        Parameters:
        row - the input row
      • insert

        public final void insert​(Out out,
                                 Row anchor,
                                 List<Object> columnValues)
        Insert a new row into an output.
        Parameters:
        out - the output
        anchor - the anchored row.
        columnValues - the list of column values
      • insert

        public final void insert​(List<Out> outs,
                                 Row anchor,
                                 List<Object> columnValues)
        Dispatch rows towards several destinations.
        Parameters:
        outs - the output
        anchor - the anchored row.
        columnValues - the list of column values
      • ack

        public final void ack​(Row row)
        Ack a row.
        Parameters:
        row - the row
      • fail

        public final void fail​(Row row)
        Fail a row
        Parameters:
        row - the row
      • setTableCollector

        public void setTableCollector​(FunctionTableCollector tableCollector)
        Setter to make it clearer to source implementor to not refer directly to the collector.
        Parameters:
        tableCollector - collector to use
      • setPersistentId

        public void setPersistentId​(String persistentId)
      • setMetricContext

        public void setMetricContext​(MetricContext metricContext)