Class: Rafflesia::FoldIndexMaterializeData

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

Constant Summary collapse

HASH_ATTRS =
{
  all_cache_hits: :all_cache_hits,
  file_count: :file_count,
  manifest_id: :manifest_id,
  manifest_path: :manifest_path,
  metrics: :metrics,
  ref: :ref,
  routing: :routing,
  segment_roles: :segment_roles,
  shard_count: :shard_count,
  shards: :shards,
  target_dir: :target_dir,
  total_size_bytes: :total_size_bytes,
  verified: :verified
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoldIndexMaterializeData

Returns a new instance of FoldIndexMaterializeData.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 39

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @all_cache_hits = hash[:all_cache_hits]
  @file_count = hash[:file_count]
  @manifest_id = hash[:manifest_id]
  @manifest_path = hash[:manifest_path]
  @metrics = hash[:metrics] ? Rafflesia::CacheMaterializationMetrics.new(hash[:metrics]) : nil
  @ref = hash[:ref]
  @routing = hash[:routing] ? Rafflesia::FoldIndexMaterializedSegment.new(hash[:routing]) : nil
  @segment_roles = (hash[:segment_roles] || [])
  @shard_count = hash[:shard_count]
  @shards = (hash[:shards] || []).map { |item| item ? Rafflesia::FoldIndexMaterializedShard.new(item) : nil }
  @target_dir = hash[:target_dir]
  @total_size_bytes = hash[:total_size_bytes]
  @verified = hash[:verified]
end

Instance Attribute Details

#all_cache_hitsObject

Returns the value of attribute all_cache_hits.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def all_cache_hits
  @all_cache_hits
end

#file_countObject

Returns the value of attribute file_count.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def file_count
  @file_count
end

#manifest_idObject

Returns the value of attribute manifest_id.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def manifest_id
  @manifest_id
end

#manifest_pathObject

Returns the value of attribute manifest_path.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def manifest_path
  @manifest_path
end

#metricsObject

Returns the value of attribute metrics.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def metrics
  @metrics
end

#refObject

Returns the value of attribute ref.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def ref
  @ref
end

#routingObject

Returns the value of attribute routing.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def routing
  @routing
end

#segment_rolesObject

Returns the value of attribute segment_roles.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def segment_roles
  @segment_roles
end

#shard_countObject

Returns the value of attribute shard_count.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def shard_count
  @shard_count
end

#shardsObject

Returns the value of attribute shards.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def shards
  @shards
end

#target_dirObject

Returns the value of attribute target_dir.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def target_dir
  @target_dir
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def total_size_bytes
  @total_size_bytes
end

#verifiedObject

Returns the value of attribute verified.



24
25
26
# File 'lib/rafflesia/proteins/fold_index_materialize_data.rb', line 24

def verified
  @verified
end