MapReduce Application Master REST API

MapReduce Application Master REST API

MapReduce Application Master REST API를 통해 사용자는 실행 중인 MapReduce application master의 상태를 얻을 수 있어요. 현재 이것은 실행 중인 MapReduce 작업과 동등해요. 정보에는 app master가 실행 중인 작업과 태스크, 카운터, 구성, 시도 등 모든 작업 세부 사항이 포함돼요. application master는 프록시를 통해 접근해야 해요. 이 프록시는 resource manager 또는 별도 호스트에서 실행되도록 구성할 수 있어요. 프록시 URL은 보통 다음과 같아요: http://proxy-http-address:port/proxy/appid.

출처: 문서

본문

개요 (Overview)

MapReduce Application Master REST API를 통해 사용자는 실행 중인 MapReduce application master의 상태를 얻을 수 있어요. 현재 이것은 실행 중인 MapReduce 작업과 동등해요. 정보에는 app master가 실행 중인 작업과 태스크, 카운터, 구성, 시도 등 모든 작업 세부 사항이 포함돼요. application master는 프록시를 통해 접근해야 해요. 이 프록시는 resource manager 또는 별도 호스트에서 실행되도록 구성할 수 있어요. 프록시 URL은 보통 http://proxy-http-address:port/proxy/appid처럼 보여요.

Mapreduce Application Master Info API

MapReduce application master 정보 리소스는 그 mapreduce application master에 대한 전반적인 정보를 제공해요. 여기에는 애플리케이션 id, 시작된 시간, 사용자, 이름 등이 포함돼요.

  • URI: 다음 두 URI 모두 appid 값으로 식별되는 애플리케이션에서 MapReduce application master 정보를 제공해요.
    http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce
    http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/info
    
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

info 객체의 요소 (Elements of the info object)

Item Data Type Description
appId string 애플리케이션 id
startedOn long 애플리케이션이 시작된 시간 (epoch 이후 ms)
name string 애플리케이션의 이름
user string 애플리케이션을 시작한 사용자의 사용자 이름
elapsedTime long 애플리케이션이 시작된 이후의 시간 (ms)

응답 예

JSON 응답:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0003/ws/v1/mapreduce/info
Response Body:
{
  "info" : {
      "appId" : "application_1326232085508_0003",
      "startedOn" : 1326238244047,
      "user" : "user1",
      "name" : "Sleep job",
      "elapsedTime" : 32374
   }
}

XML 응답:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0003/ws/v1/mapreduce/info
  Accept: application/xml
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<info>
  <appId>application_1326232085508_0003</appId>
  <name>Sleep job</name>
  <user>user1</user>
  <startedOn>1326238244047</startedOn>
  <elapsedTime>32407</elapsedTime>
</info>

Jobs API

jobs 리소스는 이 application master에서 실행 중인 작업의 목록을 제공해요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

jobs 객체의 요소: job 배열(JSON)/0개 이상의 job 객체(XML) - job 객체의 컬렉션.

JSON 응답 예:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs
Response Body:
{
  "jobs" : {
      "job" : [
         {
            "runningReduceAttempts" : 1,
            "reduceProgress" : 100,
            "failedReduceAttempts" : 0,
            "newMapAttempts" : 0,
            "mapsRunning" : 0,
            "state" : "RUNNING",
            "successfulReduceAttempts" : 0,
            "reducesRunning" : 1,
            "acls" : [
               { "value" : " ", "name" : "mapreduce.job.acl-modify-job" },
               { "value" : " ", "name" : "mapreduce.job.acl-view-job" }
            ],
            "reducesPending" : 0,
            "user" : "user1",
            "reducesTotal" : 1,
            "mapsCompleted" : 1,
            "startTime" : 1326238769379,
            "id" : "job_1326232085508_4_4",
            "successfulMapAttempts" : 1,
            "runningMapAttempts" : 0,
            "newReduceAttempts" : 0,
            "name" : "Sleep job",
            "mapsPending" : 0,
            "elapsedTime" : 59377,
            "reducesCompleted" : 0,
            "mapProgress" : 100,
            "diagnostics" : "",
            "failedMapAttempts" : 0,
            "killedReduceAttempts" : 0,
            "mapsTotal" : 1,
            "uberized" : false,
            "killedMapAttempts" : 0,
            "finishTime" : 0
         }
     ]
   }
}

XML 응답: <jobs> 루트 요소와 <job> 요소들로 반환해요.

Job API

Job 리소스는 이 application master가 시작한 특정 작업에 대한 정보를 포함해요. 일부 필드는 사용자에게 권한이 있는 경우에만 접근할 수 있어요 — acl 설정에 따라 달라요.

  • URI: http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/{jobid}
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

job 객체의 요소 (Elements of the job object)

Item Data Type Description
id string 작업 id
name string 작업 이름
user string 사용자 이름
state string 작업 상태 - 유효한 값: NEW, INITED, RUNNING, SUCCEEDED, FAILED, KILL_WAIT, KILLED, ERROR
startTime long 작업이 시작된 시간 (epoch 이후 ms)
finishTime long 작업이 완료된 시간 (epoch 이후 ms)
elapsedTime long 작업 시작 이후 경과 시간 (ms)
mapsTotal int 총 map 수
mapsCompleted int 완료된 map 수
reducesTotal int 총 reduce 수
reducesCompleted int 완료된 reduce 수
diagnostics string 진단 메시지
uberized boolean 작업이 uber 작업이었는지(application master에서 완전히 실행됐는지) 여부
mapsPending int 아직 실행할 map 수
mapsRunning int 실행 중인 map 수
reducesPending int 아직 실행할 reduce 수
reducesRunning int 실행 중인 reduce 수
newReduceAttempts int 새 reduce 시도 수
runningReduceAttempts int 실행 중인 reduce 시도 수
failedReduceAttempts int 실패한 reduce 시도 수
killedReduceAttempts int 종료된 reduce 시도 수
successfulReduceAttempts int 성공한 reduce 시도 수
newMapAttempts int 새 map 시도 수
runningMapAttempts int 실행 중인 map 시도 수
failedMapAttempts int 실패한 map 시도 수
killedMapAttempts int 종료된 map 시도 수
successfulMapAttempts int 성공한 map 시도 수
acls acls 배열(JSON)/0개 이상의 acls 객체(XML) acls 객체의 컬렉션
mapProgress float 작업의 map 진행률 (퍼센트)
reduceProgress float 작업의 reduce 진행률 (퍼센트)

응답 예

JSON 응답:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/job_1326232085508_4_4
Response Body:
{
   "job" : {
      "runningReduceAttempts" : 1,
      "reduceProgress" : 100,
      "failedReduceAttempts" : 0,
      "newMapAttempts" : 0,
      "mapsRunning" : 0,
      "state" : "RUNNING",
      "successfulReduceAttempts" : 0,
      "reducesRunning" : 1,
      "acls" : [ { "value" : " ", "name" : "mapreduce.job.acl-modify-job" }, { "value" : " ", "name" : "mapreduce.job.acl-view-job" } ],
      "reducesPending" : 0,
      "user" : "user1",
      "reducesTotal" : 1,
      "mapsCompleted" : 1,
      "startTime" : 1326238769379,
      "id" : "job_1326232085508_4_4",
      "successfulMapAttempts" : 1,
      "runningMapAttempts" : 0,
      "newReduceAttempts" : 0,
      "name" : "Sleep job",
      "mapsPending" : 0,
      "elapsedTime" : 59437,
      "reducesCompleted" : 0,
      "mapProgress" : 100,
      "diagnostics" : "",
      "failedMapAttempts" : 0,
      "killedReduceAttempts" : 0,
      "mapsTotal" : 1,
      "uberized" : false,
      "killedMapAttempts" : 0,
      "finishTime" : 0
   }
}

XML 응답: <job> 루트 요소로 위 필드들을 하위 요소(mapProgress, reduceProgress, mapsPending, mapsRunning, reducesPending, reducesRunning, 각 시도 수, acls 등 포함)로 반환해요.

Job Attempts API

job attempts API로 작업 시도를 나타내는 리소스의 컬렉션을 얻을 수 있어요.

  • URI: http://history-server-http-address:port/ws/v1/history/jobs/{jobid}/jobattempts
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

jobAttempts / jobAttempt 객체의 요소:

jobAttempts: jobAttempt 배열/0개 이상의 jobAttempt 객체(XML) - job attempt 객체의 컬렉션.

jobAttempt: | Item | Data Type | Description | |------|-----------|-------------| | id | string | job attempt id | | nodeId | string | attempt가 실행된 노드의 node id | | nodeHttpAddress | string | attempt가 실행된 노드의 node http 주소 | | logsLink | string | job attempt 로그에 대한 http 링크 | | containerId | string | job attempt용 컨테이너의 id | | startTime | long | attempt의 시작 시간 (epoch 이후 ms) |

JSON 응답 예:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/job_1326232085508_4_4/jobattempts
Response Body:
{
   "jobAttempts" : {
      "jobAttempt" : [
         {
            "nodeId" : "host.domain.com:8041",
            "nodeHttpAddress" : "host.domain.com:8042",
            "startTime" : 1326238773493,
            "id" : 1,
            "logsLink" : "http://host.domain.com:8042/node/containerlogs/container_1326232085508_0004_01_000001",
            "containerId" : "container_1326232085508_0004_01_000001"
         }
      ]
   }
}

XML 응답: <jobAttempts> 루트 요소와 <jobAttempt> 요소로 반환해요.

Job Counters API

job counters API로 해당 작업의 모든 카운터를 나타내는 리소스의 컬렉션을 얻을 수 있어요.

  • URI: http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/{jobid}/counters
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

jobCounters / counterGroup / counter 객체의 요소:

jobCounters: id(string, job id), counterGroup 배열 - counter group 객체의 컬렉션. counterGroup: counterGroupName(string), counter 배열 - counter 객체의 컬렉션. counter: name(string), reduceCounterValue(long, reduce 태스크의 카운터 값), mapCounterValue(long, map 태스크의 카운터 값), totalCounterValue(long, 모든 태스크의 카운터 값).

JSON 응답 예: job_1326232085508_4_4 작업의 카운터는 jobCounters 루트와 counterGroup·counter 요소들로 반환되며, Shuffle Errors(BAD_ID, CONNECTION, IO_ERROR, WRONG_LENGTH, WRONG_MAP, WRONG_REDUCE), FileSystemCounter(FILE_BYTES_READ 등), TaskCounter(MAP_INPUT_RECORDS, REDUCE_INPUT_GROUPS, GC_TIME_MILLIS 등) 그룹을 포함해요. XML 응답은 같은 정보를 <jobCounters> 루트 요소와 <counterGroup>·<counter> 요소들로 반환해요.

Job Conf API

작업 구성 리소스는 이 작업의 작업 구성에 대한 정보를 포함해요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs/{jobid}/conf
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

conf / property 객체의 요소:

conf: path(string, 작업 구성 파일의 경로), property 배열 - property 객체의 컬렉션. property: name(string), value(string), source(string, 이 구성 객체가 온 위치. 둘 이상이면 목록 끝에 최신 소스로 히스토리 표시).

JSON 응답 예:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/job_1326232085508_4_4/conf
Response Body:
{
   "conf" : {
      "path" : "hdfs://host.domain.com:9000/user/user1/.staging/job_1326232085508_0004/job.xml",
      "property" : [
         {
            "value" : "/home/hadoop/hdfs/data",
            "name" : "dfs.datanode.data.dir",
            "source" : ["hdfs-site.xml", "job.xml"]
         },
         {
            "value" : "org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializer",
            "name" : "hadoop.http.filter.initializers"
            "source" : ["programmatically", "job.xml"]
         },
         ...
      ]
   }
}

XML 응답: <conf> 루트 요소와 <property> 요소들로 반환해요.

Tasks API

tasks API로 작업의 모든 태스크를 나타내는 리소스의 컬렉션을 얻을 수 있어요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs/{jobid}/tasks
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: type - 태스크 유형, 유효한 값은 m(map) 또는 r(reduce).

JSON 응답 예:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/job_1326232085508_4_4/tasks
Response Body:
{
   "tasks" : {
      "task" : [
         {
            "progress" : 100,
            "elapsedTime" : 2768,
            "state" : "SUCCEEDED",
            "startTime" : 1326238773493,
            "id" : "task_1326232085508_4_4_m_0",
            "type" : "MAP",
            "successfulAttempt" : "attempt_1326232085508_4_4_m_0_0",
            "finishTime" : 1326238776261
         },
         {
            "progress" : 100,
            "elapsedTime" : 0,
            "state" : "RUNNING",
            "startTime" : 1326238777460,
            "id" : "task_1326232085508_4_4_r_0",
            "type" : "REDUCE",
            "successfulAttempt" : "",
            "finishTime" : 0
         }
      ]
   }
}

XML 응답: <tasks> 루트 요소와 <task> 요소들로 반환해요.

Task API

Task 리소스는 작업 내의 특정 태스크에 대한 정보를 포함해요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs/{jobid}/tasks/{taskid}
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

task 객체의 요소:

Item Data Type Description
id string 태스크 id
state string 태스크 상태 - 유효한 값: NEW, SCHEDULED, RUNNING, SUCCEEDED, FAILED, KILL_WAIT, KILLED
type string 태스크 유형 - MAP 또는 REDUCE
successfulAttempt string 마지막 성공 시도의 id
progress float 태스크의 진행률 (퍼센트)
startTime long 태스크가 시작된 시간 (epoch 이후 ms)
finishTime long 태스크가 완료된 시간 (epoch 이후 ms)
elapsedTime long 애플리케이션이 시작된 이후 경과 시간 (ms)

JSON 응답 예:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/job_1326232085508_4_4/tasks/task_1326232085508_4_4_r_0
Response Body:
{
   "task" : {
      "progress" : 100,
      "elapsedTime" : 0,
      "state" : "RUNNING",
      "startTime" : 1326238777460,
      "id" : "task_1326232085508_4_4_r_0",
      "type" : "REDUCE",
      "successfulAttempt" : "",
      "finishTime" : 0
   }
}

XML 응답: <task> 루트 요소로 반환해요.

Task Counters API

task counters API로 해당 태스크의 모든 카운터를 나타내는 리소스의 컬렉션을 얻을 수 있어요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs/{jobid}/tasks/{taskid}/counters
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

jobTaskCounters / counterGroup / counter 객체의 요소:

jobTaskCounters: id(string, 태스크 id), taskCounterGroup 배열 - counter group 객체의 컬렉션. counterGroup: counterGroupName(string), counter 배열 - counter 객체의 컬렉션. counter: name(string), value(long, 카운터 값).

JSON 응답 예:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/job_1326232085508_4_4/tasks/task_1326232085508_4_4_r_0/counters
Response Body:
{
   "jobTaskCounters" : {
      "id" : "task_1326232085508_4_4_r_0",
      "taskCounterGroup" : [
         {
            "counterGroupName" : "org.apache.hadoop.mapreduce.FileSystemCounter",
            "counter" : [ { "value" : 2363, "name" : "FILE_BYTES_READ" }, ... ]
         },
         {
            "counterGroupName" : "org.apache.hadoop.mapreduce.TaskCounter",
            "counter" : [ { "value" : 0, "name" : "COMBINE_INPUT_RECORDS" }, ... ]
         },
         ...
      ]
   }
}

XML 응답: <jobTaskCounters> 루트 요소와 <taskCounterGroup>·<counter> 요소로 반환해요.

Task Attempts API

task attempts API로 작업 내의 태스크 시도를 나타내는 리소스의 컬렉션을 얻을 수 있어요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

JSON 응답 예:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/job_1326232085508_4_4/tasks/task_1326232085508_4_4_r_0/attempts
Response Body:
{
   "taskAttempts" : {
      "taskAttempt" : [
         {
            "elapsedMergeTime" : 47,
            "shuffleFinishTime" : 1326238780052,
            "assignedContainerId" : "container_1326232085508_0004_01_000003",
            "progress" : 100,
            "elapsedTime" : 0,
            "state" : "RUNNING",
            "elapsedShuffleTime" : 2592,
            "mergeFinishTime" : 1326238780099,
            "rack" : "/98.139.92.0",
            "elapsedReduceTime" : 0,
            "nodeHttpAddress" : "host.domain.com:8042",
            "type" : "REDUCE",
            "startTime" : 1326238777460,
            "id" : "attempt_1326232085508_4_4_r_0_0",
            "finishTime" : 0
         }
      ]
   }
}

XML 응답: <taskAttempts> 루트 요소와 <taskAttempt> 요소로 반환해요.

Task Attempt API

Task Attempt 리소스는 작업 내의 특정 태스크 시도에 대한 정보를 포함해요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

taskAttempt 객체의 요소:

Item Data Type Description
id string 태스크 id
rack string rack
state string 태스크 시도 상태 - 유효한 값: NEW, UNASSIGNED, ASSIGNED, RUNNING, COMMIT_PENDING, SUCCESS_CONTAINER_CLEANUP, SUCCEEDED, FAIL_CONTAINER_CLEANUP, FAIL_TASK_CLEANUP, FAILED, KILL_CONTAINER_CLEANUP, KILL_TASK_CLEANUP, KILLED
type string 태스크 유형
assignedContainerId string 이 시도가 할당된 컨테이너 id
nodeHttpAddress string 이 태스크 시도가 실행된 노드의 http 주소
diagnostics string 진단 메시지
progress float 태스크 시도의 진행률 (퍼센트)
startTime long 태스크 시도가 시작된 시간 (epoch 이후 ms)
finishTime long 태스크 시도가 완료된 시간 (epoch 이후 ms)
elapsedTime long 태스크 시도가 시작된 이후 경과 시간 (ms)

reduce 태스크 시도의 경우 다음 필드도 있어요:

Item Data Type Description
shuffleFinishTime long shuffle이 완료된 시간 (epoch 이후 ms)
mergeFinishTime long merge가 완료된 시간 (epoch 이후 ms)
elapsedShuffleTime long shuffle 단계를 완료하는 데 걸린 시간 (reduce 태스크 시작과 shuffle 완료 사이의 ms)
elapsedMergeTime long merge 단계를 완료하는 데 걸린 시간 (shuffle 완료와 merge 완료 사이의 ms)
elapsedReduceTime long reduce 단계를 완료하는 데 걸린 시간 (merge 완료와 reduce 태스크 끝 사이의 ms)

JSON/XML 응답 예: taskAttempt 루트 요소(JSON 객체 또는 <taskAttempt> XML 요소)로 위 필드들을 반환해요.

Task Attempt State API

task attempt state API로 제출된 태스크 시도의 상태를 조회할 수 있으며, 실행 중인 태스크 시도의 상태를 "KILLED"로 설정한 PUT 요청으로 수정해 실행 중인 태스크 시도를 종료할 수도 있어요. PUT 연산을 수행하려면 AM 웹 서비스에 인증이 설정되어야 해요. 또한 태스크 시도를 종료할 권한이 있어야 해요. 현재 상태를 "KILLED"로만 변경할 수 있으며, 다른 것으로 변경하려는 시도는 400 오류 응답을 초래해요.

성공적인 PUT을 수행하면 초기 응답이 202일 수 있어요. 200을 받을 때까지 PUT 요청을 반복하거나, GET 메서드로 상태를 조회하거나, 태스크 시도 정보를 조회해 상태를 확인함으로써 앱이 종료됐는지 확인할 수 있어요. 아래 예제에서는 PUT 요청을 반복해 200 응답을 받아요.

태스크 시도를 종료하려면 HTTP 인터페이스에 인증 필터가 설정되어 있어야 해요. 이 기능은 HttpServletRequest에 사용자 이름이 설정되어 있어야 합니다. 필터가 설정되지 않으면 응답은 "UNAUTHORIZED"가 돼요. 이 기능은 현재 알파 단계이며 향후 변경될 수 있어요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}/state
  • 지원 HTTP 연산: GET, POST
  • 지원 쿼리 파라미터: 없음

jobTaskAttemptState 객체의 요소: 앱의 상태를 요청하면 다음 필드가 반환돼요: state(string) - 애플리케이션 상태. "NEW", "STARTING", "RUNNING", "COMMIT_PENDING", "SUCCEEDED", "FAILED", "KILLED" 중 하나.

JSON 응답 예:

HTTP Request GET http://proxy-http-address:port/proxy/application_1429692837321_0001/ws/v1/mapreduce/jobs/job_1429692837321_0001/tasks/task_1429692837321_0001_m_000000/attempts/attempt_1429692837321_0001_m_000000_0/state
Response Body:
{ "state":"STARTING" }

HTTP Request PUT .../attempt_1429692837321_0001_m_000000_0/state
Request Body: { "state":"KILLED" }
Response Header: HTTP/1.1 200 OK
Response Body: { "state":"KILLED" }

XML 응답 예:

HTTP Request GET .../attempt_1429692837321_0001_m_000000_0/state
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jobTaskAttemptState><state>STARTING</state></jobTaskAttemptState>

HTTP Request PUT .../attempt_1429692837321_0001_m_000000_0/state
Request Body:
<jobTaskAttemptState><state>KILLED</state></jobTaskAttemptState>
Response Header: HTTP/1.1 200 OK
Response Body:
<jobTaskAttemptState><state>KILLED</state></jobTaskAttemptState>

권한 없음(Unauthorized) 오류 응답:

HTTP Request PUT .../attempt_1429692837321_0001_m_000000_0/state
Request Body: <jobTaskAttemptState><state>KILLED</state></jobTaskAttemptState>
Response Header: HTTP/1.1 403 Unauthorized

Bad Request 오류 응답:

HTTP Request PUT .../attempt_1429692837321_0001_m_000000_0/state
Request Body: <jobTaskAttemptState><state>RUNNING</state></jobTaskAttemptState>
Response Header: HTTP/1.1 400
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RemoteException>
  <exception>BadRequestException</exception>
  <message>java.lang.Exception: Only 'KILLED' is allowed as a target state.</message>
  <javaClassName>org.apache.hadoop.yarn.webapp.BadRequestException</javaClassName>
</RemoteException>

Task Attempt Counters API

task attempt counters API로 해당 태스크 시도의 모든 카운터를 나타내는 리소스의 컬렉션을 얻을 수 있어요.

  • URI: http://proxy-http-address:port/proxy/{appid}/ws/v1/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}/counters
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

jobTaskAttemptCounters / taskAttemptCounterGroup / counter 객체의 요소:

jobTaskAttemptCounters: id(string, 태스크 시도 id), taskAttemptCounterGroup 배열 - counterGroup 객체의 컬렉션. taskAttemptCounterGroup: counterGroupName(string), counter 배열 - counter 객체의 컬렉션. counter: name(string), value(long, 카운터 값).

JSON 응답 예:

HTTP Request: GET http://proxy-http-address:port/proxy/application_1326232085508_0004/ws/v1/mapreduce/jobs/job_1326232085508_4_4/tasks/task_1326232085508_4_4_r_0/attempts/attempt_1326232085508_4_4_r_0_0/counters
Response Body:
{
   "jobTaskAttemptCounters" : {
      "taskAttemptCounterGroup" : [
         {
            "counterGroupName" : "org.apache.hadoop.mapreduce.FileSystemCounter",
            "counter" : [ { "value" : 2363, "name" : "FILE_BYTES_READ" }, ... ]
         },
         {
            "counterGroupName" : "org.apache.hadoop.mapreduce.TaskCounter",
            "counter" : [ ... ]
         },
         ...
      ],
      "id" : "attempt_1326232085508_4_4_r_0_0"
   }
}

XML 응답: <jobTaskAttemptCounters> 루트 요소와 <taskAttemptCounterGroup>·<counter> 요소들로 반환해요.

더 알아보기 (Learn more)