Class FairshareSchedulingPolicy
- All Implemented Interfaces:
IResource
,IFairshareSchedulingPolicy
,ISchedulingPolicy
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Example:
FairshareSchedulingPolicy fairsharePolicy = new FairshareSchedulingPolicy(this, "myFairsharePolicy"); fairsharePolicy.addShare(Share.builder() .shareIdentifier("A") .weightFactor(1) .build()); fairsharePolicy.addShare(Share.builder() .shareIdentifier("B") .weightFactor(1) .build()); JobQueue.Builder.create(this, "JobQueue") .schedulingPolicy(fairsharePolicy) .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forFairshareSchedulingPolicy
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.IFairshareSchedulingPolicy
IFairshareSchedulingPolicy.Jsii$Default, IFairshareSchedulingPolicy.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.ISchedulingPolicy
ISchedulingPolicy.Jsii$Default, ISchedulingPolicy.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
FairshareSchedulingPolicy
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
FairshareSchedulingPolicy
(software.amazon.jsii.JsiiObjectRef objRef) FairshareSchedulingPolicy
(software.constructs.Construct scope, String id) FairshareSchedulingPolicy
(software.constructs.Construct scope, String id, FairshareSchedulingPolicyProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a share this to this Fairshare SchedulingPolicy.static IFairshareSchedulingPolicy
fromFairshareSchedulingPolicyArn
(software.constructs.Construct scope, String id, String fairshareSchedulingPolicyArn) Reference an exisiting Scheduling Policy by its ARN.Used to calculate the percentage of the maximum available vCPU to reserve for share identifiers not present in the Queue.The arn of this scheduling policy.The name of this scheduling policy.The amount of time to use to measure the usage of each job.The shares that this Scheduling Policy applies to.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
FairshareSchedulingPolicy
protected FairshareSchedulingPolicy(software.amazon.jsii.JsiiObjectRef objRef) -
FairshareSchedulingPolicy
protected FairshareSchedulingPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
FairshareSchedulingPolicy
@Stability(Stable) public FairshareSchedulingPolicy(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
getSchedulingPolicyArn
The arn of this scheduling policy.- Specified by:
getSchedulingPolicyArn
in interfaceISchedulingPolicy
-
getSchedulingPolicyName
The name of this scheduling policy.- Specified by:
getSchedulingPolicyName
in interfaceISchedulingPolicy
-
getComputeReservation
Used to calculate the percentage of the maximum available vCPU to reserve for share identifiers not present in the Queue.The percentage reserved is defined by the Scheduler as:
(computeReservation/100)^ActiveFairShares
whereActiveFairShares
is the number of active fair share identifiers.For example, a computeReservation value of 50 indicates that AWS Batch reserves 50% of the maximum available vCPU if there's only one fair share identifier. It reserves 25% if there are two fair share identifiers. It reserves 12.5% if there are three fair share identifiers.
A computeReservation value of 25 indicates that AWS Batch should reserve 25% of the maximum available vCPU if there's only one fair share identifier, 6.25% if there are two fair share identifiers, and 1.56% if there are three fair share identifiers.
- Specified by:
getComputeReservation
in interfaceIFairshareSchedulingPolicy