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.10.1 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.10.0 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.9.0 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.8.1 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.8.0 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.7.0 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.6.2 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.10 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.10 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.6.1 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.9 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.6.0 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.9 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.8 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.8 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.7 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.7 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.6 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.3.6 lib/VolumeManager/LVM/lv_segment.rb
manageiq-smartstate-0.5.5 lib/VolumeManager/LVM/lv_segment.rb