github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/pkg/ingester/wal.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: wal.proto 3 4 package ingester 5 6 import ( 7 fmt "fmt" 8 _ "github.com/cortexproject/cortex/pkg/cortexpb" 9 github_com_cortexproject_cortex_pkg_cortexpb "github.com/cortexproject/cortex/pkg/cortexpb" 10 client "github.com/cortexproject/cortex/pkg/ingester/client" 11 _ "github.com/gogo/protobuf/gogoproto" 12 proto "github.com/gogo/protobuf/proto" 13 io "io" 14 math "math" 15 math_bits "math/bits" 16 reflect "reflect" 17 strings "strings" 18 ) 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var _ = proto.Marshal 22 var _ = fmt.Errorf 23 var _ = math.Inf 24 25 // This is a compile-time assertion to ensure that this generated file 26 // is compatible with the proto package it is being compiled against. 27 // A compilation error at this line likely means your copy of the 28 // proto package needs to be updated. 29 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 30 31 type Series struct { 32 UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` 33 Fingerprint uint64 `protobuf:"varint,2,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` 34 Labels []github_com_cortexproject_cortex_pkg_cortexpb.LabelAdapter `protobuf:"bytes,3,rep,name=labels,proto3,customtype=github.com/cortexproject/cortex/pkg/cortexpb.LabelAdapter" json:"labels"` 35 Chunks []client.Chunk `protobuf:"bytes,4,rep,name=chunks,proto3" json:"chunks"` 36 } 37 38 func (m *Series) Reset() { *m = Series{} } 39 func (*Series) ProtoMessage() {} 40 func (*Series) Descriptor() ([]byte, []int) { 41 return fileDescriptor_ae6364fc8077884f, []int{0} 42 } 43 func (m *Series) XXX_Unmarshal(b []byte) error { 44 return m.Unmarshal(b) 45 } 46 func (m *Series) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 47 if deterministic { 48 return xxx_messageInfo_Series.Marshal(b, m, deterministic) 49 } else { 50 b = b[:cap(b)] 51 n, err := m.MarshalToSizedBuffer(b) 52 if err != nil { 53 return nil, err 54 } 55 return b[:n], nil 56 } 57 } 58 func (m *Series) XXX_Merge(src proto.Message) { 59 xxx_messageInfo_Series.Merge(m, src) 60 } 61 func (m *Series) XXX_Size() int { 62 return m.Size() 63 } 64 func (m *Series) XXX_DiscardUnknown() { 65 xxx_messageInfo_Series.DiscardUnknown(m) 66 } 67 68 var xxx_messageInfo_Series proto.InternalMessageInfo 69 70 func (m *Series) GetUserId() string { 71 if m != nil { 72 return m.UserId 73 } 74 return "" 75 } 76 77 func (m *Series) GetFingerprint() uint64 { 78 if m != nil { 79 return m.Fingerprint 80 } 81 return 0 82 } 83 84 func (m *Series) GetChunks() []client.Chunk { 85 if m != nil { 86 return m.Chunks 87 } 88 return nil 89 } 90 91 func init() { 92 proto.RegisterType((*Series)(nil), "ingester.Series") 93 } 94 95 func init() { proto.RegisterFile("wal.proto", fileDescriptor_ae6364fc8077884f) } 96 97 var fileDescriptor_ae6364fc8077884f = []byte{ 98 // 323 bytes of a gzipped FileDescriptorProto 99 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x31, 0x4e, 0xc3, 0x30, 100 0x18, 0x85, 0x6d, 0x5a, 0x05, 0xea, 0x8a, 0x25, 0x0c, 0x44, 0x1d, 0xfe, 0x46, 0x4c, 0x95, 0x10, 101 0x89, 0x04, 0x13, 0x0b, 0x52, 0xc3, 0x84, 0xc4, 0x80, 0xc2, 0xc6, 0x82, 0x92, 0xd4, 0x4d, 0x4d, 102 0x43, 0x1c, 0x39, 0x8e, 0x60, 0xe4, 0x08, 0x1c, 0x83, 0xa3, 0x74, 0xec, 0x58, 0x31, 0x54, 0xad, 103 0xbb, 0x30, 0xf6, 0x08, 0x28, 0xae, 0x5b, 0x75, 0x84, 0xed, 0x7f, 0x2f, 0xef, 0xcb, 0xfb, 0x6d, 104 0x93, 0xd6, 0x5b, 0x94, 0x79, 0x85, 0xe0, 0x92, 0xdb, 0x47, 0x2c, 0x4f, 0x69, 0x29, 0xa9, 0xe8, 105 0x5c, 0xa4, 0x4c, 0x8e, 0xaa, 0xd8, 0x4b, 0xf8, 0xab, 0x9f, 0xf2, 0x94, 0xfb, 0x3a, 0x10, 0x57, 106 0x43, 0xad, 0xb4, 0xd0, 0xd3, 0x06, 0xec, 0x5c, 0xef, 0xc5, 0x13, 0x2e, 0x24, 0x7d, 0x2f, 0x04, 107 0x7f, 0xa1, 0x89, 0x34, 0xca, 0x2f, 0xc6, 0xe9, 0xf6, 0x43, 0x6c, 0x06, 0x83, 0x06, 0x7f, 0x41, 108 0xb7, 0x7b, 0xf9, 0x49, 0xc6, 0x68, 0x2e, 0x77, 0x7a, 0xf3, 0x8f, 0xb3, 0x05, 0x26, 0xd6, 0x23, 109 0x15, 0x8c, 0x96, 0xf6, 0x29, 0x39, 0xac, 0x4a, 0x2a, 0x9e, 0xd9, 0xc0, 0xc1, 0x2e, 0xee, 0xb5, 110 0x42, 0xab, 0x96, 0x77, 0x03, 0xdb, 0x25, 0xed, 0x61, 0x8d, 0x89, 0x42, 0xb0, 0x5c, 0x3a, 0x07, 111 0x2e, 0xee, 0x35, 0xc3, 0x7d, 0xcb, 0xce, 0x89, 0x95, 0x45, 0x31, 0xcd, 0x4a, 0xa7, 0xe1, 0x36, 112 0x7a, 0xed, 0xcb, 0x13, 0x6f, 0xbb, 0xb1, 0x77, 0x5f, 0xfb, 0x0f, 0x11, 0x13, 0x41, 0x7f, 0x32, 113 0xef, 0xa2, 0xef, 0x79, 0xf7, 0x5f, 0x27, 0xde, 0xf0, 0xfd, 0x41, 0x54, 0x48, 0x2a, 0x42, 0xd3, 114 0x62, 0x9f, 0x13, 0x2b, 0x19, 0x55, 0xf9, 0xb8, 0x74, 0x9a, 0xba, 0xef, 0xd8, 0xf4, 0x79, 0xb7, 115 0xb5, 0x1b, 0x34, 0xeb, 0xa6, 0xd0, 0x44, 0x82, 0x9b, 0xe9, 0x12, 0xd0, 0x6c, 0x09, 0x68, 0xbd, 116 0x04, 0xfc, 0xa1, 0x00, 0x7f, 0x29, 0xc0, 0x13, 0x05, 0x78, 0xaa, 0x00, 0x2f, 0x14, 0xe0, 0x1f, 117 0x05, 0x68, 0xad, 0x00, 0x7f, 0xae, 0x00, 0x4d, 0x57, 0x80, 0x66, 0x2b, 0x40, 0x4f, 0xbb, 0x07, 118 0x8d, 0x2d, 0x7d, 0x53, 0x57, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x67, 0x44, 0x9d, 0xee, 119 0x01, 0x00, 0x00, 120 } 121 122 func (this *Series) Equal(that interface{}) bool { 123 if that == nil { 124 return this == nil 125 } 126 127 that1, ok := that.(*Series) 128 if !ok { 129 that2, ok := that.(Series) 130 if ok { 131 that1 = &that2 132 } else { 133 return false 134 } 135 } 136 if that1 == nil { 137 return this == nil 138 } else if this == nil { 139 return false 140 } 141 if this.UserId != that1.UserId { 142 return false 143 } 144 if this.Fingerprint != that1.Fingerprint { 145 return false 146 } 147 if len(this.Labels) != len(that1.Labels) { 148 return false 149 } 150 for i := range this.Labels { 151 if !this.Labels[i].Equal(that1.Labels[i]) { 152 return false 153 } 154 } 155 if len(this.Chunks) != len(that1.Chunks) { 156 return false 157 } 158 for i := range this.Chunks { 159 if !this.Chunks[i].Equal(&that1.Chunks[i]) { 160 return false 161 } 162 } 163 return true 164 } 165 func (this *Series) GoString() string { 166 if this == nil { 167 return "nil" 168 } 169 s := make([]string, 0, 8) 170 s = append(s, "&ingester.Series{") 171 s = append(s, "UserId: "+fmt.Sprintf("%#v", this.UserId)+",\n") 172 s = append(s, "Fingerprint: "+fmt.Sprintf("%#v", this.Fingerprint)+",\n") 173 s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") 174 if this.Chunks != nil { 175 vs := make([]*client.Chunk, len(this.Chunks)) 176 for i := range vs { 177 vs[i] = &this.Chunks[i] 178 } 179 s = append(s, "Chunks: "+fmt.Sprintf("%#v", vs)+",\n") 180 } 181 s = append(s, "}") 182 return strings.Join(s, "") 183 } 184 func valueToGoStringWal(v interface{}, typ string) string { 185 rv := reflect.ValueOf(v) 186 if rv.IsNil() { 187 return "nil" 188 } 189 pv := reflect.Indirect(rv).Interface() 190 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 191 } 192 func (m *Series) Marshal() (dAtA []byte, err error) { 193 size := m.Size() 194 dAtA = make([]byte, size) 195 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 196 if err != nil { 197 return nil, err 198 } 199 return dAtA[:n], nil 200 } 201 202 func (m *Series) MarshalTo(dAtA []byte) (int, error) { 203 size := m.Size() 204 return m.MarshalToSizedBuffer(dAtA[:size]) 205 } 206 207 func (m *Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { 208 i := len(dAtA) 209 _ = i 210 var l int 211 _ = l 212 if len(m.Chunks) > 0 { 213 for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { 214 { 215 size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 216 if err != nil { 217 return 0, err 218 } 219 i -= size 220 i = encodeVarintWal(dAtA, i, uint64(size)) 221 } 222 i-- 223 dAtA[i] = 0x22 224 } 225 } 226 if len(m.Labels) > 0 { 227 for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { 228 { 229 size := m.Labels[iNdEx].Size() 230 i -= size 231 if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { 232 return 0, err 233 } 234 i = encodeVarintWal(dAtA, i, uint64(size)) 235 } 236 i-- 237 dAtA[i] = 0x1a 238 } 239 } 240 if m.Fingerprint != 0 { 241 i = encodeVarintWal(dAtA, i, uint64(m.Fingerprint)) 242 i-- 243 dAtA[i] = 0x10 244 } 245 if len(m.UserId) > 0 { 246 i -= len(m.UserId) 247 copy(dAtA[i:], m.UserId) 248 i = encodeVarintWal(dAtA, i, uint64(len(m.UserId))) 249 i-- 250 dAtA[i] = 0xa 251 } 252 return len(dAtA) - i, nil 253 } 254 255 func encodeVarintWal(dAtA []byte, offset int, v uint64) int { 256 offset -= sovWal(v) 257 base := offset 258 for v >= 1<<7 { 259 dAtA[offset] = uint8(v&0x7f | 0x80) 260 v >>= 7 261 offset++ 262 } 263 dAtA[offset] = uint8(v) 264 return base 265 } 266 func (m *Series) Size() (n int) { 267 if m == nil { 268 return 0 269 } 270 var l int 271 _ = l 272 l = len(m.UserId) 273 if l > 0 { 274 n += 1 + l + sovWal(uint64(l)) 275 } 276 if m.Fingerprint != 0 { 277 n += 1 + sovWal(uint64(m.Fingerprint)) 278 } 279 if len(m.Labels) > 0 { 280 for _, e := range m.Labels { 281 l = e.Size() 282 n += 1 + l + sovWal(uint64(l)) 283 } 284 } 285 if len(m.Chunks) > 0 { 286 for _, e := range m.Chunks { 287 l = e.Size() 288 n += 1 + l + sovWal(uint64(l)) 289 } 290 } 291 return n 292 } 293 294 func sovWal(x uint64) (n int) { 295 return (math_bits.Len64(x|1) + 6) / 7 296 } 297 func sozWal(x uint64) (n int) { 298 return sovWal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 299 } 300 func (this *Series) String() string { 301 if this == nil { 302 return "nil" 303 } 304 repeatedStringForChunks := "[]Chunk{" 305 for _, f := range this.Chunks { 306 repeatedStringForChunks += fmt.Sprintf("%v", f) + "," 307 } 308 repeatedStringForChunks += "}" 309 s := strings.Join([]string{`&Series{`, 310 `UserId:` + fmt.Sprintf("%v", this.UserId) + `,`, 311 `Fingerprint:` + fmt.Sprintf("%v", this.Fingerprint) + `,`, 312 `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, 313 `Chunks:` + repeatedStringForChunks + `,`, 314 `}`, 315 }, "") 316 return s 317 } 318 func valueToStringWal(v interface{}) string { 319 rv := reflect.ValueOf(v) 320 if rv.IsNil() { 321 return "nil" 322 } 323 pv := reflect.Indirect(rv).Interface() 324 return fmt.Sprintf("*%v", pv) 325 } 326 func (m *Series) Unmarshal(dAtA []byte) error { 327 l := len(dAtA) 328 iNdEx := 0 329 for iNdEx < l { 330 preIndex := iNdEx 331 var wire uint64 332 for shift := uint(0); ; shift += 7 { 333 if shift >= 64 { 334 return ErrIntOverflowWal 335 } 336 if iNdEx >= l { 337 return io.ErrUnexpectedEOF 338 } 339 b := dAtA[iNdEx] 340 iNdEx++ 341 wire |= uint64(b&0x7F) << shift 342 if b < 0x80 { 343 break 344 } 345 } 346 fieldNum := int32(wire >> 3) 347 wireType := int(wire & 0x7) 348 if wireType == 4 { 349 return fmt.Errorf("proto: Series: wiretype end group for non-group") 350 } 351 if fieldNum <= 0 { 352 return fmt.Errorf("proto: Series: illegal tag %d (wire type %d)", fieldNum, wire) 353 } 354 switch fieldNum { 355 case 1: 356 if wireType != 2 { 357 return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) 358 } 359 var stringLen uint64 360 for shift := uint(0); ; shift += 7 { 361 if shift >= 64 { 362 return ErrIntOverflowWal 363 } 364 if iNdEx >= l { 365 return io.ErrUnexpectedEOF 366 } 367 b := dAtA[iNdEx] 368 iNdEx++ 369 stringLen |= uint64(b&0x7F) << shift 370 if b < 0x80 { 371 break 372 } 373 } 374 intStringLen := int(stringLen) 375 if intStringLen < 0 { 376 return ErrInvalidLengthWal 377 } 378 postIndex := iNdEx + intStringLen 379 if postIndex < 0 { 380 return ErrInvalidLengthWal 381 } 382 if postIndex > l { 383 return io.ErrUnexpectedEOF 384 } 385 m.UserId = string(dAtA[iNdEx:postIndex]) 386 iNdEx = postIndex 387 case 2: 388 if wireType != 0 { 389 return fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", wireType) 390 } 391 m.Fingerprint = 0 392 for shift := uint(0); ; shift += 7 { 393 if shift >= 64 { 394 return ErrIntOverflowWal 395 } 396 if iNdEx >= l { 397 return io.ErrUnexpectedEOF 398 } 399 b := dAtA[iNdEx] 400 iNdEx++ 401 m.Fingerprint |= uint64(b&0x7F) << shift 402 if b < 0x80 { 403 break 404 } 405 } 406 case 3: 407 if wireType != 2 { 408 return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) 409 } 410 var msglen int 411 for shift := uint(0); ; shift += 7 { 412 if shift >= 64 { 413 return ErrIntOverflowWal 414 } 415 if iNdEx >= l { 416 return io.ErrUnexpectedEOF 417 } 418 b := dAtA[iNdEx] 419 iNdEx++ 420 msglen |= int(b&0x7F) << shift 421 if b < 0x80 { 422 break 423 } 424 } 425 if msglen < 0 { 426 return ErrInvalidLengthWal 427 } 428 postIndex := iNdEx + msglen 429 if postIndex < 0 { 430 return ErrInvalidLengthWal 431 } 432 if postIndex > l { 433 return io.ErrUnexpectedEOF 434 } 435 m.Labels = append(m.Labels, github_com_cortexproject_cortex_pkg_cortexpb.LabelAdapter{}) 436 if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 437 return err 438 } 439 iNdEx = postIndex 440 case 4: 441 if wireType != 2 { 442 return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) 443 } 444 var msglen int 445 for shift := uint(0); ; shift += 7 { 446 if shift >= 64 { 447 return ErrIntOverflowWal 448 } 449 if iNdEx >= l { 450 return io.ErrUnexpectedEOF 451 } 452 b := dAtA[iNdEx] 453 iNdEx++ 454 msglen |= int(b&0x7F) << shift 455 if b < 0x80 { 456 break 457 } 458 } 459 if msglen < 0 { 460 return ErrInvalidLengthWal 461 } 462 postIndex := iNdEx + msglen 463 if postIndex < 0 { 464 return ErrInvalidLengthWal 465 } 466 if postIndex > l { 467 return io.ErrUnexpectedEOF 468 } 469 m.Chunks = append(m.Chunks, client.Chunk{}) 470 if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 471 return err 472 } 473 iNdEx = postIndex 474 default: 475 iNdEx = preIndex 476 skippy, err := skipWal(dAtA[iNdEx:]) 477 if err != nil { 478 return err 479 } 480 if skippy < 0 { 481 return ErrInvalidLengthWal 482 } 483 if (iNdEx + skippy) < 0 { 484 return ErrInvalidLengthWal 485 } 486 if (iNdEx + skippy) > l { 487 return io.ErrUnexpectedEOF 488 } 489 iNdEx += skippy 490 } 491 } 492 493 if iNdEx > l { 494 return io.ErrUnexpectedEOF 495 } 496 return nil 497 } 498 func skipWal(dAtA []byte) (n int, err error) { 499 l := len(dAtA) 500 iNdEx := 0 501 for iNdEx < l { 502 var wire uint64 503 for shift := uint(0); ; shift += 7 { 504 if shift >= 64 { 505 return 0, ErrIntOverflowWal 506 } 507 if iNdEx >= l { 508 return 0, io.ErrUnexpectedEOF 509 } 510 b := dAtA[iNdEx] 511 iNdEx++ 512 wire |= (uint64(b) & 0x7F) << shift 513 if b < 0x80 { 514 break 515 } 516 } 517 wireType := int(wire & 0x7) 518 switch wireType { 519 case 0: 520 for shift := uint(0); ; shift += 7 { 521 if shift >= 64 { 522 return 0, ErrIntOverflowWal 523 } 524 if iNdEx >= l { 525 return 0, io.ErrUnexpectedEOF 526 } 527 iNdEx++ 528 if dAtA[iNdEx-1] < 0x80 { 529 break 530 } 531 } 532 return iNdEx, nil 533 case 1: 534 iNdEx += 8 535 return iNdEx, nil 536 case 2: 537 var length int 538 for shift := uint(0); ; shift += 7 { 539 if shift >= 64 { 540 return 0, ErrIntOverflowWal 541 } 542 if iNdEx >= l { 543 return 0, io.ErrUnexpectedEOF 544 } 545 b := dAtA[iNdEx] 546 iNdEx++ 547 length |= (int(b) & 0x7F) << shift 548 if b < 0x80 { 549 break 550 } 551 } 552 if length < 0 { 553 return 0, ErrInvalidLengthWal 554 } 555 iNdEx += length 556 if iNdEx < 0 { 557 return 0, ErrInvalidLengthWal 558 } 559 return iNdEx, nil 560 case 3: 561 for { 562 var innerWire uint64 563 var start int = iNdEx 564 for shift := uint(0); ; shift += 7 { 565 if shift >= 64 { 566 return 0, ErrIntOverflowWal 567 } 568 if iNdEx >= l { 569 return 0, io.ErrUnexpectedEOF 570 } 571 b := dAtA[iNdEx] 572 iNdEx++ 573 innerWire |= (uint64(b) & 0x7F) << shift 574 if b < 0x80 { 575 break 576 } 577 } 578 innerWireType := int(innerWire & 0x7) 579 if innerWireType == 4 { 580 break 581 } 582 next, err := skipWal(dAtA[start:]) 583 if err != nil { 584 return 0, err 585 } 586 iNdEx = start + next 587 if iNdEx < 0 { 588 return 0, ErrInvalidLengthWal 589 } 590 } 591 return iNdEx, nil 592 case 4: 593 return iNdEx, nil 594 case 5: 595 iNdEx += 4 596 return iNdEx, nil 597 default: 598 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 599 } 600 } 601 panic("unreachable") 602 } 603 604 var ( 605 ErrInvalidLengthWal = fmt.Errorf("proto: negative length found during unmarshaling") 606 ErrIntOverflowWal = fmt.Errorf("proto: integer overflow") 607 )