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); }
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; }
@Override public GetCountersResponse getCounters(GetCountersRequest request) throws IOException { JobId jobId = request.getJobId(); Job job = verifyAndGetJob(jobId, JobACL.VIEW_JOB, true); GetCountersResponse response = recordFactory.newRecordInstance(GetCountersResponse.class); response.setCounters(TypeConverter.toYarn(job.getAllCounters())); return response; }
@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; }
@Override public GetCountersResponse getCounters(GetCountersRequest request) throws IOException { hsContact = true; Counters counters = getMyCounters(); GetCountersResponse response = recordFactory.newRecordInstance(GetCountersResponse.class); response.setCounters(counters); return response; }
@Override public GetCountersResponse getCounters(GetCountersRequest request) throws IOException { JobId jobID = request.getJobId(); amContact = true; Counters counters = getMyCounters(); GetCountersResponse response = recordFactory .newRecordInstance(GetCountersResponse.class); response.setCounters(counters); return response; }
@Override public GetCountersResponseProto getCounters(RpcController controller, GetCountersRequestProto proto) throws ServiceException { GetCountersRequest request = new GetCountersRequestPBImpl(proto); try { GetCountersResponse response = real.getCounters(request); return ((GetCountersResponsePBImpl)response).getProto(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public GetCountersResponse getCounters(GetCountersRequest request) throws IOException { GetCountersRequestProto requestProto = ((GetCountersRequestPBImpl)request).getProto(); try { return new GetCountersResponsePBImpl(proxy.getCounters(null, requestProto)); } catch (ServiceException e) { throw unwrapAndThrowException(e); } }
@Override public GetCountersResponse getCounters(GetCountersRequest request) throws IOException { JobId jobId = request.getJobId(); Job job = verifyAndGetJob(jobId, true); GetCountersResponse response = recordFactory.newRecordInstance(GetCountersResponse.class); response.setCounters(TypeConverter.toYarn(job.getAllCounters())); return response; }
@Override public GetCountersResponse getCounters(GetCountersRequest request) throws IOException { JobId jobId = request.getJobId(); Job job = verifyAndGetJob(jobId, JobACL.VIEW_JOB); GetCountersResponse response = recordFactory.newRecordInstance(GetCountersResponse.class); response.setCounters(TypeConverter.toYarn(job.getAllCounters())); return response; }