yarn_protos.proto 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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. PATTERN = 3;
  120. }
  121. message LocalResourceProto {
  122. optional URLProto resource = 1;
  123. optional int64 size = 2;
  124. optional int64 timestamp = 3;
  125. optional LocalResourceTypeProto type = 4;
  126. optional LocalResourceVisibilityProto visibility = 5;
  127. optional string pattern = 6;
  128. }
  129. message ApplicationResourceUsageReportProto {
  130. optional int32 num_used_containers = 1;
  131. optional int32 num_reserved_containers = 2;
  132. optional ResourceProto used_resources = 3;
  133. optional ResourceProto reserved_resources = 4;
  134. optional ResourceProto needed_resources = 5;
  135. }
  136. message ApplicationReportProto {
  137. optional ApplicationIdProto applicationId = 1;
  138. optional string user = 2;
  139. optional string queue = 3;
  140. optional string name = 4;
  141. optional string host = 5;
  142. optional int32 rpc_port = 6;
  143. optional string client_token = 7;
  144. optional ApplicationStatusProto status = 8;
  145. optional YarnApplicationStateProto yarn_application_state = 9;
  146. optional ContainerProto masterContainer = 10;
  147. optional string trackingUrl = 11;
  148. optional string diagnostics = 12 [default = "N/A"];
  149. optional int64 startTime = 13;
  150. optional int64 finishTime = 14;
  151. optional FinalApplicationStatusProto final_application_status = 15;
  152. optional ApplicationResourceUsageReportProto app_resource_Usage = 16;
  153. optional string originalTrackingUrl = 17;
  154. }
  155. message NodeIdProto {
  156. optional string host = 1;
  157. optional int32 port = 2;
  158. }
  159. message NodeHealthStatusProto {
  160. optional bool is_node_healthy = 1;
  161. optional string health_report = 2;
  162. optional int64 last_health_report_time = 3;
  163. }
  164. message NodeReportProto {
  165. optional NodeIdProto nodeId = 1;
  166. optional string httpAddress = 2;
  167. optional string rackName = 3;
  168. optional ResourceProto used = 4;
  169. optional ResourceProto capability = 5;
  170. optional int32 numContainers = 6;
  171. optional NodeHealthStatusProto node_health_status = 8;
  172. }
  173. ////////////////////////////////////////////////////////////////////////
  174. ////// From AM_RM_Protocol /////////////////////////////////////////////
  175. ////////////////////////////////////////////////////////////////////////
  176. message ResourceRequestProto {
  177. optional PriorityProto priority = 1;
  178. optional string host_name = 2;
  179. optional ResourceProto capability = 3;
  180. optional int32 num_containers = 4;
  181. }
  182. message AMResponseProto {
  183. optional bool reboot = 1;
  184. optional int32 response_id = 2;
  185. repeated ContainerProto allocated_containers = 3;
  186. repeated ContainerStatusProto completed_container_statuses = 4;
  187. optional ResourceProto limit = 5;
  188. }
  189. ////////////////////////////////////////////////////////////////////////
  190. ////// From client_RM_Protocol /////////////////////////////////////////
  191. ////////////////////////////////////////////////////////////////////////
  192. message ApplicationSubmissionContextProto {
  193. optional ApplicationIdProto application_id = 1;
  194. optional string application_name = 2 [default = "N/A"];
  195. optional string user = 3;
  196. optional string queue = 4 [default = "default"];
  197. optional PriorityProto priority = 5;
  198. optional ContainerLaunchContextProto am_container_spec = 6;
  199. optional bool cancel_tokens_when_complete = 7 [default = true];
  200. }
  201. enum ApplicationAccessTypeProto {
  202. APPACCESS_VIEW_APP = 1;
  203. APPACCESS_MODIFY_APP = 2;
  204. }
  205. message ApplicationACLMapProto {
  206. optional ApplicationAccessTypeProto accessType = 1;
  207. optional string acl = 2 [default = " "];
  208. }
  209. message YarnClusterMetricsProto {
  210. optional int32 num_node_managers = 1;
  211. }
  212. enum QueueStateProto {
  213. Q_STOPPED = 1;
  214. Q_RUNNING = 2;
  215. }
  216. message QueueInfoProto {
  217. optional string queueName = 1;
  218. optional float capacity = 2;
  219. optional float maximumCapacity = 3;
  220. optional float currentCapacity = 4;
  221. optional QueueStateProto state = 5;
  222. repeated QueueInfoProto childQueues = 6;
  223. repeated ApplicationReportProto applications = 7;
  224. }
  225. enum QueueACLProto {
  226. QACL_SUBMIT_APPLICATIONS = 1;
  227. QACL_ADMINISTER_QUEUE = 2;
  228. }
  229. message QueueUserACLInfoProto {
  230. optional string queueName = 1;
  231. repeated QueueACLProto userAcls = 2;
  232. }
  233. ////////////////////////////////////////////////////////////////////////
  234. ////// From container_manager //////////////////////////////////////////
  235. ////////////////////////////////////////////////////////////////////////
  236. message ContainerLaunchContextProto {
  237. optional ContainerIdProto container_id = 1;
  238. optional string user = 2;
  239. optional ResourceProto resource = 3;
  240. repeated StringLocalResourceMapProto localResources = 4;
  241. optional bytes container_tokens = 5;
  242. repeated StringBytesMapProto service_data = 6;
  243. repeated StringStringMapProto environment = 7;
  244. repeated string command = 8;
  245. repeated ApplicationACLMapProto application_ACLs = 9;
  246. }
  247. message ContainerStatusProto {
  248. optional ContainerIdProto container_id = 1;
  249. optional ContainerStateProto state = 2;
  250. optional string diagnostics = 3 [default = "N/A"];
  251. optional int32 exit_status = 4 [default = -1000];
  252. }
  253. ////////////////////////////////////////////////////////////////////////
  254. ////// From common//////////////////////////////////////////////////////
  255. ////////////////////////////////////////////////////////////////////////
  256. message StringURLMapProto {
  257. optional string key = 1;
  258. optional URLProto value = 2;
  259. }
  260. message StringLocalResourceMapProto {
  261. optional string key = 1;
  262. optional LocalResourceProto value = 2;
  263. }
  264. message StringStringMapProto {
  265. optional string key = 1;
  266. optional string value = 2;
  267. }
  268. message StringBytesMapProto {
  269. optional string key = 1;
  270. optional bytes value = 2;
  271. }