Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Getting jobs on different states using yarn history API

Getting jobs on different states using yarn history API

Super Collaborator

Hi Community,

 

I'm using the yarn hisotry API to get the failed ,mapreduce jobs in specific queue, but recently i see that i missing some other states like KILLED and ERROR.

 

I tried to figure out how i can get all these 3 state in one API call, i want to avoid sending 3 separated API requets, one for each state, I tried to use OR operand and other commonly used ways like comma,semicolon and so on but without success

 

I'm aware that i can use the resource manager API  that can allow this but i prefer to use this API

 

Here is my API request:

 

curl -GET http://historyserver:19888/ws/v1/history/mapreduce/jobs?state='FAILED'&queue=blabla

2 REPLIES 2

Re: Getting jobs on different states using yarn history API

Super Collaborator

Any insight?

 

Much appreciated

Re: Getting jobs on different states using yarn history API

Master Guru
The state parameter in the /jobs API of MR History Server presently only accepts a single value per [1]

Your other approach right now (aside of multiple-queries as you've noted) could be to query for all jobs and filter on the client side.

[1] - http://archive.cloudera.com/cdh5/cdh/5/hadoop/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/His... and https://github.com/cloudera/hadoop-common/blob/cdh5.14.0-release/hadoop-mapreduce-project/hadoop-map...
Don't have an account?
Coming from Hortonworks? Activate your account here