Class Share
Represents a group of Job Definitions.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Share : Object, IShare
Syntax (vb)
Public Class Share
Inherits Object
Implements IShare
Remarks
All Job Definitions that declare a share identifier will be considered members of the Share defined by that share identifier.
The Scheduler divides the maximum available vCPUs of the ComputeEnvironment among Jobs in the Queue based on their shareIdentifier and the weightFactor associated with that shareIdentifier.
ExampleMetadata: infused
Examples
var fairsharePolicy = new FairshareSchedulingPolicy(this, "myFairsharePolicy");
fairsharePolicy.AddShare(new Share {
ShareIdentifier = "A",
WeightFactor = 1
});
fairsharePolicy.AddShare(new Share {
ShareIdentifier = "B",
WeightFactor = 1
});
new JobQueue(this, "JobQueue", new JobQueueProps {
SchedulingPolicy = fairsharePolicy
});
Synopsis
Constructors
Share() |
Properties
ShareIdentifier | The identifier of this Share. |
WeightFactor | The weight factor given to this Share. |
Constructors
Share()
public Share()
Properties
ShareIdentifier
The identifier of this Share.
public string ShareIdentifier { get; set; }
Property Value
System.String
Remarks
All jobs that specify this share identifier when submitted to the queue will be considered as part of this Share.
WeightFactor
The weight factor given to this Share.
public double WeightFactor { get; set; }
Property Value
System.Double
Remarks
The Scheduler decides which jobs to put in the Compute Environment such that the following ratio is equal for each job:
sharevCpu / weightFactor
,
where sharevCpu
is the total amount of vCPU given to that particular share; that is,
the sum of the vCPU of each job currently in the Compute Environment for that share.
See the readme of this module for a detailed example that shows how these are used,
how it relates to computeReservation
, and how shareDecay
affects these calculations.