Search in sources :

Example 1 with HadoopV2Counter

use of org.apache.ignite.internal.processors.hadoop.impl.v2.HadoopV2Counter in project ignite by apache.

the class HadoopMapReduceCounters method findCounter.

/**
     * Find a counter in the group.
     *
     * @param grpName The name of the counter group.
     * @param cntrName The name of the counter.
     * @param create Create the counter if not found if true.
     * @return The counter that was found or added or {@code null} if create is false.
     */
public Counter findCounter(String grpName, String cntrName, boolean create) {
    T2<String, String> key = new T2<>(grpName, cntrName);
    HadoopLongCounter internalCntr = cntrs.get(key);
    if (internalCntr == null & create) {
        internalCntr = new HadoopLongCounter(grpName, cntrName);
        cntrs.put(key, new HadoopLongCounter(grpName, cntrName));
    }
    return internalCntr == null ? null : new HadoopV2Counter(internalCntr);
}
Also used : HadoopLongCounter(org.apache.ignite.internal.processors.hadoop.counter.HadoopLongCounter) HadoopV2Counter(org.apache.ignite.internal.processors.hadoop.impl.v2.HadoopV2Counter) T2(org.apache.ignite.internal.util.typedef.T2)

Aggregations

HadoopLongCounter (org.apache.ignite.internal.processors.hadoop.counter.HadoopLongCounter)1 HadoopV2Counter (org.apache.ignite.internal.processors.hadoop.impl.v2.HadoopV2Counter)1 T2 (org.apache.ignite.internal.util.typedef.T2)1