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.



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/pinot/response.rb', line 202

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.



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

def aggregation_results
  @aggregation_results
end

#broker_hostObject (readonly)

Returns the value of attribute broker_host.



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

def broker_host
  @broker_host
end

#broker_portObject (readonly)

Returns the value of attribute broker_port.



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

def broker_port
  @broker_port
end

#exceptionsObject (readonly)

Returns the value of attribute exceptions.



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

def exceptions
  @exceptions
end

#expiration_time_msObject (readonly)

Returns the value of attribute expiration_time_ms.



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

def expiration_time_ms
  @expiration_time_ms
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_rowsObject (readonly)

Returns the value of attribute num_rows.



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

def num_rows
  @num_rows
end

#num_rows_result_setObject (readonly)

Returns the value of attribute num_rows_result_set.



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

def num_rows_result_set
  @num_rows_result_set
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

#offsetObject (readonly)

Returns the value of attribute offset.



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

def offset
  @offset
end

#request_idObject (readonly)

Returns the value of attribute request_id.



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

def request_id
  @request_id
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

#submission_time_msObject (readonly)

Returns the value of attribute submission_time_ms.



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

def submission_time_ms
  @submission_time_ms
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



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

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

Instance Method Details

#cursor?Boolean

Returns:

  • (Boolean)


233
234
235
# File 'lib/pinot/response.rb', line 233

def cursor?
  !@request_id.nil?
end