yarn_protos.proto 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  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. enum ResourceTypesProto {
  49. COUNTABLE = 0;
  50. }
  51. message ResourceInformationProto {
  52. required string key = 1;
  53. optional int64 value = 2;
  54. optional string units = 3;
  55. optional ResourceTypesProto type = 4;
  56. }
  57. message ResourceTypeInfoProto {
  58. required string name = 1;
  59. optional string units = 2;
  60. optional ResourceTypesProto type = 3;
  61. }
  62. message ResourceProto {
  63. optional int64 memory = 1;
  64. optional int32 virtual_cores = 2;
  65. repeated ResourceInformationProto resource_value_map = 3;
  66. }
  67. message ResourceUtilizationProto {
  68. optional int32 pmem = 1;
  69. optional int32 vmem = 2;
  70. optional float cpu = 3;
  71. }
  72. message ResourceOptionProto {
  73. optional ResourceProto resource = 1;
  74. optional int32 over_commit_timeout = 2;
  75. }
  76. message ResourceProfileEntry {
  77. required string name = 1;
  78. required ResourceProto resources = 2;
  79. }
  80. message ResourceProfilesProto {
  81. repeated ResourceProfileEntry resource_profiles_map = 1;
  82. }
  83. message NodeResourceMapProto {
  84. optional NodeIdProto node_id = 1;
  85. optional ResourceOptionProto resource_option = 2;
  86. }
  87. message PriorityProto {
  88. optional int32 priority = 1;
  89. }
  90. enum ContainerStateProto {
  91. C_NEW = 1;
  92. C_RUNNING = 2;
  93. C_COMPLETE = 3;
  94. }
  95. enum ContainerSubStateProto {
  96. /**
  97. * NEW, LOCALIZING, SCHEDULED,
  98. * REINITIALIZING_AWAITING_KILL, RELAUNCHING,
  99. */
  100. CSS_SCHEDULED = 1;
  101. /**
  102. * RUNNING, REINITIALIZING, PAUSING, KILLING
  103. */
  104. CSS_RUNNING = 2;
  105. /**
  106. * PAUSED, RESUMING
  107. */
  108. CSS_PAUSED = 3;
  109. /**
  110. * LOCALIZATION_FAILED, EXITED_WITH_SUCCESS,
  111. * EXITED_WITH_FAILURE,
  112. * CONTAINER_CLEANEDUP_AFTER_KILL,
  113. * CONTAINER_RESOURCES_CLEANINGUP
  114. */
  115. CSS_COMPLETING = 4;
  116. /**
  117. * DONE
  118. */
  119. CSS_DONE = 5;
  120. }
  121. message ContainerProto {
  122. optional ContainerIdProto id = 1;
  123. optional NodeIdProto nodeId = 2;
  124. optional string node_http_address = 3;
  125. optional ResourceProto resource = 4;
  126. optional PriorityProto priority = 5;
  127. optional hadoop.common.TokenProto container_token = 6;
  128. optional ExecutionTypeProto execution_type = 7 [default = GUARANTEED];
  129. optional int64 allocation_request_id = 8 [default = -1];
  130. optional int32 version = 9 [default = 0];
  131. repeated string allocation_tags = 10;
  132. }
  133. message ContainerReportProto {
  134. optional ContainerIdProto container_id = 1;
  135. optional ResourceProto resource = 2;
  136. optional NodeIdProto node_id = 3;
  137. optional PriorityProto priority = 4;
  138. optional int64 creation_time = 5;
  139. optional int64 finish_time = 6;
  140. optional string diagnostics_info = 7 [default = "N/A"];
  141. optional string log_url = 8;
  142. optional int32 container_exit_status = 9;
  143. optional ContainerStateProto container_state = 10;
  144. optional string node_http_address = 11;
  145. optional ExecutionTypeProto executionType = 12 [default = GUARANTEED];
  146. }
  147. enum YarnApplicationStateProto {
  148. NEW = 1;
  149. NEW_SAVING = 2;
  150. SUBMITTED = 3;
  151. ACCEPTED = 4;
  152. RUNNING = 5;
  153. FINISHED = 6;
  154. FAILED = 7;
  155. KILLED = 8;
  156. }
  157. enum YarnApplicationAttemptStateProto {
  158. APP_ATTEMPT_NEW = 1;
  159. APP_ATTEMPT_SUBMITTED = 2;
  160. APP_ATTEMPT_SCHEDULED = 3;
  161. APP_ATTEMPT_ALLOCATED_SAVING = 4;
  162. APP_ATTEMPT_ALLOCATED = 5;
  163. APP_ATTEMPT_LAUNCHED = 6;
  164. APP_ATTEMPT_FAILED = 7;
  165. APP_ATTEMPT_RUNNING = 8;
  166. APP_ATTEMPT_FINISHING = 9;
  167. APP_ATTEMPT_FINISHED = 10;
  168. APP_ATTEMPT_KILLED = 11;
  169. }
  170. enum FinalApplicationStatusProto {
  171. APP_UNDEFINED = 0;
  172. APP_SUCCEEDED = 1;
  173. APP_FAILED = 2;
  174. APP_KILLED = 3;
  175. APP_ENDED = 4;
  176. }
  177. message URLProto {
  178. optional string scheme = 1;
  179. optional string host = 2;
  180. optional int32 port = 3;
  181. optional string file = 4;
  182. optional string userInfo = 5;
  183. }
  184. enum LocalResourceVisibilityProto {
  185. PUBLIC = 1;
  186. PRIVATE = 2;
  187. APPLICATION = 3;
  188. }
  189. enum LocalResourceTypeProto {
  190. ARCHIVE = 1;
  191. FILE = 2;
  192. PATTERN = 3;
  193. }
  194. message LocalResourceProto {
  195. optional URLProto resource = 1;
  196. optional int64 size = 2;
  197. optional int64 timestamp = 3;
  198. optional LocalResourceTypeProto type = 4;
  199. optional LocalResourceVisibilityProto visibility = 5;
  200. optional string pattern = 6;
  201. optional bool should_be_uploaded_to_shared_cache = 7;
  202. }
  203. message StringLongMapProto {
  204. required string key = 1;
  205. required int64 value = 2;
  206. }
  207. message ApplicationResourceUsageReportProto {
  208. optional int32 num_used_containers = 1;
  209. optional int32 num_reserved_containers = 2;
  210. optional ResourceProto used_resources = 3;
  211. optional ResourceProto reserved_resources = 4;
  212. optional ResourceProto needed_resources = 5;
  213. optional int64 memory_seconds = 6;
  214. optional int64 vcore_seconds = 7;
  215. optional float queue_usage_percentage = 8;
  216. optional float cluster_usage_percentage = 9;
  217. optional int64 preempted_memory_seconds = 10;
  218. optional int64 preempted_vcore_seconds = 11;
  219. repeated StringLongMapProto application_resource_usage_map = 12;
  220. repeated StringLongMapProto application_preempted_resource_usage_map = 13;
  221. }
  222. message ApplicationReportProto {
  223. optional ApplicationIdProto applicationId = 1;
  224. optional string user = 2;
  225. optional string queue = 3;
  226. optional string name = 4;
  227. optional string host = 5;
  228. optional int32 rpc_port = 6;
  229. optional hadoop.common.TokenProto client_to_am_token = 7;
  230. optional YarnApplicationStateProto yarn_application_state = 8;
  231. optional string trackingUrl = 9;
  232. optional string diagnostics = 10 [default = "N/A"];
  233. optional int64 startTime = 11;
  234. optional int64 finishTime = 12;
  235. optional FinalApplicationStatusProto final_application_status = 13;
  236. optional ApplicationResourceUsageReportProto app_resource_Usage = 14;
  237. optional string originalTrackingUrl = 15;
  238. optional ApplicationAttemptIdProto currentApplicationAttemptId = 16;
  239. optional float progress = 17;
  240. optional string applicationType = 18;
  241. optional hadoop.common.TokenProto am_rm_token = 19;
  242. repeated string applicationTags = 20;
  243. optional LogAggregationStatusProto log_aggregation_status = 21;
  244. optional bool unmanaged_application = 22 [default = false];
  245. optional PriorityProto priority = 23;
  246. optional string appNodeLabelExpression = 24;
  247. optional string amNodeLabelExpression = 25;
  248. repeated AppTimeoutsMapProto appTimeouts = 26;
  249. }
  250. message AppTimeoutsMapProto {
  251. optional ApplicationTimeoutTypeProto application_timeout_type = 1;
  252. optional ApplicationTimeoutProto application_timeout = 2;
  253. }
  254. message ApplicationTimeoutProto {
  255. required ApplicationTimeoutTypeProto application_timeout_type = 1;
  256. optional string expire_time = 2;
  257. optional int64 remaining_time = 3;
  258. }
  259. enum LogAggregationStatusProto {
  260. LOG_DISABLED = 1;
  261. LOG_NOT_START = 2;
  262. LOG_RUNNING = 3;
  263. LOG_SUCCEEDED = 4;
  264. LOG_FAILED = 5;
  265. LOG_TIME_OUT = 6;
  266. LOG_RUNNING_WITH_FAILURE = 7;
  267. }
  268. message ApplicationAttemptReportProto {
  269. optional ApplicationAttemptIdProto application_attempt_id = 1;
  270. optional string host = 2;
  271. optional int32 rpc_port = 3;
  272. optional string tracking_url = 4;
  273. optional string diagnostics = 5 [default = "N/A"];
  274. optional YarnApplicationAttemptStateProto yarn_application_attempt_state = 6;
  275. optional ContainerIdProto am_container_id = 7;
  276. optional string original_tracking_url = 8;
  277. optional int64 startTime = 9;
  278. optional int64 finishTime = 10;
  279. }
  280. enum NodeStateProto {
  281. NS_NEW = 1;
  282. NS_RUNNING = 2;
  283. NS_UNHEALTHY = 3;
  284. NS_DECOMMISSIONED = 4;
  285. NS_LOST = 5;
  286. NS_REBOOTED = 6;
  287. NS_DECOMMISSIONING = 7;
  288. NS_SHUTDOWN = 8;
  289. }
  290. message NodeIdProto {
  291. optional string host = 1;
  292. optional int32 port = 2;
  293. }
  294. enum NodeUpdateTypeProto {
  295. NODE_USABLE = 0;
  296. NODE_UNUSABLE = 1;
  297. NODE_DECOMMISSIONING = 2;
  298. }
  299. message NodeReportProto {
  300. optional NodeIdProto nodeId = 1;
  301. optional string httpAddress = 2;
  302. optional string rackName = 3;
  303. optional ResourceProto used = 4;
  304. optional ResourceProto capability = 5;
  305. optional int32 numContainers = 6;
  306. optional NodeStateProto node_state = 7;
  307. optional string health_report = 8;
  308. optional int64 last_health_report_time = 9;
  309. repeated string node_labels = 10;
  310. optional ResourceUtilizationProto containers_utilization = 11;
  311. optional ResourceUtilizationProto node_utilization = 12;
  312. optional uint32 decommissioning_timeout = 13;
  313. optional NodeUpdateTypeProto node_update_type = 14;
  314. }
  315. message NodeIdToLabelsProto {
  316. optional NodeIdProto nodeId = 1;
  317. repeated string nodeLabels = 2;
  318. }
  319. message LabelsToNodeIdsProto {
  320. optional string nodeLabels = 1;
  321. repeated NodeIdProto nodeId = 2;
  322. }
  323. message NodeLabelProto {
  324. optional string name = 1;
  325. optional bool isExclusive = 2 [default = true];
  326. }
  327. enum ContainerTypeProto {
  328. APPLICATION_MASTER = 1;
  329. TASK = 2;
  330. }
  331. enum ExecutionTypeProto {
  332. GUARANTEED = 1;
  333. OPPORTUNISTIC = 2;
  334. }
  335. ////////////////////////////////////////////////////////////////////////
  336. ////// From AM_RM_Protocol /////////////////////////////////////////////
  337. ////////////////////////////////////////////////////////////////////////
  338. message ResourceRequestProto {
  339. optional PriorityProto priority = 1;
  340. optional string resource_name = 2;
  341. optional ResourceProto capability = 3;
  342. optional int32 num_containers = 4;
  343. optional bool relax_locality = 5 [default = true];
  344. optional string node_label_expression = 6;
  345. optional ExecutionTypeRequestProto execution_type_request = 7;
  346. optional int64 allocation_request_id = 8 [default = -1];
  347. }
  348. message ExecutionTypeRequestProto {
  349. optional ExecutionTypeProto execution_type = 1 [default = GUARANTEED];
  350. optional bool enforce_execution_type = 2 [default = false];
  351. }
  352. message SchedulingRequestProto {
  353. optional int64 allocationRequestId = 1 [default = 0];
  354. optional PriorityProto priority = 2;
  355. optional ExecutionTypeRequestProto executionType = 3;
  356. repeated string allocationTags = 4;
  357. optional ResourceSizingProto resourceSizing = 5;
  358. optional PlacementConstraintProto placementConstraint = 6;
  359. }
  360. message ResourceSizingProto {
  361. optional int32 numAllocations = 1;
  362. optional ResourceProto resources = 2;
  363. }
  364. enum AMCommandProto {
  365. AM_RESYNC = 1;
  366. AM_SHUTDOWN = 2;
  367. }
  368. enum RejectionReasonProto {
  369. RRP_COULD_NOT_PLACE_ON_NODE = 1;
  370. RRP_COULD_NOT_SCHEDULE_ON_NODE = 2;
  371. }
  372. message RejectedSchedulingRequestProto {
  373. required RejectionReasonProto reason = 1;
  374. required SchedulingRequestProto request = 2;
  375. }
  376. message PreemptionMessageProto {
  377. optional StrictPreemptionContractProto strictContract = 1;
  378. optional PreemptionContractProto contract = 2;
  379. }
  380. message StrictPreemptionContractProto {
  381. repeated PreemptionContainerProto container = 1;
  382. }
  383. message PreemptionContractProto {
  384. repeated PreemptionResourceRequestProto resource = 1;
  385. repeated PreemptionContainerProto container = 2;
  386. }
  387. message PreemptionContainerProto {
  388. optional ContainerIdProto id = 1;
  389. }
  390. message PreemptionResourceRequestProto {
  391. optional ResourceRequestProto resource = 1;
  392. }
  393. message ResourceBlacklistRequestProto {
  394. repeated string blacklist_additions = 1;
  395. repeated string blacklist_removals = 2;
  396. }
  397. ////////////////////////////////////////////////////////////////////////
  398. ////// From client_RM_Protocol /////////////////////////////////////////
  399. ////////////////////////////////////////////////////////////////////////
  400. message ApplicationSubmissionContextProto {
  401. optional ApplicationIdProto application_id = 1;
  402. optional string application_name = 2 [default = "N/A"];
  403. optional string queue = 3 [default = "default"];
  404. optional PriorityProto priority = 4;
  405. optional ContainerLaunchContextProto am_container_spec = 5;
  406. optional bool cancel_tokens_when_complete = 6 [default = true];
  407. optional bool unmanaged_am = 7 [default = false];
  408. optional int32 maxAppAttempts = 8 [default = 0];
  409. optional ResourceProto resource = 9;
  410. optional string applicationType = 10 [default = "YARN"];
  411. optional bool keep_containers_across_application_attempts = 11 [default = false];
  412. repeated string applicationTags = 12;
  413. optional int64 attempt_failures_validity_interval = 13 [default = -1];
  414. optional LogAggregationContextProto log_aggregation_context = 14;
  415. optional ReservationIdProto reservation_id = 15;
  416. optional string node_label_expression = 16;
  417. repeated ResourceRequestProto am_container_resource_request = 17;
  418. repeated ApplicationTimeoutMapProto application_timeouts = 18;
  419. repeated StringStringMapProto application_scheduling_properties = 19;
  420. }
  421. enum ApplicationTimeoutTypeProto {
  422. APP_TIMEOUT_LIFETIME = 1;
  423. }
  424. message ApplicationTimeoutMapProto {
  425. optional ApplicationTimeoutTypeProto application_timeout_type = 1;
  426. optional int64 timeout = 2;
  427. }
  428. message ApplicationUpdateTimeoutMapProto {
  429. optional ApplicationTimeoutTypeProto application_timeout_type = 1;
  430. optional string expire_time = 2;
  431. }
  432. message LogAggregationContextProto {
  433. optional string include_pattern = 1 [default = ".*"];
  434. optional string exclude_pattern = 2 [default = ""];
  435. optional string rolled_logs_include_pattern = 3 [default = ""];
  436. optional string rolled_logs_exclude_pattern = 4 [default = ".*"];
  437. optional string log_aggregation_policy_class_name = 5;
  438. optional string log_aggregation_policy_parameters = 6;
  439. }
  440. enum ApplicationAccessTypeProto {
  441. APPACCESS_VIEW_APP = 1;
  442. APPACCESS_MODIFY_APP = 2;
  443. }
  444. message ApplicationACLMapProto {
  445. optional ApplicationAccessTypeProto accessType = 1;
  446. optional string acl = 2 [default = " "];
  447. }
  448. message YarnClusterMetricsProto {
  449. optional int32 num_node_managers = 1;
  450. optional int32 num_decommissioned_nms = 2;
  451. optional int32 num_active_nms = 3;
  452. optional int32 num_lost_nms = 4;
  453. optional int32 num_unhealthy_nms = 5;
  454. optional int32 num_rebooted_nms = 6;
  455. }
  456. enum QueueStateProto {
  457. Q_STOPPED = 1;
  458. Q_RUNNING = 2;
  459. Q_DRAINING = 3;
  460. }
  461. message QueueStatisticsProto {
  462. optional int64 numAppsSubmitted = 1;
  463. optional int64 numAppsRunning = 2;
  464. optional int64 numAppsPending = 3;
  465. optional int64 numAppsCompleted = 4;
  466. optional int64 numAppsKilled = 5;
  467. optional int64 numAppsFailed = 6;
  468. optional int64 numActiveUsers = 7;
  469. optional int64 availableMemoryMB = 8;
  470. optional int64 allocatedMemoryMB = 9;
  471. optional int64 pendingMemoryMB = 10;
  472. optional int64 reservedMemoryMB = 11;
  473. optional int64 availableVCores = 12;
  474. optional int64 allocatedVCores = 13;
  475. optional int64 pendingVCores = 14;
  476. optional int64 reservedVCores = 15;
  477. optional int64 allocatedContainers = 16;
  478. optional int64 pendingContainers = 17;
  479. optional int64 reservedContainers = 18;
  480. }
  481. message QueueInfoProto {
  482. optional string queueName = 1;
  483. optional float capacity = 2;
  484. optional float maximumCapacity = 3;
  485. optional float currentCapacity = 4;
  486. optional QueueStateProto state = 5;
  487. repeated QueueInfoProto childQueues = 6;
  488. repeated ApplicationReportProto applications = 7;
  489. repeated string accessibleNodeLabels = 8;
  490. optional string defaultNodeLabelExpression = 9;
  491. optional QueueStatisticsProto queueStatistics = 10;
  492. optional bool preemptionDisabled = 11;
  493. repeated QueueConfigurationsMapProto queueConfigurationsMap = 12;
  494. optional bool intraQueuePreemptionDisabled = 13;
  495. }
  496. message QueueConfigurationsProto {
  497. optional float capacity = 1;
  498. optional float absoluteCapacity = 2;
  499. optional float maxCapacity = 3;
  500. optional float absoluteMaxCapacity = 4;
  501. optional float maxAMPercentage = 5;
  502. optional ResourceProto effectiveMinCapacity = 6;
  503. optional ResourceProto effectiveMaxCapacity = 7;
  504. optional ResourceProto configuredMinCapacity = 8;
  505. optional ResourceProto configuredMaxCapacity = 9;
  506. }
  507. message QueueConfigurationsMapProto {
  508. required string partitionName = 1;
  509. optional QueueConfigurationsProto queueConfigurations = 2;
  510. }
  511. enum QueueACLProto {
  512. QACL_SUBMIT_APPLICATIONS = 1;
  513. QACL_ADMINISTER_QUEUE = 2;
  514. }
  515. message QueueUserACLInfoProto {
  516. optional string queueName = 1;
  517. repeated QueueACLProto userAcls = 2;
  518. }
  519. enum SignalContainerCommandProto {
  520. OUTPUT_THREAD_DUMP = 1;
  521. GRACEFUL_SHUTDOWN = 2;
  522. FORCEFUL_SHUTDOWN = 3;
  523. }
  524. ////////////////////////////////////////////////////////////////////////
  525. ////// Placement constraints ///////////////////////////////////////////
  526. ////////////////////////////////////////////////////////////////////////
  527. message PlacementConstraintProto {
  528. optional SimplePlacementConstraintProto simpleConstraint = 1;
  529. optional CompositePlacementConstraintProto compositeConstraint = 2;
  530. }
  531. message SimplePlacementConstraintProto {
  532. required string scope = 1;
  533. repeated PlacementConstraintTargetProto targetExpressions = 2;
  534. optional int32 minCardinality = 3;
  535. optional int32 maxCardinality = 4;
  536. }
  537. message PlacementConstraintTargetProto {
  538. enum TargetType {
  539. NODE_ATTRIBUTE = 1;
  540. ALLOCATION_TAG = 2;
  541. SELF = 3;
  542. }
  543. required TargetType targetType = 1;
  544. optional string targetKey = 2;
  545. repeated string targetValues = 3;
  546. }
  547. message TimedPlacementConstraintProto {
  548. enum DelayUnit {
  549. MILLISECONDS = 1;
  550. OPPORTUNITIES = 2;
  551. }
  552. required PlacementConstraintProto placementConstraint = 1;
  553. required int64 schedulingDelay = 2;
  554. optional DelayUnit delayUnit = 3 [ default = MILLISECONDS ];
  555. }
  556. message CompositePlacementConstraintProto {
  557. enum CompositeType {
  558. // All children constraints have to be satisfied.
  559. AND = 1;
  560. // One of the children constraints has to be satisfied.
  561. OR = 2;
  562. // Attempt to satisfy the first child constraint for delays[0] units (e.g.,
  563. // millisec or heartbeats). If this fails, try to satisfy the second child
  564. // constraint for delays[1] units and so on.
  565. DELAYED_OR = 3;
  566. }
  567. required CompositeType compositeType = 1;
  568. repeated PlacementConstraintProto childConstraints = 2;
  569. repeated TimedPlacementConstraintProto timedChildConstraints = 3;
  570. }
  571. // This associates a set of allocation tags to a Placement Constraint.
  572. message PlacementConstraintMapEntryProto {
  573. repeated string allocation_tags = 1;
  574. optional PlacementConstraintProto placement_constraint = 2;
  575. }
  576. ////////////////////////////////////////////////////////////////////////
  577. ////// From reservation_protocol /////////////////////////////////////
  578. ////////////////////////////////////////////////////////////////////////
  579. message ReservationIdProto {
  580. optional int64 id = 1;
  581. optional int64 cluster_timestamp = 2;
  582. }
  583. message ReservationRequestProto {
  584. optional ResourceProto capability = 1;
  585. optional int32 num_containers = 2 [default = 1];
  586. optional int32 concurrency = 3 [default = 1];
  587. optional int64 duration = 4 [default = -1];
  588. }
  589. message ReservationRequestsProto {
  590. repeated ReservationRequestProto reservation_resources = 1;
  591. optional ReservationRequestInterpreterProto interpreter = 2 [default = R_ALL];
  592. }
  593. message ReservationDefinitionProto {
  594. optional ReservationRequestsProto reservation_requests = 1;
  595. optional int64 arrival = 2;
  596. optional int64 deadline = 3;
  597. optional string reservation_name = 4;
  598. optional string recurrence_expression = 5 [default = "0"];
  599. optional PriorityProto priority = 6;
  600. }
  601. message ResourceAllocationRequestProto {
  602. optional int64 start_time = 1;
  603. optional int64 end_time = 2;
  604. optional ResourceProto resource = 3;
  605. }
  606. message ReservationAllocationStateProto {
  607. optional ReservationDefinitionProto reservation_definition = 1;
  608. repeated ResourceAllocationRequestProto allocation_requests = 2;
  609. optional int64 start_time = 3;
  610. optional int64 end_time = 4;
  611. optional string user = 5;
  612. optional bool contains_gangs = 6;
  613. optional int64 acceptance_time = 7;
  614. optional ReservationIdProto reservation_id = 8;
  615. }
  616. enum ReservationRequestInterpreterProto {
  617. R_ANY = 0;
  618. R_ALL = 1;
  619. R_ORDER = 2;
  620. R_ORDER_NO_GAP = 3;
  621. }
  622. ////////////////////////////////////////////////////////////////////////
  623. ////// From container_manager //////////////////////////////////////////
  624. ////////////////////////////////////////////////////////////////////////
  625. message ContainerLaunchContextProto {
  626. repeated StringLocalResourceMapProto localResources = 1;
  627. optional bytes tokens = 2;
  628. repeated StringBytesMapProto service_data = 3;
  629. repeated StringStringMapProto environment = 4;
  630. repeated string command = 5;
  631. repeated ApplicationACLMapProto application_ACLs = 6;
  632. optional ContainerRetryContextProto container_retry_context = 7;
  633. optional bytes tokens_conf = 8;
  634. }
  635. message ContainerStatusProto {
  636. optional ContainerIdProto container_id = 1;
  637. optional ContainerStateProto state = 2;
  638. optional string diagnostics = 3 [default = "N/A"];
  639. optional int32 exit_status = 4 [default = -1000];
  640. optional ResourceProto capability = 5;
  641. optional ExecutionTypeProto executionType = 6 [default = GUARANTEED];
  642. repeated StringStringMapProto container_attributes = 7;
  643. optional ContainerSubStateProto container_sub_state = 8;
  644. }
  645. enum ContainerExitStatusProto {
  646. SUCCESS = 0;
  647. INVALID = -1000;
  648. ABORTED = -100;
  649. DISKS_FAILED = -101;
  650. }
  651. message ContainerRetryContextProto {
  652. optional ContainerRetryPolicyProto retry_policy = 1 [default = NEVER_RETRY];
  653. repeated int32 error_codes = 2;
  654. optional int32 max_retries = 3 [default = 0];
  655. optional int32 retry_interval = 4 [default = 0];
  656. optional int64 failures_validity_interval = 5 [default = -1];
  657. }
  658. enum ContainerRetryPolicyProto {
  659. NEVER_RETRY = 0;
  660. RETRY_ON_ALL_ERRORS = 1;
  661. RETRY_ON_SPECIFIC_ERROR_CODES = 2;
  662. }
  663. ////////////////////////////////////////////////////////////////////////
  664. ////// From common//////////////////////////////////////////////////////
  665. ////////////////////////////////////////////////////////////////////////
  666. message StringLocalResourceMapProto {
  667. optional string key = 1;
  668. optional LocalResourceProto value = 2;
  669. }
  670. message StringStringMapProto {
  671. optional string key = 1;
  672. optional string value = 2;
  673. }
  674. message StringBytesMapProto {
  675. optional string key = 1;
  676. optional bytes value = 2;
  677. }
  678. message CollectorInfoProto {
  679. optional string collector_addr = 1;
  680. optional hadoop.common.TokenProto collector_token = 2;
  681. }