Github user vasia commented on the pull request:

    https://github.com/apache/flink/pull/408#issuecomment-75770438
  
    This looks great already! We just need a few more changes: 
    - you can add the `Triplet` type inside the gsa package. This should just 
be a simple wrapper around `Tuple3<VV, EV, VV>`. (I think we don't even need 
the Vertex IDs here, just the values).
    
    - I see you have exposed the vertex keys in the UDFs. These should be 
hidden from the user-facing methods, e.g. in the SSSP example `gather()` should 
return `Double`, not `Tuple2<Long, Double>`, `sum()` should get two Doubles and 
return a Double (the minimum) and `apply()` should get a Double (the current 
value) and an M (the accumulator result) and return a Double.
    More specifically, the UDFs should be defined like this:
    - `gather: Triplet -> M`
    - `sum: <M, M> -> M`
    - `apply: <VV, M> -> VV`
    
    Of course the wrappers inside `GatherSumApplyIteration` (`GatherUDF`, 
SumUDF`, `ApplyUDF`) will have to maintain the keys. The point is to hide them 
from the user :)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to