/** * A supplier to return a new value at each invocation */ @InterfaceStability.Unstable @FunctionalInterface public interface SupplierFunction<T> extends InitableFunction, ClosableFunction, Serializable { /** * Returns a value of type T * * @return a value for type T */ T get(); }
/** * A supplier to return a new value at each invocation */ @InterfaceStability.Unstable @FunctionalInterface public interface SupplierFunction<T> extends InitableFunction, ClosableFunction, Serializable { /** * Returns a value of type T * * @return a value for type T */ T get(); }
/** * Incrementally updates the aggregated value as messages are added. Main usage is in {@link org.apache.samza.operators.windows.Window} operator. */ @InterfaceStability.Unstable @FunctionalInterface public interface FoldLeftFunction<M, WV> extends InitableFunction, ClosableFunction, Serializable { /** * Incrementally updates the aggregated value as messages are added. * * @param message the message being added to the aggregated value * @param oldValue the previous value * @return the new value */ WV apply(M message, WV oldValue); }
/** * Transforms an input message into another message, possibly of a different type. * * @param <M> type of the input message * @param <OM> type of the transformed message */ @InterfaceStability.Unstable @FunctionalInterface public interface MapFunction<M, OM> extends InitableFunction, ClosableFunction, Serializable { /** * Transforms the provided message into another message. * * @param message the input message to be transformed * @return the transformed message */ OM apply(M message); }
/** * Function interface for providing rate limiting credits for each table record. * This interface allows callers to pass in lambda expressions which are otherwise * non-serializable as-is. * @param <K> the type of the key * @param <V> the type of the value */ @InterfaceStability.Unstable public interface CreditFunction<K, V> extends Serializable { /** * Get the number of credits required for the {@code key} and {@code value} pair. * @param key table key * @param value table record * @return number of credits */ int getCredits(K key, V value); }
/** * Incrementally updates the aggregated value as messages are added. Main usage is in {@link org.apache.samza.operators.windows.Window} operator. */ @InterfaceStability.Unstable @FunctionalInterface public interface FoldLeftFunction<M, WV> extends InitableFunction, ClosableFunction, Serializable { /** * Incrementally updates the aggregated value as messages are added. * * @param message the message being added to the aggregated value * @param oldValue the previous value * @return the new value */ WV apply(M message, WV oldValue); }
/** * Transforms an input message into a collection of 0 or more messages, possibly of a different type. * * @param <M> type of the input message * @param <OM> type of the transformed messages */ @InterfaceStability.Unstable @FunctionalInterface public interface FlatMapFunction<M, OM> extends InitableFunction, ClosableFunction, Serializable { /** * Transforms the provided message into a collection of 0 or more messages. * * @param message the input message to be transformed * @return a collection of 0 or more transformed messages */ Collection<OM> apply(M message); }
/** * Function interface for providing rate limiting credits for each table record. * This interface allows callers to pass in lambda expressions which are otherwise * non-serializable as-is. * @param <K> the type of the key * @param <V> the type of the value */ @InterfaceStability.Unstable public interface CreditFunction<K, V> extends Serializable { /** * Get the number of credits required for the {@code key} and {@code value} pair. * @param key table key * @param value table record * @return number of credits */ int getCredits(K key, V value); }
/** * The processing logic for store side inputs. Accepts incoming messages from side input streams * and the current store contents, and returns the new key-value entries to be written to the store. */ @FunctionalInterface @InterfaceStability.Unstable public interface SideInputsProcessor extends Serializable { /** * Process the incoming side input message for the {@code store}. * * @param message incoming message envelope * @param store the store associated with the incoming message envelope * @return a {@link Collection} of {@link Entry}s that will be written to the {@code store}. */ Collection<Entry<?, ?>> process(IncomingMessageEnvelope message, KeyValueStore store); }
/** * Specifies whether a message should be retained for further processing. * * @param <M> type of the input message */ @InterfaceStability.Unstable @FunctionalInterface public interface FilterFunction<M> extends InitableFunction, ClosableFunction, Serializable { /** * Returns a boolean indicating whether this message should be retained or filtered out. * * @param message the input message to be checked * @return true if {@code message} should be retained */ boolean apply(M message); }
/** * Factory of a table provider object */ @InterfaceStability.Unstable public interface TableProviderFactory { /** * Constructs an instances of the table provider based on a given table spec * @param tableSpec the table spec * @return the table provider */ TableProvider getTableProvider(TableSpec tableSpec); }
/** * A {@link Trigger} whose firing logic is determined by a time duration. * * <p> Use the {@link Triggers} APIs to create a {@link Trigger}. * * @param <M> the type of the incoming message */ @InterfaceStability.Unstable public interface TimeBasedTrigger<M> extends Trigger<M> { Duration getDuration(); }
/** * The context for a StreamProcessor. A placeholder class for the general context for Samza application. * * TODO: pending change with SAMZA-1714 */ @InterfaceStability.Unstable public interface ProcessorContext { }
/** * An output stream to send messages to. * * @param <M> the type of message being sent to this {@link OutputStream} */ @InterfaceStability.Unstable public interface OutputStream<M> { }
/** * The context for a StreamProcessor. A placeholder class for the general context for Samza application. * * TODO: pending change with SAMZA-1714 */ @InterfaceStability.Unstable public interface ProcessorContext { }
/** * Marker interface for all triggers. The firing of a trigger indicates the completion of a window pane. * * <p> Use the {@link Triggers} APIs to create a {@link Trigger}. * * @param <M> the type of the incoming message */ @InterfaceStability.Unstable public interface Trigger<M> extends Serializable { }
/** * Marker interface for all triggers. The firing of a trigger indicates the completion of a window pane. * * <p> Use the {@link Triggers} APIs to create a {@link Trigger}. * * @param <M> the type of the incoming message */ @InterfaceStability.Unstable public interface Trigger<M> extends Serializable { }
/** * Factory of a table provider object */ @InterfaceStability.Unstable public interface TableProviderFactory { /** * Construct a table provider based on job configuration * @param tableId Id of the table * @return the constructed table provider */ TableProvider getTableProvider(String tableId); }
/** * An output stream to send messages to. * * @param <M> the type of message being sent to this {@link OutputStream} */ @InterfaceStability.Unstable public interface OutputStream<M> { }
/** * A {@link Trigger} whose firing logic is determined by a time duration. * * <p> Use the {@link Triggers} APIs to create a {@link Trigger}. * * @param <M> the type of the incoming message */ @InterfaceStability.Unstable public interface TimeBasedTrigger<M> extends Trigger<M> { Duration getDuration(); }