yarn_protos.proto 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. option java_package = "org.apache.hadoop.yarn.proto";
  19. option java_outer_classname = "YarnProtos";
  20. option java_generic_services = true;
  21. option java_generate_equals_and_hash = true;
  22. message YarnRemoteExceptionProto {
  23. optional string message = 1;
  24. optional string trace = 2;
  25. optional string class_name = 3;
  26. optional YarnRemoteExceptionProto cause = 4;
  27. }
  28. message ApplicationIdProto {
  29. optional int32 id = 1;
  30. optional int64 cluster_timestamp = 2;
  31. }
  32. message ApplicationAttemptIdProto {
  33. optional ApplicationIdProto application_id = 1;
  34. optional int32 attemptId = 2;
  35. }
  36. message ContainerIdProto {
  37. optional ApplicationIdProto app_id = 1;
  38. optional ApplicationAttemptIdProto app_attempt_id = 2;
  39. optional int32 id = 3;
  40. }
  41. message ResourceProto {
  42. optional int32 memory = 1;
  43. }
  44. message PriorityProto {
  45. optional int32 priority = 1;
  46. }
  47. enum ContainerStateProto {
  48. C_NEW = 1;
  49. C_RUNNING = 2;
  50. C_COMPLETE = 3;
  51. }
  52. message ContainerTokenProto {
  53. optional bytes identifier = 1;
  54. optional bytes password = 2;
  55. optional string kind = 3;
  56. optional string service = 4;
  57. }
  58. message ContainerProto {
  59. optional ContainerIdProto id = 1;
  60. optional NodeIdProto nodeId = 2;
  61. optional string node_http_address = 3;
  62. optional ResourceProto resource = 4;
  63. optional PriorityProto priority = 5;
  64. optional ContainerStateProto state = 6;
  65. optional ContainerTokenProto container_token = 7;
  66. optional ContainerStatusProto container_status = 8;
  67. }
  68. enum YarnApplicationStateProto {
  69. NEW = 1;
  70. SUBMITTED = 2;
  71. RUNNING = 3;
  72. FINISHED = 4;
  73. FAILED = 5;
  74. KILLED = 6;
  75. }
  76. enum FinalApplicationStatusProto {
  77. APP_UNDEFINED = 0;
  78. APP_SUCCEEDED = 1;
  79. APP_FAILED = 2;
  80. APP_KILLED = 3;
  81. }
  82. message ApplicationStatusProto {
  83. optional int32 response_id = 1;
  84. optional ApplicationAttemptIdProto application_attempt_id = 2;
  85. optional float progress = 3;
  86. }
  87. message ApplicationMasterProto {
  88. optional ApplicationIdProto application_id = 1;
  89. optional string host = 2;
  90. optional int32 rpc_port = 3;
  91. optional string trackingUrl = 4;
  92. optional ApplicationStatusProto status = 5;
  93. optional YarnApplicationStateProto state = 6;
  94. optional string client_token = 7;
  95. optional int32 containerCount = 8;
  96. optional int32 amFailCount = 9;
  97. optional string diagnostics = 10 [default = ""];
  98. }
  99. message URLProto {
  100. optional string scheme = 1;
  101. optional string host = 2;
  102. optional int32 port = 3;
  103. optional string file = 4;
  104. }
  105. enum LocalResourceVisibilityProto {
  106. PUBLIC = 1;
  107. PRIVATE = 2;
  108. APPLICATION = 3;
  109. }
  110. enum LocalResourceTypeProto {
  111. ARCHIVE = 1;
  112. FILE = 2;
  113. }
  114. message LocalResourceProto {
  115. optional URLProto resource = 1;
  116. optional int64 size = 2;
  117. optional int64 timestamp = 3;
  118. optional LocalResourceTypeProto type = 4;
  119. optional LocalResourceVisibilityProto visibility= 5;
  120. }
  121. message ApplicationResourceUsageReportProto {
  122. optional int32 num_used_containers = 1;
  123. optional int32 num_reserved_containers = 2;
  124. optional ResourceProto used_resources = 3;
  125. optional ResourceProto reserved_resources = 4;
  126. optional ResourceProto needed_resources = 5;
  127. }
  128. message ApplicationReportProto {
  129. optional ApplicationIdProto applicationId = 1;
  130. optional string user = 2;
  131. optional string queue = 3;
  132. optional string name = 4;
  133. optional string host = 5;
  134. optional int32 rpc_port = 6;
  135. optional string client_token = 7;
  136. optional ApplicationStatusProto status = 8;
  137. optional YarnApplicationStateProto yarn_application_state = 9;
  138. optional ContainerProto masterContainer = 10;
  139. optional string trackingUrl = 11;
  140. optional string diagnostics = 12 [default = "N/A"];
  141. optional int64 startTime = 13;
  142. optional int64 finishTime = 14;
  143. optional FinalApplicationStatusProto final_application_status = 15;
  144. optional ApplicationResourceUsageReportProto app_resource_Usage = 16;
  145. }
  146. message NodeIdProto {
  147. optional string host = 1;
  148. optional int32 port = 2;
  149. }
  150. message NodeHealthStatusProto {
  151. optional bool is_node_healthy = 1;
  152. optional string health_report = 2;
  153. optional int64 last_health_report_time = 3;
  154. }
  155. message NodeReportProto {
  156. optional NodeIdProto nodeId = 1;
  157. optional string httpAddress = 2;
  158. optional string rackName = 3;
  159. optional ResourceProto used = 4;
  160. optional ResourceProto capability = 5;
  161. optional int32 numContainers = 6;
  162. optional NodeHealthStatusProto node_health_status = 8;
  163. }
  164. ////////////////////////////////////////////////////////////////////////
  165. ////// From AM_RM_Protocol /////////////////////////////////////////////
  166. ////////////////////////////////////////////////////////////////////////
  167. message ResourceRequestProto {
  168. optional PriorityProto priority = 1;
  169. optional string host_name = 2;
  170. optional ResourceProto capability = 3;
  171. optional int32 num_containers = 4;
  172. }
  173. message AMResponseProto {
  174. optional bool reboot = 1;
  175. optional int32 response_id = 2;
  176. repeated ContainerProto allocated_containers = 3;
  177. repeated ContainerStatusProto completed_container_statuses = 4;
  178. optional ResourceProto limit = 5;
  179. }
  180. ////////////////////////////////////////////////////////////////////////
  181. ////// From client_RM_Protocol /////////////////////////////////////////
  182. ////////////////////////////////////////////////////////////////////////
  183. message ApplicationSubmissionContextProto {
  184. optional ApplicationIdProto application_id = 1;
  185. optional string application_name = 2 [default = "N/A"];
  186. optional string user = 3;
  187. optional string queue = 4 [default = "default"];
  188. optional PriorityProto priority = 5;
  189. optional ContainerLaunchContextProto am_container_spec = 6;
  190. }
  191. message YarnClusterMetricsProto {
  192. optional int32 num_node_managers = 1;
  193. }
  194. enum QueueStateProto {
  195. Q_STOPPED = 1;
  196. Q_RUNNING = 2;
  197. }
  198. message QueueInfoProto {
  199. optional string queueName = 1;
  200. optional float capacity = 2;
  201. optional float maximumCapacity = 3;
  202. optional float currentCapacity = 4;
  203. optional QueueStateProto state = 5;
  204. repeated QueueInfoProto childQueues = 6;
  205. repeated ApplicationReportProto applications = 7;
  206. }
  207. enum QueueACLProto {
  208. Q_SUBMIT_JOB = 1;
  209. Q_ADMINISTER_QUEUE = 2;
  210. Q_ADMINISTER_JOBS = 3;
  211. }
  212. message QueueUserACLInfoProto {
  213. optional string queueName = 1;
  214. repeated QueueACLProto userAcls = 2;
  215. }
  216. ////////////////////////////////////////////////////////////////////////
  217. ////// From container_manager //////////////////////////////////////////
  218. ////////////////////////////////////////////////////////////////////////
  219. message ContainerLaunchContextProto {
  220. optional ContainerIdProto container_id = 1;
  221. optional string user = 2;
  222. optional ResourceProto resource = 3;
  223. repeated StringLocalResourceMapProto localResources = 4;
  224. optional bytes container_tokens = 5;
  225. repeated StringBytesMapProto service_data = 6;
  226. repeated StringStringMapProto environment = 7;
  227. repeated string command = 8;
  228. }
  229. message ContainerStatusProto {
  230. optional ContainerIdProto container_id = 1;
  231. optional ContainerStateProto state = 2;
  232. optional string diagnostics = 3 [default = "N/A"];
  233. optional int32 exit_status = 4 [default = -1000];
  234. }
  235. ////////////////////////////////////////////////////////////////////////
  236. ////// From common//////////////////////////////////////////////////////
  237. ////////////////////////////////////////////////////////////////////////
  238. message StringURLMapProto {
  239. optional string key = 1;
  240. optional URLProto value = 2;
  241. }
  242. message StringLocalResourceMapProto {
  243. optional string key = 1;
  244. optional LocalResourceProto value = 2;
  245. }
  246. message StringStringMapProto {
  247. optional string key = 1;
  248. optional string value = 2;
  249. }
  250. message StringBytesMapProto {
  251. optional string key = 1;
  252. optional bytes value = 2;
  253. }