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 SummaryNested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forFairshareSchedulingPolicy.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstructsoftware.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.IFairshareSchedulingPolicyIFairshareSchedulingPolicy.Jsii$Default, IFairshareSchedulingPolicy.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResourceIResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.ISchedulingPolicyISchedulingPolicy.Jsii$Default, ISchedulingPolicy.Jsii$Proxy
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedFairshareSchedulingPolicy(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 SummaryModifier 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.ResourceapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.ConstructgetNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstructgetNodeMethods inherited from interface software.amazon.awscdk.IResourceapplyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Field Details- 
PROPERTY_INJECTION_IDUniquely identifies this class.
 
- 
- 
Constructor Details- 
FairshareSchedulingPolicyprotected FairshareSchedulingPolicy(software.amazon.jsii.JsiiObjectRef objRef) 
- 
FairshareSchedulingPolicyprotected 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
- 
getSchedulingPolicyArnThe arn of this scheduling policy.- Specified by:
- getSchedulingPolicyArnin interface- ISchedulingPolicy
 
- 
getSchedulingPolicyNameThe name of this scheduling policy.- Specified by:
- getSchedulingPolicyNamein interface- ISchedulingPolicy
 
- 
getComputeReservationUsed 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 interface- IFairshareSchedulingPolicy