[
https://issues.apache.org/jira/browse/STORM-1511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15132285#comment-15132285
]
ASF GitHub Bot commented on STORM-1511:
---------------------------------------
Github user arunmahadevan commented on the pull request:
https://github.com/apache/storm/pull/1061#issuecomment-179827493
Haven't gone through the implementation details yet, but from the api
`public <T> Stream max(String inputFieldName, String outputFieldName,
Comparator<T> comparator)`
it looks like the comparison is based on a single field and the trident
tuples itself are not compared.
Since we are dealing with a stream of `TridentTuple`, can we have an api
that just takes a `Comparator<TridentTuple>` (similar to the Java8
[min/max](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#max-java.util.Comparator-))
and passes the entire tuple in the compareTo? The comparison can then be based
on one or more fields as users wish and the max tuple is finally emitted.
`Stream max(Comparator<TridentTuple> comparator)`
With this api user need not care about the input or output fields but only
the values.
> min/max operations on trident stream
> ------------------------------------
>
> Key: STORM-1511
> URL: https://issues.apache.org/jira/browse/STORM-1511
> Project: Apache Storm
> Issue Type: Improvement
> Components: storm-core
> Reporter: Satish Duggana
> Assignee: Satish Duggana
> Fix For: 1.0.0
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)