Class PreemptionContract
java.lang.Object
org.apache.hadoop.yarn.api.records.PreemptionContract
Description of resources requested back by the
ResourceManager.
The ApplicationMaster (AM) can satisfy this request according
to its own priorities to prevent containers from being forcibly killed by
the platform.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Set<PreemptionContainer>Assign the set ofPreemptionContainerspecifying which containers owned by theApplicationMasterthat may be reclaimed by theResourceManager.abstract List<PreemptionResourceRequest>If the AM releases resources matching these requests, then thePreemptionContainers enumerated ingetContainers()should not be evicted from the cluster.static PreemptionContractnewInstance(List<PreemptionResourceRequest> req, Set<PreemptionContainer> containers) abstract voidsetContainers(Set<PreemptionContainer> containers) abstract voidsetResourceRequest(List<PreemptionResourceRequest> req)
-
Constructor Details
-
PreemptionContract
public PreemptionContract()
-
-
Method Details
-
newInstance
@Private @Unstable public static PreemptionContract newInstance(List<PreemptionResourceRequest> req, Set<PreemptionContainer> containers) -
getResourceRequest
If the AM releases resources matching these requests, then thePreemptionContainers enumerated ingetContainers()should not be evicted from the cluster. Due to delays in propagating cluster state and sending these messages, there are conditions where satisfied contracts may not prevent the platform from killing containers.- Returns:
- List of
PreemptionResourceRequestto update theApplicationMasterabout resources requested back by theResourceManager. - See Also:
-
setResourceRequest
-
getContainers
Assign the set ofPreemptionContainerspecifying which containers owned by theApplicationMasterthat may be reclaimed by theResourceManager. If the AM prefers a different set of containers, then it may checkpoint or kill containers matching the description ingetResourceRequest().- Returns:
- Set of containers at risk if the contract is not met.
-
setContainers
-