yarn_protos.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  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. optional string node_http_address = 11;
  88. }
  89. enum YarnApplicationStateProto {
  90. NEW = 1;
  91. NEW_SAVING = 2;
  92. SUBMITTED = 3;
  93. ACCEPTED = 4;
  94. RUNNING = 5;
  95. FINISHED = 6;
  96. FAILED = 7;
  97. KILLED = 8;
  98. }
  99. enum YarnApplicationAttemptStateProto {
  100. APP_ATTEMPT_NEW = 1;
  101. APP_ATTEMPT_SUBMITTED = 2;
  102. APP_ATTEMPT_SCHEDULED = 3;
  103. APP_ATTEMPT_ALLOCATED_SAVING = 4;
  104. APP_ATTEMPT_ALLOCATED = 5;
  105. APP_ATTEMPT_LAUNCHED = 6;
  106. APP_ATTEMPT_FAILED = 7;
  107. APP_ATTEMPT_RUNNING = 8;
  108. APP_ATTEMPT_FINISHING = 9;
  109. APP_ATTEMPT_FINISHED = 10;
  110. APP_ATTEMPT_KILLED = 11;
  111. }
  112. enum FinalApplicationStatusProto {
  113. APP_UNDEFINED = 0;
  114. APP_SUCCEEDED = 1;
  115. APP_FAILED = 2;
  116. APP_KILLED = 3;
  117. }
  118. message URLProto {
  119. optional string scheme = 1;
  120. optional string host = 2;
  121. optional int32 port = 3;
  122. optional string file = 4;
  123. optional string userInfo = 5;
  124. }
  125. enum LocalResourceVisibilityProto {
  126. PUBLIC = 1;
  127. PRIVATE = 2;
  128. APPLICATION = 3;
  129. }
  130. enum LocalResourceTypeProto {
  131. ARCHIVE = 1;
  132. FILE = 2;
  133. PATTERN = 3;
  134. }
  135. message LocalResourceProto {
  136. optional URLProto resource = 1;
  137. optional int64 size = 2;
  138. optional int64 timestamp = 3;
  139. optional LocalResourceTypeProto type = 4;
  140. optional LocalResourceVisibilityProto visibility = 5;
  141. optional string pattern = 6;
  142. optional bool should_be_uploaded_to_shared_cache = 7;
  143. }
  144. message ApplicationResourceUsageReportProto {
  145. optional int32 num_used_containers = 1;
  146. optional int32 num_reserved_containers = 2;
  147. optional ResourceProto used_resources = 3;
  148. optional ResourceProto reserved_resources = 4;
  149. optional ResourceProto needed_resources = 5;
  150. optional int64 memory_seconds = 6;
  151. optional int64 vcore_seconds = 7;
  152. }
  153. message ApplicationReportProto {
  154. optional ApplicationIdProto applicationId = 1;
  155. optional string user = 2;
  156. optional string queue = 3;
  157. optional string name = 4;
  158. optional string host = 5;
  159. optional int32 rpc_port = 6;
  160. optional hadoop.common.TokenProto client_to_am_token = 7;
  161. optional YarnApplicationStateProto yarn_application_state = 8;
  162. optional string trackingUrl = 9;
  163. optional string diagnostics = 10 [default = "N/A"];
  164. optional int64 startTime = 11;
  165. optional int64 finishTime = 12;
  166. optional FinalApplicationStatusProto final_application_status = 13;
  167. optional ApplicationResourceUsageReportProto app_resource_Usage = 14;
  168. optional string originalTrackingUrl = 15;
  169. optional ApplicationAttemptIdProto currentApplicationAttemptId = 16;
  170. optional float progress = 17;
  171. optional string applicationType = 18;
  172. optional hadoop.common.TokenProto am_rm_token = 19;
  173. repeated string applicationTags = 20;
  174. optional LogAggregationStatusProto log_aggregation_status = 21;
  175. optional bool unmanaged_application = 22 [default = false];
  176. optional PriorityProto priority = 23;
  177. optional string appNodeLabelExpression = 24;
  178. optional string amNodeLabelExpression = 25;
  179. }
  180. enum LogAggregationStatusProto {
  181. LOG_DISABLED = 1;
  182. LOG_NOT_START = 2;
  183. LOG_RUNNING = 3;
  184. LOG_SUCCEEDED = 4;
  185. LOG_FAILED = 5;
  186. LOG_TIME_OUT = 6;
  187. LOG_RUNNING_WITH_FAILURE = 7;
  188. }
  189. message ApplicationAttemptReportProto {
  190. optional ApplicationAttemptIdProto application_attempt_id = 1;
  191. optional string host = 2;
  192. optional int32 rpc_port = 3;
  193. optional string tracking_url = 4;
  194. optional string diagnostics = 5 [default = "N/A"];
  195. optional YarnApplicationAttemptStateProto yarn_application_attempt_state = 6;
  196. optional ContainerIdProto am_container_id = 7;
  197. optional string original_tracking_url = 8;
  198. optional int64 startTime = 9;
  199. optional int64 finishTime = 10;
  200. }
  201. enum NodeStateProto {
  202. NS_NEW = 1;
  203. NS_RUNNING = 2;
  204. NS_UNHEALTHY = 3;
  205. NS_DECOMMISSIONED = 4;
  206. NS_LOST = 5;
  207. NS_REBOOTED = 6;
  208. NS_DECOMMISSIONING = 7;
  209. NS_SHUTDOWN = 8;
  210. }
  211. message NodeIdProto {
  212. optional string host = 1;
  213. optional int32 port = 2;
  214. }
  215. message NodeReportProto {
  216. optional NodeIdProto nodeId = 1;
  217. optional string httpAddress = 2;
  218. optional string rackName = 3;
  219. optional ResourceProto used = 4;
  220. optional ResourceProto capability = 5;
  221. optional int32 numContainers = 6;
  222. optional NodeStateProto node_state = 7;
  223. optional string health_report = 8;
  224. optional int64 last_health_report_time = 9;
  225. repeated string node_labels = 10;
  226. }
  227. message NodeIdToLabelsInfoProto {
  228. optional NodeIdProto nodeId = 1;
  229. repeated NodeLabelProto nodeLabels = 2;
  230. }
  231. message LabelsToNodeIdsProto {
  232. optional NodeLabelProto nodeLabels = 1;
  233. repeated NodeIdProto nodeId = 2;
  234. }
  235. message NodeLabelProto {
  236. optional string name = 1;
  237. optional bool isExclusive = 2 [default = true];
  238. }
  239. enum ContainerTypeProto {
  240. APPLICATION_MASTER = 1;
  241. TASK = 2;
  242. }
  243. ////////////////////////////////////////////////////////////////////////
  244. ////// From AM_RM_Protocol /////////////////////////////////////////////
  245. ////////////////////////////////////////////////////////////////////////
  246. message ResourceRequestProto {
  247. optional PriorityProto priority = 1;
  248. optional string resource_name = 2;
  249. optional ResourceProto capability = 3;
  250. optional int32 num_containers = 4;
  251. optional bool relax_locality = 5 [default = true];
  252. optional string node_label_expression = 6;
  253. }
  254. enum AMCommandProto {
  255. AM_RESYNC = 1;
  256. AM_SHUTDOWN = 2;
  257. }
  258. message PreemptionMessageProto {
  259. optional StrictPreemptionContractProto strictContract = 1;
  260. optional PreemptionContractProto contract = 2;
  261. }
  262. message StrictPreemptionContractProto {
  263. repeated PreemptionContainerProto container = 1;
  264. }
  265. message PreemptionContractProto {
  266. repeated PreemptionResourceRequestProto resource = 1;
  267. repeated PreemptionContainerProto container = 2;
  268. }
  269. message PreemptionContainerProto {
  270. optional ContainerIdProto id = 1;
  271. }
  272. message PreemptionResourceRequestProto {
  273. optional ResourceRequestProto resource = 1;
  274. }
  275. message ResourceBlacklistRequestProto {
  276. repeated string blacklist_additions = 1;
  277. repeated string blacklist_removals = 2;
  278. }
  279. ////////////////////////////////////////////////////////////////////////
  280. ////// From client_RM_Protocol /////////////////////////////////////////
  281. ////////////////////////////////////////////////////////////////////////
  282. message ApplicationSubmissionContextProto {
  283. optional ApplicationIdProto application_id = 1;
  284. optional string application_name = 2 [default = "N/A"];
  285. optional string queue = 3 [default = "default"];
  286. optional PriorityProto priority = 4;
  287. optional ContainerLaunchContextProto am_container_spec = 5;
  288. optional bool cancel_tokens_when_complete = 6 [default = true];
  289. optional bool unmanaged_am = 7 [default = false];
  290. optional int32 maxAppAttempts = 8 [default = 0];
  291. optional ResourceProto resource = 9;
  292. optional string applicationType = 10 [default = "YARN"];
  293. optional bool keep_containers_across_application_attempts = 11 [default = false];
  294. repeated string applicationTags = 12;
  295. optional int64 attempt_failures_validity_interval = 13 [default = -1];
  296. optional LogAggregationContextProto log_aggregation_context = 14;
  297. optional ReservationIdProto reservation_id = 15;
  298. optional string node_label_expression = 16;
  299. optional ResourceRequestProto am_container_resource_request = 17;
  300. }
  301. message LogAggregationContextProto {
  302. optional string include_pattern = 1 [default = ".*"];
  303. optional string exclude_pattern = 2 [default = ""];
  304. optional string rolled_logs_include_pattern = 3 [default = ""];
  305. optional string rolled_logs_exclude_pattern = 4 [default = ".*"];
  306. optional string log_aggregation_policy_class_name = 5;
  307. optional string log_aggregation_policy_parameters = 6;
  308. }
  309. enum ApplicationAccessTypeProto {
  310. APPACCESS_VIEW_APP = 1;
  311. APPACCESS_MODIFY_APP = 2;
  312. }
  313. message ApplicationACLMapProto {
  314. optional ApplicationAccessTypeProto accessType = 1;
  315. optional string acl = 2 [default = " "];
  316. }
  317. message YarnClusterMetricsProto {
  318. optional int32 num_node_managers = 1;
  319. optional int32 num_decommissioned_nms = 2;
  320. optional int32 num_active_nms = 3;
  321. optional int32 num_lost_nms = 4;
  322. optional int32 num_unhealthy_nms = 5;
  323. optional int32 num_rebooted_nms = 6;
  324. }
  325. enum QueueStateProto {
  326. Q_STOPPED = 1;
  327. Q_RUNNING = 2;
  328. }
  329. message QueueStatisticsProto {
  330. optional int64 numAppsSubmitted = 1;
  331. optional int64 numAppsRunning = 2;
  332. optional int64 numAppsPending = 3;
  333. optional int64 numAppsCompleted = 4;
  334. optional int64 numAppsKilled = 5;
  335. optional int64 numAppsFailed = 6;
  336. optional int64 numActiveUsers = 7;
  337. optional int64 availableMemoryMB = 8;
  338. optional int64 allocatedMemoryMB = 9;
  339. optional int64 pendingMemoryMB = 10;
  340. optional int64 reservedMemoryMB = 11;
  341. optional int64 availableVCores = 12;
  342. optional int64 allocatedVCores = 13;
  343. optional int64 pendingVCores = 14;
  344. optional int64 reservedVCores = 15;
  345. optional int64 allocatedContainers = 16;
  346. optional int64 pendingContainers = 17;
  347. optional int64 reservedContainers = 18;
  348. }
  349. message QueueInfoProto {
  350. optional string queueName = 1;
  351. optional float capacity = 2;
  352. optional float maximumCapacity = 3;
  353. optional float currentCapacity = 4;
  354. optional QueueStateProto state = 5;
  355. repeated QueueInfoProto childQueues = 6;
  356. repeated ApplicationReportProto applications = 7;
  357. repeated string accessibleNodeLabels = 8;
  358. optional string defaultNodeLabelExpression = 9;
  359. optional QueueStatisticsProto queueStatistics = 10;
  360. }
  361. enum QueueACLProto {
  362. QACL_SUBMIT_APPLICATIONS = 1;
  363. QACL_ADMINISTER_QUEUE = 2;
  364. }
  365. message QueueUserACLInfoProto {
  366. optional string queueName = 1;
  367. repeated QueueACLProto userAcls = 2;
  368. }
  369. enum SignalContainerCommandProto {
  370. OUTPUT_THREAD_DUMP = 1;
  371. GRACEFUL_SHUTDOWN = 2;
  372. FORCEFUL_SHUTDOWN = 3;
  373. }
  374. ////////////////////////////////////////////////////////////////////////
  375. ////// From reservation_protocol /////////////////////////////////////
  376. ////////////////////////////////////////////////////////////////////////
  377. message ReservationIdProto {
  378. optional int64 id = 1;
  379. optional int64 cluster_timestamp = 2;
  380. }
  381. message ReservationRequestProto {
  382. optional ResourceProto capability = 1;
  383. optional int32 num_containers = 2 [default = 1];
  384. optional int32 concurrency = 3 [default = 1];
  385. optional int64 duration = 4 [default = -1];
  386. }
  387. message ReservationRequestsProto {
  388. repeated ReservationRequestProto reservation_resources = 1;
  389. optional ReservationRequestInterpreterProto interpreter = 2 [default = R_ALL];
  390. }
  391. message ReservationDefinitionProto {
  392. optional ReservationRequestsProto reservation_requests = 1;
  393. optional int64 arrival = 2;
  394. optional int64 deadline = 3;
  395. optional string reservation_name = 4;
  396. }
  397. enum ReservationRequestInterpreterProto {
  398. R_ANY = 0;
  399. R_ALL = 1;
  400. R_ORDER = 2;
  401. R_ORDER_NO_GAP = 3;
  402. }
  403. ////////////////////////////////////////////////////////////////////////
  404. ////// From container_manager //////////////////////////////////////////
  405. ////////////////////////////////////////////////////////////////////////
  406. message ContainerLaunchContextProto {
  407. repeated StringLocalResourceMapProto localResources = 1;
  408. optional bytes tokens = 2;
  409. repeated StringBytesMapProto service_data = 3;
  410. repeated StringStringMapProto environment = 4;
  411. repeated string command = 5;
  412. repeated ApplicationACLMapProto application_ACLs = 6;
  413. }
  414. message ContainerStatusProto {
  415. optional ContainerIdProto container_id = 1;
  416. optional ContainerStateProto state = 2;
  417. optional string diagnostics = 3 [default = "N/A"];
  418. optional int32 exit_status = 4 [default = -1000];
  419. optional ResourceProto capability = 5;
  420. }
  421. enum ContainerExitStatusProto {
  422. SUCCESS = 0;
  423. INVALID = -1000;
  424. ABORTED = -100;
  425. DISKS_FAILED = -101;
  426. }
  427. message ContainerResourceChangeRequestProto {
  428. optional ContainerIdProto container_id = 1;
  429. optional ResourceProto capability = 2;
  430. }
  431. ////////////////////////////////////////////////////////////////////////
  432. ////// From common//////////////////////////////////////////////////////
  433. ////////////////////////////////////////////////////////////////////////
  434. message StringLocalResourceMapProto {
  435. optional string key = 1;
  436. optional LocalResourceProto value = 2;
  437. }
  438. message StringStringMapProto {
  439. optional string key = 1;
  440. optional string value = 2;
  441. }
  442. message StringBytesMapProto {
  443. optional string key = 1;
  444. optional bytes value = 2;
  445. }