yarn_protos.proto 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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 SerializedExceptionProto {
  24. optional string message = 1;
  25. optional string trace = 2;
  26. optional string class_name = 3;
  27. optional SerializedExceptionProto 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 YarnApplicationStateProto yarn_application_state = 8;
  135. optional string trackingUrl = 9;
  136. optional string diagnostics = 10 [default = "N/A"];
  137. optional int64 startTime = 11;
  138. optional int64 finishTime = 12;
  139. optional FinalApplicationStatusProto final_application_status = 13;
  140. optional ApplicationResourceUsageReportProto app_resource_Usage = 14;
  141. optional string originalTrackingUrl = 15;
  142. optional ApplicationAttemptIdProto currentApplicationAttemptId = 16;
  143. optional float progress = 17;
  144. optional string applicationType = 18;
  145. }
  146. enum NodeStateProto {
  147. NS_NEW = 1;
  148. NS_RUNNING = 2;
  149. NS_UNHEALTHY = 3;
  150. NS_DECOMMISSIONED = 4;
  151. NS_LOST = 5;
  152. NS_REBOOTED = 6;
  153. }
  154. message NodeIdProto {
  155. optional string host = 1;
  156. optional int32 port = 2;
  157. }
  158. message NodeHealthStatusProto {
  159. optional bool is_node_healthy = 1;
  160. optional string health_report = 2;
  161. optional int64 last_health_report_time = 3;
  162. }
  163. message NodeReportProto {
  164. optional NodeIdProto nodeId = 1;
  165. optional string httpAddress = 2;
  166. optional string rackName = 3;
  167. optional ResourceProto used = 4;
  168. optional ResourceProto capability = 5;
  169. optional int32 numContainers = 6;
  170. optional NodeHealthStatusProto node_health_status = 8;
  171. optional NodeStateProto node_state = 9;
  172. }
  173. ////////////////////////////////////////////////////////////////////////
  174. ////// From AM_RM_Protocol /////////////////////////////////////////////
  175. ////////////////////////////////////////////////////////////////////////
  176. message ResourceRequestProto {
  177. optional PriorityProto priority = 1;
  178. optional string resource_name = 2;
  179. optional ResourceProto capability = 3;
  180. optional int32 num_containers = 4;
  181. optional bool relax_locality = 5 [default = true];
  182. }
  183. message PreemptionMessageProto {
  184. optional StrictPreemptionContractProto strictContract = 1;
  185. optional PreemptionContractProto contract = 2;
  186. }
  187. message StrictPreemptionContractProto {
  188. repeated PreemptionContainerProto container = 1;
  189. }
  190. message PreemptionContractProto {
  191. repeated PreemptionResourceRequestProto resource = 1;
  192. repeated PreemptionContainerProto container = 2;
  193. }
  194. message PreemptionContainerProto {
  195. optional ContainerIdProto id = 1;
  196. }
  197. message PreemptionResourceRequestProto {
  198. optional ResourceRequestProto resource = 1;
  199. }
  200. message ResourceBlacklistRequestProto {
  201. repeated string blacklist_additions = 1;
  202. repeated string blacklist_removals = 2;
  203. }
  204. ////////////////////////////////////////////////////////////////////////
  205. ////// From client_RM_Protocol /////////////////////////////////////////
  206. ////////////////////////////////////////////////////////////////////////
  207. message ApplicationSubmissionContextProto {
  208. optional ApplicationIdProto application_id = 1;
  209. optional string application_name = 2 [default = "N/A"];
  210. optional string queue = 3 [default = "default"];
  211. optional PriorityProto priority = 4;
  212. optional ContainerLaunchContextProto am_container_spec = 5;
  213. optional bool cancel_tokens_when_complete = 6 [default = true];
  214. optional bool unmanaged_am = 7 [default = false];
  215. optional int32 maxAppAttempts = 8 [default = 0];
  216. optional ResourceProto resource = 9;
  217. optional string applicationType = 10 [default = "YARN"];
  218. }
  219. enum ApplicationAccessTypeProto {
  220. APPACCESS_VIEW_APP = 1;
  221. APPACCESS_MODIFY_APP = 2;
  222. }
  223. message ApplicationACLMapProto {
  224. optional ApplicationAccessTypeProto accessType = 1;
  225. optional string acl = 2 [default = " "];
  226. }
  227. message YarnClusterMetricsProto {
  228. optional int32 num_node_managers = 1;
  229. }
  230. enum QueueStateProto {
  231. Q_STOPPED = 1;
  232. Q_RUNNING = 2;
  233. }
  234. message QueueInfoProto {
  235. optional string queueName = 1;
  236. optional float capacity = 2;
  237. optional float maximumCapacity = 3;
  238. optional float currentCapacity = 4;
  239. optional QueueStateProto state = 5;
  240. repeated QueueInfoProto childQueues = 6;
  241. repeated ApplicationReportProto applications = 7;
  242. }
  243. enum QueueACLProto {
  244. QACL_SUBMIT_APPLICATIONS = 1;
  245. QACL_ADMINISTER_QUEUE = 2;
  246. }
  247. message QueueUserACLInfoProto {
  248. optional string queueName = 1;
  249. repeated QueueACLProto userAcls = 2;
  250. }
  251. ////////////////////////////////////////////////////////////////////////
  252. ////// From container_manager //////////////////////////////////////////
  253. ////////////////////////////////////////////////////////////////////////
  254. message ContainerLaunchContextProto {
  255. repeated StringLocalResourceMapProto localResources = 1;
  256. optional bytes tokens = 2;
  257. repeated StringBytesMapProto service_data = 3;
  258. repeated StringStringMapProto environment = 4;
  259. repeated string command = 5;
  260. repeated ApplicationACLMapProto application_ACLs = 6;
  261. }
  262. message ContainerStatusProto {
  263. optional ContainerIdProto container_id = 1;
  264. optional ContainerStateProto state = 2;
  265. optional string diagnostics = 3 [default = "N/A"];
  266. optional int32 exit_status = 4 [default = -1000];
  267. }
  268. enum ContainerExitStatusProto {
  269. SUCCESS = 0;
  270. INVALID = -1000;
  271. ABORTED = -100;
  272. DISKS_FAILED = -101;
  273. }
  274. ////////////////////////////////////////////////////////////////////////
  275. ////// From common//////////////////////////////////////////////////////
  276. ////////////////////////////////////////////////////////////////////////
  277. message StringURLMapProto {
  278. optional string key = 1;
  279. optional URLProto value = 2;
  280. }
  281. message StringLocalResourceMapProto {
  282. optional string key = 1;
  283. optional LocalResourceProto value = 2;
  284. }
  285. message StringStringMapProto {
  286. optional string key = 1;
  287. optional string value = 2;
  288. }
  289. message StringBytesMapProto {
  290. optional string key = 1;
  291. optional bytes value = 2;
  292. }