apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tushargosavi <...@git.apache.org>
Subject [GitHub] apex-malhar pull request #319: REVIEW ONLY: Operator supporting the Beam con...
Date Mon, 20 Jun 2016 12:18:33 GMT
Github user tushargosavi commented on a diff in the pull request:

    https://github.com/apache/apex-malhar/pull/319#discussion_r67679805
  
    --- Diff: stream/src/main/java/org/apache/apex/malhar/stream/api/WindowedStream.java ---
    @@ -53,4 +60,121 @@
      */
     public interface WindowedStream<T> extends ApexStream<T>
     {
    +
    +  /**
    +   * Count of all tuples
    +   * @return new stream of Integer
    +   */
    +  <STREAM extends ApexStream<Integer>> STREAM count();
    +
    +  /**
    +   * Count tuples by the key<br>
    +   * If the input is KeyedTuple it will get the key from getKey method from the tuple<br>
    +   * If not, use the tuple itself as a key
    +   * @return new stream of Map
    +   */
    +  <STREAM extends ApexStream<Map.Entry<Object, Integer>>> STREAM countByKey();
    +
    +  /**
    +   *
    +   * Count tuples by the indexed key
    +   * @param key the index of the field in the tuple that are used as key
    +   * @return new stream of Map
    +   */
    +  <STREAM extends ApexStream<Map<Object, Integer>>> STREAM countByKey(int
key);
    +
    +
    +  /**
    +   *
    +   * Return top tuples by the selected key
    +   * @return new stream of Key and top N tuple of the key
    +   */
    +  <TUPLE, KEY, STREAM extends ApexStream<Map.Entry<KEY, List<TUPLE>>>>
STREAM topByKey(int N);
    +
    +  /**
    +   *
    +   * Return top tuples of all tuples in the window
    +   * @return new stream of Map
    +   */
    +  <STREAM extends ApexStream<T>> STREAM top(int N);
    +
    +  <O, STREAM extends ApexStream<O>> STREAM combineByKey();
    +
    +  <O, STREAM extends ApexStream<O>> STREAM combine();
    +
    +  /**
    +   * Reduce transformation<br>
    +   * Add an operator to the DAG which merge tuple t1, t2 to new tuple
    +   * @param name operator name
    +   * @param reduce reduce function
    +   * @return new stream of same type
    +   */
    +  <STREAM extends ApexStream<T>> STREAM reduce(String name, Function.ReduceFunction<T>
reduce);
    +
    +  /**
    +   * Fold transformation<br>
    +   * Add an operator to the DAG which merge tuple T to accumulated result tuple O
    +   * @param initialValue initial result value
    +   * @param fold fold function
    +   * @param <O> Result type
    +   * @return new stream of type O
    +   */
    +  <O, STREAM extends ApexStream<O>> STREAM fold(O initialValue, Function.FoldFunction<T,
O> fold);
    +
    +  /**
    +   * Fold transformation<br>
    +   * Add an operator to the DAG which merge tuple T to accumulated result tuple O
    +   * @param name name of the operator
    +   * @param initialValue initial result value
    +   * @param fold fold function
    +   * @param <O> Result type
    +   * @return new stream of type O
    +   */
    +  <O, STREAM extends ApexStream<O>> STREAM fold(String name, O initialValue,
Function.FoldFunction<T, O> fold);
    +
    +
    +  /**
    +   * Fold transformation<br>
    +   * Add an operator to the DAG which merge tuple T to accumulated result tuple O
    +   * @param name name of the operator
    +   * @param fold fold function
    +   * @param <O> Result type
    +   * @return new stream of type O
    +   */
    +  <O, K, STREAM extends ApexStream<KeyValPair<K, O>>> STREAM foldByKey(String
name, Function.FoldFunction<T, KeyValPair<K, O>> fold);
    +
    +  /**
    +   * Fold transformation<br>
    +   * Add an operator to the DAG which merge tuple T to accumulated result tuple O
    +   * @param fold fold function
    +   * @param <O> Result type
    +   * @return new stream of type O
    +   */
    +  <O, K, STREAM extends ApexStream<KeyValPair<K, O>>> STREAM foldByKey(Function.FoldFunction<T,
KeyValPair<K, O>> fold);
    +
    +
    +  /**
    +   * Reduce transformation<br>
    +   * Add an operator to the DAG which merge tuple t1, t2 to new tuple
    +   * @param reduce reduce function
    +   * @return new stream of same type
    +   */
    +  <STREAM extends ApexStream<T>> STREAM reduce(Function.ReduceFunction<T>
reduce);
    --- End diff --
    
    reduceByKey ??


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message