giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [giraph] aanchal204 commented on a change in pull request #110: Counter Mechanism
Date Wed, 06 Nov 2019 20:18:10 GMT
aanchal204 commented on a change in pull request #110: Counter Mechanism
URL: https://github.com/apache/giraph/pull/110#discussion_r343307009
 
 

 ##########
 File path: giraph-core/src/main/java/org/apache/giraph/master/BspServiceMaster.java
 ##########
 @@ -1794,6 +1804,154 @@ private void doMasterCompute() {
     timerContext.stop();
   }
 
+  /**
+   * Use the counterGroupAndNames and context, to get the counter values,
+   * create a custom counter out of each, and add to the set of counters
+   * @param context Job context
+   * @param counterGroupAndNames List of counter names
+   * @param counters Set of CustomCounter which will be populated
+   */
+  private void populateCountersFromContext(Mapper.Context context,
+           Map<String, Set<String>> counterGroupAndNames,
+           Set<CustomCounter> counters) {
+    Counter counter;
+    for (Map.Entry<String, Set<String>> entry :
+            counterGroupAndNames.entrySet()) {
+      String groupName = entry.getKey();
+      for (String counterName: entry.getValue()) {
+        CustomCounter customCounter = new CustomCounter(groupName, counterName,
+                CustomCounter.AGGREGATION.SUM);
+        counter = context.getCounter(groupName, counterName);
+        customCounter.setValue(counter.getValue());
+        counters.add(customCounter);
+      }
+    }
+  }
+
+  /**
+   * Receive the counters from the workers, and aggregate them with the
+   * master counters.
+   * The aggregated counters are stored in a thrift struct
+   */
+  private void aggregateCountersFromWorkersAndMaster() {
 
 Review comment:
   I am not sure, I don't think we should be failing the jobs here. We can definitely show
as a warning in the logs.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message