Sha256: b3118542ecef92d40500c1da8bec66100c2c8dfcf580a8e673a50274987bb8fc

Contents?: true

Size: 1.27 KB

Versions: 66

Compression:

Stored size: 1.27 KB

Contents

#
# One object of this class for each segment in a logical volume.
#
class LvSegment
  attr_accessor :startExtent, :extentCount, :type, :stripeCount, :stripes

  attr_accessor :thin_pool, :device_id # set for thin segments

  attr_accessor :metadata, :pool # set for thin pool segments

  attr_accessor :thin_pool_volume, :metadata_volume, :data_volume

  def initialize(startExtent = 0, extentCount = 0, type = nil, stripeCount = 0, deviceId=nil)
    @startExtent = startExtent.to_i     # the first logical extent of this segment
    @extentCount = extentCount.to_i     # the number of logical extents in this segment
    @type = type                        # the type of segment
    @stripeCount = stripeCount.to_i     # the number of stripes in this segment(1 = linear)

    @stripes = []                # <pvName, startPhysicalExtent> pairs for each stripe.
    @device_id = deviceId
  end

  def thin?
    type == 'thin'
  end

  def thin_pool?
    type == 'thin-pool'
  end

  def set_metadata_volume(lvs)
    @metadata_volume = lvs.find { |lv| lv.lvName == metadata }
  end

  def set_data_volume(lvs)
    @data_volume = lvs.find { |lv| lv.lvName == pool }
  end

  def set_thin_pool_volume(lvs)
    @thin_pool_volume = lvs.find { |lv| lv.lvName == thin_pool }
  end
end # class LvSegment

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
manageiq-smartstate-0.5.4 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.5 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.3 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.2 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.1 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.0 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.4 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.4.0 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.2.18.2 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.3 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.2 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.1 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.0 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.2.24 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.2.18.1 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.2.23 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.2.22 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.2.21 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.2.20 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.2.19 lib/VolumeManager/LVM/lv_segment.rb