forked from hyperledger/fabric
/
kafka.pb.go
363 lines (323 loc) · 13.8 KB
/
kafka.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: orderer/kafka.proto
package orderer
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type KafkaMessageRegular_Class int32
const (
KafkaMessageRegular_UNKNOWN KafkaMessageRegular_Class = 0
KafkaMessageRegular_NORMAL KafkaMessageRegular_Class = 1
KafkaMessageRegular_CONFIG KafkaMessageRegular_Class = 2
)
var KafkaMessageRegular_Class_name = map[int32]string{
0: "UNKNOWN",
1: "NORMAL",
2: "CONFIG",
}
var KafkaMessageRegular_Class_value = map[string]int32{
"UNKNOWN": 0,
"NORMAL": 1,
"CONFIG": 2,
}
func (x KafkaMessageRegular_Class) String() string {
return proto.EnumName(KafkaMessageRegular_Class_name, int32(x))
}
func (KafkaMessageRegular_Class) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{1, 0} }
// KafkaMessage is a wrapper type for the messages
// that the Kafka-based orderer deals with.
type KafkaMessage struct {
// Types that are valid to be assigned to Type:
// *KafkaMessage_Regular
// *KafkaMessage_TimeToCut
// *KafkaMessage_Connect
Type isKafkaMessage_Type `protobuf_oneof:"Type"`
}
func (m *KafkaMessage) Reset() { *m = KafkaMessage{} }
func (m *KafkaMessage) String() string { return proto.CompactTextString(m) }
func (*KafkaMessage) ProtoMessage() {}
func (*KafkaMessage) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
type isKafkaMessage_Type interface {
isKafkaMessage_Type()
}
type KafkaMessage_Regular struct {
Regular *KafkaMessageRegular `protobuf:"bytes,1,opt,name=regular,oneof"`
}
type KafkaMessage_TimeToCut struct {
TimeToCut *KafkaMessageTimeToCut `protobuf:"bytes,2,opt,name=time_to_cut,json=timeToCut,oneof"`
}
type KafkaMessage_Connect struct {
Connect *KafkaMessageConnect `protobuf:"bytes,3,opt,name=connect,oneof"`
}
func (*KafkaMessage_Regular) isKafkaMessage_Type() {}
func (*KafkaMessage_TimeToCut) isKafkaMessage_Type() {}
func (*KafkaMessage_Connect) isKafkaMessage_Type() {}
func (m *KafkaMessage) GetType() isKafkaMessage_Type {
if m != nil {
return m.Type
}
return nil
}
func (m *KafkaMessage) GetRegular() *KafkaMessageRegular {
if x, ok := m.GetType().(*KafkaMessage_Regular); ok {
return x.Regular
}
return nil
}
func (m *KafkaMessage) GetTimeToCut() *KafkaMessageTimeToCut {
if x, ok := m.GetType().(*KafkaMessage_TimeToCut); ok {
return x.TimeToCut
}
return nil
}
func (m *KafkaMessage) GetConnect() *KafkaMessageConnect {
if x, ok := m.GetType().(*KafkaMessage_Connect); ok {
return x.Connect
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*KafkaMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _KafkaMessage_OneofMarshaler, _KafkaMessage_OneofUnmarshaler, _KafkaMessage_OneofSizer, []interface{}{
(*KafkaMessage_Regular)(nil),
(*KafkaMessage_TimeToCut)(nil),
(*KafkaMessage_Connect)(nil),
}
}
func _KafkaMessage_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*KafkaMessage)
// Type
switch x := m.Type.(type) {
case *KafkaMessage_Regular:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Regular); err != nil {
return err
}
case *KafkaMessage_TimeToCut:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.TimeToCut); err != nil {
return err
}
case *KafkaMessage_Connect:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Connect); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("KafkaMessage.Type has unexpected type %T", x)
}
return nil
}
func _KafkaMessage_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*KafkaMessage)
switch tag {
case 1: // Type.regular
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(KafkaMessageRegular)
err := b.DecodeMessage(msg)
m.Type = &KafkaMessage_Regular{msg}
return true, err
case 2: // Type.time_to_cut
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(KafkaMessageTimeToCut)
err := b.DecodeMessage(msg)
m.Type = &KafkaMessage_TimeToCut{msg}
return true, err
case 3: // Type.connect
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(KafkaMessageConnect)
err := b.DecodeMessage(msg)
m.Type = &KafkaMessage_Connect{msg}
return true, err
default:
return false, nil
}
}
func _KafkaMessage_OneofSizer(msg proto.Message) (n int) {
m := msg.(*KafkaMessage)
// Type
switch x := m.Type.(type) {
case *KafkaMessage_Regular:
s := proto.Size(x.Regular)
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *KafkaMessage_TimeToCut:
s := proto.Size(x.TimeToCut)
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *KafkaMessage_Connect:
s := proto.Size(x.Connect)
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// KafkaMessageRegular wraps a marshalled envelope.
type KafkaMessageRegular struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
ConfigSeq uint64 `protobuf:"varint,2,opt,name=config_seq,json=configSeq" json:"config_seq,omitempty"`
Class KafkaMessageRegular_Class `protobuf:"varint,3,opt,name=class,enum=orderer.KafkaMessageRegular_Class" json:"class,omitempty"`
OriginalOffset int64 `protobuf:"varint,4,opt,name=original_offset,json=originalOffset" json:"original_offset,omitempty"`
}
func (m *KafkaMessageRegular) Reset() { *m = KafkaMessageRegular{} }
func (m *KafkaMessageRegular) String() string { return proto.CompactTextString(m) }
func (*KafkaMessageRegular) ProtoMessage() {}
func (*KafkaMessageRegular) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
func (m *KafkaMessageRegular) GetPayload() []byte {
if m != nil {
return m.Payload
}
return nil
}
func (m *KafkaMessageRegular) GetConfigSeq() uint64 {
if m != nil {
return m.ConfigSeq
}
return 0
}
func (m *KafkaMessageRegular) GetClass() KafkaMessageRegular_Class {
if m != nil {
return m.Class
}
return KafkaMessageRegular_UNKNOWN
}
func (m *KafkaMessageRegular) GetOriginalOffset() int64 {
if m != nil {
return m.OriginalOffset
}
return 0
}
// KafkaMessageTimeToCut is used to signal to the orderers
// that it is time to cut block <block_number>.
type KafkaMessageTimeToCut struct {
BlockNumber uint64 `protobuf:"varint,1,opt,name=block_number,json=blockNumber" json:"block_number,omitempty"`
}
func (m *KafkaMessageTimeToCut) Reset() { *m = KafkaMessageTimeToCut{} }
func (m *KafkaMessageTimeToCut) String() string { return proto.CompactTextString(m) }
func (*KafkaMessageTimeToCut) ProtoMessage() {}
func (*KafkaMessageTimeToCut) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
func (m *KafkaMessageTimeToCut) GetBlockNumber() uint64 {
if m != nil {
return m.BlockNumber
}
return 0
}
// KafkaMessageConnect is posted by an orderer upon booting up.
// It is used to prevent the panic that would be caused if we
// were to consume an empty partition. It is ignored by all
// orderers when processing the partition.
type KafkaMessageConnect struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
}
func (m *KafkaMessageConnect) Reset() { *m = KafkaMessageConnect{} }
func (m *KafkaMessageConnect) String() string { return proto.CompactTextString(m) }
func (*KafkaMessageConnect) ProtoMessage() {}
func (*KafkaMessageConnect) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
func (m *KafkaMessageConnect) GetPayload() []byte {
if m != nil {
return m.Payload
}
return nil
}
// KafkaMetadata is encoded into the ORDERER block to keep track of
// Kafka-related metadata associated with this block.
type KafkaMetadata struct {
// LastOffsetPersisted is the encoded value for the Metadata message
// which is encoded in the ORDERER block metadata index for the case
// of the Kafka-based orderer.
LastOffsetPersisted int64 `protobuf:"varint,1,opt,name=last_offset_persisted,json=lastOffsetPersisted" json:"last_offset_persisted,omitempty"`
// LastOriginalOffsetProcessed is used to keep track of the newest
// offset processed if a message is re-validated and re-ordered.
// This value is used to deduplicate re-submitted messages from
// multiple orderer so that we don't bother re-processing it again.
LastOriginalOffsetProcessed int64 `protobuf:"varint,2,opt,name=last_original_offset_processed,json=lastOriginalOffsetProcessed" json:"last_original_offset_processed,omitempty"`
// LastResubmittedConfigOffset is used to capture the newest offset of
// CONFIG kafka message, which is revalidated and resubmitted. By comparing
// this with LastOriginalOffsetProcessed, we could detemine whether there
// are still CONFIG messages that have been resubmitted but NOT processed
// yet. It's used as condition to block ingress messages, so we could reduce
// the overhead of repeatedly resubmitting messages as config seq keeps
// advancing.
LastResubmittedConfigOffset int64 `protobuf:"varint,3,opt,name=last_resubmitted_config_offset,json=lastResubmittedConfigOffset" json:"last_resubmitted_config_offset,omitempty"`
}
func (m *KafkaMetadata) Reset() { *m = KafkaMetadata{} }
func (m *KafkaMetadata) String() string { return proto.CompactTextString(m) }
func (*KafkaMetadata) ProtoMessage() {}
func (*KafkaMetadata) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} }
func (m *KafkaMetadata) GetLastOffsetPersisted() int64 {
if m != nil {
return m.LastOffsetPersisted
}
return 0
}
func (m *KafkaMetadata) GetLastOriginalOffsetProcessed() int64 {
if m != nil {
return m.LastOriginalOffsetProcessed
}
return 0
}
func (m *KafkaMetadata) GetLastResubmittedConfigOffset() int64 {
if m != nil {
return m.LastResubmittedConfigOffset
}
return 0
}
func init() {
proto.RegisterType((*KafkaMessage)(nil), "orderer.KafkaMessage")
proto.RegisterType((*KafkaMessageRegular)(nil), "orderer.KafkaMessageRegular")
proto.RegisterType((*KafkaMessageTimeToCut)(nil), "orderer.KafkaMessageTimeToCut")
proto.RegisterType((*KafkaMessageConnect)(nil), "orderer.KafkaMessageConnect")
proto.RegisterType((*KafkaMetadata)(nil), "orderer.KafkaMetadata")
proto.RegisterEnum("orderer.KafkaMessageRegular_Class", KafkaMessageRegular_Class_name, KafkaMessageRegular_Class_value)
}
func init() { proto.RegisterFile("orderer/kafka.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
// 476 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00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