yarn_protos.proto 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. import "Security.proto";
  23. message YarnRemoteExceptionProto {
  24. optional string message = 1;
  25. optional string trace = 2;
  26. optional string class_name = 3;
  27. optional YarnRemoteExceptionProto cause = 4;
  28. }
  29. message ApplicationIdProto {
  30. optional int32 id = 1;
  31. optional int64 cluster_timestamp = 2;
  32. }
  33. message ApplicationAttemptIdProto {
  34. optional ApplicationIdProto application_id = 1;
  35. optional int32 attemptId = 2;
  36. }
  37. message ContainerIdProto {
  38. optional ApplicationIdProto app_id = 1;
  39. optional ApplicationAttemptIdProto app_attempt_id = 2;
  40. optional int32 id = 3;
  41. }
  42. message ResourceProto {
  43. optional int32 memory = 1;
  44. optional int32 virtual_cores = 2;
  45. }
  46. message PriorityProto {
  47. optional int32 priority = 1;
  48. }
  49. enum ContainerStateProto {
  50. C_NEW = 1;
  51. C_RUNNING = 2;
  52. C_COMPLETE = 3;
  53. }
  54. message ContainerProto {
  55. optional ContainerIdProto id = 1;
  56. optional NodeIdProto nodeId = 2;
  57. optional string node_http_address = 3;
  58. optional ResourceProto resource = 4;
  59. optional PriorityProto priority = 5;
  60. optional hadoop.common.TokenProto container_token = 6;
  61. }
  62. enum YarnApplicationStateProto {
  63. NEW = 1;
  64. NEW_SAVING = 2;
  65. SUBMITTED = 3;
  66. ACCEPTED = 4;
  67. RUNNING = 5;
  68. FINISHED = 6;
  69. FAILED = 7;
  70. KILLED = 8;
  71. }
  72. enum FinalApplicationStatusProto {
  73. APP_UNDEFINED = 0;
  74. APP_SUCCEEDED = 1;
  75. APP_FAILED = 2;
  76. APP_KILLED = 3;
  77. }
  78. message ApplicationStatusProto {
  79. optional int32 response_id = 1;
  80. optional ApplicationAttemptIdProto application_attempt_id = 2;
  81. optional float progress = 3;
  82. }
  83. message ApplicationMasterProto {
  84. optional ApplicationIdProto application_id = 1;
  85. optional string host = 2;
  86. optional int32 rpc_port = 3;
  87. optional string trackingUrl = 4;
  88. optional ApplicationStatusProto status = 5;
  89. optional YarnApplicationStateProto state = 6;
  90. optional hadoop.common.TokenProto client_token = 7;
  91. optional int32 containerCount = 8;
  92. optional int32 amFailCount = 9;
  93. optional string diagnostics = 10 [default = ""];
  94. }
  95. message URLProto {
  96. optional string scheme = 1;
  97. optional string host = 2;
  98. optional int32 port = 3;
  99. optional string file = 4;
  100. }
  101. enum LocalResourceVisibilityProto {
  102. PUBLIC = 1;
  103. PRIVATE = 2;
  104. APPLICATION = 3;
  105. }
  106. enum LocalResourceTypeProto {
  107. ARCHIVE = 1;
  108. FILE = 2;
  109. PATTERN = 3;
  110. }
  111. message LocalResourceProto {
  112. optional URLProto resource = 1;
  113. optional int64 size = 2;
  114. optional int64 timestamp = 3;
  115. optional LocalResourceTypeProto type = 4;
  116. optional LocalResourceVisibilityProto visibility = 5;
  117. optional string pattern = 6;
  118. }
  119. message ApplicationResourceUsageReportProto {
  120. optional int32 num_used_containers = 1;
  121. optional int32 num_reserved_containers = 2;
  122. optional ResourceProto used_resources = 3;
  123. optional ResourceProto reserved_resources = 4;
  124. optional ResourceProto needed_resources = 5;
  125. }
  126. message ApplicationReportProto {
  127. optional ApplicationIdProto applicationId = 1;
  128. optional string user = 2;
  129. optional string queue = 3;
  130. optional string name = 4;
  131. optional string host = 5;
  132. optional int32 rpc_port = 6;
  133. optional hadoop.common.TokenProto client_token = 7;
  134. optional ApplicationStatusProto status = 8;
  135. optional YarnApplicationStateProto yarn_application_state = 9;
  136. optional ContainerProto masterContainer = 10;
  137. optional string trackingUrl = 11;
  138. optional string diagnostics = 12 [default = "N/A"];
  139. optional int64 startTime = 13;
  140. optional int64 finishTime = 14;
  141. optional FinalApplicationStatusProto final_application_status = 15;
  142. optional ApplicationResourceUsageReportProto app_resource_Usage = 16;
  143. optional string originalTrackingUrl = 17;
  144. optional ApplicationAttemptIdProto currentApplicationAttemptId = 18;
  145. optional float progress = 19;
  146. }
  147. enum NodeStateProto {
  148. NS_NEW = 1;
  149. NS_RUNNING = 2;
  150. NS_UNHEALTHY = 3;
  151. NS_DECOMMISSIONED = 4;
  152. NS_LOST = 5;
  153. NS_REBOOTED = 6;
  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. optional NodeStateProto node_state = 9;
  173. }
  174. ////////////////////////////////////////////////////////////////////////
  175. ////// From AM_RM_Protocol /////////////////////////////////////////////
  176. ////////////////////////////////////////////////////////////////////////
  177. message ResourceRequestProto {
  178. optional PriorityProto priority = 1;
  179. optional string host_name = 2;
  180. optional ResourceProto capability = 3;
  181. optional int32 num_containers = 4;
  182. }
  183. ////////////////////////////////////////////////////////////////////////
  184. ////// From client_RM_Protocol /////////////////////////////////////////
  185. ////////////////////////////////////////////////////////////////////////
  186. message ApplicationSubmissionContextProto {
  187. optional ApplicationIdProto application_id = 1;
  188. optional string application_name = 2 [default = "N/A"];
  189. optional string queue = 3 [default = "default"];
  190. optional PriorityProto priority = 4;
  191. optional ContainerLaunchContextProto am_container_spec = 5;
  192. optional bool cancel_tokens_when_complete = 6 [default = true];
  193. optional bool unmanaged_am = 7 [default = false];
  194. optional int32 maxAppAttempts = 8 [default = 0];
  195. optional ResourceProto resource = 9;
  196. }
  197. enum ApplicationAccessTypeProto {
  198. APPACCESS_VIEW_APP = 1;
  199. APPACCESS_MODIFY_APP = 2;
  200. }
  201. message ApplicationACLMapProto {
  202. optional ApplicationAccessTypeProto accessType = 1;
  203. optional string acl = 2 [default = " "];
  204. }
  205. message YarnClusterMetricsProto {
  206. optional int32 num_node_managers = 1;
  207. }
  208. enum QueueStateProto {
  209. Q_STOPPED = 1;
  210. Q_RUNNING = 2;
  211. }
  212. message QueueInfoProto {
  213. optional string queueName = 1;
  214. optional float capacity = 2;
  215. optional float maximumCapacity = 3;
  216. optional float currentCapacity = 4;
  217. optional QueueStateProto state = 5;
  218. repeated QueueInfoProto childQueues = 6;
  219. repeated ApplicationReportProto applications = 7;
  220. }
  221. enum QueueACLProto {
  222. QACL_SUBMIT_APPLICATIONS = 1;
  223. QACL_ADMINISTER_QUEUE = 2;
  224. }
  225. message QueueUserACLInfoProto {
  226. optional string queueName = 1;
  227. repeated QueueACLProto userAcls = 2;
  228. }
  229. ////////////////////////////////////////////////////////////////////////
  230. ////// From container_manager //////////////////////////////////////////
  231. ////////////////////////////////////////////////////////////////////////
  232. message ContainerLaunchContextProto {
  233. optional string user = 1;
  234. repeated StringLocalResourceMapProto localResources = 2;
  235. optional bytes container_tokens = 3;
  236. repeated StringBytesMapProto service_data = 4;
  237. repeated StringStringMapProto environment = 5;
  238. repeated string command = 6;
  239. repeated ApplicationACLMapProto application_ACLs = 7;
  240. }
  241. message ContainerStatusProto {
  242. optional ContainerIdProto container_id = 1;
  243. optional ContainerStateProto state = 2;
  244. optional string diagnostics = 3 [default = "N/A"];
  245. optional int32 exit_status = 4 [default = -1000];
  246. }
  247. enum ContainerExitStatusProto {
  248. SUCCESS = 0;
  249. INVALID = -1000;
  250. ABORTED = -100;
  251. DISKS_FAILED = -101;
  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. }
  272. ////////////////////////////////////////////////////////////////////////
  273. ////// From recovery////////////////////////////////////////////////////
  274. ////////////////////////////////////////////////////////////////////////
  275. message ApplicationStateDataProto {
  276. optional int64 submit_time = 1;
  277. optional ApplicationSubmissionContextProto application_submission_context = 2;
  278. }
  279. message ApplicationAttemptStateDataProto {
  280. optional ApplicationAttemptIdProto attemptId = 1;
  281. optional ContainerProto master_container = 2;
  282. }