Task Resource
The Task resource provides a set of REST endpoints that give Presto servers the ability to communicate about tasks and task output. This isn’t a service that will be used by end users, but it supports the execution of queries on a Presto installation.
GET /v1/task()
Returns information about all tasks known to a Presto server.
Note that the output of a call to /v1/task can be quite large. If you execute this against a busy Presto server the response received will include a listing of every task known to that server along with detailed statistics about operators and drivers.
The following example response shows a trivial task response that has been truncated to fit this manual. A real response from a busy Presto server would generate pages and pages of output. Here there is a taskId for a task which is in the CANCELED state.
Example response:
1. [ {
2. "taskId" : "20131222_183944_00011_dk5x2.1.0",
3. "version" : 9223372036854775807,
4. "state" : "CANCELED",
5. "self" : "unknown",
6. "lastHeartbeat" : "2013-12-22T13:54:46.566-05:00",
7. "outputBuffers" : {
8. "state" : "FINISHED",
9. "masterSequenceId" : 0,
10. "pagesAdded" : 0,
11. "buffers" : [ ]
12. },
13. "noMoreSplits" : [ ],
14. "stats" : {
15. "createTime" : "2013-12-22T13:54:46.566-05:00",
16. "elapsedTime" : "0.00ns",
17. "queuedTime" : "92.00us",
18. "totalDrivers" : 0,
19. "queuedDrivers" : 0,
20. "runningDrivers" : 0,
21. "completedDrivers" : 0,
22. "memoryReservation" : "0B",
23. "totalScheduledTime" : "0.00ns",
24. "totalCpuTime" : "0.00ns",
25. "totalBlockedTime" : "0.00ns",
26. "rawInputDataSize" : "0B",
27. "rawInputPositions" : 0,
28. "processedInputDataSize" : "0B",
29. "processedInputPositions" : 0,
30. "outputDataSize" : "0B",
31. "outputPositions" : 0,
32. "pipelines" : [ ]
33. },
34. "failures" : [ ],
35. "outputs" : { }
36. }]
POST /v1/task/{taskId}()
DELETE /v1/task/{taskId}()
Deletes a given task from a Presto server.
GET /v1/task/{taskId}()
Retrieves information about a specific task by taskId.
The following example lists the output of a task. It contains the following high-level sections:
outputBuffersnoMoreSplitsstatsfailuresoutputs
This is the same output that is also present in the response from the Query resource which lists all of the stages and tasks involved in a particular query. This is call is used by Presto to coordinate a queries.
Example response:
1. {
2. "taskId" : "20140115_170528_00004_dk5x2.0.0",
3. "version" : 42,
4. "state" : "FINISHED",
5. "self" : "http://10.193.207.128:8080/v1/task/20140115_170528_00004_dk5x2.0.0",
6. "lastHeartbeat" : "2014-01-15T12:12:12.518-05:00",
7. "outputBuffers" : {
8. "state" : "FINISHED",
9. "masterSequenceId" : 0,
10. "pagesAdded" : 1,
11. "buffers" : [ {
12. "bufferId" : "out",
13. "finished" : true,
14. "bufferedPages" : 0,
15. "pagesSent" : 1
16. } ]
17. },
18. "noMoreSplits" : [ "8" ],
19. "stats" : {
20. "createTime" : "2014-01-15T12:12:08.520-05:00",
21. "startTime" : "2014-01-15T12:12:08.526-05:00",
22. "endTime" : "2014-01-15T12:12:12.518-05:00",
23. "elapsedTime" : "4.00s",
24. "queuedTime" : "6.39ms",
25. "totalDrivers" : 1,
26. "queuedDrivers" : 0,
27. "runningDrivers" : 0,
28. "completedDrivers" : 1,
29. "memoryReservation" : "174.76kB",
30. "totalScheduledTime" : "4.19ms",
31. "totalCpuTime" : "4.09ms",
32. "totalBlockedTime" : "29.50ms",
33. "rawInputDataSize" : "10.90kB",
34. "rawInputPositions" : 154,
35. "processedInputDataSize" : "10.90kB",
36. "processedInputPositions" : 154,
37. "outputDataSize" : "10.90kB",
38. "outputPositions" : 154,
39. "pipelines" : [ {
40. "inputPipeline" : true,
41. "outputPipeline" : true,
42. "totalDrivers" : 1,
43. "queuedDrivers" : 0,
44. "runningDrivers" : 0,
45. "completedDrivers" : 1,
46. "memoryReservation" : "0B",
47. "queuedTime" : {
48. "maxError" : 0.0,
49. "count" : 1.0,
50. "total" : 5857000.0,
51. "p01" : 5857000,
52. "p05" : 5857000,
53. "p10" : 5857000,
54. "p25" : 5857000,
55. "p50" : 5857000,
56. "p75" : 5857000,
57. "p90" : 5857000,
58. "p95" : 5857000,
59. "p99" : 5857000,
60. "min" : 5857000,
61. "max" : 5857000
62. },
63. "elapsedTime" : {
64. "maxError" : 0.0,
65. "count" : 1.0,
66. "total" : 4.1812E7,
67. "p01" : 41812000,
68. "p05" : 41812000,
69. "p10" : 41812000,
70. "p25" : 41812000,
71. "p50" : 41812000,
72. "p75" : 41812000,
73. "p90" : 41812000,
74. "p95" : 41812000,
75. "p99" : 41812000,
76. "min" : 41812000,
77. "max" : 41812000
78. },
79. "totalScheduledTime" : "4.19ms",
80. "totalCpuTime" : "4.09ms",
81. "totalBlockedTime" : "29.50ms",
82. "rawInputDataSize" : "10.90kB",
83. "rawInputPositions" : 154,
84. "processedInputDataSize" : "10.90kB",
85. "processedInputPositions" : 154,
86. "outputDataSize" : "10.90kB",
87. "outputPositions" : 154,
88. "operatorSummaries" : [ {
89. "operatorId" : 0,
90. "operatorType" : "ExchangeOperator",
91. "addInputCalls" : 0,
92. "addInputWall" : "0.00ns",
93. "addInputCpu" : "0.00ns",
94. "addInputUser" : "0.00ns",
95. "inputDataSize" : "10.90kB",
96. "inputPositions" : 154,
97. "getOutputCalls" : 1,
98. "getOutputWall" : "146.00us",
99. "getOutputCpu" : "137.90us",
100. "getOutputUser" : "0.00ns",
101. "outputDataSize" : "10.90kB",
102. "outputPositions" : 154,
103. "blockedWall" : "29.50ms",
104. "finishCalls" : 0,
105. "finishWall" : "0.00ns",
106. "finishCpu" : "0.00ns",
107. "finishUser" : "0.00ns",
108. "memoryReservation" : "0B",
109. "info" : {
110. "bufferedBytes" : 0,
111. "averageBytesPerRequest" : 11158,
112. "bufferedPages" : 0,
113. "pageBufferClientStatuses" : [ {
114. "uri" : "http://10.193.207.128:8080/v1/task/20140115_170528_00004_dk5x2.1.0/results/ab68e201-3878-4b21-b6b9-f6658ddc408b",
115. "state" : "closed",
116. "lastUpdate" : "2014-01-15T12:12:08.562-05:00",
117. "pagesReceived" : 1,
118. "requestsScheduled" : 3,
119. "requestsCompleted" : 3,
120. "httpRequestState" : "queued"
121. } ]
122. }
123. }, {
124. "operatorId" : 1,
125. "operatorType" : "FilterAndProjectOperator",
126. "addInputCalls" : 1,
127. "addInputWall" : "919.00us",
128. "addInputCpu" : "919.38us",
129. "addInputUser" : "0.00ns",
130. "inputDataSize" : "10.90kB",
131. "inputPositions" : 154,
132. "getOutputCalls" : 2,
133. "getOutputWall" : "128.00us",
134. "getOutputCpu" : "128.64us",
135. "getOutputUser" : "0.00ns",
136. "outputDataSize" : "10.45kB",
137. "outputPositions" : 154,
138. "blockedWall" : "0.00ns",
139. "finishCalls" : 5,
140. "finishWall" : "258.00us",
141. "finishCpu" : "253.19us",
142. "finishUser" : "0.00ns",
143. "memoryReservation" : "0B"
144. }, {
145. "operatorId" : 2,
146. "operatorType" : "OrderByOperator",
147. "addInputCalls" : 1,
148. "addInputWall" : "438.00us",
149. "addInputCpu" : "439.18us",
150. "addInputUser" : "0.00ns",
151. "inputDataSize" : "10.45kB",
152. "inputPositions" : 154,
153. "getOutputCalls" : 4,
154. "getOutputWall" : "869.00us",
155. "getOutputCpu" : "831.85us",
156. "getOutputUser" : "0.00ns",
157. "outputDataSize" : "10.45kB",
158. "outputPositions" : 154,
159. "blockedWall" : "0.00ns",
160. "finishCalls" : 4,
161. "finishWall" : "808.00us",
162. "finishCpu" : "810.18us",
163. "finishUser" : "0.00ns",
164. "memoryReservation" : "174.76kB"
165. }, {
166. "operatorId" : 3,
167. "operatorType" : "FilterAndProjectOperator",
168. "addInputCalls" : 1,
169. "addInputWall" : "166.00us",
170. "addInputCpu" : "166.66us",
171. "addInputUser" : "0.00ns",
172. "inputDataSize" : "10.45kB",
173. "inputPositions" : 154,
174. "getOutputCalls" : 5,
175. "getOutputWall" : "305.00us",
176. "getOutputCpu" : "241.14us",
177. "getOutputUser" : "0.00ns",
178. "outputDataSize" : "10.90kB",
179. "outputPositions" : 154,
180. "blockedWall" : "0.00ns",
181. "finishCalls" : 2,
182. "finishWall" : "70.00us",
183. "finishCpu" : "71.02us",
184. "finishUser" : "0.00ns",
185. "memoryReservation" : "0B"
186. }, {
187. "operatorId" : 4,
188. "operatorType" : "TaskOutputOperator",
189. "addInputCalls" : 1,
190. "addInputWall" : "50.00us",
191. "addInputCpu" : "51.03us",
192. "addInputUser" : "0.00ns",
193. "inputDataSize" : "10.90kB",
194. "inputPositions" : 154,
195. "getOutputCalls" : 0,
196. "getOutputWall" : "0.00ns",
197. "getOutputCpu" : "0.00ns",
198. "getOutputUser" : "0.00ns",
199. "outputDataSize" : "10.90kB",
200. "outputPositions" : 154,
201. "blockedWall" : "0.00ns",
202. "finishCalls" : 1,
203. "finishWall" : "35.00us",
204. "finishCpu" : "35.39us",
205. "finishUser" : "0.00ns",
206. "memoryReservation" : "0B"
207. } ],
208. "drivers" : [ ]
209. } ]
210. },
211. "failures" : [ ],
212. "outputs" : { }
213. }
GET /v1/task/{taskId}/results/{outputId}/{token}()
This service is used by Presto to retrieve task output.
DELETE /v1/task/{taskId}/results/{outputId}()
This service is used by Presto to delete task output.
