Class: Lvm2DiskIO::Segment

Inherits:
Object
  • Object
show all
Defined in:
lib/VolumeManager/LVM/lvm2disk.rb

Overview

Like LvSegment but optimized for logical volume IO

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(startByte, endByte, type = nil) ⇒ Segment

Returns a new instance of Segment.



141
142
143
144
145
146
# File 'lib/VolumeManager/LVM/lvm2disk.rb', line 141

def initialize(startByte, endByte, type = nil)
  @byteRange = Range.new(startByte, endByte, false)
  @type = type
  @segSize = endByte - startByte + 1
  @stripes = []
end

Instance Attribute Details

#byteRangeObject

Returns the value of attribute byteRange.



138
139
140
# File 'lib/VolumeManager/LVM/lvm2disk.rb', line 138

def byteRange
  @byteRange
end

#lvSegObject

Returns the value of attribute lvSeg.



139
140
141
# File 'lib/VolumeManager/LVM/lvm2disk.rb', line 139

def lvSeg
  @lvSeg
end

#segSizeObject

Returns the value of attribute segSize.



138
139
140
# File 'lib/VolumeManager/LVM/lvm2disk.rb', line 138

def segSize
  @segSize
end

#stripesObject

Returns the value of attribute stripes.



138
139
140
# File 'lib/VolumeManager/LVM/lvm2disk.rb', line 138

def stripes
  @stripes
end

#typeObject

Returns the value of attribute type.



138
139
140
# File 'lib/VolumeManager/LVM/lvm2disk.rb', line 138

def type
  @type
end

Instance Method Details

#endByteAddrObject



152
153
154
# File 'lib/VolumeManager/LVM/lvm2disk.rb', line 152

def endByteAddr
  @byteRange.end
end

#startByteAddrObject



148
149
150
# File 'lib/VolumeManager/LVM/lvm2disk.rb', line 148

def startByteAddr
  @byteRange.begin
end