Search in sources :

Example 1 with SparkCounterGroup

use of org.apache.hive.spark.counter.SparkCounterGroup in project hive by apache.

the class SparkStatisticsBuilder method add.

public SparkStatisticsBuilder add(SparkCounters sparkCounters) {
    for (SparkCounterGroup counterGroup : sparkCounters.getSparkCounterGroups().values()) {
        String groupDisplayName = counterGroup.getGroupDisplayName();
        List<SparkStatistic> statisticList = statisticMap.get(groupDisplayName);
        if (statisticList == null) {
            statisticList = new LinkedList<SparkStatistic>();
            statisticMap.put(groupDisplayName, statisticList);
        }
        for (SparkCounter counter : counterGroup.getSparkCounters().values()) {
            String displayName = counter.getDisplayName();
            statisticList.add(new SparkStatistic(displayName, Long.toString(counter.getValue())));
        }
    }
    return this;
}
Also used : SparkCounterGroup(org.apache.hive.spark.counter.SparkCounterGroup) SparkCounter(org.apache.hive.spark.counter.SparkCounter)

Aggregations

SparkCounter (org.apache.hive.spark.counter.SparkCounter)1 SparkCounterGroup (org.apache.hive.spark.counter.SparkCounterGroup)1