Class: Rafflesia::CacheAdmissionRequest

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/cache/cache_admission_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  candidate_object_ids: :candidate_object_ids,
  candidate_ref: :candidate_ref,
  estimated_size_bytes: :estimated_size_bytes,
  expected_reuse_count: :expected_reuse_count,
  max_bytes: :max_bytes,
  namespace: :namespace,
  older_than_seconds: :older_than_seconds,
  pinned_paths: :pinned_paths,
  policy: :policy,
  priority: :priority,
  require_free_capacity: :require_free_capacity,
  target_dir: :target_dir,
  workload: :workload,
  workload_profile: :workload_profile
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CacheAdmissionRequest

Returns a new instance of CacheAdmissionRequest.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 41

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @candidate_object_ids = (hash[:candidate_object_ids] || [])
  @candidate_ref = hash[:candidate_ref]
  @estimated_size_bytes = hash[:estimated_size_bytes]
  @expected_reuse_count = hash[:expected_reuse_count]
  @max_bytes = hash[:max_bytes]
  @namespace = hash[:namespace]
  @older_than_seconds = hash[:older_than_seconds]
  @pinned_paths = (hash[:pinned_paths] || [])
  @policy = hash[:policy] ? Rafflesia::CacheEvictionPolicy.new(hash[:policy]) : nil
  @priority = hash[:priority]
  @require_free_capacity = hash[:require_free_capacity]
  @target_dir = hash[:target_dir]
  @workload = hash[:workload]
  @workload_profile = hash[:workload_profile]
end

Instance Attribute Details

#candidate_object_idsObject

Returns the value of attribute candidate_object_ids.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def candidate_object_ids
  @candidate_object_ids
end

#candidate_refObject

Returns the value of attribute candidate_ref.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def candidate_ref
  @candidate_ref
end

#estimated_size_bytesObject

Returns the value of attribute estimated_size_bytes.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def estimated_size_bytes
  @estimated_size_bytes
end

#expected_reuse_countObject

Returns the value of attribute expected_reuse_count.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def expected_reuse_count
  @expected_reuse_count
end

#max_bytesObject

Returns the value of attribute max_bytes.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def max_bytes
  @max_bytes
end

#namespaceObject

Returns the value of attribute namespace.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def namespace
  @namespace
end

#older_than_secondsObject

Returns the value of attribute older_than_seconds.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def older_than_seconds
  @older_than_seconds
end

#pinned_pathsObject

Returns the value of attribute pinned_paths.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def pinned_paths
  @pinned_paths
end

#policyObject

Returns the value of attribute policy.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def policy
  @policy
end

#priorityObject

Returns the value of attribute priority.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def priority
  @priority
end

#require_free_capacityObject

Returns the value of attribute require_free_capacity.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def require_free_capacity
  @require_free_capacity
end

#target_dirObject

Returns the value of attribute target_dir.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def target_dir
  @target_dir
end

#workloadObject

Returns the value of attribute workload.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def workload
  @workload
end

#workload_profileObject

Returns the value of attribute workload_profile.



25
26
27
# File 'lib/rafflesia/cache/cache_admission_request.rb', line 25

def workload_profile
  @workload_profile
end