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.



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/pinot/response.rb', line 216

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

  @request_id          = hash["requestId"]
  @num_rows_result_set = hash["numRowsResultSet"]
  @offset              = hash["offset"]
  @num_rows            = hash["numRows"]
  @broker_host         = hash["brokerHost"]
  @broker_port         = hash["brokerPort"]
  @submission_time_ms  = hash["submissionTimeMs"]
  @expiration_time_ms  = hash["expirationTimeMs"]
end

Instance Attribute Details

#aggregation_resultsObject (readonly)

Returns the value of attribute aggregation_results.



197
198
199
# File 'lib/pinot/response.rb', line 197

def aggregation_results
  @aggregation_results
end

#broker_hostObject (readonly)

Returns the value of attribute broker_host.



197
198
199
# File 'lib/pinot/response.rb', line 197

def broker_host
  @broker_host
end

#broker_portObject (readonly)

Returns the value of attribute broker_port.



197
198
199
# File 'lib/pinot/response.rb', line 197

def broker_port
  @broker_port
end

#exceptionsObject (readonly)

Returns the value of attribute exceptions.



197
198
199
# File 'lib/pinot/response.rb', line 197

def exceptions
  @exceptions
end

#expiration_time_msObject (readonly)

Returns the value of attribute expiration_time_ms.



197
198
199
# File 'lib/pinot/response.rb', line 197

def expiration_time_ms
  @expiration_time_ms
end

#min_consuming_freshness_time_msObject (readonly)

Returns the value of attribute min_consuming_freshness_time_ms.



197
198
199
# File 'lib/pinot/response.rb', line 197

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.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_consuming_segments_queried
  @num_consuming_segments_queried
end

#num_docs_scannedObject (readonly)

Returns the value of attribute num_docs_scanned.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_docs_scanned
  @num_docs_scanned
end

#num_entries_scanned_in_filterObject (readonly)

Returns the value of attribute num_entries_scanned_in_filter.



197
198
199
# File 'lib/pinot/response.rb', line 197

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.



197
198
199
# File 'lib/pinot/response.rb', line 197

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.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_groups_limit_reached
  @num_groups_limit_reached
end

#num_rowsObject (readonly)

Returns the value of attribute num_rows.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_rows
  @num_rows
end

#num_rows_result_setObject (readonly)

Returns the value of attribute num_rows_result_set.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_rows_result_set
  @num_rows_result_set
end

#num_segments_matchedObject (readonly)

Returns the value of attribute num_segments_matched.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_segments_matched
  @num_segments_matched
end

#num_segments_processedObject (readonly)

Returns the value of attribute num_segments_processed.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_segments_processed
  @num_segments_processed
end

#num_segments_queriedObject (readonly)

Returns the value of attribute num_segments_queried.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_segments_queried
  @num_segments_queried
end

#num_servers_queriedObject (readonly)

Returns the value of attribute num_servers_queried.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_servers_queried
  @num_servers_queried
end

#num_servers_respondedObject (readonly)

Returns the value of attribute num_servers_responded.



197
198
199
# File 'lib/pinot/response.rb', line 197

def num_servers_responded
  @num_servers_responded
end

#offsetObject (readonly)

Returns the value of attribute offset.



197
198
199
# File 'lib/pinot/response.rb', line 197

def offset
  @offset
end

#request_idObject (readonly)

Returns the value of attribute request_id.



197
198
199
# File 'lib/pinot/response.rb', line 197

def request_id
  @request_id
end

#result_tableObject (readonly)

Returns the value of attribute result_table.



197
198
199
# File 'lib/pinot/response.rb', line 197

def result_table
  @result_table
end

#selection_resultsObject (readonly)

Returns the value of attribute selection_results.



197
198
199
# File 'lib/pinot/response.rb', line 197

def selection_results
  @selection_results
end

#submission_time_msObject (readonly)

Returns the value of attribute submission_time_ms.



197
198
199
# File 'lib/pinot/response.rb', line 197

def submission_time_ms
  @submission_time_ms
end

#time_used_msObject (readonly)

Returns the value of attribute time_used_ms.



197
198
199
# File 'lib/pinot/response.rb', line 197

def time_used_ms
  @time_used_ms
end

#total_docsObject (readonly)

Returns the value of attribute total_docs.



197
198
199
# File 'lib/pinot/response.rb', line 197

def total_docs
  @total_docs
end

#trace_infoObject (readonly)

Returns the value of attribute trace_info.



197
198
199
# File 'lib/pinot/response.rb', line 197

def trace_info
  @trace_info
end

Class Method Details

.from_json(json_str) ⇒ Object



211
212
213
214
# File 'lib/pinot/response.rb', line 211

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

Instance Method Details

#cursor?Boolean

Returns:

  • (Boolean)


247
248
249
# File 'lib/pinot/response.rb', line 247

def cursor?
  !@request_id.nil?
end