Class: AWSCDK::Batch::CfnSchedulingPolicy::ShareAttributesProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
batch/cfn_scheduling_policy.rb

Overview

Specifies the weights for the share identifiers for the fair-share policy.

Share identifiers that aren't included have a default weight of 1.0 .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(share_identifier: nil, weight_factor: nil) ⇒ ShareAttributesProperty

Returns a new instance of ShareAttributesProperty.

Parameters:

  • share_identifier (String, nil) (defaults to: nil)

    A share identifier or share identifier prefix.

  • weight_factor (Numeric, nil) (defaults to: nil)

    The weight factor for the share identifier.



658
659
660
661
662
663
# File 'batch/cfn_scheduling_policy.rb', line 658

def initialize(share_identifier: nil, weight_factor: nil)
  @share_identifier = share_identifier
  Jsii::Type.check_type(@share_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "shareIdentifier") unless @share_identifier.nil?
  @weight_factor = weight_factor
  Jsii::Type.check_type(@weight_factor, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weightFactor") unless @weight_factor.nil?
end

Instance Attribute Details

#share_identifierString? (readonly)

A share identifier or share identifier prefix.

If the string ends with an asterisk (), this entry specifies the weight factor to use for share identifiers that start with that prefix. The list of share identifiers in a fair-share policy can't overlap. For example, you can't have one that specifies a share_identifier of `UserAand another that specifies ashare_identifierofUserA1` .

There can be no more than 500 share identifiers active in a job queue.

The string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).



675
676
677
# File 'batch/cfn_scheduling_policy.rb', line 675

def share_identifier
  @share_identifier
end

#weight_factorNumeric? (readonly)

The weight factor for the share identifier.

The default value is 1.0. A lower value has a higher priority for compute resources. For example, jobs that use a share identifier with a weight factor of 0.125 (1/8) get 8 times the compute resources of jobs that use a share identifier with a weight factor of 1.

The smallest supported value is 0.0001, and the largest supported value is 999.9999.



684
685
686
# File 'batch/cfn_scheduling_policy.rb', line 684

def weight_factor
  @weight_factor
end

Class Method Details

.jsii_propertiesObject



686
687
688
689
690
691
# File 'batch/cfn_scheduling_policy.rb', line 686

def self.jsii_properties
  {
    :share_identifier => "shareIdentifier",
    :weight_factor => "weightFactor",
  }
end

Instance Method Details

#to_jsiiObject



693
694
695
696
697
698
699
700
# File 'batch/cfn_scheduling_policy.rb', line 693

def to_jsii
  result = {}
  result.merge!({
    "shareIdentifier" => @share_identifier,
    "weightFactor" => @weight_factor,
  })
  result.compact
end