Class: Rafflesia::SearchSegmentPrefetchData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/sequences/search_segment_prefetch_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  block_cache_hits: :block_cache_hits,
  block_cache_misses: :block_cache_misses,
  budget: :budget,
  materialized_bytes: :materialized_bytes,
  object_bytes_fetched: :object_bytes_fetched,
  object_read_count: :object_read_count,
  plan: :plan,
  prefetched_object_ids: :prefetched_object_ids,
  query_key: :query_key,
  read_warnings: :read_warnings,
  segment_id: :segment_id,
  selected_block_count: :selected_block_count
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ SearchSegmentPrefetchData

Returns a new instance of SearchSegmentPrefetchData.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 37

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @block_cache_hits = hash[:block_cache_hits]
  @block_cache_misses = hash[:block_cache_misses]
  @budget = hash[:budget] ? Rafflesia::SearchPhysicalPlanBudget.new(hash[:budget]) : nil
  @materialized_bytes = hash[:materialized_bytes]
  @object_bytes_fetched = hash[:object_bytes_fetched]
  @object_read_count = hash[:object_read_count]
  @plan = hash[:plan] ? Rafflesia::SearchSegmentPlanData.new(hash[:plan]) : nil
  @prefetched_object_ids = (hash[:prefetched_object_ids] || [])
  @query_key = hash[:query_key]
  @read_warnings = (hash[:read_warnings] || []).map { |item| item ? Rafflesia::SearchWarning.new(item) : nil }
  @segment_id = hash[:segment_id]
  @selected_block_count = hash[:selected_block_count]
end

Instance Attribute Details

#block_cache_hitsObject

Returns the value of attribute block_cache_hits.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def block_cache_hits
  @block_cache_hits
end

#block_cache_missesObject

Returns the value of attribute block_cache_misses.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def block_cache_misses
  @block_cache_misses
end

#budgetObject

Returns the value of attribute budget.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def budget
  @budget
end

#materialized_bytesObject

Returns the value of attribute materialized_bytes.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def materialized_bytes
  @materialized_bytes
end

#object_bytes_fetchedObject

Returns the value of attribute object_bytes_fetched.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def object_bytes_fetched
  @object_bytes_fetched
end

#object_read_countObject

Returns the value of attribute object_read_count.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def object_read_count
  @object_read_count
end

#planObject

Returns the value of attribute plan.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def plan
  @plan
end

#prefetched_object_idsObject

Returns the value of attribute prefetched_object_ids.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def prefetched_object_ids
  @prefetched_object_ids
end

#query_keyObject

Returns the value of attribute query_key.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def query_key
  @query_key
end

#read_warningsObject

Returns the value of attribute read_warnings.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def read_warnings
  @read_warnings
end

#segment_idObject

Returns the value of attribute segment_id.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def segment_id
  @segment_id
end

#selected_block_countObject

Returns the value of attribute selected_block_count.



23
24
25
# File 'lib/rafflesia/sequences/search_segment_prefetch_data.rb', line 23

def selected_block_count
  @selected_block_count
end