Class: Gqldb::GqlResponse
- Inherits:
-
Object
- Object
- Gqldb::GqlResponse
- Defined in:
- lib/tina4_ultipa/pb.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#compute_cost_ns ⇒ Object
Returns the value of attribute compute_cost_ns.
-
#current_graph ⇒ Object
Returns the value of attribute current_graph.
-
#disk_cost_ns ⇒ Object
Returns the value of attribute disk_cost_ns.
-
#dml_stats ⇒ Object
Returns the value of attribute dml_stats.
-
#has_more ⇒ Object
Returns the value of attribute has_more.
-
#row_count ⇒ Object
Returns the value of attribute row_count.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#rows_affected ⇒ Object
Returns the value of attribute rows_affected.
-
#time_cost_ns ⇒ Object
Returns the value of attribute time_cost_ns.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ GqlResponse
constructor
A new instance of GqlResponse.
Constructor Details
#initialize ⇒ GqlResponse
Returns a new instance of GqlResponse.
387 388 389 390 391 392 393 394 395 396 397 398 399 |
# File 'lib/tina4_ultipa/pb.rb', line 387 def initialize @columns = [] @rows = [] @row_count = 0 @has_more = false @warnings = [] @rows_affected = 0 @current_graph = "" @time_cost_ns = 0 @disk_cost_ns = 0 @compute_cost_ns = 0 @dml_stats = DmlStats.new end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def columns @columns end |
#compute_cost_ns ⇒ Object
Returns the value of attribute compute_cost_ns.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def compute_cost_ns @compute_cost_ns end |
#current_graph ⇒ Object
Returns the value of attribute current_graph.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def current_graph @current_graph end |
#disk_cost_ns ⇒ Object
Returns the value of attribute disk_cost_ns.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def disk_cost_ns @disk_cost_ns end |
#dml_stats ⇒ Object
Returns the value of attribute dml_stats.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def dml_stats @dml_stats end |
#has_more ⇒ Object
Returns the value of attribute has_more.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def has_more @has_more end |
#row_count ⇒ Object
Returns the value of attribute row_count.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def row_count @row_count end |
#rows ⇒ Object
Returns the value of attribute rows.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def rows @rows end |
#rows_affected ⇒ Object
Returns the value of attribute rows_affected.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def rows_affected @rows_affected end |
#time_cost_ns ⇒ Object
Returns the value of attribute time_cost_ns.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def time_cost_ns @time_cost_ns end |
#warnings ⇒ Object
Returns the value of attribute warnings.
383 384 385 |
# File 'lib/tina4_ultipa/pb.rb', line 383 def warnings @warnings end |
Class Method Details
.decode(bytes) ⇒ Object
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
# File 'lib/tina4_ultipa/pb.rb', line 401 def self.decode(bytes) o = new r = Reader.new(bytes) until r.eof? tag = r.read_varint fn = tag >> 3 wt = tag & 7 case [fn, wt] when [1, 2] then o.columns << r.read_string when [2, 2] then o.rows << Row.decode(r.read_len) when [3, 0] then o.row_count = r.read_signed_varint when [4, 0] then o.has_more = !r.read_varint.zero? when [5, 2] then o.warnings << r.read_string when [6, 0] then o.rows_affected = r.read_signed_varint when [7, 2] then o.current_graph = r.read_string when [8, 0] then o.time_cost_ns = r.read_signed_varint when [9, 0] then o.disk_cost_ns = r.read_signed_varint when [10, 0] then o.compute_cost_ns = r.read_signed_varint when [11, 2] then o.dml_stats = DmlStats.decode(r.read_len) else r.skip(wt) end end o end |