Class: Pinot::BrokerResponse
- Inherits:
-
Object
- Object
- Pinot::BrokerResponse
- Defined in:
- lib/pinot/response.rb
Instance Attribute Summary collapse
-
#aggregation_results ⇒ Object
readonly
Returns the value of attribute aggregation_results.
-
#broker_host ⇒ Object
readonly
Returns the value of attribute broker_host.
-
#broker_port ⇒ Object
readonly
Returns the value of attribute broker_port.
-
#exceptions ⇒ Object
readonly
Returns the value of attribute exceptions.
-
#expiration_time_ms ⇒ Object
readonly
Returns the value of attribute expiration_time_ms.
-
#min_consuming_freshness_time_ms ⇒ Object
readonly
Returns the value of attribute min_consuming_freshness_time_ms.
-
#num_consuming_segments_queried ⇒ Object
readonly
Returns the value of attribute num_consuming_segments_queried.
-
#num_docs_scanned ⇒ Object
readonly
Returns the value of attribute num_docs_scanned.
-
#num_entries_scanned_in_filter ⇒ Object
readonly
Returns the value of attribute num_entries_scanned_in_filter.
-
#num_entries_scanned_post_filter ⇒ Object
readonly
Returns the value of attribute num_entries_scanned_post_filter.
-
#num_groups_limit_reached ⇒ Object
readonly
Returns the value of attribute num_groups_limit_reached.
-
#num_rows ⇒ Object
readonly
Returns the value of attribute num_rows.
-
#num_rows_result_set ⇒ Object
readonly
Returns the value of attribute num_rows_result_set.
-
#num_segments_matched ⇒ Object
readonly
Returns the value of attribute num_segments_matched.
-
#num_segments_processed ⇒ Object
readonly
Returns the value of attribute num_segments_processed.
-
#num_segments_queried ⇒ Object
readonly
Returns the value of attribute num_segments_queried.
-
#num_servers_queried ⇒ Object
readonly
Returns the value of attribute num_servers_queried.
-
#num_servers_responded ⇒ Object
readonly
Returns the value of attribute num_servers_responded.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#result_table ⇒ Object
readonly
Returns the value of attribute result_table.
-
#selection_results ⇒ Object
readonly
Returns the value of attribute selection_results.
-
#submission_time_ms ⇒ Object
readonly
Returns the value of attribute submission_time_ms.
-
#time_used_ms ⇒ Object
readonly
Returns the value of attribute time_used_ms.
-
#total_docs ⇒ Object
readonly
Returns the value of attribute total_docs.
-
#trace_info ⇒ Object
readonly
Returns the value of attribute trace_info.
Class Method Summary collapse
Instance Method Summary collapse
- #cursor? ⇒ Boolean
-
#initialize(hash) ⇒ BrokerResponse
constructor
A new instance of BrokerResponse.
Constructor Details
#initialize(hash) ⇒ BrokerResponse
Returns a new instance of BrokerResponse.
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/pinot/response.rb', line 210 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_results ⇒ Object (readonly)
Returns the value of attribute aggregation_results.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def aggregation_results @aggregation_results end |
#broker_host ⇒ Object (readonly)
Returns the value of attribute broker_host.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def broker_host @broker_host end |
#broker_port ⇒ Object (readonly)
Returns the value of attribute broker_port.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def broker_port @broker_port end |
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def exceptions @exceptions end |
#expiration_time_ms ⇒ Object (readonly)
Returns the value of attribute expiration_time_ms.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def expiration_time_ms @expiration_time_ms end |
#min_consuming_freshness_time_ms ⇒ Object (readonly)
Returns the value of attribute min_consuming_freshness_time_ms.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def min_consuming_freshness_time_ms @min_consuming_freshness_time_ms end |
#num_consuming_segments_queried ⇒ Object (readonly)
Returns the value of attribute num_consuming_segments_queried.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_consuming_segments_queried @num_consuming_segments_queried end |
#num_docs_scanned ⇒ Object (readonly)
Returns the value of attribute num_docs_scanned.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_docs_scanned @num_docs_scanned end |
#num_entries_scanned_in_filter ⇒ Object (readonly)
Returns the value of attribute num_entries_scanned_in_filter.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_entries_scanned_in_filter @num_entries_scanned_in_filter end |
#num_entries_scanned_post_filter ⇒ Object (readonly)
Returns the value of attribute num_entries_scanned_post_filter.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_entries_scanned_post_filter @num_entries_scanned_post_filter end |
#num_groups_limit_reached ⇒ Object (readonly)
Returns the value of attribute num_groups_limit_reached.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_groups_limit_reached @num_groups_limit_reached end |
#num_rows ⇒ Object (readonly)
Returns the value of attribute num_rows.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_rows @num_rows end |
#num_rows_result_set ⇒ Object (readonly)
Returns the value of attribute num_rows_result_set.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_rows_result_set @num_rows_result_set end |
#num_segments_matched ⇒ Object (readonly)
Returns the value of attribute num_segments_matched.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_segments_matched @num_segments_matched end |
#num_segments_processed ⇒ Object (readonly)
Returns the value of attribute num_segments_processed.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_segments_processed @num_segments_processed end |
#num_segments_queried ⇒ Object (readonly)
Returns the value of attribute num_segments_queried.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_segments_queried @num_segments_queried end |
#num_servers_queried ⇒ Object (readonly)
Returns the value of attribute num_servers_queried.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_servers_queried @num_servers_queried end |
#num_servers_responded ⇒ Object (readonly)
Returns the value of attribute num_servers_responded.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def num_servers_responded @num_servers_responded end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def offset @offset end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def request_id @request_id end |
#result_table ⇒ Object (readonly)
Returns the value of attribute result_table.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def result_table @result_table end |
#selection_results ⇒ Object (readonly)
Returns the value of attribute selection_results.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def selection_results @selection_results end |
#submission_time_ms ⇒ Object (readonly)
Returns the value of attribute submission_time_ms.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def submission_time_ms @submission_time_ms end |
#time_used_ms ⇒ Object (readonly)
Returns the value of attribute time_used_ms.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def time_used_ms @time_used_ms end |
#total_docs ⇒ Object (readonly)
Returns the value of attribute total_docs.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def total_docs @total_docs end |
#trace_info ⇒ Object (readonly)
Returns the value of attribute trace_info.
191 192 193 |
# File 'lib/pinot/response.rb', line 191 def trace_info @trace_info end |
Class Method Details
.from_json(json_str) ⇒ Object
205 206 207 208 |
# File 'lib/pinot/response.rb', line 205 def self.from_json(json_str) hash = JSON.parse(json_str) new(hash) end |
Instance Method Details
#cursor? ⇒ Boolean
241 242 243 |
# File 'lib/pinot/response.rb', line 241 def cursor? !@request_id.nil? end |