kafka-grpc 0.41.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/grpcdc/kafka_grpc_dc.rb +15 -0
- data/lib/grpcdc/kafka_pb.rb +232 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21fb4bd9d63bdd7caebce23d3d3e95ef6cbe85a938c4d591a9c4631e736d90fe
|
|
4
|
+
data.tar.gz: 69bac36110be426e7842f02906a34bf515a21e88ea53d3606d4183db7c2bc5cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a05061dd3a419efa8a97f9260233c2c23c7db999fe906a5a0175760eb8d1864c2108dc4c344cc237d4b812e6ea4d3e10e9d322e26020fa522689bf01a36827f9
|
|
7
|
+
data.tar.gz: 988110b6170d9547d876f959be711b11143a84dab47a30183720daa0733cb51f34d802d85669e8aa396f71ca3d6388b5af165b40537f7709965a235d634c330d
|
data/lib/grpcdc/kafka_grpc_dc.rb
CHANGED
|
@@ -299,6 +299,10 @@ module KafkaGrpcDc
|
|
|
299
299
|
@channel.unary("/grpcdc.kafka.v1.Kafka/CloseShareGroup", req, KafkaPb::CloseShareGroupResponse.new, metadata, timeout: timeout)
|
|
300
300
|
end
|
|
301
301
|
|
|
302
|
+
def DescribeShareGroups(req, metadata = nil, timeout: nil)
|
|
303
|
+
@channel.unary("/grpcdc.kafka.v1.Kafka/DescribeShareGroups", req, KafkaPb::DescribeShareGroupsResponse.new, metadata, timeout: timeout)
|
|
304
|
+
end
|
|
305
|
+
|
|
302
306
|
end
|
|
303
307
|
|
|
304
308
|
# Fiber client: wraps a Grpcdc::FiberChannel (a sync Channel is wrapped).
|
|
@@ -425,6 +429,10 @@ module KafkaGrpcDc
|
|
|
425
429
|
@channel.unary("/grpcdc.kafka.v1.Kafka/CloseShareGroup", req, KafkaPb::CloseShareGroupResponse.new, metadata, timeout: timeout)
|
|
426
430
|
end
|
|
427
431
|
|
|
432
|
+
def DescribeShareGroups(req, metadata = nil, timeout: nil)
|
|
433
|
+
@channel.unary("/grpcdc.kafka.v1.Kafka/DescribeShareGroups", req, KafkaPb::DescribeShareGroupsResponse.new, metadata, timeout: timeout)
|
|
434
|
+
end
|
|
435
|
+
|
|
428
436
|
end
|
|
429
437
|
|
|
430
438
|
def self.register_kafka_server(server, impl)
|
|
@@ -600,6 +608,12 @@ module KafkaGrpcDc
|
|
|
600
608
|
sink.send(resp.marshal_dc)
|
|
601
609
|
end
|
|
602
610
|
|
|
611
|
+
describe_share_groups_handler = lambda do |ctx, reqs, sink|
|
|
612
|
+
req = reqs.recv_into(KafkaPb::DescribeShareGroupsRequest.new)
|
|
613
|
+
resp = impl.DescribeShareGroups(ctx, req)
|
|
614
|
+
sink.send(resp.marshal_dc)
|
|
615
|
+
end
|
|
616
|
+
|
|
603
617
|
server.register_service(Grpcdc::ServiceDesc.new(
|
|
604
618
|
"grpcdc.kafka.v1.Kafka",
|
|
605
619
|
[
|
|
@@ -632,6 +646,7 @@ module KafkaGrpcDc
|
|
|
632
646
|
Grpcdc::Method.new("SharePoll", "/grpcdc.kafka.v1.Kafka/SharePoll", Grpcdc::KIND_UNARY, share_poll_handler),
|
|
633
647
|
Grpcdc::Method.new("ShareAck", "/grpcdc.kafka.v1.Kafka/ShareAck", Grpcdc::KIND_UNARY, share_ack_handler),
|
|
634
648
|
Grpcdc::Method.new("CloseShareGroup", "/grpcdc.kafka.v1.Kafka/CloseShareGroup", Grpcdc::KIND_UNARY, close_share_group_handler),
|
|
649
|
+
Grpcdc::Method.new("DescribeShareGroups", "/grpcdc.kafka.v1.Kafka/DescribeShareGroups", Grpcdc::KIND_UNARY, describe_share_groups_handler),
|
|
635
650
|
]
|
|
636
651
|
))
|
|
637
652
|
end
|
data/lib/grpcdc/kafka_pb.rb
CHANGED
|
@@ -4592,4 +4592,236 @@ end
|
|
|
4592
4592
|
end
|
|
4593
4593
|
end
|
|
4594
4594
|
|
|
4595
|
+
class ShareGroupMember
|
|
4596
|
+
attr_accessor :member_id, :member_epoch, :client_id, :client_host, :subscribed_topics, :assignment, :unknown_fields
|
|
4597
|
+
|
|
4598
|
+
def initialize(member_id: "", member_epoch: 0, client_id: "", client_host: "", subscribed_topics: [], assignment: [])
|
|
4599
|
+
@member_id = member_id
|
|
4600
|
+
@member_epoch = member_epoch
|
|
4601
|
+
@client_id = client_id
|
|
4602
|
+
@client_host = client_host
|
|
4603
|
+
@subscribed_topics = subscribed_topics
|
|
4604
|
+
@assignment = assignment
|
|
4605
|
+
@unknown_fields = "".b
|
|
4606
|
+
end
|
|
4607
|
+
|
|
4608
|
+
def marshal_dc
|
|
4609
|
+
w = Writer.new
|
|
4610
|
+
w.string_field(1, @member_id)
|
|
4611
|
+
if @member_epoch != 0
|
|
4612
|
+
w.tag(2, 0)
|
|
4613
|
+
w.varint(@member_epoch)
|
|
4614
|
+
end
|
|
4615
|
+
w.string_field(3, @client_id)
|
|
4616
|
+
w.string_field(4, @client_host)
|
|
4617
|
+
@subscribed_topics.each { |x| w.bytes_field(5, x) }
|
|
4618
|
+
@assignment.each { |x| w.bytes_field(6, x.marshal_dc) }
|
|
4619
|
+
w.raw(@unknown_fields)
|
|
4620
|
+
w.to_bytes
|
|
4621
|
+
end
|
|
4622
|
+
|
|
4623
|
+
def unmarshal_dc(data)
|
|
4624
|
+
@unknown_fields = "".b
|
|
4625
|
+
@member_id = ""
|
|
4626
|
+
@member_epoch = 0
|
|
4627
|
+
@client_id = ""
|
|
4628
|
+
@client_host = ""
|
|
4629
|
+
@subscribed_topics = []
|
|
4630
|
+
@assignment = []
|
|
4631
|
+
r = Reader.new(data)
|
|
4632
|
+
loop do
|
|
4633
|
+
item = r.field
|
|
4634
|
+
break if item.nil?
|
|
4635
|
+
|
|
4636
|
+
num, wire, varint_value, bytes_value, fixed_value, raw_value = item
|
|
4637
|
+
case num
|
|
4638
|
+
when 1
|
|
4639
|
+
@member_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
|
|
4640
|
+
when 2
|
|
4641
|
+
@member_epoch = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
|
|
4642
|
+
when 3
|
|
4643
|
+
@client_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
|
|
4644
|
+
when 4
|
|
4645
|
+
@client_host = bytes_value.dup.force_encoding(Encoding::UTF_8)
|
|
4646
|
+
when 5
|
|
4647
|
+
@subscribed_topics << bytes_value.dup.force_encoding(Encoding::UTF_8)
|
|
4648
|
+
when 6
|
|
4649
|
+
item = TopicPartition.new
|
|
4650
|
+
item.unmarshal_dc(bytes_value)
|
|
4651
|
+
@assignment << item
|
|
4652
|
+
else
|
|
4653
|
+
@unknown_fields = @unknown_fields + raw_value
|
|
4654
|
+
end
|
|
4655
|
+
end
|
|
4656
|
+
self
|
|
4657
|
+
end
|
|
4658
|
+
|
|
4659
|
+
def ==(other)
|
|
4660
|
+
other.is_a?(ShareGroupMember) && @member_id == other.member_id && @member_epoch == other.member_epoch && @client_id == other.client_id && @client_host == other.client_host && @subscribed_topics == other.subscribed_topics && @assignment == other.assignment
|
|
4661
|
+
end
|
|
4662
|
+
end
|
|
4663
|
+
|
|
4664
|
+
class ShareGroupDescription
|
|
4665
|
+
attr_accessor :group_id, :error_code, :state, :group_epoch, :assignment_epoch, :members, :unknown_fields
|
|
4666
|
+
|
|
4667
|
+
def initialize(group_id: "", error_code: 0, state: "", group_epoch: 0, assignment_epoch: 0, members: [])
|
|
4668
|
+
@group_id = group_id
|
|
4669
|
+
@error_code = error_code
|
|
4670
|
+
@state = state
|
|
4671
|
+
@group_epoch = group_epoch
|
|
4672
|
+
@assignment_epoch = assignment_epoch
|
|
4673
|
+
@members = members
|
|
4674
|
+
@unknown_fields = "".b
|
|
4675
|
+
end
|
|
4676
|
+
|
|
4677
|
+
def marshal_dc
|
|
4678
|
+
w = Writer.new
|
|
4679
|
+
w.string_field(1, @group_id)
|
|
4680
|
+
if @error_code != 0
|
|
4681
|
+
w.tag(2, 0)
|
|
4682
|
+
w.varint(@error_code)
|
|
4683
|
+
end
|
|
4684
|
+
w.string_field(3, @state)
|
|
4685
|
+
if @group_epoch != 0
|
|
4686
|
+
w.tag(4, 0)
|
|
4687
|
+
w.varint(@group_epoch)
|
|
4688
|
+
end
|
|
4689
|
+
if @assignment_epoch != 0
|
|
4690
|
+
w.tag(5, 0)
|
|
4691
|
+
w.varint(@assignment_epoch)
|
|
4692
|
+
end
|
|
4693
|
+
@members.each { |x| w.bytes_field(6, x.marshal_dc) }
|
|
4694
|
+
w.raw(@unknown_fields)
|
|
4695
|
+
w.to_bytes
|
|
4696
|
+
end
|
|
4697
|
+
|
|
4698
|
+
def unmarshal_dc(data)
|
|
4699
|
+
@unknown_fields = "".b
|
|
4700
|
+
@group_id = ""
|
|
4701
|
+
@error_code = 0
|
|
4702
|
+
@state = ""
|
|
4703
|
+
@group_epoch = 0
|
|
4704
|
+
@assignment_epoch = 0
|
|
4705
|
+
@members = []
|
|
4706
|
+
r = Reader.new(data)
|
|
4707
|
+
loop do
|
|
4708
|
+
item = r.field
|
|
4709
|
+
break if item.nil?
|
|
4710
|
+
|
|
4711
|
+
num, wire, varint_value, bytes_value, fixed_value, raw_value = item
|
|
4712
|
+
case num
|
|
4713
|
+
when 1
|
|
4714
|
+
@group_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
|
|
4715
|
+
when 2
|
|
4716
|
+
@error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
|
|
4717
|
+
when 3
|
|
4718
|
+
@state = bytes_value.dup.force_encoding(Encoding::UTF_8)
|
|
4719
|
+
when 4
|
|
4720
|
+
@group_epoch = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
|
|
4721
|
+
when 5
|
|
4722
|
+
@assignment_epoch = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
|
|
4723
|
+
when 6
|
|
4724
|
+
item = ShareGroupMember.new
|
|
4725
|
+
item.unmarshal_dc(bytes_value)
|
|
4726
|
+
@members << item
|
|
4727
|
+
else
|
|
4728
|
+
@unknown_fields = @unknown_fields + raw_value
|
|
4729
|
+
end
|
|
4730
|
+
end
|
|
4731
|
+
self
|
|
4732
|
+
end
|
|
4733
|
+
|
|
4734
|
+
def ==(other)
|
|
4735
|
+
other.is_a?(ShareGroupDescription) && @group_id == other.group_id && @error_code == other.error_code && @state == other.state && @group_epoch == other.group_epoch && @assignment_epoch == other.assignment_epoch && @members == other.members
|
|
4736
|
+
end
|
|
4737
|
+
end
|
|
4738
|
+
|
|
4739
|
+
class DescribeShareGroupsRequest
|
|
4740
|
+
attr_accessor :group_ids, :unknown_fields
|
|
4741
|
+
|
|
4742
|
+
def initialize(group_ids: [])
|
|
4743
|
+
@group_ids = group_ids
|
|
4744
|
+
@unknown_fields = "".b
|
|
4745
|
+
end
|
|
4746
|
+
|
|
4747
|
+
def marshal_dc
|
|
4748
|
+
w = Writer.new
|
|
4749
|
+
@group_ids.each { |x| w.bytes_field(1, x) }
|
|
4750
|
+
w.raw(@unknown_fields)
|
|
4751
|
+
w.to_bytes
|
|
4752
|
+
end
|
|
4753
|
+
|
|
4754
|
+
def unmarshal_dc(data)
|
|
4755
|
+
@unknown_fields = "".b
|
|
4756
|
+
@group_ids = []
|
|
4757
|
+
r = Reader.new(data)
|
|
4758
|
+
loop do
|
|
4759
|
+
item = r.field
|
|
4760
|
+
break if item.nil?
|
|
4761
|
+
|
|
4762
|
+
num, wire, varint_value, bytes_value, fixed_value, raw_value = item
|
|
4763
|
+
case num
|
|
4764
|
+
when 1
|
|
4765
|
+
@group_ids << bytes_value.dup.force_encoding(Encoding::UTF_8)
|
|
4766
|
+
else
|
|
4767
|
+
@unknown_fields = @unknown_fields + raw_value
|
|
4768
|
+
end
|
|
4769
|
+
end
|
|
4770
|
+
self
|
|
4771
|
+
end
|
|
4772
|
+
|
|
4773
|
+
def ==(other)
|
|
4774
|
+
other.is_a?(DescribeShareGroupsRequest) && @group_ids == other.group_ids
|
|
4775
|
+
end
|
|
4776
|
+
end
|
|
4777
|
+
|
|
4778
|
+
class DescribeShareGroupsResponse
|
|
4779
|
+
attr_accessor :groups, :error_code, :unknown_fields
|
|
4780
|
+
|
|
4781
|
+
def initialize(groups: [], error_code: 0)
|
|
4782
|
+
@groups = groups
|
|
4783
|
+
@error_code = error_code
|
|
4784
|
+
@unknown_fields = "".b
|
|
4785
|
+
end
|
|
4786
|
+
|
|
4787
|
+
def marshal_dc
|
|
4788
|
+
w = Writer.new
|
|
4789
|
+
@groups.each { |x| w.bytes_field(1, x.marshal_dc) }
|
|
4790
|
+
if @error_code != 0
|
|
4791
|
+
w.tag(2, 0)
|
|
4792
|
+
w.varint(@error_code)
|
|
4793
|
+
end
|
|
4794
|
+
w.raw(@unknown_fields)
|
|
4795
|
+
w.to_bytes
|
|
4796
|
+
end
|
|
4797
|
+
|
|
4798
|
+
def unmarshal_dc(data)
|
|
4799
|
+
@unknown_fields = "".b
|
|
4800
|
+
@groups = []
|
|
4801
|
+
@error_code = 0
|
|
4802
|
+
r = Reader.new(data)
|
|
4803
|
+
loop do
|
|
4804
|
+
item = r.field
|
|
4805
|
+
break if item.nil?
|
|
4806
|
+
|
|
4807
|
+
num, wire, varint_value, bytes_value, fixed_value, raw_value = item
|
|
4808
|
+
case num
|
|
4809
|
+
when 1
|
|
4810
|
+
item = ShareGroupDescription.new
|
|
4811
|
+
item.unmarshal_dc(bytes_value)
|
|
4812
|
+
@groups << item
|
|
4813
|
+
when 2
|
|
4814
|
+
@error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
|
|
4815
|
+
else
|
|
4816
|
+
@unknown_fields = @unknown_fields + raw_value
|
|
4817
|
+
end
|
|
4818
|
+
end
|
|
4819
|
+
self
|
|
4820
|
+
end
|
|
4821
|
+
|
|
4822
|
+
def ==(other)
|
|
4823
|
+
other.is_a?(DescribeShareGroupsResponse) && @groups == other.groups && @error_code == other.error_code
|
|
4824
|
+
end
|
|
4825
|
+
end
|
|
4826
|
+
|
|
4595
4827
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kafka-grpc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.42.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Davis
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.42.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.42.0
|
|
26
26
|
description: Kafka over gRPC — generated grpcdc.kafka.v1 clients (produce/consume/groups/topics)
|
|
27
27
|
speaking gRPC over WebRTC DataChannels, via the grpc-dc runtime (Ruby).
|
|
28
28
|
email:
|