Class: SMPTool::VirtualVolume::VolumeParams

Inherits:
Object
  • Object
show all
Defined in:
lib/smp_tool/virtual_volume/volume_params.rb

Overview

Virtual volume parameters.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n_clusters_allocated:, n_extra_bytes_per_entry:, n_dir_segs:, n_clusters_per_dir_seg:, extra_word:) ⇒ VolumeParams

Returns a new instance of VolumeParams.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 15

def initialize(
  n_clusters_allocated:,
  n_extra_bytes_per_entry:,
  n_dir_segs:,
  n_clusters_per_dir_seg:,
  extra_word:
)
  @n_clusters_allocated = n_clusters_allocated
  @n_extra_bytes_per_entry = n_extra_bytes_per_entry
  @n_dir_segs = n_dir_segs
  @n_clusters_per_dir_seg = n_clusters_per_dir_seg
  @extra_word = extra_word

  _validate_input

  @n_max_entries_per_dir_seg = _calc_n_max_entries_per_dir_seg
  @n_max_entries = @n_dir_segs * @n_max_entries_per_dir_seg
end

Instance Attribute Details

#extra_wordObject (readonly)

Returns the value of attribute extra_word.



11
12
13
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 11

def extra_word
  @extra_word
end

#n_clusters_allocatedObject

Returns the value of attribute n_clusters_allocated.



9
10
11
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 9

def n_clusters_allocated
  @n_clusters_allocated
end

#n_clusters_per_dir_segObject (readonly)

Returns the value of attribute n_clusters_per_dir_seg.



11
12
13
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 11

def n_clusters_per_dir_seg
  @n_clusters_per_dir_seg
end

#n_dir_segsObject (readonly)

Returns the value of attribute n_dir_segs.



11
12
13
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 11

def n_dir_segs
  @n_dir_segs
end

#n_extra_bytes_per_entryObject (readonly)

Returns the value of attribute n_extra_bytes_per_entry.



11
12
13
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 11

def n_extra_bytes_per_entry
  @n_extra_bytes_per_entry
end

#n_max_entriesObject (readonly)

Returns the value of attribute n_max_entries.



11
12
13
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 11

def n_max_entries
  @n_max_entries
end

#n_max_entries_per_dir_segObject (readonly)

Returns the value of attribute n_max_entries_per_dir_seg.



11
12
13
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 11

def n_max_entries_per_dir_seg
  @n_max_entries_per_dir_seg
end

Instance Method Details

#snapshotObject



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/smp_tool/virtual_volume/volume_params.rb', line 34

def snapshot
  {
    n_clusters_allocated: @n_clusters_allocated,
    n_extra_bytes_per_entry: @n_extra_bytes_per_entry,
    n_dir_segs: @n_dir_segs,
    n_clusters_per_dir_seg: @n_clusters_per_dir_seg,
    extra_word: @extra_word,
    n_max_entries_per_dir_seg: @n_max_entries_per_dir_seg,
    n_max_entries: @n_max_entries
  }
end