Interface ProcessFunction<InputT,​OutputT>

  • Type Parameters:
    InputT - input value type
    OutputT - output value type
    All Superinterfaces:
    java.io.Serializable
    All Known Subinterfaces:
    SerializableFunction<InputT,​OutputT>
    All Known Implementing Classes:
    InferableFunction, PAssert.MatcherCheckerFn, SimpleFunction, WithFailures.ExceptionAsMapHandler, WithFailures.ThrowableHandler
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ProcessFunction<InputT,​OutputT>
    extends java.io.Serializable
    A function that computes an output value of type OutputT from an input value of type InputT and is Serializable.

    This is the most general function type provided in this SDK, allowing arbitrary Exceptions to be thrown, and matching Java's expectations of a functional interface that can be supplied as a lambda expression or method reference. It is named ProcessFunction because it is particularly appropriate anywhere a user needs to provide code that will eventually be executed as part of a DoFn ProcessElement function, which is allowed to declare throwing Exception. If you need to execute user code in a context where arbitrary checked exceptions should not be allowed, require that users implement the subinterface SerializableFunction instead.

    For more robust Coder inference, consider extending InferableFunction rather than implementing this interface directly.

    • Method Detail

      • apply

        OutputT apply​(InputT input)
               throws java.lang.Exception
        Returns the result of invoking this function on the given input.
        Throws:
        java.lang.Exception