yarn_protos.proto 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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 DelegationTokenProto {
  59. optional bytes identifier = 1;
  60. optional bytes password = 2;
  61. optional string kind = 3;
  62. optional string service = 4;
  63. }
  64. message ContainerProto {
  65. optional ContainerIdProto id = 1;
  66. optional NodeIdProto nodeId = 2;
  67. optional string node_http_address = 3;
  68. optional ResourceProto resource = 4;
  69. optional PriorityProto priority = 5;
  70. optional ContainerStateProto state = 6;
  71. optional ContainerTokenProto container_token = 7;
  72. optional ContainerStatusProto container_status = 8;
  73. }
  74. enum YarnApplicationStateProto {
  75. NEW = 1;
  76. SUBMITTED = 2;
  77. RUNNING = 3;
  78. FINISHED = 4;
  79. FAILED = 5;
  80. KILLED = 6;
  81. }
  82. enum FinalApplicationStatusProto {
  83. APP_UNDEFINED = 0;
  84. APP_SUCCEEDED = 1;
  85. APP_FAILED = 2;
  86. APP_KILLED = 3;
  87. }
  88. message ApplicationStatusProto {
  89. optional int32 response_id = 1;
  90. optional ApplicationAttemptIdProto application_attempt_id = 2;
  91. optional float progress = 3;
  92. }
  93. message ApplicationMasterProto {
  94. optional ApplicationIdProto application_id = 1;
  95. optional string host = 2;
  96. optional int32 rpc_port = 3;
  97. optional string trackingUrl = 4;
  98. optional ApplicationStatusProto status = 5;
  99. optional YarnApplicationStateProto state = 6;
  100. optional string client_token = 7;
  101. optional int32 containerCount = 8;
  102. optional int32 amFailCount = 9;
  103. optional string diagnostics = 10 [default = ""];
  104. }
  105. message URLProto {
  106. optional string scheme = 1;
  107. optional string host = 2;
  108. optional int32 port = 3;
  109. optional string file = 4;
  110. }
  111. enum LocalResourceVisibilityProto {
  112. PUBLIC = 1;
  113. PRIVATE = 2;
  114. APPLICATION = 3;
  115. }
  116. enum LocalResourceTypeProto {
  117. ARCHIVE = 1;
  118. FILE = 2;
  119. }
  120. message LocalResourceProto {
  121. optional URLProto resource = 1;
  122. optional int64 size = 2;
  123. optional int64 timestamp = 3;
  124. optional LocalResourceTypeProto type = 4;
  125. optional LocalResourceVisibilityProto visibility= 5;
  126. }
  127. message ApplicationResourceUsageReportProto {
  128. optional int32 num_used_containers = 1;
  129. optional int32 num_reserved_containers = 2;
  130. optional ResourceProto used_resources = 3;
  131. optional ResourceProto reserved_resources = 4;
  132. optional ResourceProto needed_resources = 5;
  133. }
  134. message ApplicationReportProto {
  135. optional ApplicationIdProto applicationId = 1;
  136. optional string user = 2;
  137. optional string queue = 3;
  138. optional string name = 4;
  139. optional string host = 5;
  140. optional int32 rpc_port = 6;
  141. optional string client_token = 7;
  142. optional ApplicationStatusProto status = 8;
  143. optional YarnApplicationStateProto yarn_application_state = 9;
  144. optional ContainerProto masterContainer = 10;
  145. optional string trackingUrl = 11;
  146. optional string diagnostics = 12 [default = "N/A"];
  147. optional int64 startTime = 13;
  148. optional int64 finishTime = 14;
  149. optional FinalApplicationStatusProto final_application_status = 15;
  150. optional ApplicationResourceUsageReportProto app_resource_Usage = 16;
  151. optional string originalTrackingUrl = 17;
  152. }
  153. message NodeIdProto {
  154. optional string host = 1;
  155. optional int32 port = 2;
  156. }
  157. message NodeHealthStatusProto {
  158. optional bool is_node_healthy = 1;
  159. optional string health_report = 2;
  160. optional int64 last_health_report_time = 3;
  161. }
  162. message NodeReportProto {
  163. optional NodeIdProto nodeId = 1;
  164. optional string httpAddress = 2;
  165. optional string rackName = 3;
  166. optional ResourceProto used = 4;
  167. optional ResourceProto capability = 5;
  168. optional int32 numContainers = 6;
  169. optional NodeHealthStatusProto node_health_status = 8;
  170. }
  171. ////////////////////////////////////////////////////////////////////////
  172. ////// From AM_RM_Protocol /////////////////////////////////////////////
  173. ////////////////////////////////////////////////////////////////////////
  174. message ResourceRequestProto {
  175. optional PriorityProto priority = 1;
  176. optional string host_name = 2;
  177. optional ResourceProto capability = 3;
  178. optional int32 num_containers = 4;
  179. }
  180. message AMResponseProto {
  181. optional bool reboot = 1;
  182. optional int32 response_id = 2;
  183. repeated ContainerProto allocated_containers = 3;
  184. repeated ContainerStatusProto completed_container_statuses = 4;
  185. optional ResourceProto limit = 5;
  186. }
  187. ////////////////////////////////////////////////////////////////////////
  188. ////// From client_RM_Protocol /////////////////////////////////////////
  189. ////////////////////////////////////////////////////////////////////////
  190. message ApplicationSubmissionContextProto {
  191. optional ApplicationIdProto application_id = 1;
  192. optional string application_name = 2 [default = "N/A"];
  193. optional string user = 3;
  194. optional string queue = 4 [default = "default"];
  195. optional PriorityProto priority = 5;
  196. optional ContainerLaunchContextProto am_container_spec = 6;
  197. optional bool cancel_tokens_when_complete = 7 [default = true];
  198. }
  199. enum ApplicationAccessTypeProto {
  200. APPACCESS_VIEW_APP = 1;
  201. APPACCESS_MODIFY_APP = 2;
  202. }
  203. message ApplicationACLMapProto {
  204. optional ApplicationAccessTypeProto accessType = 1;
  205. optional string acl = 2 [default = " "];
  206. }
  207. message YarnClusterMetricsProto {
  208. optional int32 num_node_managers = 1;
  209. }
  210. enum QueueStateProto {
  211. Q_STOPPED = 1;
  212. Q_RUNNING = 2;
  213. }
  214. message QueueInfoProto {
  215. optional string queueName = 1;
  216. optional float capacity = 2;
  217. optional float maximumCapacity = 3;
  218. optional float currentCapacity = 4;
  219. optional QueueStateProto state = 5;
  220. repeated QueueInfoProto childQueues = 6;
  221. repeated ApplicationReportProto applications = 7;
  222. }
  223. enum QueueACLProto {
  224. QACL_SUBMIT_APPLICATIONS = 1;
  225. QACL_ADMINISTER_QUEUE = 2;
  226. }
  227. message QueueUserACLInfoProto {
  228. optional string queueName = 1;
  229. repeated QueueACLProto userAcls = 2;
  230. }
  231. ////////////////////////////////////////////////////////////////////////
  232. ////// From container_manager //////////////////////////////////////////
  233. ////////////////////////////////////////////////////////////////////////
  234. message ContainerLaunchContextProto {
  235. optional ContainerIdProto container_id = 1;
  236. optional string user = 2;
  237. optional ResourceProto resource = 3;
  238. repeated StringLocalResourceMapProto localResources = 4;
  239. optional bytes container_tokens = 5;
  240. repeated StringBytesMapProto service_data = 6;
  241. repeated StringStringMapProto environment = 7;
  242. repeated string command = 8;
  243. repeated ApplicationACLMapProto application_ACLs = 9;
  244. }
  245. message ContainerStatusProto {
  246. optional ContainerIdProto container_id = 1;
  247. optional ContainerStateProto state = 2;
  248. optional string diagnostics = 3 [default = "N/A"];
  249. optional int32 exit_status = 4 [default = -1000];
  250. }
  251. ////////////////////////////////////////////////////////////////////////
  252. ////// From common//////////////////////////////////////////////////////
  253. ////////////////////////////////////////////////////////////////////////
  254. message StringURLMapProto {
  255. optional string key = 1;
  256. optional URLProto value = 2;
  257. }
  258. message StringLocalResourceMapProto {
  259. optional string key = 1;
  260. optional LocalResourceProto value = 2;
  261. }
  262. message StringStringMapProto {
  263. optional string key = 1;
  264. optional string value = 2;
  265. }
  266. message StringBytesMapProto {
  267. optional string key = 1;
  268. optional bytes value = 2;
  269. }