MapReduce History Server REST API

MapReduce History Server REST API

히스토리 서버 REST API를 통해 사용자는 완료된 애플리케이션의 상태를 얻을 수 있어요.

출처: 문서

본문

개요 (Overview)

히스토리 서버 REST API를 통해 사용자는 완료된 애플리케이션의 상태를 얻을 수 있어요.

히스토리 서버 정보 API (History Server Information API)

히스토리 서버 정보 리소스는 히스토리 서버에 대한 전반적인 정보를 제공해요.

  • URI: 다음 두 URI 모두 appid 값으로 식별되는 애플리케이션에서 히스토리 서버 정보를 제공해요.
    http://history-server-http-address:port/ws/v1/history
    http://history-server-http-address:port/ws/v1/history/info
    
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음

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

Item Data Type Description
startedOn long 히스토리 서버가 시작된 시간 (epoch 이후 ms)
hadoopVersion string hadoop common 버전
hadoopBuildVersion string 빌드 버전, 사용자, 체크섬을 가진 Hadoop common 빌드 문자열
hadoopVersionBuiltOn string hadoop common이 빌드된 타임스탬프

응답 예 (Response Examples)

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/info
Response Header: HTTP/1.1 200 OK
  Content-Type: application/json
  Transfer-Encoding: chunked
  Server: Jetty(6.1.26)
Response Body:
{
 "historyInfo" : {
    "startedOn":1353512830963,
    "hadoopVersionBuiltOn" : "Wed Jan 11 21:18:36 UTC 2012",
    "hadoopBuildVersion" : "0.23.1-SNAPSHOT from 1230253 by user1 source checksum bb6e554c6d50b0397d826081017437a7",
    "hadoopVersion" : "0.23.1-SNAPSHOT"
 }
}

XML 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/info
  Accept: application/xml
Response Header: HTTP/1.1 200 OK
  Content-Type: application/xml
  Content-Length: 330
  Server: Jetty(6.1.26)
Response Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<historyInfo>
  <startedOn>1353512830963</startedOn>
  <hadoopVersion>0.23.1-SNAPSHOT</hadoopVersion>
  <hadoopBuildVersion>0.23.1-SNAPSHOT from 1230253 by user1 source checksum bb6e554c6d50b0397d826081017437a7</hadoopBuildVersion>
  <hadoopVersionBuiltOn>Wed Jan 11 21:18:36 UTC 2012</hadoopVersionBuiltOn>
</historyInfo>

MapReduce API들 (MapReduce API's)

다음 리소스 목록은 MapReduce에 적용돼요.

Jobs API

jobs 리소스는 완료된 MapReduce 작업의 목록을 제공해요. 현재 파라미터의 전체 목록을 반환하지는 않아요.

  • URI: http://history-server-http-address:port/ws/v1/history/mapreduce/jobs
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 여러 파라미터를 지정할 수 있어요. started와 finished 시간은 범위를 지정할 수 있게 하는 begin과 end 파라미터를 가져요. 예를 들어 2011-12-19 오전 1시와 오후 2시 사이에 시작된 모든 작업을 startedTimeBegin=1324256400&startedTimeEnd=1324303200으로 요청할 수 있어요. Begin 파라미터가 지정되지 않으면 0으로, End 파라미터가 지정되지 않으면 무한대로 기본값이 정해져요.
    • user - 사용자 이름
    • state - 작업 상태
    • queue - 큐 이름
    • limit - 반환할 app 객체의 총 수
    • startedTimeBegin - 이 시간(epoch 이후 ms)에 시작하는 시작 시간을 가진 작업
    • startedTimeEnd - 이 시간에 끝나는 시작 시간을 가진 작업
    • finishedTimeBegin - 이 시간에 시작하는 완료 시간을 가진 작업
    • finishedTimeEnd - 이 시간에 끝나는 완료 시간을 가진 작업
jobs 객체의 요소 (Elements of the jobs object)

작업 목록을 요청하면 정보가 job 객체 배열로 반환돼요. job 객체의 구문은 Job API를 참고하세요. 단, 이것은 전체 job의 부분 집합이에요. startTime, finishTime, id, name, queue, user, state, mapsTotal, mapsCompleted, reducesTotal, reducesCompleted만 반환돼요.

Item Data Type Description
job job 객체 배열(JSON)/0개 이상의 job 객체(XML) job 객체의 컬렉션
응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs
Response Body:
{
 "jobs" : {
    "job" : [
       {
          "submitTime" : 1326381344449,
          "state" : "SUCCEEDED",
          "user" : "user1",
          "reducesTotal" : 1,
          "mapsCompleted" : 1,
          "startTime" : 1326381344489,
          "id" : "job_1326381300833_1_1",
          "name" : "word count",
          "reducesCompleted" : 1,
          "mapsTotal" : 1,
          "queue" : "default",
          "finishTime" : 1326381356010
       },
       {
          "submitTime" : 1326381446500,
          "state" : "SUCCEEDED",
          "user" : "user1",
          "reducesTotal" : 1,
          "mapsCompleted" : 1,
          "startTime" : 1326381446529,
          "id" : "job_1326381300833_2_2",
          "name" : "Sleep job",
          "reducesCompleted" : 1,
          "mapsTotal" : 1,
          "queue" : "default",
          "finishTime" : 1326381582106
       }
    ]
 }
}

XML 응답: 같은 정보를 <jobs> 루트 요소와 <job> 요소들로 반환하며, 각 필드(submitTime, startTime, finishTime, id, name, queue, user, state, mapsTotal, mapsCompleted, reducesTotal, reducesCompleted)가 하위 요소로 표현돼요.

Job API

Job 리소스는 jobid로 식별되는 특정 작업에 대한 정보를 포함해요.

  • URI: http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/{jobid}
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음
job 객체의 요소 (Elements of the job object)
Item Data Type Description
id string 작업 id
name string 작업 이름
queue string 작업이 제출된 큐
user string 사용자 이름
state string 작업 상태 - 유효한 값: NEW, INITED, RUNNING, SUCCEEDED, FAILED, KILL_WAIT, KILLED, ERROR
diagnostics string 진단 메시지
submitTime long 작업이 제출된 시간 (epoch 이후 ms)
startTime long 작업이 시작된 시간 (epoch 이후 ms)
finishTime long 작업이 완료된 시간 (epoch 이후 ms)
mapsTotal int 총 map 수
mapsCompleted int 완료된 map 수
reducesTotal int 총 reduce 수
reducesCompleted int 완료된 reduce 수
uberized boolean 작업이 uber 작업이었는지(애플리케이션 마스터에서 완전히 실행됐는지) 여부
avgMapTime long map 태스크의 평균 시간 (ms)
avgReduceTime long reduce의 평균 시간 (ms)
avgShuffleTime long shuffle의 평균 시간 (ms)
avgMergeTime long merge의 평균 시간 (ms)
failedReduceAttempts int 실패한 reduce 시도 수
killedReduceAttempts int 종료된 reduce 시도 수
successfulReduceAttempts int 성공한 reduce 시도 수
failedMapAttempts int 실패한 map 시도 수
killedMapAttempts int 종료된 map 시도 수
successfulMapAttempts int 성공한 map 시도 수
acls acls 배열(JSON)/0개 이상의 acls 객체(XML) acls 객체의 컬렉션
acls 객체의 요소 (Elements of the acls object)
Item Data Type Description
value string acl 값
name string acl 이름
응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2
Response Body:
{
 "job" : {
    "submitTime":  1326381446500,
    "avgReduceTime" : 124961,
    "failedReduceAttempts" : 0,
    "state" : "SUCCEEDED",
    "successfulReduceAttempts" : 1,
    "acls" : [
       {
          "value" : " ",
          "name" : "mapreduce.job.acl-modify-job"
       },
       {
          "value" : " ",
          "name" : "mapreduce.job.acl-view-job"
       }
    ],
    "user" : "user1",
    "reducesTotal" : 1,
    "mapsCompleted" : 1,
    "startTime" : 1326381446529,
    "id" : "job_1326381300833_2_2",
    "avgMapTime" : 2638,
    "successfulMapAttempts" : 1,
    "name" : "Sleep job",
    "avgShuffleTime" : 2540,
    "reducesCompleted" : 1,
    "diagnostics" : "",
    "failedMapAttempts" : 0,
    "avgMergeTime" : 2589,
    "killedReduceAttempts" : 0,
    "mapsTotal" : 1,
    "queue" : "default",
    "uberized" : false,
    "killedMapAttempts" : 0,
    "finishTime" : 1326381582106
 }
}

XML 응답: 같은 정보를 <job> 루트 요소와 위 필드 각각에 대응하는 하위 요소(successfulAttempt, acls 등 포함)로 반환해요.

Job Attempts API

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

  • URI: http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/{jobid}/jobattempts
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음
jobAttempts / jobAttempt 객체의 요소

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

Item Data Type Description
id int 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://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/jobattempts
Response Body:
{
 "jobAttempts" : {
    "jobAttempt" : [
       {
          "nodeId" : "host.domain.com:8041",
          "nodeHttpAddress" : "host.domain.com:8042",
          "startTime" : 1326381444693,
          "id" : 1,
          "logsLink" : "http://host.domain.com:19888/jobhistory/logs/host.domain.com:8041/container_1326381300833_0002_01_000001/job_1326381300833_2_2/user1",
          "containerId" : "container_1326381300833_0002_01_000001"
       }
    ]
 }
}

XML 응답: 같은 정보를 <jobAttempts> 루트 요소와 <jobAttempt> 요소들로 반환해요.

Job Counters API

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

  • URI: http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/{jobid}/counters
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음
jobCounters / counterGroup / counter 객체의 요소

jobCounters: id(string, job id), counterGroup 배열/0개 이상의 counterGroup 객체(XML) - counter group 객체의 컬렉션.

counterGroup: counterGroupName(string, 카운터 그룹 이름), counter 배열/0개 이상의 counter 객체(XML) - counter 객체의 컬렉션.

counter: | Item | Data Type | Description | |------|-----------|-------------| | name | string | 카운터 이름 | | reduceCounterValue | long | reduce 태스크의 카운터 값 | | mapCounterValue | long | map 태스크의 카운터 값 | | totalCounterValue | long | 모든 태스크의 카운터 값 |

응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/counters
Response Body:
{
 "jobCounters" : {
    "id" : "job_1326381300833_2_2",
    "counterGroup" : [
       {
          "counterGroupName" : "Shuffle Errors",
          "counter" : [
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "BAD_ID" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "CONNECTION" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "IO_ERROR" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "WRONG_LENGTH" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "WRONG_MAP" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "WRONG_REDUCE" }
          ]
       },
       {
          "counterGroupName" : "org.apache.hadoop.mapreduce.FileSystemCounter",
          "counter" : [
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 2483, "name" : "FILE_BYTES_READ" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 108525, "name" : "FILE_BYTES_WRITTEN" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "FILE_READ_OPS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "FILE_LARGE_READ_OPS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "FILE_WRITE_OPS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 48, "name" : "HDFS_BYTES_READ" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "HDFS_BYTES_WRITTEN" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 1, "name" : "HDFS_READ_OPS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "HDFS_LARGE_READ_OPS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "HDFS_WRITE_OPS" }
          ]
       },
       {
          "counterGroupName" : "org.apache.hadoop.mapreduce.TaskCounter",
          "counter" : [
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 1, "name" : "MAP_INPUT_RECORDS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 1200, "name" : "MAP_OUTPUT_RECORDS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 4800, "name" : "MAP_OUTPUT_BYTES" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 2235, "name" : "MAP_OUTPUT_MATERIALIZED_BYTES" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 48, "name" : "SPLIT_RAW_BYTES" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "COMBINE_INPUT_RECORDS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "COMBINE_OUTPUT_RECORDS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 1200, "name" : "REDUCE_INPUT_GROUPS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 2235, "name" : "REDUCE_SHUFFLE_BYTES" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 1200, "name" : "REDUCE_INPUT_RECORDS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "REDUCE_OUTPUT_RECORDS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 2400, "name" : "SPILLED_RECORDS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 1, "name" : "SHUFFLED_MAPS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "FAILED_SHUFFLE" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 1, "name" : "MERGED_MAP_OUTPUTS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 113, "name" : "GC_TIME_MILLIS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 1830, "name" : "CPU_MILLISECONDS" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 478068736, "name" : "PHYSICAL_MEMORY_BYTES" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 2159284224, "name" : "VIRTUAL_MEMORY_BYTES" },
             { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 378863616, "name" : "COMMITTED_HEAP_BYTES" }
          ]
       },
       {
          "counterGroupName" : "org.apache.hadoop.mapreduce.lib.input.FileInputFormatCounter",
          "counter" : [ { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "BYTES_READ" } ]
       },
       {
          "counterGroupName" : "org.apache.hadoop.mapreduce.lib.output.FileOutputFormatCounter",
          "counter" : [ { "reduceCounterValue" : 0, "mapCounterValue" : 0, "totalCounterValue" : 0, "name" : "BYTES_WRITTEN" } ]
       }
    ]
 }
}

XML 응답: 같은 정보를 <jobCounters> 루트 요소, <counterGroup>과 <counter> 요소들로 반환해요.

Job Conf API

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

  • URI: http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/{jobid}/conf
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음
conf / property 객체의 요소

conf: path(string, 작업 구성 파일의 경로), property 배열/0개 이상의 구성 속성(XML) - 구성 속성 객체의 컬렉션.

property: | Item | Data Type | Description | |------|-----------|-------------| | name | string | 구성 속성의 이름 | | value | string | 구성 속성의 값 | | source | string | 이 구성 객체가 온 위치. 둘 이상이면 목록 끝에 최신 소스로 히스토리를 보여줘요. |

응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/conf
Response Body: (작은 스니펫. 실제 출력은 작업 구성 파일의 모든 속성을 포함)
{
 "conf" : {
    "path" : "hdfs://host.domain.com:9000/user/user1/.staging/job_1326381300833_0002/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> 요소들(각각 name, value, source 하위 요소)로 반환해요.

Tasks API

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

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

task 객체 배열 - task 객체의 컬렉션 (task 객체의 구문은 Task API 참고).

응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks
Response Body:
{
 "tasks" : {
    "task" : [
       {
          "progress" : 100,
          "elapsedTime" : 6777,
          "state" : "SUCCEEDED",
          "startTime" : 1326381446541,
          "id" : "task_1326381300833_2_2_m_0",
          "type" : "MAP",
          "successfulAttempt" : "attempt_1326381300833_2_2_m_0_0",
          "finishTime" : 1326381453318
       },
       {
          "progress" : 100,
          "elapsedTime" : 135559,
          "state" : "SUCCEEDED",
          "startTime" : 1326381446544,
          "id" : "task_1326381300833_2_2_r_0",
          "type" : "REDUCE",
          "successfulAttempt" : "attempt_1326381300833_2_2_r_0_0",
          "finishTime" : 1326381582103
       }
    ]
 }
}

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

Task API

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

  • URI: http://history-server-http-address:port/ws/v1/history/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) 또는 시작되지 않았다면 -1
finishTime long 태스크가 완료된 시간 (epoch 이후 ms)
elapsedTime long 애플리케이션이 시작된 이후 경과 시간 (ms)
응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0
Response Body:
{
 "task" : {
    "progress" : 100,
    "elapsedTime" : 6777,
    "state" : "SUCCEEDED",
    "startTime" : 1326381446541,
    "id" : "task_1326381300833_2_2_m_0",
    "type" : "MAP",
    "successfulAttempt" : "attempt_1326381300833_2_2_m_0_0",
    "finishTime" : 1326381453318
 }
}

XML 응답: <task> 루트 요소로 위 필드들을 하위 요소로 반환해요.

Task Counters API

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

  • URI: http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/counters
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음
jobTaskCounters / taskCounterGroup / counter 객체의 요소

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

응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/counters
Response Body:
{
 "jobTaskCounters" : {
    "id" : "task_1326381300833_2_2_m_0",
    "taskCounterGroup" : [
       {
          "counterGroupName" : "org.apache.hadoop.mapreduce.FileSystemCounter",
          "counter" : [
             { "value" : 2363, "name" : "FILE_BYTES_READ" },
             { "value" : 54372, "name" : "FILE_BYTES_WRITTEN" },
             ...
          ]
       },
       {
          "counterGroupName" : "org.apache.hadoop.mapreduce.TaskCounter",
          "counter" : [
             { "value" : 0, "name" : "COMBINE_INPUT_RECORDS" },
             { "value" : 460, "name" : "REDUCE_INPUT_GROUPS" },
             { "value" : 27, "name" : "GC_TIME_MILLIS" },
             ...
          ]
       },
       ...
    ]
 }
}

XML 응답: <jobTaskCounters> 루트 요소, <taskCounterGroup>과 <counter> 요소들로 반환해요.

Task Attempts API

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

  • URI: http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음
taskAttempts 객체의 요소

taskAttempt 객체 배열 - task attempt 객체의 컬렉션 (구문은 Task Attempt API 참고).

응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/attempts
Response Body:
{
 "taskAttempts" : {
    "taskAttempt" : [
       {
          "assignedContainerId" : "container_1326381300833_0002_01_000002",
          "progress" : 100,
          "elapsedTime" : 2638,
          "state" : "SUCCEEDED",
          "diagnostics" : "",
          "rack" : "/98.139.92.0",
          "nodeHttpAddress" : "host.domain.com:8042",
          "startTime" : 1326381450680,
          "id" : "attempt_1326381300833_2_2_m_0_0",
          "type" : "MAP",
          "finishTime" : 1326381453318
       }
    ]
 }
}

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

Task Attempt API

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

  • URI: http://history-server-http-address:port/ws/v1/history/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 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/attempts/attempt_1326381300833_2_2_m_0_0
Response Body:
{
 "taskAttempt" : {
    "assignedContainerId" : "container_1326381300833_0002_01_000002",
    "progress" : 100,
    "elapsedTime" : 2638,
    "state" : "SUCCEEDED",
    "diagnostics" : "",
    "rack" : "/98.139.92.0",
    "nodeHttpAddress" : "host.domain.com:8042",
    "startTime" : 1326381450680,
    "id" : "attempt_1326381300833_2_2_m_0_0",
    "type" : "MAP",
    "finishTime" : 1326381453318
 }
}

XML 응답: <taskAttempt> 루트 요소로 위 필드들을 하위 요소로 반환해요.

Task Attempt Counters API

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

  • URI: http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}/counters
  • 지원 HTTP 연산: GET
  • 지원 쿼리 파라미터: 없음
jobTaskAttemptCounters / taskAttemptCounterGroup / counter 객체의 요소

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

응답 예

JSON 응답:

HTTP Request: GET http://history-server-http-address:port/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/attempts/attempt_1326381300833_2_2_m_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" : [ { "value" : 0, "name" : "COMBINE_INPUT_RECORDS" }, ... ]
       },
       ...
    ],
    "id" : "attempt_1326381300833_2_2_m_0_0"
 }
}

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

더 알아보기 (Learn more)