yarn_protos.proto 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  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. /**
  19. * These .proto interfaces are public and stable.
  20. * Please see http://wiki.apache.org/hadoop/Compatibility
  21. * for what changes are allowed for a *stable* .proto interface.
  22. */
  23. option java_package = "org.apache.hadoop.yarn.proto";
  24. option java_outer_classname = "YarnProtos";
  25. option java_generic_services = true;
  26. option java_generate_equals_and_hash = true;
  27. package hadoop.yarn;
  28. import "Security.proto";
  29. message SerializedExceptionProto {
  30. optional string message = 1;
  31. optional string trace = 2;
  32. optional string class_name = 3;
  33. optional SerializedExceptionProto cause = 4;
  34. }
  35. message ApplicationIdProto {
  36. optional int32 id = 1;
  37. optional int64 cluster_timestamp = 2;
  38. }
  39. message ApplicationAttemptIdProto {
  40. optional ApplicationIdProto application_id = 1;
  41. optional int32 attemptId = 2;
  42. }
  43. message ContainerIdProto {
  44. optional ApplicationIdProto app_id = 1;
  45. optional ApplicationAttemptIdProto app_attempt_id = 2;
  46. optional int64 id = 3;
  47. }
  48. message ResourceProto {
  49. optional int32 memory = 1;
  50. optional int32 virtual_cores = 2;
  51. }
  52. message ResourceOptionProto {
  53. optional ResourceProto resource = 1;
  54. optional int32 over_commit_timeout = 2;
  55. }
  56. message NodeResourceMapProto {
  57. optional NodeIdProto node_id = 1;
  58. optional ResourceOptionProto resource_option = 2;
  59. }
  60. message PriorityProto {
  61. optional int32 priority = 1;
  62. }
  63. enum ContainerStateProto {
  64. C_NEW = 1;
  65. C_RUNNING = 2;
  66. C_COMPLETE = 3;
  67. }
  68. message ContainerProto {
  69. optional ContainerIdProto id = 1;
  70. optional NodeIdProto nodeId = 2;
  71. optional string node_http_address = 3;
  72. optional ResourceProto resource = 4;
  73. optional PriorityProto priority = 5;
  74. optional hadoop.common.TokenProto container_token = 6;
  75. }
  76. message ContainerReportProto {
  77. optional ContainerIdProto container_id = 1;
  78. optional ResourceProto resource = 2;
  79. optional NodeIdProto node_id = 3;
  80. optional PriorityProto priority = 4;
  81. optional int64 creation_time = 5;
  82. optional int64 finish_time = 6;
  83. optional string diagnostics_info = 7 [default = "N/A"];
  84. optional string log_url = 8;
  85. optional int32 container_exit_status = 9;
  86. optional ContainerStateProto container_state = 10;
  87. }
  88. enum YarnApplicationStateProto {
  89. NEW = 1;
  90. NEW_SAVING = 2;
  91. SUBMITTED = 3;
  92. ACCEPTED = 4;
  93. RUNNING = 5;
  94. FINISHED = 6;
  95. FAILED = 7;
  96. KILLED = 8;
  97. }
  98. enum YarnApplicationAttemptStateProto {
  99. APP_ATTEMPT_NEW = 1;
  100. APP_ATTEMPT_SUBMITTED = 2;
  101. APP_ATTEMPT_SCHEDULED = 3;
  102. APP_ATTEMPT_ALLOCATED_SAVING = 4;
  103. APP_ATTEMPT_ALLOCATED = 5;
  104. APP_ATTEMPT_LAUNCHED = 6;
  105. APP_ATTEMPT_FAILED = 7;
  106. APP_ATTEMPT_RUNNING = 8;
  107. APP_ATTEMPT_FINISHING = 9;
  108. APP_ATTEMPT_FINISHED = 10;
  109. APP_ATTEMPT_KILLED = 11;
  110. }
  111. enum FinalApplicationStatusProto {
  112. APP_UNDEFINED = 0;
  113. APP_SUCCEEDED = 1;
  114. APP_FAILED = 2;
  115. APP_KILLED = 3;
  116. }
  117. message URLProto {
  118. optional string scheme = 1;
  119. optional string host = 2;
  120. optional int32 port = 3;
  121. optional string file = 4;
  122. optional string userInfo = 5;
  123. }
  124. enum LocalResourceVisibilityProto {
  125. PUBLIC = 1;
  126. PRIVATE = 2;
  127. APPLICATION = 3;
  128. }
  129. enum LocalResourceTypeProto {
  130. ARCHIVE = 1;
  131. FILE = 2;
  132. PATTERN = 3;
  133. }
  134. message LocalResourceProto {
  135. optional URLProto resource = 1;
  136. optional int64 size = 2;
  137. optional int64 timestamp = 3;
  138. optional LocalResourceTypeProto type = 4;
  139. optional LocalResourceVisibilityProto visibility = 5;
  140. optional string pattern = 6;
  141. optional bool should_be_uploaded_to_shared_cache = 7;
  142. }
  143. message ApplicationResourceUsageReportProto {
  144. optional int32 num_used_containers = 1;
  145. optional int32 num_reserved_containers = 2;
  146. optional ResourceProto used_resources = 3;
  147. optional ResourceProto reserved_resources = 4;
  148. optional ResourceProto needed_resources = 5;
  149. optional int64 memory_seconds = 6;
  150. optional int64 vcore_seconds = 7;
  151. }
  152. message ApplicationReportProto {
  153. optional ApplicationIdProto applicationId = 1;
  154. optional string user = 2;
  155. optional string queue = 3;
  156. optional string name = 4;
  157. optional string host = 5;
  158. optional int32 rpc_port = 6;
  159. optional hadoop.common.TokenProto client_to_am_token = 7;
  160. optional YarnApplicationStateProto yarn_application_state = 8;
  161. optional string trackingUrl = 9;
  162. optional string diagnostics = 10 [default = "N/A"];
  163. optional int64 startTime = 11;
  164. optional int64 finishTime = 12;
  165. optional FinalApplicationStatusProto final_application_status = 13;
  166. optional ApplicationResourceUsageReportProto app_resource_Usage = 14;
  167. optional string originalTrackingUrl = 15;
  168. optional ApplicationAttemptIdProto currentApplicationAttemptId = 16;
  169. optional float progress = 17;
  170. optional string applicationType = 18;
  171. optional hadoop.common.TokenProto am_rm_token = 19;
  172. repeated string applicationTags = 20;
  173. }
  174. message ApplicationAttemptReportProto {
  175. optional ApplicationAttemptIdProto application_attempt_id = 1;
  176. optional string host = 2;
  177. optional int32 rpc_port = 3;
  178. optional string tracking_url = 4;
  179. optional string diagnostics = 5 [default = "N/A"];
  180. optional YarnApplicationAttemptStateProto yarn_application_attempt_state = 6;
  181. optional ContainerIdProto am_container_id = 7;
  182. optional string original_tracking_url = 8;
  183. }
  184. enum NodeStateProto {
  185. NS_NEW = 1;
  186. NS_RUNNING = 2;
  187. NS_UNHEALTHY = 3;
  188. NS_DECOMMISSIONED = 4;
  189. NS_LOST = 5;
  190. NS_REBOOTED = 6;
  191. }
  192. message NodeIdProto {
  193. optional string host = 1;
  194. optional int32 port = 2;
  195. }
  196. message NodeReportProto {
  197. optional NodeIdProto nodeId = 1;
  198. optional string httpAddress = 2;
  199. optional string rackName = 3;
  200. optional ResourceProto used = 4;
  201. optional ResourceProto capability = 5;
  202. optional int32 numContainers = 6;
  203. optional NodeStateProto node_state = 7;
  204. optional string health_report = 8;
  205. optional int64 last_health_report_time = 9;
  206. repeated string node_labels = 10;
  207. }
  208. message NodeIdToLabelsProto {
  209. optional NodeIdProto nodeId = 1;
  210. repeated string nodeLabels = 2;
  211. }
  212. ////////////////////////////////////////////////////////////////////////
  213. ////// From AM_RM_Protocol /////////////////////////////////////////////
  214. ////////////////////////////////////////////////////////////////////////
  215. message ResourceRequestProto {
  216. optional PriorityProto priority = 1;
  217. optional string resource_name = 2;
  218. optional ResourceProto capability = 3;
  219. optional int32 num_containers = 4;
  220. optional bool relax_locality = 5 [default = true];
  221. optional string node_label_expression = 6;
  222. }
  223. enum AMCommandProto {
  224. AM_RESYNC = 1;
  225. AM_SHUTDOWN = 2;
  226. }
  227. message PreemptionMessageProto {
  228. optional StrictPreemptionContractProto strictContract = 1;
  229. optional PreemptionContractProto contract = 2;
  230. }
  231. message StrictPreemptionContractProto {
  232. repeated PreemptionContainerProto container = 1;
  233. }
  234. message PreemptionContractProto {
  235. repeated PreemptionResourceRequestProto resource = 1;
  236. repeated PreemptionContainerProto container = 2;
  237. }
  238. message PreemptionContainerProto {
  239. optional ContainerIdProto id = 1;
  240. }
  241. message PreemptionResourceRequestProto {
  242. optional ResourceRequestProto resource = 1;
  243. }
  244. message ResourceBlacklistRequestProto {
  245. repeated string blacklist_additions = 1;
  246. repeated string blacklist_removals = 2;
  247. }
  248. ////////////////////////////////////////////////////////////////////////
  249. ////// From client_RM_Protocol /////////////////////////////////////////
  250. ////////////////////////////////////////////////////////////////////////
  251. message ApplicationSubmissionContextProto {
  252. optional ApplicationIdProto application_id = 1;
  253. optional string application_name = 2 [default = "N/A"];
  254. optional string queue = 3 [default = "default"];
  255. optional PriorityProto priority = 4;
  256. optional ContainerLaunchContextProto am_container_spec = 5;
  257. optional bool cancel_tokens_when_complete = 6 [default = true];
  258. optional bool unmanaged_am = 7 [default = false];
  259. optional int32 maxAppAttempts = 8 [default = 0];
  260. optional ResourceProto resource = 9;
  261. optional string applicationType = 10 [default = "YARN"];
  262. optional bool keep_containers_across_application_attempts = 11 [default = false];
  263. repeated string applicationTags = 12;
  264. optional int64 attempt_failures_validity_interval = 13 [default = -1];
  265. optional LogAggregationContextProto log_aggregation_context = 14;
  266. optional ReservationIdProto reservation_id = 15;
  267. optional string node_label_expression = 16;
  268. optional ResourceRequestProto am_container_resource_request = 17;
  269. }
  270. message LogAggregationContextProto {
  271. optional string include_pattern = 1 [default = ".*"];
  272. optional string exclude_pattern = 2 [default = ""];
  273. }
  274. enum ApplicationAccessTypeProto {
  275. APPACCESS_VIEW_APP = 1;
  276. APPACCESS_MODIFY_APP = 2;
  277. }
  278. message ApplicationACLMapProto {
  279. optional ApplicationAccessTypeProto accessType = 1;
  280. optional string acl = 2 [default = " "];
  281. }
  282. message YarnClusterMetricsProto {
  283. optional int32 num_node_managers = 1;
  284. }
  285. enum QueueStateProto {
  286. Q_STOPPED = 1;
  287. Q_RUNNING = 2;
  288. }
  289. message QueueInfoProto {
  290. optional string queueName = 1;
  291. optional float capacity = 2;
  292. optional float maximumCapacity = 3;
  293. optional float currentCapacity = 4;
  294. optional QueueStateProto state = 5;
  295. repeated QueueInfoProto childQueues = 6;
  296. repeated ApplicationReportProto applications = 7;
  297. repeated string accessibleNodeLabels = 8;
  298. optional string defaultNodeLabelExpression = 9;
  299. }
  300. enum QueueACLProto {
  301. QACL_SUBMIT_APPLICATIONS = 1;
  302. QACL_ADMINISTER_QUEUE = 2;
  303. }
  304. message QueueUserACLInfoProto {
  305. optional string queueName = 1;
  306. repeated QueueACLProto userAcls = 2;
  307. }
  308. ////////////////////////////////////////////////////////////////////////
  309. ////// From reservation_protocol /////////////////////////////////////
  310. ////////////////////////////////////////////////////////////////////////
  311. message ReservationIdProto {
  312. optional int64 id = 1;
  313. optional int64 cluster_timestamp = 2;
  314. }
  315. message ReservationRequestProto {
  316. optional ResourceProto capability = 1;
  317. optional int32 num_containers = 2 [default = 1];
  318. optional int32 concurrency = 3 [default = 1];
  319. optional int64 duration = 4 [default = -1];
  320. }
  321. message ReservationRequestsProto {
  322. repeated ReservationRequestProto reservation_resources = 1;
  323. optional ReservationRequestInterpreterProto interpreter = 2 [default = R_ALL];
  324. }
  325. message ReservationDefinitionProto {
  326. optional ReservationRequestsProto reservation_requests = 1;
  327. optional int64 arrival = 2;
  328. optional int64 deadline = 3;
  329. optional string reservation_name = 4;
  330. }
  331. enum ReservationRequestInterpreterProto {
  332. R_ANY = 0;
  333. R_ALL = 1;
  334. R_ORDER = 2;
  335. R_ORDER_NO_GAP = 3;
  336. }
  337. ////////////////////////////////////////////////////////////////////////
  338. ////// From container_manager //////////////////////////////////////////
  339. ////////////////////////////////////////////////////////////////////////
  340. message ContainerLaunchContextProto {
  341. repeated StringLocalResourceMapProto localResources = 1;
  342. optional bytes tokens = 2;
  343. repeated StringBytesMapProto service_data = 3;
  344. repeated StringStringMapProto environment = 4;
  345. repeated string command = 5;
  346. repeated ApplicationACLMapProto application_ACLs = 6;
  347. }
  348. message ContainerStatusProto {
  349. optional ContainerIdProto container_id = 1;
  350. optional ContainerStateProto state = 2;
  351. optional string diagnostics = 3 [default = "N/A"];
  352. optional int32 exit_status = 4 [default = -1000];
  353. }
  354. enum ContainerExitStatusProto {
  355. SUCCESS = 0;
  356. INVALID = -1000;
  357. ABORTED = -100;
  358. DISKS_FAILED = -101;
  359. }
  360. message ContainerResourceIncreaseRequestProto {
  361. optional ContainerIdProto container_id = 1;
  362. optional ResourceProto capability = 2;
  363. }
  364. message ContainerResourceIncreaseProto {
  365. optional ContainerIdProto container_id = 1;
  366. optional ResourceProto capability = 2;
  367. optional hadoop.common.TokenProto container_token = 3;
  368. }
  369. message ContainerResourceDecreaseProto {
  370. optional ContainerIdProto container_id = 1;
  371. optional ResourceProto capability = 2;
  372. }
  373. ////////////////////////////////////////////////////////////////////////
  374. ////// From common//////////////////////////////////////////////////////
  375. ////////////////////////////////////////////////////////////////////////
  376. message StringLocalResourceMapProto {
  377. optional string key = 1;
  378. optional LocalResourceProto value = 2;
  379. }
  380. message StringStringMapProto {
  381. optional string key = 1;
  382. optional string value = 2;
  383. }
  384. message StringBytesMapProto {
  385. optional string key = 1;
  386. optional bytes value = 2;
  387. }