Class: KafkaSyrup::Protocol::FetchResponse::Partition
- Inherits:
-
Struct
- Object
- Struct
- KafkaSyrup::Protocol::FetchResponse::Partition
- Defined in:
- lib/kafka_syrup/protocol/fetch_response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#highwater_offset ⇒ Object
Returns the value of attribute highwater_offset.
-
#id ⇒ Object
Returns the value of attribute id.
-
#message_set ⇒ Object
Returns the value of attribute message_set.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
50 51 52 |
# File 'lib/kafka_syrup/protocol/fetch_response.rb', line 50 def code @code end |
#highwater_offset ⇒ Object
Returns the value of attribute highwater_offset
50 51 52 |
# File 'lib/kafka_syrup/protocol/fetch_response.rb', line 50 def highwater_offset @highwater_offset end |
#id ⇒ Object
Returns the value of attribute id
50 51 52 |
# File 'lib/kafka_syrup/protocol/fetch_response.rb', line 50 def id @id end |
#message_set ⇒ Object
Returns the value of attribute message_set
50 51 52 |
# File 'lib/kafka_syrup/protocol/fetch_response.rb', line 50 def @message_set end |
Class Method Details
.decode(io, &block) ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/kafka_syrup/protocol/fetch_response.rb', line 72 def self.decode(io, &block) partition = new partition.id = E.read_int32(io) partition.code = E.read_int16(io) partition.highwater_offset = E.read_int64(io) length = E.read_int32(io) partition. = MessageSet.new(io, length, &block) partition end |
Instance Method Details
#add_message(value = nil, opts = {}) ⇒ Object
55 56 57 58 59 |
# File 'lib/kafka_syrup/protocol/fetch_response.rb', line 55 def (value = nil, opts = {}) m = Message.new(opts.merge(value: value)) . << m m end |
#encode ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/kafka_syrup/protocol/fetch_response.rb', line 61 def encode encoded = .encode [ E.write_int32(id), E.write_int16(code), E.write_int64(highwater_offset), E.write_int32(encoded.length), encoded ].join end |
#messages ⇒ Object
51 52 53 |
# File 'lib/kafka_syrup/protocol/fetch_response.rb', line 51 def . end |