Search in sources :

Example 1 with GetCountersResponse

use of org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse in project hadoop by apache.

the class ClientServiceDelegate method getJobCounters.

public org.apache.hadoop.mapreduce.Counters getJobCounters(JobID arg0) throws IOException, InterruptedException {
    org.apache.hadoop.mapreduce.v2.api.records.JobId jobID = TypeConverter.toYarn(arg0);
    GetCountersRequest request = recordFactory.newRecordInstance(GetCountersRequest.class);
    request.setJobId(jobID);
    Counters cnt = ((GetCountersResponse) invoke("getCounters", GetCountersRequest.class, request)).getCounters();
    return TypeConverter.fromYarn(cnt);
}
Also used : GetCountersRequest(org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersRequest) GetCountersResponse(org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse) Counters(org.apache.hadoop.mapreduce.v2.api.records.Counters)

Example 2 with GetCountersResponse

use of org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse in project hadoop by apache.

the class NotRunningJob method getCounters.

@Override
public GetCountersResponse getCounters(GetCountersRequest request) throws IOException {
    GetCountersResponse resp = recordFactory.newRecordInstance(GetCountersResponse.class);
    Counters counters = recordFactory.newRecordInstance(Counters.class);
    counters.addAllCounterGroups(new HashMap<String, CounterGroup>());
    resp.setCounters(counters);
    return resp;
}
Also used : GetCountersResponse(org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse) CounterGroup(org.apache.hadoop.mapreduce.v2.api.records.CounterGroup) Counters(org.apache.hadoop.mapreduce.v2.api.records.Counters)

Example 3 with GetCountersResponse

use of org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse in project hadoop by apache.

the class TestClientServiceDelegate method getCountersResponseFromHistoryServer.

private GetCountersResponse getCountersResponseFromHistoryServer() {
    GetCountersResponse countersResponse = Records.newRecord(GetCountersResponse.class);
    Counter counter = Records.newRecord(Counter.class);
    CounterGroup counterGroup = Records.newRecord(CounterGroup.class);
    Counters counters = Records.newRecord(Counters.class);
    counter.setDisplayName("dummyCounter");
    counter.setName("dummyCounter");
    counter.setValue(1001);
    counterGroup.setName("dummyCounters");
    counterGroup.setDisplayName("dummyCounters");
    counterGroup.setCounter("dummyCounter", counter);
    counters.setCounterGroup("dummyCounters", counterGroup);
    countersResponse.setCounters(counters);
    return countersResponse;
}
Also used : GetCountersResponse(org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse) Counter(org.apache.hadoop.mapreduce.v2.api.records.Counter) CounterGroup(org.apache.hadoop.mapreduce.v2.api.records.CounterGroup) Counters(org.apache.hadoop.mapreduce.v2.api.records.Counters)

Example 4 with GetCountersResponse

use of org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse in project tez by apache.

the class NotRunningJob method getCounters.

@Override
public GetCountersResponse getCounters(GetCountersRequest request) throws IOException {
    GetCountersResponse resp = recordFactory.newRecordInstance(GetCountersResponse.class);
    Counters counters = recordFactory.newRecordInstance(Counters.class);
    counters.addAllCounterGroups(new HashMap<String, CounterGroup>());
    resp.setCounters(counters);
    return resp;
}
Also used : GetCountersResponse(org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse) CounterGroup(org.apache.hadoop.mapreduce.v2.api.records.CounterGroup) Counters(org.apache.hadoop.mapreduce.v2.api.records.Counters)

Aggregations

GetCountersResponse (org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse)4 Counters (org.apache.hadoop.mapreduce.v2.api.records.Counters)4 CounterGroup (org.apache.hadoop.mapreduce.v2.api.records.CounterGroup)3 GetCountersRequest (org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersRequest)1 Counter (org.apache.hadoop.mapreduce.v2.api.records.Counter)1