Class: Rafflesia::FoldIndexMaterializedShard

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/fold_index_materialized_shard.rb

Constant Summary collapse

HASH_ATTRS =
{
  all_cache_hits: :all_cache_hits,
  db_prefix: :db_prefix,
  file_count: :file_count,
  files: :files,
  metrics: :metrics,
  shard_id: :shard_id,
  total_size_bytes: :total_size_bytes
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoldIndexMaterializedShard

Returns a new instance of FoldIndexMaterializedShard.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @all_cache_hits = hash[:all_cache_hits]
  @db_prefix = hash[:db_prefix]
  @file_count = hash[:file_count]
  @files = (hash[:files] || []).map { |item| item ? Rafflesia::FoldIndexMaterializedFile.new(item) : nil }
  @metrics = hash[:metrics] ? Rafflesia::CacheMaterializationMetrics.new(hash[:metrics]) : nil
  @shard_id = hash[:shard_id]
  @total_size_bytes = hash[:total_size_bytes]
end

Instance Attribute Details

#all_cache_hitsObject

Returns the value of attribute all_cache_hits.



18
19
20
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18

def all_cache_hits
  @all_cache_hits
end

#db_prefixObject

Returns the value of attribute db_prefix.



18
19
20
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18

def db_prefix
  @db_prefix
end

#file_countObject

Returns the value of attribute file_count.



18
19
20
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18

def file_count
  @file_count
end

#filesObject

Returns the value of attribute files.



18
19
20
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18

def files
  @files
end

#metricsObject

Returns the value of attribute metrics.



18
19
20
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18

def metrics
  @metrics
end

#shard_idObject

Returns the value of attribute shard_id.



18
19
20
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18

def shard_id
  @shard_id
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



18
19
20
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18

def total_size_bytes
  @total_size_bytes
end