Interface BundleTrigger<T>

  • Type Parameters:
    T - The input element type.
    All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    CountBundleTrigger

    @Internal
    public interface BundleTrigger<T>
    extends Serializable
    A BundleTrigger determines when a bundle of input elements should be evaluated and trigger the callback which registered previously.
    • Method Detail

      • registerCallback

        void registerCallback​(BundleTriggerCallback callback)
        Register a callback which will be called once this trigger decides to finish this bundle.
      • onElement

        void onElement​(T element)
                throws Exception
        Called for every element that gets added to the bundle. If the trigger decides to start evaluate the input, BundleTriggerCallback.finishBundle() should be invoked.
        Parameters:
        element - The element that arrived.
        Throws:
        Exception
      • reset

        void reset()
        Reset the trigger to its initiate status.