Github user greghogan commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2036#discussion_r64723638
  
    --- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/gsa/GatherSumApplyIteration.java
 ---
    @@ -289,6 +300,11 @@ private GatherUdf(GatherFunction<VV, EV, M> 
gatherFunction, TypeInformation<Tupl
     
                @Override
                public void open(Configuration parameters) throws Exception {
    +                   try {
    +                           Collection<LongValue> numberOfVertices = 
getRuntimeContext().getBroadcastVariable("number of vertices");
    +                           
this.gatherFunction.setNumberOfVertices(numberOfVertices.iterator().next().getValue());
    +                   } catch (Exception e) {
    +                   }
    --- End diff --
    
    @sewen thanks for the pointers.
    
    What are your thoughts on adding a hasBroadcastVariable method to 
RuntimeContext? And elsewhere in that class?
    
    The javadocs for getBroadcastVariable could note the exception as for 
getAccumulator.


---
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