// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: storage/engine/enginepb/file_registry.proto

/*
	Package enginepb is a generated protocol buffer package.

	It is generated from these files:
		storage/engine/enginepb/file_registry.proto
		storage/engine/enginepb/mvcc.proto
		storage/engine/enginepb/mvcc3.proto
		storage/engine/enginepb/rocksdb.proto

	It has these top-level messages:
		Registry
		FileEntry
		MVCCMetadata
		MVCCStats
		TxnMeta
		MVCCNetworkStats
		SSTUserProperties
		SSTUserPropertiesCollection
*/
package enginepb

import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"

import io "io"

// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package

type RegistryVersion int32

const (
	// The only version so far.
	RegistryVersion_Base RegistryVersion = 0
)

var RegistryVersion_name = map[int32]string{
	0: "Base",
}
var RegistryVersion_value = map[string]int32{
	"Base": 0,
}

func (x RegistryVersion) String() string {
	return proto.EnumName(RegistryVersion_name, int32(x))
}
func (RegistryVersion) EnumDescriptor() ([]byte, []int) { return fileDescriptorFileRegistry, []int{0} }

// Registry describes how a files are handled. This includes the
// rockdb::Env responsible for each file as well as opaque env details.
// TODO(mberhault): this is still in flux.
type Registry struct {
	// version is currently always Base.
	Version RegistryVersion `protobuf:"varint,1,opt,name=version,proto3,enum=cockroach.storage.engine.enginepb.RegistryVersion" json:"version,omitempty"`
	Files   []*FileEntry    `protobuf:"bytes,2,rep,name=files" json:"files,omitempty"`
}

func (m *Registry) Reset()                    { *m = Registry{} }
func (m *Registry) String() string            { return proto.CompactTextString(m) }
func (*Registry) ProtoMessage()               {}
func (*Registry) Descriptor() ([]byte, []int) { return fileDescriptorFileRegistry, []int{0} }

type FileEntry struct {
	// File path relative to the DB directory.
	// TODO(mberhault): figure out if we need anything special for Windows.
	Filename string `protobuf:"bytes,1,opt,name=Filename,proto3" json:"Filename,omitempty"`
	// Env level identifies which rocksdb::Env is responsible for this file.
	EnvLevel int32 `protobuf:"varint,2,opt,name=env_level,json=envLevel,proto3" json:"env_level,omitempty"`
}

func (m *FileEntry) Reset()                    { *m = FileEntry{} }
func (m *FileEntry) String() string            { return proto.CompactTextString(m) }
func (*FileEntry) ProtoMessage()               {}
func (*FileEntry) Descriptor() ([]byte, []int) { return fileDescriptorFileRegistry, []int{1} }

func init() {
	proto.RegisterType((*Registry)(nil), "cockroach.storage.engine.enginepb.Registry")
	proto.RegisterType((*FileEntry)(nil), "cockroach.storage.engine.enginepb.FileEntry")
	proto.RegisterEnum("cockroach.storage.engine.enginepb.RegistryVersion", RegistryVersion_name, RegistryVersion_value)
}
func (m *Registry) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalTo(dAtA)
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Registry) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Version != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintFileRegistry(dAtA, i, uint64(m.Version))
	}
	if len(m.Files) > 0 {
		for _, msg := range m.Files {
			dAtA[i] = 0x12
			i++
			i = encodeVarintFileRegistry(dAtA, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(dAtA[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	return i, nil
}

func (m *FileEntry) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalTo(dAtA)
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *FileEntry) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.Filename) > 0 {
		dAtA[i] = 0xa
		i++
		i = encodeVarintFileRegistry(dAtA, i, uint64(len(m.Filename)))
		i += copy(dAtA[i:], m.Filename)
	}
	if m.EnvLevel != 0 {
		dAtA[i] = 0x10
		i++
		i = encodeVarintFileRegistry(dAtA, i, uint64(m.EnvLevel))
	}
	return i, nil
}

func encodeVarintFileRegistry(dAtA []byte, offset int, v uint64) int {
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return offset + 1
}
func (m *Registry) Size() (n int) {
	var l int
	_ = l
	if m.Version != 0 {
		n += 1 + sovFileRegistry(uint64(m.Version))
	}
	if len(m.Files) > 0 {
		for _, e := range m.Files {
			l = e.Size()
			n += 1 + l + sovFileRegistry(uint64(l))
		}
	}
	return n
}

func (m *FileEntry) Size() (n int) {
	var l int
	_ = l
	l = len(m.Filename)
	if l > 0 {
		n += 1 + l + sovFileRegistry(uint64(l))
	}
	if m.EnvLevel != 0 {
		n += 1 + sovFileRegistry(uint64(m.EnvLevel))
	}
	return n
}

func sovFileRegistry(x uint64) (n int) {
	for {
		n++
		x >>= 7
		if x == 0 {
			break
		}
	}
	return n
}
func sozFileRegistry(x uint64) (n int) {
	return sovFileRegistry(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Registry) 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 ErrIntOverflowFileRegistry
			}
			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: Registry: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Registry: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
			}
			m.Version = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFileRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Version |= (RegistryVersion(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Files", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFileRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthFileRegistry
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Files = append(m.Files, &FileEntry{})
			if err := m.Files[len(m.Files)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipFileRegistry(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthFileRegistry
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *FileEntry) 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 ErrIntOverflowFileRegistry
			}
			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: FileEntry: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: FileEntry: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Filename", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFileRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthFileRegistry
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Filename = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field EnvLevel", wireType)
			}
			m.EnvLevel = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFileRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.EnvLevel |= (int32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipFileRegistry(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthFileRegistry
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipFileRegistry(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, ErrIntOverflowFileRegistry
			}
			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, ErrIntOverflowFileRegistry
				}
				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, ErrIntOverflowFileRegistry
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			iNdEx += length
			if length < 0 {
				return 0, ErrInvalidLengthFileRegistry
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowFileRegistry
					}
					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 := skipFileRegistry(dAtA[start:])
				if err != nil {
					return 0, err
				}
				iNdEx = start + next
			}
			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 (
	ErrInvalidLengthFileRegistry = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFileRegistry   = fmt.Errorf("proto: integer overflow")
)

func init() {
	proto.RegisterFile("storage/engine/enginepb/file_registry.proto", fileDescriptorFileRegistry)
}

var fileDescriptorFileRegistry = []byte{
	// 267 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2e, 0x2e, 0xc9, 0x2f,
	0x4a, 0x4c, 0x4f, 0xd5, 0x4f, 0xcd, 0x4b, 0xcf, 0xcc, 0x83, 0x51, 0x05, 0x49, 0xfa, 0x69, 0x99,
	0x39, 0xa9, 0xf1, 0x45, 0xa9, 0xe9, 0x99, 0xc5, 0x25, 0x45, 0x95, 0x7a, 0x05, 0x45, 0xf9, 0x25,
	0xf9, 0x42, 0x8a, 0xc9, 0xf9, 0xc9, 0xd9, 0x45, 0xf9, 0x89, 0xc9, 0x19, 0x7a, 0x50, 0x6d, 0x7a,
	0x10, 0xf5, 0x7a, 0x30, 0x6d, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xd5, 0xfa, 0x20, 0x16,
	0x44, 0xa3, 0xd2, 0x1c, 0x46, 0x2e, 0x8e, 0x20, 0xa8, 0x59, 0x42, 0x3e, 0x5c, 0xec, 0x65, 0xa9,
	0x45, 0xc5, 0x99, 0xf9, 0x79, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x7c, 0x46, 0x46, 0x7a, 0x04, 0xcd,
	0xd5, 0x83, 0xe9, 0x0e, 0x83, 0xe8, 0x0c, 0x82, 0x19, 0x21, 0xe4, 0xc4, 0xc5, 0x0a, 0x72, 0x6a,
	0xb1, 0x04, 0x93, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0x0e, 0x11, 0x66, 0xb9, 0x65, 0xe6, 0xa4, 0xba,
	0xe6, 0x95, 0x14, 0x55, 0x06, 0x41, 0xb4, 0x2a, 0xb9, 0x70, 0x71, 0xc2, 0xc5, 0x84, 0xa4, 0xb8,
	0x38, 0x40, 0x9c, 0xbc, 0xc4, 0xdc, 0x54, 0xb0, 0xfb, 0x38, 0x83, 0xe0, 0x7c, 0x21, 0x69, 0x2e,
	0xce, 0xd4, 0xbc, 0xb2, 0xf8, 0x9c, 0xd4, 0xb2, 0xd4, 0x1c, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xd6,
	0x20, 0x8e, 0xd4, 0xbc, 0x32, 0x1f, 0x10, 0x5f, 0x4b, 0x9a, 0x8b, 0x1f, 0xcd, 0x95, 0x42, 0x1c,
	0x5c, 0x2c, 0x4e, 0x89, 0xc5, 0xa9, 0x02, 0x0c, 0x4e, 0x4a, 0x27, 0x1e, 0xca, 0x31, 0x9c, 0x78,
	0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e,
	0x78, 0x2c, 0xc7, 0x10, 0xc5, 0x01, 0x73, 0x57, 0x12, 0x1b, 0x38, 0xb0, 0x8c, 0x01, 0x01, 0x00,
	0x00, 0xff, 0xff, 0x97, 0xf2, 0x8e, 0xf1, 0x94, 0x01, 0x00, 0x00,
}
