Class: Pinot::BrokerResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/pinot/response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ BrokerResponse

Returns a new instance of BrokerResponse.



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/pinot/response.rb', line 198

def initialize(hash)
  @selection_results = hash["selectionResults"] ? SelectionResults.new(hash["selectionResults"]) : nil
  @result_table = hash["resultTable"] ? ResultTable.new(hash["resultTable"]) : nil
  @aggregation_results = (hash["aggregationResults"] || []).map { |r| AggregationResult.new(r) }
  @exceptions = (hash["exceptions"] || []).map { |e| PinotException.new(e) }
  @trace_info = hash["traceInfo"] || {}

  @num_servers_queried = hash["numServersQueried"] || 0
  @num_servers_responded = hash["numServersResponded"] || 0
  @num_segments_queried = hash["numSegmentsQueried"] || 0
  @num_segments_processed = hash["numSegmentsProcessed"] || 0
  @num_segments_matched = hash["numSegmentsMatched"] || 0
  @num_consuming_segments_queried = hash["numConsumingSegmentsQueried"] || 0
  @num_docs_scanned = hash["numDocsScanned"] || 0
  @num_entries_scanned_in_filter = hash["numEntriesScannedInFilter"] || 0
  @num_entries_scanned_post_filter = hash["numEntriesScannedPostFilter"] || 0
  @num_groups_limit_reached = hash["numGroupsLimitReached"] || false
  @total_docs = hash["totalDocs"] || 0
  @time_used_ms = hash["timeUsedMs"] || 0
  @min_consuming_freshness_time_ms = hash["minConsumingFreshnessTimeMs"] || 0
end

Instance Attribute Details

#aggregation_resultsObject (readonly)

Returns the value of attribute aggregation_results.



183
184
185
# File 'lib/pinot/response.rb', line 183

def aggregation_results
  @aggregation_results
end

#exceptionsObject (readonly)

Returns the value of attribute exceptions.



183
184
185
# File 'lib/pinot/response.rb', line 183

def exceptions
  @exceptions
end

#min_consuming_freshness_time_msObject (readonly)

Returns the value of attribute min_consuming_freshness_time_ms.



183
184
185
# File 'lib/pinot/response.rb', line 183

def min_consuming_freshness_time_ms
  @min_consuming_freshness_time_ms
end

#num_consuming_segments_queriedObject (readonly)

Returns the value of attribute num_consuming_segments_queried.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_consuming_segments_queried
  @num_consuming_segments_queried
end

#num_docs_scannedObject (readonly)

Returns the value of attribute num_docs_scanned.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_docs_scanned
  @num_docs_scanned
end

#num_entries_scanned_in_filterObject (readonly)

Returns the value of attribute num_entries_scanned_in_filter.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_entries_scanned_in_filter
  @num_entries_scanned_in_filter
end

#num_entries_scanned_post_filterObject (readonly)

Returns the value of attribute num_entries_scanned_post_filter.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_entries_scanned_post_filter
  @num_entries_scanned_post_filter
end

#num_groups_limit_reachedObject (readonly)

Returns the value of attribute num_groups_limit_reached.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_groups_limit_reached
  @num_groups_limit_reached
end

#num_segments_matchedObject (readonly)

Returns the value of attribute num_segments_matched.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_segments_matched
  @num_segments_matched
end

#num_segments_processedObject (readonly)

Returns the value of attribute num_segments_processed.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_segments_processed
  @num_segments_processed
end

#num_segments_queriedObject (readonly)

Returns the value of attribute num_segments_queried.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_segments_queried
  @num_segments_queried
end

#num_servers_queriedObject (readonly)

Returns the value of attribute num_servers_queried.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_servers_queried
  @num_servers_queried
end

#num_servers_respondedObject (readonly)

Returns the value of attribute num_servers_responded.



183
184
185
# File 'lib/pinot/response.rb', line 183

def num_servers_responded
  @num_servers_responded
end

#result_tableObject (readonly)

Returns the value of attribute result_table.



183
184
185
# File 'lib/pinot/response.rb', line 183

def result_table
  @result_table
end

#selection_resultsObject (readonly)

Returns the value of attribute selection_results.



183
184
185
# File 'lib/pinot/response.rb', line 183

def selection_results
  @selection_results
end

#time_used_msObject (readonly)

Returns the value of attribute time_used_ms.



183
184
185
# File 'lib/pinot/response.rb', line 183

def time_used_ms
  @time_used_ms
end

#total_docsObject (readonly)

Returns the value of attribute total_docs.



183
184
185
# File 'lib/pinot/response.rb', line 183

def total_docs
  @total_docs
end

#trace_infoObject (readonly)

Returns the value of attribute trace_info.



183
184
185
# File 'lib/pinot/response.rb', line 183

def trace_info
  @trace_info
end

Class Method Details

.from_json(json_str) ⇒ Object



193
194
195
196
# File 'lib/pinot/response.rb', line 193

def self.from_json(json_str)
  hash = JSON.parse(json_str)
  new(hash)
end