Search in sources :

Example 1 with FileSystemCounter

use of org.apache.hadoop.mapreduce.FileSystemCounter in project hadoop by apache.

the class MockJobs method newCounters.

public static Counters newCounters() {
    Counters hc = new Counters();
    for (JobCounter c : JobCounter.values()) {
        hc.findCounter(c).setValue((long) (Math.random() * 1000));
    }
    for (TaskCounter c : TaskCounter.values()) {
        hc.findCounter(c).setValue((long) (Math.random() * 1000));
    }
    int nc = FileSystemCounter.values().length * 4;
    for (int i = 0; i < nc; ++i) {
        for (FileSystemCounter c : FileSystemCounter.values()) {
            hc.findCounter(FS_SCHEMES.next(), c).setValue((long) (Math.random() * DT));
        }
    }
    for (int i = 0; i < 2 * 3; ++i) {
        hc.findCounter(USER_COUNTER_GROUPS.next(), USER_COUNTERS.next()).setValue((long) (Math.random() * 100000));
    }
    return hc;
}
Also used : JobCounter(org.apache.hadoop.mapreduce.JobCounter) Counters(org.apache.hadoop.mapreduce.Counters) FileSystemCounter(org.apache.hadoop.mapreduce.FileSystemCounter) TaskCounter(org.apache.hadoop.mapreduce.TaskCounter)

Aggregations

Counters (org.apache.hadoop.mapreduce.Counters)1 FileSystemCounter (org.apache.hadoop.mapreduce.FileSystemCounter)1 JobCounter (org.apache.hadoop.mapreduce.JobCounter)1 TaskCounter (org.apache.hadoop.mapreduce.TaskCounter)1