Reply
Highlighted
Expert Contributor
Posts: 321
Registered: ‎01-25-2017

Getting jobs on different states using yarn history API

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

Expert Contributor
Posts: 321
Registered: ‎01-25-2017

Re: Getting jobs on different states using yarn history API

Any insight?

 

Much appreciated

Posts: 1,695
Kudos: 341
Solutions: 264
Registered: ‎07-31-2013

Re: Getting jobs on different states using yarn history API

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...
Announcements