// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cache.proto

package storepb

import (
	bytes "bytes"
	fmt "fmt"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	_ "github.com/grafana/mimir/pkg/mimirpb"
	github_com_grafana_mimir_pkg_mimirpb "github.com/grafana/mimir/pkg/mimirpb"
	io "io"
	math "math"
	math_bits "math/bits"
	reflect "reflect"
	strings "strings"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

type CachedSeries struct {
	// Keep reference to buffer for unsafe references.
	github_com_grafana_mimir_pkg_mimirpb.BufferHolder

	Series              []github_com_grafana_mimir_pkg_mimirpb.PreallocatingMetric `protobuf:"bytes,1,rep,name=series,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.PreallocatingMetric" json:"series"`
	DiffEncodedPostings []byte                                                     `protobuf:"bytes,5,opt,name=diffEncodedPostings,proto3" json:"diffEncodedPostings,omitempty"`
}

func (m *CachedSeries) Reset()      { *m = CachedSeries{} }
func (*CachedSeries) ProtoMessage() {}
func (*CachedSeries) Descriptor() ([]byte, []int) {
	return fileDescriptor_5fca3b110c9bbf3a, []int{0}
}
func (m *CachedSeries) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *CachedSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_CachedSeries.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *CachedSeries) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CachedSeries.Merge(m, src)
}
func (m *CachedSeries) XXX_Size() int {
	return m.Size()
}
func (m *CachedSeries) XXX_DiscardUnknown() {
	xxx_messageInfo_CachedSeries.DiscardUnknown(m)
}

var xxx_messageInfo_CachedSeries proto.InternalMessageInfo

func init() {
	proto.RegisterType((*CachedSeries)(nil), "thanos.CachedSeries")
}

func init() { proto.RegisterFile("cache.proto", fileDescriptor_5fca3b110c9bbf3a) }

var fileDescriptor_5fca3b110c9bbf3a = []byte{
	// 303 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4f, 0x02, 0x31,
	0x1c, 0xc5, 0x5b, 0x39, 0x90, 0x1c, 0x0c, 0x17, 0x5c, 0x08, 0xc3, 0x1f, 0xe2, 0xc4, 0xe2, 0x1d,
	0xd1, 0xc5, 0x51, 0x31, 0x2e, 0x24, 0x26, 0x04, 0x37, 0xb7, 0xb6, 0xd7, 0x3b, 0xaa, 0x70, 0xbd,
	0xb4, 0x25, 0x71, 0xf4, 0x23, 0xf8, 0x31, 0xfc, 0x14, 0xce, 0x8c, 0x8c, 0xc4, 0x81, 0x78, 0xbd,
	0xc5, 0x91, 0x8f, 0x60, 0xe8, 0x39, 0x38, 0x38, 0x38, 0xf5, 0xbd, 0xbc, 0xf7, 0xfa, 0x4b, 0xfe,
	0x7e, 0x8b, 0x11, 0x36, 0xe7, 0x61, 0xae, 0xa4, 0x91, 0x9d, 0x86, 0x99, 0x93, 0x4c, 0xea, 0xde,
	0x59, 0x2a, 0xcc, 0x7c, 0x45, 0x43, 0x26, 0x97, 0x51, 0x2a, 0x53, 0x19, 0xb9, 0x98, 0xae, 0x12,
	0xe7, 0x9c, 0x71, 0xaa, 0x9a, 0xf5, 0x46, 0xbf, 0xeb, 0x8a, 0x24, 0x24, 0x23, 0xd1, 0x52, 0x2c,
	0x85, 0x8a, 0xf2, 0xa7, 0xb4, 0x52, 0x39, 0xad, 0xde, 0x6a, 0x71, 0xfa, 0x8e, 0xfd, 0xf6, 0xcd,
	0x01, 0x1c, 0xdf, 0x73, 0x25, 0xb8, 0xee, 0x3c, 0xfa, 0x0d, 0xed, 0x54, 0x17, 0x0f, 0x6a, 0xc3,
	0xd6, 0x79, 0x10, 0x32, 0xa9, 0x0c, 0x7f, 0xce, 0x69, 0x78, 0xc7, 0x8d, 0x12, 0x6c, 0x7c, 0xb5,
	0xde, 0xf5, 0xd1, 0xc7, 0xae, 0x7f, 0xf9, 0x1f, 0x58, 0x38, 0x55, 0x9c, 0x2c, 0x16, 0x92, 0x11,
	0x23, 0xb2, 0xb4, 0xfa, 0x61, 0xf6, 0x43, 0xe8, 0x8c, 0xfc, 0x93, 0x58, 0x24, 0xc9, 0x6d, 0xc6,
	0x64, 0xcc, 0xe3, 0xa9, 0xd4, 0x87, 0x8e, 0xee, 0xd6, 0x07, 0x78, 0xd8, 0x9e, 0xfd, 0x15, 0x4d,
	0xbc, 0xe6, 0x51, 0x50, 0x9b, 0x78, 0xcd, 0x5a, 0xe0, 0x4d, 0xbc, 0xa6, 0x17, 0xd4, 0xc7, 0xd7,
	0xeb, 0x02, 0xd0, 0xa6, 0x00, 0xb4, 0x2d, 0x00, 0xed, 0x0b, 0xc0, 0x2f, 0x16, 0xf0, 0x9b, 0x05,
	0xbc, 0xb6, 0x80, 0x37, 0x16, 0xf0, 0xa7, 0x05, 0xfc, 0x65, 0x01, 0xed, 0x2d, 0xe0, 0xd7, 0x12,
	0xd0, 0xa6, 0x04, 0xb4, 0x2d, 0x01, 0x3d, 0x1c, 0x6b, 0x23, 0x15, 0xcf, 0x29, 0x6d, 0xb8, 0x53,
	0x5c, 0x7c, 0x07, 0x00, 0x00, 0xff, 0xff, 0x86, 0x0e, 0x5e, 0xee, 0x82, 0x01, 0x00, 0x00,
}

func (this *CachedSeries) Equal(that interface{}) bool {
	if that == nil {
		return this == nil
	}

	that1, ok := that.(*CachedSeries)
	if !ok {
		that2, ok := that.(CachedSeries)
		if ok {
			that1 = &that2
		} else {
			return false
		}
	}
	if that1 == nil {
		return this == nil
	} else if this == nil {
		return false
	}
	if len(this.Series) != len(that1.Series) {
		return false
	}
	for i := range this.Series {
		if !this.Series[i].Equal(that1.Series[i]) {
			return false
		}
	}
	if !bytes.Equal(this.DiffEncodedPostings, that1.DiffEncodedPostings) {
		return false
	}
	return true
}
func (this *CachedSeries) GoString() string {
	if this == nil {
		return "nil"
	}
	s := make([]string, 0, 6)
	s = append(s, "&storepb.CachedSeries{")
	s = append(s, "Series: "+fmt.Sprintf("%#v", this.Series)+",\n")
	s = append(s, "DiffEncodedPostings: "+fmt.Sprintf("%#v", this.DiffEncodedPostings)+",\n")
	s = append(s, "}")
	return strings.Join(s, "")
}
func valueToGoStringCache(v interface{}, typ string) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *CachedSeries) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *CachedSeries) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *CachedSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.DiffEncodedPostings) > 0 {
		i -= len(m.DiffEncodedPostings)
		copy(dAtA[i:], m.DiffEncodedPostings)
		i = encodeVarintCache(dAtA, i, uint64(len(m.DiffEncodedPostings)))
		i--
		dAtA[i] = 0x2a
	}
	if len(m.Series) > 0 {
		for iNdEx := len(m.Series) - 1; iNdEx >= 0; iNdEx-- {
			{
				size := m.Series[iNdEx].Size()
				i -= size
				if _, err := m.Series[iNdEx].MarshalTo(dAtA[i:]); err != nil {
					return 0, err
				}
				i = encodeVarintCache(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0xa
		}
	}
	return len(dAtA) - i, nil
}

func encodeVarintCache(dAtA []byte, offset int, v uint64) int {
	offset -= sovCache(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *CachedSeries) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if len(m.Series) > 0 {
		for _, e := range m.Series {
			l = e.Size()
			n += 1 + l + sovCache(uint64(l))
		}
	}
	l = len(m.DiffEncodedPostings)
	if l > 0 {
		n += 1 + l + sovCache(uint64(l))
	}
	return n
}

func sovCache(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozCache(x uint64) (n int) {
	return sovCache(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *CachedSeries) String() string {
	if this == nil {
		return "nil"
	}
	s := strings.Join([]string{`&CachedSeries{`,
		`Series:` + fmt.Sprintf("%v", this.Series) + `,`,
		`DiffEncodedPostings:` + fmt.Sprintf("%v", this.DiffEncodedPostings) + `,`,
		`}`,
	}, "")
	return s
}
func valueToStringCache(v interface{}) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("*%v", pv)
}
func (m *CachedSeries) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowCache
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: CachedSeries: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: CachedSeries: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowCache
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthCache
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthCache
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Series = append(m.Series, github_com_grafana_mimir_pkg_mimirpb.PreallocatingMetric{})
			if err := m.Series[len(m.Series)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 5:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field DiffEncodedPostings", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowCache
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthCache
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return ErrInvalidLengthCache
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.DiffEncodedPostings = append(m.DiffEncodedPostings[:0], dAtA[iNdEx:postIndex]...)
			if m.DiffEncodedPostings == nil {
				m.DiffEncodedPostings = []byte{}
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipCache(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthCache
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthCache
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipCache(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowCache
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowCache
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
			return iNdEx, nil
		case 1:
			iNdEx += 8
			return iNdEx, nil
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowCache
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthCache
			}
			iNdEx += length
			if iNdEx < 0 {
				return 0, ErrInvalidLengthCache
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowCache
					}
					if iNdEx >= l {
						return 0, io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					innerWire |= (uint64(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				innerWireType := int(innerWire & 0x7)
				if innerWireType == 4 {
					break
				}
				next, err := skipCache(dAtA[start:])
				if err != nil {
					return 0, err
				}
				iNdEx = start + next
				if iNdEx < 0 {
					return 0, ErrInvalidLengthCache
				}
			}
			return iNdEx, nil
		case 4:
			return iNdEx, nil
		case 5:
			iNdEx += 4
			return iNdEx, nil
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
	}
	panic("unreachable")
}

var (
	ErrInvalidLengthCache = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCache   = fmt.Errorf("proto: integer overflow")
)
