Class: LvSegment
- Inherits:
-
Object
- Object
- LvSegment
- Defined in:
- lib/VolumeManager/LVM/lv_segment.rb
Overview
One object of this class for each segment in a logical volume.
Instance Attribute Summary collapse
-
#data_volume ⇒ Object
Returns the value of attribute data_volume.
-
#device_id ⇒ Object
set for thin segments.
-
#extentCount ⇒ Object
Returns the value of attribute extentCount.
-
#metadata ⇒ Object
set for thin pool segments.
-
#metadata_volume ⇒ Object
Returns the value of attribute metadata_volume.
-
#pool ⇒ Object
set for thin pool segments.
-
#startExtent ⇒ Object
Returns the value of attribute startExtent.
-
#stripeCount ⇒ Object
Returns the value of attribute stripeCount.
-
#stripes ⇒ Object
Returns the value of attribute stripes.
-
#thin_pool ⇒ Object
set for thin segments.
-
#thin_pool_volume ⇒ Object
Returns the value of attribute thin_pool_volume.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(startExtent = 0, extentCount = 0, type = nil, stripeCount = 0, deviceId = nil) ⇒ LvSegment
constructor
A new instance of LvSegment.
- #set_data_volume(lvs) ⇒ Object
- #set_metadata_volume(lvs) ⇒ Object
- #set_thin_pool_volume(lvs) ⇒ Object
- #thin? ⇒ Boolean
- #thin_pool? ⇒ Boolean
Constructor Details
#initialize(startExtent = 0, extentCount = 0, type = nil, stripeCount = 0, deviceId = nil) ⇒ LvSegment
Returns a new instance of LvSegment.
13 14 15 16 17 18 19 20 21 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 13 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 |
Instance Attribute Details
#data_volume ⇒ Object
Returns the value of attribute data_volume.
11 12 13 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 11 def data_volume @data_volume end |
#device_id ⇒ Object
set for thin segments
7 8 9 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 7 def device_id @device_id end |
#extentCount ⇒ Object
Returns the value of attribute extentCount.
5 6 7 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 5 def extentCount @extentCount end |
#metadata ⇒ Object
set for thin pool segments
9 10 11 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 9 def @metadata end |
#metadata_volume ⇒ Object
Returns the value of attribute metadata_volume.
11 12 13 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 11 def @metadata_volume end |
#pool ⇒ Object
set for thin pool segments
9 10 11 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 9 def pool @pool end |
#startExtent ⇒ Object
Returns the value of attribute startExtent.
5 6 7 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 5 def startExtent @startExtent end |
#stripeCount ⇒ Object
Returns the value of attribute stripeCount.
5 6 7 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 5 def stripeCount @stripeCount end |
#stripes ⇒ Object
Returns the value of attribute stripes.
5 6 7 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 5 def stripes @stripes end |
#thin_pool ⇒ Object
set for thin segments
7 8 9 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 7 def thin_pool @thin_pool end |
#thin_pool_volume ⇒ Object
Returns the value of attribute thin_pool_volume.
11 12 13 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 11 def thin_pool_volume @thin_pool_volume end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 5 def type @type end |
Instance Method Details
#set_data_volume(lvs) ⇒ Object
35 36 37 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 35 def set_data_volume(lvs) @data_volume = lvs.find { |lv| lv.lvName == pool } end |
#set_metadata_volume(lvs) ⇒ Object
31 32 33 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 31 def (lvs) @metadata_volume = lvs.find { |lv| lv.lvName == } end |
#set_thin_pool_volume(lvs) ⇒ Object
39 40 41 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 39 def set_thin_pool_volume(lvs) @thin_pool_volume = lvs.find { |lv| lv.lvName == thin_pool } end |
#thin? ⇒ Boolean
23 24 25 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 23 def thin? type == 'thin' end |
#thin_pool? ⇒ Boolean
27 28 29 |
# File 'lib/VolumeManager/LVM/lv_segment.rb', line 27 def thin_pool? type == 'thin-pool' end |