Class: Rafflesia::CacheSweepData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::CacheSweepData
- Defined in:
- lib/rafflesia/cache/cache_sweep_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ active_lease_count: :active_lease_count, active_lease_pinned_count: :active_lease_pinned_count, age_basis: :age_basis, dry_run: :dry_run, eligible_size_bytes: :eligible_size_bytes, namespace: :namespace, namespace_usage: :namespace_usage, pinned_size_bytes: :pinned_size_bytes, policy: :policy, remaining_size_bytes: :remaining_size_bytes, removed_count: :removed_count, removed_files: :removed_files, removed_paths: :removed_paths, selected_size_bytes: :selected_size_bytes, skipped_pinned_count: :skipped_pinned_count, target_dir: :target_dir, total_size_bytes: :total_size_bytes }.freeze
Instance Attribute Summary collapse
-
#active_lease_count ⇒ Object
Returns the value of attribute active_lease_count.
-
#active_lease_pinned_count ⇒ Object
Returns the value of attribute active_lease_pinned_count.
-
#age_basis ⇒ Object
Returns the value of attribute age_basis.
-
#dry_run ⇒ Object
Returns the value of attribute dry_run.
-
#eligible_size_bytes ⇒ Object
Returns the value of attribute eligible_size_bytes.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#namespace_usage ⇒ Object
Returns the value of attribute namespace_usage.
-
#pinned_size_bytes ⇒ Object
Returns the value of attribute pinned_size_bytes.
-
#policy ⇒ Object
Returns the value of attribute policy.
-
#remaining_size_bytes ⇒ Object
Returns the value of attribute remaining_size_bytes.
-
#removed_count ⇒ Object
Returns the value of attribute removed_count.
-
#removed_files ⇒ Object
Returns the value of attribute removed_files.
-
#removed_paths ⇒ Object
Returns the value of attribute removed_paths.
-
#selected_size_bytes ⇒ Object
Returns the value of attribute selected_size_bytes.
-
#skipped_pinned_count ⇒ Object
Returns the value of attribute skipped_pinned_count.
-
#target_dir ⇒ Object
Returns the value of attribute target_dir.
-
#total_size_bytes ⇒ Object
Returns the value of attribute total_size_bytes.
Instance Method Summary collapse
-
#initialize(json) ⇒ CacheSweepData
constructor
A new instance of CacheSweepData.
Constructor Details
#initialize(json) ⇒ CacheSweepData
Returns a new instance of CacheSweepData.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 47 def initialize(json) super() hash = self.class.normalize(json) @active_lease_count = hash[:active_lease_count] @active_lease_pinned_count = hash[:active_lease_pinned_count] @age_basis = hash[:age_basis] @dry_run = hash[:dry_run] @eligible_size_bytes = hash[:eligible_size_bytes] @namespace = hash[:namespace] @namespace_usage = (hash[:namespace_usage] || []).map { |item| item ? Rafflesia::CacheNamespaceUsage.new(item) : nil } @pinned_size_bytes = hash[:pinned_size_bytes] @policy = hash[:policy] ? Rafflesia::CacheEvictionPolicy.new(hash[:policy]) : nil @remaining_size_bytes = hash[:remaining_size_bytes] @removed_count = hash[:removed_count] @removed_files = (hash[:removed_files] || []).map { |item| item ? Rafflesia::CacheEvictedFile.new(item) : nil } @removed_paths = (hash[:removed_paths] || []) @selected_size_bytes = hash[:selected_size_bytes] @skipped_pinned_count = hash[:skipped_pinned_count] @target_dir = hash[:target_dir] @total_size_bytes = hash[:total_size_bytes] end |
Instance Attribute Details
#active_lease_count ⇒ Object
Returns the value of attribute active_lease_count.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def active_lease_count @active_lease_count end |
#active_lease_pinned_count ⇒ Object
Returns the value of attribute active_lease_pinned_count.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def active_lease_pinned_count @active_lease_pinned_count end |
#age_basis ⇒ Object
Returns the value of attribute age_basis.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def age_basis @age_basis end |
#dry_run ⇒ Object
Returns the value of attribute dry_run.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def dry_run @dry_run end |
#eligible_size_bytes ⇒ Object
Returns the value of attribute eligible_size_bytes.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def eligible_size_bytes @eligible_size_bytes end |
#namespace ⇒ Object
Returns the value of attribute namespace.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def namespace @namespace end |
#namespace_usage ⇒ Object
Returns the value of attribute namespace_usage.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def namespace_usage @namespace_usage end |
#pinned_size_bytes ⇒ Object
Returns the value of attribute pinned_size_bytes.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def pinned_size_bytes @pinned_size_bytes end |
#policy ⇒ Object
Returns the value of attribute policy.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def policy @policy end |
#remaining_size_bytes ⇒ Object
Returns the value of attribute remaining_size_bytes.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def remaining_size_bytes @remaining_size_bytes end |
#removed_count ⇒ Object
Returns the value of attribute removed_count.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def removed_count @removed_count end |
#removed_files ⇒ Object
Returns the value of attribute removed_files.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def removed_files @removed_files end |
#removed_paths ⇒ Object
Returns the value of attribute removed_paths.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def removed_paths @removed_paths end |
#selected_size_bytes ⇒ Object
Returns the value of attribute selected_size_bytes.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def selected_size_bytes @selected_size_bytes end |
#skipped_pinned_count ⇒ Object
Returns the value of attribute skipped_pinned_count.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def skipped_pinned_count @skipped_pinned_count end |
#target_dir ⇒ Object
Returns the value of attribute target_dir.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def target_dir @target_dir end |
#total_size_bytes ⇒ Object
Returns the value of attribute total_size_bytes.
28 29 30 |
# File 'lib/rafflesia/cache/cache_sweep_data.rb', line 28 def total_size_bytes @total_size_bytes end |