ajamato commented on a change in pull request #11184: [BEAM-4374] Update protos 
related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r398801376
 
 

 ##########
 File path: 
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/fn/control/ElementCountMonitoringInfoToCounterUpdateTransformer.java
 ##########
 @@ -95,7 +99,12 @@ public CounterUpdate transform(MonitoringInfo 
monitoringInfo) {
       return null;
     }
 
-    long value = monitoringInfo.getMetric().getCounterData().getInt64Value();
+    long value;
+    try {
+      value = VARINT_CODER.decode(monitoringInfo.getPayload().newInput());
 
 Review comment:
   Can we encapsulte this so that its still one line to get the value out? I 
think that this would be a nicer interface. For consumers. Ideally something as 
easy to use on the receiving side as SimpleMonitoringInfoBuilder.
   
   i.e.
   long value = MonitoringInfos.getSumInt64Value(monitoringInfo)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to