yarn_protos.proto 17 KB

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