yarn_protos.proto 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. enum ContainerStateProto {
  45. C_NEW = 1;
  46. C_RUNNING = 2;
  47. C_COMPLETE = 3;
  48. }
  49. message ContainerTokenProto {
  50. optional bytes identifier = 1;
  51. optional bytes password = 2;
  52. optional string kind = 3;
  53. optional string service = 4;
  54. }
  55. message ContainerProto {
  56. optional ContainerIdProto id = 1;
  57. optional NodeIdProto nodeId = 2;
  58. optional string node_http_address = 3;
  59. optional ResourceProto resource = 4;
  60. optional ContainerStateProto state = 5;
  61. optional ContainerTokenProto container_token = 6;
  62. optional ContainerStatusProto container_status = 7;
  63. }
  64. enum ApplicationStateProto {
  65. NEW = 1;
  66. SUBMITTED = 2;
  67. RUNNING = 3;
  68. RESTARTING = 4;
  69. SUCCEEDED = 5;
  70. FAILED = 6;
  71. KILLED = 7;
  72. }
  73. message ApplicationStatusProto {
  74. optional int32 response_id = 1;
  75. optional ApplicationAttemptIdProto application_attempt_id = 2;
  76. optional float progress = 3;
  77. }
  78. message ApplicationMasterProto {
  79. optional ApplicationIdProto application_id = 1;
  80. optional string host = 2;
  81. optional int32 rpc_port = 3;
  82. optional string trackingUrl = 4;
  83. optional ApplicationStatusProto status = 5;
  84. optional ApplicationStateProto state = 6;
  85. optional string client_token = 7;
  86. optional int32 containerCount = 8;
  87. optional int32 amFailCount = 9;
  88. optional string diagnostics = 10 [default = ""];
  89. }
  90. message URLProto {
  91. optional string scheme = 1;
  92. optional string host = 2;
  93. optional int32 port = 3;
  94. optional string file = 4;
  95. }
  96. enum LocalResourceVisibilityProto {
  97. PUBLIC = 1;
  98. PRIVATE = 2;
  99. APPLICATION = 3;
  100. }
  101. enum LocalResourceTypeProto {
  102. ARCHIVE = 1;
  103. FILE = 2;
  104. }
  105. message LocalResourceProto {
  106. optional URLProto resource = 1;
  107. optional int64 size = 2;
  108. optional int64 timestamp = 3;
  109. optional LocalResourceTypeProto type = 4;
  110. optional LocalResourceVisibilityProto visibility= 5;
  111. }
  112. message ApplicationReportProto {
  113. optional ApplicationIdProto applicationId = 1;
  114. optional string user = 2;
  115. optional string queue = 3;
  116. optional string name = 4;
  117. optional string host = 5;
  118. optional int32 rpc_port = 6;
  119. optional string client_token = 7;
  120. optional ApplicationStatusProto status = 8;
  121. optional ApplicationStateProto state = 9;
  122. optional ContainerProto masterContainer = 10;
  123. optional string trackingUrl = 11;
  124. optional string diagnostics = 12 [default = "N/A"];
  125. optional int64 startTime = 13;
  126. }
  127. message NodeIdProto {
  128. optional string host = 1;
  129. optional int32 port = 2;
  130. }
  131. message NodeHealthStatusProto {
  132. optional bool is_node_healthy = 1;
  133. optional string health_report = 2;
  134. optional int64 last_health_report_time = 3;
  135. }
  136. message NodeReportProto {
  137. optional NodeIdProto nodeId = 1;
  138. optional string httpAddress = 2;
  139. optional string rackName = 3;
  140. optional ResourceProto used = 4;
  141. optional ResourceProto capability = 5;
  142. optional int32 numContainers = 6;
  143. optional NodeHealthStatusProto node_health_status = 8;
  144. }
  145. ////////////////////////////////////////////////////////////////////////
  146. ////// From AM_RM_Protocol /////////////////////////////////////////////
  147. ////////////////////////////////////////////////////////////////////////
  148. message ResourceRequestProto {
  149. optional PriorityProto priority = 1;
  150. optional string host_name = 2;
  151. optional ResourceProto capability = 3;
  152. optional int32 num_containers = 4;
  153. }
  154. message AMResponseProto {
  155. optional bool reboot = 1;
  156. optional int32 response_id = 2;
  157. repeated ContainerProto allocated_containers = 3;
  158. repeated ContainerStatusProto completed_container_statuses = 4;
  159. optional ResourceProto limit = 5;
  160. }
  161. ////////////////////////////////////////////////////////////////////////
  162. ////// From client_RM_Protocol /////////////////////////////////////////
  163. ////////////////////////////////////////////////////////////////////////
  164. message ApplicationSubmissionContextProto {
  165. optional ApplicationIdProto application_id = 1;
  166. optional string application_name = 2 [default = "N/A"];
  167. optional string user = 3;
  168. optional string queue = 4 [default = "default"];
  169. optional PriorityProto priority = 5;
  170. optional ContainerLaunchContextProto am_container_spec = 6;
  171. }
  172. message YarnClusterMetricsProto {
  173. optional int32 num_node_managers = 1;
  174. }
  175. enum QueueStateProto {
  176. Q_STOPPED = 1;
  177. Q_RUNNING = 2;
  178. }
  179. message QueueInfoProto {
  180. optional string queueName = 1;
  181. optional float capacity = 2;
  182. optional float maximumCapacity = 3;
  183. optional float currentCapacity = 4;
  184. optional QueueStateProto state = 5;
  185. repeated QueueInfoProto childQueues = 6;
  186. repeated ApplicationReportProto applications = 7;
  187. }
  188. enum QueueACLProto {
  189. Q_SUBMIT_JOB = 1;
  190. Q_ADMINISTER_QUEUE = 2;
  191. Q_ADMINISTER_JOBS = 3;
  192. }
  193. message QueueUserACLInfoProto {
  194. optional string queueName = 1;
  195. repeated QueueACLProto userAcls = 2;
  196. }
  197. ////////////////////////////////////////////////////////////////////////
  198. ////// From container_manager //////////////////////////////////////////
  199. ////////////////////////////////////////////////////////////////////////
  200. message ContainerLaunchContextProto {
  201. optional ContainerIdProto container_id = 1;
  202. optional string user = 2;
  203. optional ResourceProto resource = 3;
  204. repeated StringLocalResourceMapProto localResources = 4;
  205. optional bytes container_tokens = 5;
  206. repeated StringBytesMapProto service_data = 6;
  207. repeated StringStringMapProto environment = 7;
  208. repeated string command = 8;
  209. }
  210. message ContainerStatusProto {
  211. optional ContainerIdProto container_id = 1;
  212. optional ContainerStateProto state = 2;
  213. optional string diagnostics = 3 [default = "N/A"];
  214. optional int32 exit_status = 4 [default = -1000];
  215. }
  216. ////////////////////////////////////////////////////////////////////////
  217. ////// From common//////////////////////////////////////////////////////
  218. ////////////////////////////////////////////////////////////////////////
  219. message PriorityProto {
  220. optional int32 priority = 1;
  221. }
  222. message StringURLMapProto {
  223. optional string key = 1;
  224. optional URLProto value = 2;
  225. }
  226. message StringLocalResourceMapProto {
  227. optional string key = 1;
  228. optional LocalResourceProto value = 2;
  229. }
  230. message StringStringMapProto {
  231. optional string key = 1;
  232. optional string value = 2;
  233. }
  234. message StringBytesMapProto {
  235. optional string key = 1;
  236. optional bytes value = 2;
  237. }