Class FairshareSchedulingPolicy
- All Implemented Interfaces:
IEnvironmentAware,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
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forFairshareSchedulingPolicy.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.IFairshareSchedulingPolicy
IFairshareSchedulingPolicy.Jsii$Default, IFairshareSchedulingPolicy.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.ISchedulingPolicy
ISchedulingPolicy.Jsii$Default, ISchedulingPolicy.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFairshareSchedulingPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedFairshareSchedulingPolicy(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 TypeMethodDescriptionvoidAdd a share this to this Fairshare SchedulingPolicy.static IFairshareSchedulingPolicyfromFairshareSchedulingPolicyArn(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, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
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:
getSchedulingPolicyArnin interfaceISchedulingPolicy
-
getSchedulingPolicyName
The name of this scheduling policy.- Specified by:
getSchedulingPolicyNamein 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)^ActiveFairShareswhereActiveFairSharesis 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:
getComputeReservationin interfaceIFairshareSchedulingPolicy