yarn_protos.proto 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. optional string originalTrackingUrl = 17;
  146. }
  147. message NodeIdProto {
  148. optional string host = 1;
  149. optional int32 port = 2;
  150. }
  151. message NodeHealthStatusProto {
  152. optional bool is_node_healthy = 1;
  153. optional string health_report = 2;
  154. optional int64 last_health_report_time = 3;
  155. }
  156. message NodeReportProto {
  157. optional NodeIdProto nodeId = 1;
  158. optional string httpAddress = 2;
  159. optional string rackName = 3;
  160. optional ResourceProto used = 4;
  161. optional ResourceProto capability = 5;
  162. optional int32 numContainers = 6;
  163. optional NodeHealthStatusProto node_health_status = 8;
  164. }
  165. ////////////////////////////////////////////////////////////////////////
  166. ////// From AM_RM_Protocol /////////////////////////////////////////////
  167. ////////////////////////////////////////////////////////////////////////
  168. message ResourceRequestProto {
  169. optional PriorityProto priority = 1;
  170. optional string host_name = 2;
  171. optional ResourceProto capability = 3;
  172. optional int32 num_containers = 4;
  173. }
  174. message AMResponseProto {
  175. optional bool reboot = 1;
  176. optional int32 response_id = 2;
  177. repeated ContainerProto allocated_containers = 3;
  178. repeated ContainerStatusProto completed_container_statuses = 4;
  179. optional ResourceProto limit = 5;
  180. }
  181. ////////////////////////////////////////////////////////////////////////
  182. ////// From client_RM_Protocol /////////////////////////////////////////
  183. ////////////////////////////////////////////////////////////////////////
  184. message ApplicationSubmissionContextProto {
  185. optional ApplicationIdProto application_id = 1;
  186. optional string application_name = 2 [default = "N/A"];
  187. optional string user = 3;
  188. optional string queue = 4 [default = "default"];
  189. optional PriorityProto priority = 5;
  190. optional ContainerLaunchContextProto am_container_spec = 6;
  191. optional bool cancel_tokens_when_complete = 7 [default = true];
  192. }
  193. enum ApplicationAccessTypeProto {
  194. APPACCESS_VIEW_APP = 1;
  195. APPACCESS_MODIFY_APP = 2;
  196. }
  197. message ApplicationACLMapProto {
  198. optional ApplicationAccessTypeProto accessType = 1;
  199. optional string acl = 2 [default = " "];
  200. }
  201. message YarnClusterMetricsProto {
  202. optional int32 num_node_managers = 1;
  203. }
  204. enum QueueStateProto {
  205. Q_STOPPED = 1;
  206. Q_RUNNING = 2;
  207. }
  208. message QueueInfoProto {
  209. optional string queueName = 1;
  210. optional float capacity = 2;
  211. optional float maximumCapacity = 3;
  212. optional float currentCapacity = 4;
  213. optional QueueStateProto state = 5;
  214. repeated QueueInfoProto childQueues = 6;
  215. repeated ApplicationReportProto applications = 7;
  216. }
  217. enum QueueACLProto {
  218. QACL_SUBMIT_APPLICATIONS = 1;
  219. QACL_ADMINISTER_QUEUE = 2;
  220. }
  221. message QueueUserACLInfoProto {
  222. optional string queueName = 1;
  223. repeated QueueACLProto userAcls = 2;
  224. }
  225. ////////////////////////////////////////////////////////////////////////
  226. ////// From container_manager //////////////////////////////////////////
  227. ////////////////////////////////////////////////////////////////////////
  228. message ContainerLaunchContextProto {
  229. optional ContainerIdProto container_id = 1;
  230. optional string user = 2;
  231. optional ResourceProto resource = 3;
  232. repeated StringLocalResourceMapProto localResources = 4;
  233. optional bytes container_tokens = 5;
  234. repeated StringBytesMapProto service_data = 6;
  235. repeated StringStringMapProto environment = 7;
  236. repeated string command = 8;
  237. repeated ApplicationACLMapProto application_ACLs = 9;
  238. }
  239. message ContainerStatusProto {
  240. optional ContainerIdProto container_id = 1;
  241. optional ContainerStateProto state = 2;
  242. optional string diagnostics = 3 [default = "N/A"];
  243. optional int32 exit_status = 4 [default = -1000];
  244. }
  245. ////////////////////////////////////////////////////////////////////////
  246. ////// From common//////////////////////////////////////////////////////
  247. ////////////////////////////////////////////////////////////////////////
  248. message StringURLMapProto {
  249. optional string key = 1;
  250. optional URLProto value = 2;
  251. }
  252. message StringLocalResourceMapProto {
  253. optional string key = 1;
  254. optional LocalResourceProto value = 2;
  255. }
  256. message StringStringMapProto {
  257. optional string key = 1;
  258. optional string value = 2;
  259. }
  260. message StringBytesMapProto {
  261. optional string key = 1;
  262. optional bytes value = 2;
  263. }