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.
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_results ⇒ Object (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_host ⇒ Object (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_port ⇒ Object (readonly)
Returns the value of attribute broker_port.
197 198 199 |
# File 'lib/pinot/response.rb', line 197 def broker_port @broker_port end |
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
197 198 199 |
# File 'lib/pinot/response.rb', line 197 def exceptions @exceptions end |
#expiration_time_ms ⇒ Object (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_ms ⇒ Object (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_queried ⇒ Object (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_scanned ⇒ Object (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_filter ⇒ Object (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_filter ⇒ Object (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_reached ⇒ Object (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_rows ⇒ Object (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_set ⇒ Object (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_matched ⇒ Object (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_processed ⇒ Object (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_queried ⇒ Object (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_queried ⇒ Object (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_responded ⇒ Object (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 |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
197 198 199 |
# File 'lib/pinot/response.rb', line 197 def offset @offset end |
#request_id ⇒ Object (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_table ⇒ Object (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_results ⇒ Object (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_ms ⇒ Object (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_ms ⇒ Object (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_docs ⇒ Object (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_info ⇒ Object (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
247 248 249 |
# File 'lib/pinot/response.rb', line 247 def cursor? !@request_id.nil? end |