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

package enginepb

import (
	"fmt"
	"io"
	"math"

	proto "github.com/golang/protobuf/proto"

	metapb "github.com/pingcap/kvproto/pkg/metapb"

	raft_cmdpb "github.com/pingcap/kvproto/pkg/raft_cmdpb"

	raft_serverpb "github.com/pingcap/kvproto/pkg/raft_serverpb"

	context "golang.org/x/net/context"

	grpc "google.golang.org/grpc"
)

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

type CommandRequestHeader struct {
	RegionId uint64 `protobuf:"varint,1,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"`
	Index    uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
	Term     uint64 `protobuf:"varint,3,opt,name=term,proto3" json:"term,omitempty"`
	// Flush in-memory data to disk.
	SyncLog bool `protobuf:"varint,4,opt,name=sync_log,json=syncLog,proto3" json:"sync_log,omitempty"`
	// Destroy the region.
	Destroy bool `protobuf:"varint,5,opt,name=destroy,proto3" json:"destroy,omitempty"`
	// Additional information for the request.
	Context              []byte   `protobuf:"bytes,6,opt,name=context,proto3" json:"context,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *CommandRequestHeader) Reset()         { *m = CommandRequestHeader{} }
func (m *CommandRequestHeader) String() string { return proto.CompactTextString(m) }
func (*CommandRequestHeader) ProtoMessage()    {}
func (*CommandRequestHeader) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{0}
}
func (m *CommandRequestHeader) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *CommandRequestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_CommandRequestHeader.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *CommandRequestHeader) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CommandRequestHeader.Merge(dst, src)
}
func (m *CommandRequestHeader) XXX_Size() int {
	return m.Size()
}
func (m *CommandRequestHeader) XXX_DiscardUnknown() {
	xxx_messageInfo_CommandRequestHeader.DiscardUnknown(m)
}

var xxx_messageInfo_CommandRequestHeader proto.InternalMessageInfo

func (m *CommandRequestHeader) GetRegionId() uint64 {
	if m != nil {
		return m.RegionId
	}
	return 0
}

func (m *CommandRequestHeader) GetIndex() uint64 {
	if m != nil {
		return m.Index
	}
	return 0
}

func (m *CommandRequestHeader) GetTerm() uint64 {
	if m != nil {
		return m.Term
	}
	return 0
}

func (m *CommandRequestHeader) GetSyncLog() bool {
	if m != nil {
		return m.SyncLog
	}
	return false
}

func (m *CommandRequestHeader) GetDestroy() bool {
	if m != nil {
		return m.Destroy
	}
	return false
}

func (m *CommandRequestHeader) GetContext() []byte {
	if m != nil {
		return m.Context
	}
	return nil
}

type CommandRequest struct {
	Header *CommandRequestHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
	// kv put / delete
	Requests []*raft_cmdpb.Request `protobuf:"bytes,2,rep,name=requests" json:"requests,omitempty"`
	// region metadata manipulation command.
	AdminRequest *raft_cmdpb.AdminRequest `protobuf:"bytes,3,opt,name=admin_request,json=adminRequest" json:"admin_request,omitempty"`
	// region metadata manipulation result.
	AdminResponse        *raft_cmdpb.AdminResponse `protobuf:"bytes,4,opt,name=admin_response,json=adminResponse" json:"admin_response,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
	XXX_unrecognized     []byte                    `json:"-"`
	XXX_sizecache        int32                     `json:"-"`
}

func (m *CommandRequest) Reset()         { *m = CommandRequest{} }
func (m *CommandRequest) String() string { return proto.CompactTextString(m) }
func (*CommandRequest) ProtoMessage()    {}
func (*CommandRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{1}
}
func (m *CommandRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *CommandRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_CommandRequest.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *CommandRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CommandRequest.Merge(dst, src)
}
func (m *CommandRequest) XXX_Size() int {
	return m.Size()
}
func (m *CommandRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_CommandRequest.DiscardUnknown(m)
}

var xxx_messageInfo_CommandRequest proto.InternalMessageInfo

func (m *CommandRequest) GetHeader() *CommandRequestHeader {
	if m != nil {
		return m.Header
	}
	return nil
}

func (m *CommandRequest) GetRequests() []*raft_cmdpb.Request {
	if m != nil {
		return m.Requests
	}
	return nil
}

func (m *CommandRequest) GetAdminRequest() *raft_cmdpb.AdminRequest {
	if m != nil {
		return m.AdminRequest
	}
	return nil
}

func (m *CommandRequest) GetAdminResponse() *raft_cmdpb.AdminResponse {
	if m != nil {
		return m.AdminResponse
	}
	return nil
}

type CommandRequestBatch struct {
	Requests             []*CommandRequest `protobuf:"bytes,1,rep,name=requests" json:"requests,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *CommandRequestBatch) Reset()         { *m = CommandRequestBatch{} }
func (m *CommandRequestBatch) String() string { return proto.CompactTextString(m) }
func (*CommandRequestBatch) ProtoMessage()    {}
func (*CommandRequestBatch) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{2}
}
func (m *CommandRequestBatch) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *CommandRequestBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_CommandRequestBatch.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *CommandRequestBatch) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CommandRequestBatch.Merge(dst, src)
}
func (m *CommandRequestBatch) XXX_Size() int {
	return m.Size()
}
func (m *CommandRequestBatch) XXX_DiscardUnknown() {
	xxx_messageInfo_CommandRequestBatch.DiscardUnknown(m)
}

var xxx_messageInfo_CommandRequestBatch proto.InternalMessageInfo

func (m *CommandRequestBatch) GetRequests() []*CommandRequest {
	if m != nil {
		return m.Requests
	}
	return nil
}

type CommandResponseHeader struct {
	RegionId uint64 `protobuf:"varint,1,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"`
	// Region is destroyed.
	Destroyed            bool     `protobuf:"varint,2,opt,name=destroyed,proto3" json:"destroyed,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *CommandResponseHeader) Reset()         { *m = CommandResponseHeader{} }
func (m *CommandResponseHeader) String() string { return proto.CompactTextString(m) }
func (*CommandResponseHeader) ProtoMessage()    {}
func (*CommandResponseHeader) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{3}
}
func (m *CommandResponseHeader) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *CommandResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_CommandResponseHeader.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *CommandResponseHeader) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CommandResponseHeader.Merge(dst, src)
}
func (m *CommandResponseHeader) XXX_Size() int {
	return m.Size()
}
func (m *CommandResponseHeader) XXX_DiscardUnknown() {
	xxx_messageInfo_CommandResponseHeader.DiscardUnknown(m)
}

var xxx_messageInfo_CommandResponseHeader proto.InternalMessageInfo

func (m *CommandResponseHeader) GetRegionId() uint64 {
	if m != nil {
		return m.RegionId
	}
	return 0
}

func (m *CommandResponseHeader) GetDestroyed() bool {
	if m != nil {
		return m.Destroyed
	}
	return false
}

type CommandResponse struct {
	Header               *CommandResponseHeader        `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
	ApplyState           *raft_serverpb.RaftApplyState `protobuf:"bytes,2,opt,name=apply_state,json=applyState" json:"apply_state,omitempty"`
	AppliedTerm          uint64                        `protobuf:"varint,3,opt,name=applied_term,json=appliedTerm,proto3" json:"applied_term,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

func (m *CommandResponse) Reset()         { *m = CommandResponse{} }
func (m *CommandResponse) String() string { return proto.CompactTextString(m) }
func (*CommandResponse) ProtoMessage()    {}
func (*CommandResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{4}
}
func (m *CommandResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *CommandResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_CommandResponse.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *CommandResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CommandResponse.Merge(dst, src)
}
func (m *CommandResponse) XXX_Size() int {
	return m.Size()
}
func (m *CommandResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_CommandResponse.DiscardUnknown(m)
}

var xxx_messageInfo_CommandResponse proto.InternalMessageInfo

func (m *CommandResponse) GetHeader() *CommandResponseHeader {
	if m != nil {
		return m.Header
	}
	return nil
}

func (m *CommandResponse) GetApplyState() *raft_serverpb.RaftApplyState {
	if m != nil {
		return m.ApplyState
	}
	return nil
}

func (m *CommandResponse) GetAppliedTerm() uint64 {
	if m != nil {
		return m.AppliedTerm
	}
	return 0
}

type CommandResponseBatch struct {
	Responses            []*CommandResponse `protobuf:"bytes,1,rep,name=responses" json:"responses,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (m *CommandResponseBatch) Reset()         { *m = CommandResponseBatch{} }
func (m *CommandResponseBatch) String() string { return proto.CompactTextString(m) }
func (*CommandResponseBatch) ProtoMessage()    {}
func (*CommandResponseBatch) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{5}
}
func (m *CommandResponseBatch) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *CommandResponseBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_CommandResponseBatch.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *CommandResponseBatch) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CommandResponseBatch.Merge(dst, src)
}
func (m *CommandResponseBatch) XXX_Size() int {
	return m.Size()
}
func (m *CommandResponseBatch) XXX_DiscardUnknown() {
	xxx_messageInfo_CommandResponseBatch.DiscardUnknown(m)
}

var xxx_messageInfo_CommandResponseBatch proto.InternalMessageInfo

func (m *CommandResponseBatch) GetResponses() []*CommandResponse {
	if m != nil {
		return m.Responses
	}
	return nil
}

type SnapshotState struct {
	Region               *metapb.Region                `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"`
	Peer                 *metapb.Peer                  `protobuf:"bytes,2,opt,name=peer" json:"peer,omitempty"`
	ApplyState           *raft_serverpb.RaftApplyState `protobuf:"bytes,3,opt,name=apply_state,json=applyState" json:"apply_state,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

func (m *SnapshotState) Reset()         { *m = SnapshotState{} }
func (m *SnapshotState) String() string { return proto.CompactTextString(m) }
func (*SnapshotState) ProtoMessage()    {}
func (*SnapshotState) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{6}
}
func (m *SnapshotState) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *SnapshotState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_SnapshotState.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *SnapshotState) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SnapshotState.Merge(dst, src)
}
func (m *SnapshotState) XXX_Size() int {
	return m.Size()
}
func (m *SnapshotState) XXX_DiscardUnknown() {
	xxx_messageInfo_SnapshotState.DiscardUnknown(m)
}

var xxx_messageInfo_SnapshotState proto.InternalMessageInfo

func (m *SnapshotState) GetRegion() *metapb.Region {
	if m != nil {
		return m.Region
	}
	return nil
}

func (m *SnapshotState) GetPeer() *metapb.Peer {
	if m != nil {
		return m.Peer
	}
	return nil
}

func (m *SnapshotState) GetApplyState() *raft_serverpb.RaftApplyState {
	if m != nil {
		return m.ApplyState
	}
	return nil
}

type SnapshotData struct {
	Cf                   string                    `protobuf:"bytes,1,opt,name=cf,proto3" json:"cf,omitempty"`
	Checksum             uint32                    `protobuf:"varint,2,opt,name=checksum,proto3" json:"checksum,omitempty"`
	Data                 []*raft_serverpb.KeyValue `protobuf:"bytes,3,rep,name=data" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
	XXX_unrecognized     []byte                    `json:"-"`
	XXX_sizecache        int32                     `json:"-"`
}

func (m *SnapshotData) Reset()         { *m = SnapshotData{} }
func (m *SnapshotData) String() string { return proto.CompactTextString(m) }
func (*SnapshotData) ProtoMessage()    {}
func (*SnapshotData) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{7}
}
func (m *SnapshotData) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *SnapshotData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_SnapshotData.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *SnapshotData) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SnapshotData.Merge(dst, src)
}
func (m *SnapshotData) XXX_Size() int {
	return m.Size()
}
func (m *SnapshotData) XXX_DiscardUnknown() {
	xxx_messageInfo_SnapshotData.DiscardUnknown(m)
}

var xxx_messageInfo_SnapshotData proto.InternalMessageInfo

func (m *SnapshotData) GetCf() string {
	if m != nil {
		return m.Cf
	}
	return ""
}

func (m *SnapshotData) GetChecksum() uint32 {
	if m != nil {
		return m.Checksum
	}
	return 0
}

func (m *SnapshotData) GetData() []*raft_serverpb.KeyValue {
	if m != nil {
		return m.Data
	}
	return nil
}

type SnapshotRequest struct {
	// Types that are valid to be assigned to Chunk:
	//	*SnapshotRequest_State
	//	*SnapshotRequest_Data
	Chunk                isSnapshotRequest_Chunk `protobuf_oneof:"chunk"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

func (m *SnapshotRequest) Reset()         { *m = SnapshotRequest{} }
func (m *SnapshotRequest) String() string { return proto.CompactTextString(m) }
func (*SnapshotRequest) ProtoMessage()    {}
func (*SnapshotRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{8}
}
func (m *SnapshotRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *SnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_SnapshotRequest.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *SnapshotRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SnapshotRequest.Merge(dst, src)
}
func (m *SnapshotRequest) XXX_Size() int {
	return m.Size()
}
func (m *SnapshotRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_SnapshotRequest.DiscardUnknown(m)
}

var xxx_messageInfo_SnapshotRequest proto.InternalMessageInfo

type isSnapshotRequest_Chunk interface {
	isSnapshotRequest_Chunk()
	MarshalTo([]byte) (int, error)
	Size() int
}

type SnapshotRequest_State struct {
	State *SnapshotState `protobuf:"bytes,1,opt,name=state,oneof"`
}
type SnapshotRequest_Data struct {
	Data *SnapshotData `protobuf:"bytes,2,opt,name=data,oneof"`
}

func (*SnapshotRequest_State) isSnapshotRequest_Chunk() {}
func (*SnapshotRequest_Data) isSnapshotRequest_Chunk()  {}

func (m *SnapshotRequest) GetChunk() isSnapshotRequest_Chunk {
	if m != nil {
		return m.Chunk
	}
	return nil
}

func (m *SnapshotRequest) GetState() *SnapshotState {
	if x, ok := m.GetChunk().(*SnapshotRequest_State); ok {
		return x.State
	}
	return nil
}

func (m *SnapshotRequest) GetData() *SnapshotData {
	if x, ok := m.GetChunk().(*SnapshotRequest_Data); ok {
		return x.Data
	}
	return nil
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*SnapshotRequest) 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 _SnapshotRequest_OneofMarshaler, _SnapshotRequest_OneofUnmarshaler, _SnapshotRequest_OneofSizer, []interface{}{
		(*SnapshotRequest_State)(nil),
		(*SnapshotRequest_Data)(nil),
	}
}

func _SnapshotRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*SnapshotRequest)
	// chunk
	switch x := m.Chunk.(type) {
	case *SnapshotRequest_State:
		_ = b.EncodeVarint(1<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.State); err != nil {
			return err
		}
	case *SnapshotRequest_Data:
		_ = b.EncodeVarint(2<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.Data); err != nil {
			return err
		}
	case nil:
	default:
		return fmt.Errorf("SnapshotRequest.Chunk has unexpected type %T", x)
	}
	return nil
}

func _SnapshotRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*SnapshotRequest)
	switch tag {
	case 1: // chunk.state
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(SnapshotState)
		err := b.DecodeMessage(msg)
		m.Chunk = &SnapshotRequest_State{msg}
		return true, err
	case 2: // chunk.data
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(SnapshotData)
		err := b.DecodeMessage(msg)
		m.Chunk = &SnapshotRequest_Data{msg}
		return true, err
	default:
		return false, nil
	}
}

func _SnapshotRequest_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*SnapshotRequest)
	// chunk
	switch x := m.Chunk.(type) {
	case *SnapshotRequest_State:
		s := proto.Size(x.State)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *SnapshotRequest_Data:
		s := proto.Size(x.Data)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

type SnapshotDone struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *SnapshotDone) Reset()         { *m = SnapshotDone{} }
func (m *SnapshotDone) String() string { return proto.CompactTextString(m) }
func (*SnapshotDone) ProtoMessage()    {}
func (*SnapshotDone) Descriptor() ([]byte, []int) {
	return fileDescriptor_enginepb_3d26096a0d74b990, []int{9}
}
func (m *SnapshotDone) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *SnapshotDone) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_SnapshotDone.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *SnapshotDone) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SnapshotDone.Merge(dst, src)
}
func (m *SnapshotDone) XXX_Size() int {
	return m.Size()
}
func (m *SnapshotDone) XXX_DiscardUnknown() {
	xxx_messageInfo_SnapshotDone.DiscardUnknown(m)
}

var xxx_messageInfo_SnapshotDone proto.InternalMessageInfo

func init() {
	proto.RegisterType((*CommandRequestHeader)(nil), "enginepb.CommandRequestHeader")
	proto.RegisterType((*CommandRequest)(nil), "enginepb.CommandRequest")
	proto.RegisterType((*CommandRequestBatch)(nil), "enginepb.CommandRequestBatch")
	proto.RegisterType((*CommandResponseHeader)(nil), "enginepb.CommandResponseHeader")
	proto.RegisterType((*CommandResponse)(nil), "enginepb.CommandResponse")
	proto.RegisterType((*CommandResponseBatch)(nil), "enginepb.CommandResponseBatch")
	proto.RegisterType((*SnapshotState)(nil), "enginepb.SnapshotState")
	proto.RegisterType((*SnapshotData)(nil), "enginepb.SnapshotData")
	proto.RegisterType((*SnapshotRequest)(nil), "enginepb.SnapshotRequest")
	proto.RegisterType((*SnapshotDone)(nil), "enginepb.SnapshotDone")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// Client API for Engine service

type EngineClient interface {
	ApplyCommandBatch(ctx context.Context, opts ...grpc.CallOption) (Engine_ApplyCommandBatchClient, error)
	ApplySnapshot(ctx context.Context, opts ...grpc.CallOption) (Engine_ApplySnapshotClient, error)
}

type engineClient struct {
	cc *grpc.ClientConn
}

func NewEngineClient(cc *grpc.ClientConn) EngineClient {
	return &engineClient{cc}
}

func (c *engineClient) ApplyCommandBatch(ctx context.Context, opts ...grpc.CallOption) (Engine_ApplyCommandBatchClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Engine_serviceDesc.Streams[0], "/enginepb.Engine/ApplyCommandBatch", opts...)
	if err != nil {
		return nil, err
	}
	x := &engineApplyCommandBatchClient{stream}
	return x, nil
}

type Engine_ApplyCommandBatchClient interface {
	Send(*CommandRequestBatch) error
	Recv() (*CommandResponseBatch, error)
	grpc.ClientStream
}

type engineApplyCommandBatchClient struct {
	grpc.ClientStream
}

func (x *engineApplyCommandBatchClient) Send(m *CommandRequestBatch) error {
	return x.ClientStream.SendMsg(m)
}

func (x *engineApplyCommandBatchClient) Recv() (*CommandResponseBatch, error) {
	m := new(CommandResponseBatch)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *engineClient) ApplySnapshot(ctx context.Context, opts ...grpc.CallOption) (Engine_ApplySnapshotClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Engine_serviceDesc.Streams[1], "/enginepb.Engine/ApplySnapshot", opts...)
	if err != nil {
		return nil, err
	}
	x := &engineApplySnapshotClient{stream}
	return x, nil
}

type Engine_ApplySnapshotClient interface {
	Send(*SnapshotRequest) error
	CloseAndRecv() (*SnapshotDone, error)
	grpc.ClientStream
}

type engineApplySnapshotClient struct {
	grpc.ClientStream
}

func (x *engineApplySnapshotClient) Send(m *SnapshotRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *engineApplySnapshotClient) CloseAndRecv() (*SnapshotDone, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(SnapshotDone)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// Server API for Engine service

type EngineServer interface {
	ApplyCommandBatch(Engine_ApplyCommandBatchServer) error
	ApplySnapshot(Engine_ApplySnapshotServer) error
}

func RegisterEngineServer(s *grpc.Server, srv EngineServer) {
	s.RegisterService(&_Engine_serviceDesc, srv)
}

func _Engine_ApplyCommandBatch_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(EngineServer).ApplyCommandBatch(&engineApplyCommandBatchServer{stream})
}

type Engine_ApplyCommandBatchServer interface {
	Send(*CommandResponseBatch) error
	Recv() (*CommandRequestBatch, error)
	grpc.ServerStream
}

type engineApplyCommandBatchServer struct {
	grpc.ServerStream
}

func (x *engineApplyCommandBatchServer) Send(m *CommandResponseBatch) error {
	return x.ServerStream.SendMsg(m)
}

func (x *engineApplyCommandBatchServer) Recv() (*CommandRequestBatch, error) {
	m := new(CommandRequestBatch)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Engine_ApplySnapshot_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(EngineServer).ApplySnapshot(&engineApplySnapshotServer{stream})
}

type Engine_ApplySnapshotServer interface {
	SendAndClose(*SnapshotDone) error
	Recv() (*SnapshotRequest, error)
	grpc.ServerStream
}

type engineApplySnapshotServer struct {
	grpc.ServerStream
}

func (x *engineApplySnapshotServer) SendAndClose(m *SnapshotDone) error {
	return x.ServerStream.SendMsg(m)
}

func (x *engineApplySnapshotServer) Recv() (*SnapshotRequest, error) {
	m := new(SnapshotRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

var _Engine_serviceDesc = grpc.ServiceDesc{
	ServiceName: "enginepb.Engine",
	HandlerType: (*EngineServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ApplyCommandBatch",
			Handler:       _Engine_ApplyCommandBatch_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "ApplySnapshot",
			Handler:       _Engine_ApplySnapshot_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "enginepb.proto",
}

func (m *CommandRequestHeader) 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 *CommandRequestHeader) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.RegionId != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.RegionId))
	}
	if m.Index != 0 {
		dAtA[i] = 0x10
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.Index))
	}
	if m.Term != 0 {
		dAtA[i] = 0x18
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.Term))
	}
	if m.SyncLog {
		dAtA[i] = 0x20
		i++
		if m.SyncLog {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i++
	}
	if m.Destroy {
		dAtA[i] = 0x28
		i++
		if m.Destroy {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i++
	}
	if len(m.Context) > 0 {
		dAtA[i] = 0x32
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(len(m.Context)))
		i += copy(dAtA[i:], m.Context)
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *CommandRequest) 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 *CommandRequest) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Header != nil {
		dAtA[i] = 0xa
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.Header.Size()))
		n1, err := m.Header.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n1
	}
	if len(m.Requests) > 0 {
		for _, msg := range m.Requests {
			dAtA[i] = 0x12
			i++
			i = encodeVarintEnginepb(dAtA, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(dAtA[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	if m.AdminRequest != nil {
		dAtA[i] = 0x1a
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.AdminRequest.Size()))
		n2, err := m.AdminRequest.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n2
	}
	if m.AdminResponse != nil {
		dAtA[i] = 0x22
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.AdminResponse.Size()))
		n3, err := m.AdminResponse.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n3
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *CommandRequestBatch) 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 *CommandRequestBatch) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.Requests) > 0 {
		for _, msg := range m.Requests {
			dAtA[i] = 0xa
			i++
			i = encodeVarintEnginepb(dAtA, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(dAtA[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *CommandResponseHeader) 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 *CommandResponseHeader) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.RegionId != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.RegionId))
	}
	if m.Destroyed {
		dAtA[i] = 0x10
		i++
		if m.Destroyed {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i++
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *CommandResponse) 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 *CommandResponse) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Header != nil {
		dAtA[i] = 0xa
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.Header.Size()))
		n4, err := m.Header.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n4
	}
	if m.ApplyState != nil {
		dAtA[i] = 0x12
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.ApplyState.Size()))
		n5, err := m.ApplyState.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n5
	}
	if m.AppliedTerm != 0 {
		dAtA[i] = 0x18
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.AppliedTerm))
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *CommandResponseBatch) 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 *CommandResponseBatch) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.Responses) > 0 {
		for _, msg := range m.Responses {
			dAtA[i] = 0xa
			i++
			i = encodeVarintEnginepb(dAtA, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(dAtA[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *SnapshotState) 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 *SnapshotState) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Region != nil {
		dAtA[i] = 0xa
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.Region.Size()))
		n6, err := m.Region.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n6
	}
	if m.Peer != nil {
		dAtA[i] = 0x12
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.Peer.Size()))
		n7, err := m.Peer.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n7
	}
	if m.ApplyState != nil {
		dAtA[i] = 0x1a
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.ApplyState.Size()))
		n8, err := m.ApplyState.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n8
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *SnapshotData) 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 *SnapshotData) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.Cf) > 0 {
		dAtA[i] = 0xa
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(len(m.Cf)))
		i += copy(dAtA[i:], m.Cf)
	}
	if m.Checksum != 0 {
		dAtA[i] = 0x10
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.Checksum))
	}
	if len(m.Data) > 0 {
		for _, msg := range m.Data {
			dAtA[i] = 0x1a
			i++
			i = encodeVarintEnginepb(dAtA, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(dAtA[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *SnapshotRequest) 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 *SnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Chunk != nil {
		nn9, err := m.Chunk.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += nn9
	}
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func (m *SnapshotRequest_State) MarshalTo(dAtA []byte) (int, error) {
	i := 0
	if m.State != nil {
		dAtA[i] = 0xa
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.State.Size()))
		n10, err := m.State.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n10
	}
	return i, nil
}
func (m *SnapshotRequest_Data) MarshalTo(dAtA []byte) (int, error) {
	i := 0
	if m.Data != nil {
		dAtA[i] = 0x12
		i++
		i = encodeVarintEnginepb(dAtA, i, uint64(m.Data.Size()))
		n11, err := m.Data.MarshalTo(dAtA[i:])
		if err != nil {
			return 0, err
		}
		i += n11
	}
	return i, nil
}
func (m *SnapshotDone) 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 *SnapshotDone) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.XXX_unrecognized != nil {
		i += copy(dAtA[i:], m.XXX_unrecognized)
	}
	return i, nil
}

func encodeVarintEnginepb(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 *CommandRequestHeader) Size() (n int) {
	var l int
	_ = l
	if m.RegionId != 0 {
		n += 1 + sovEnginepb(uint64(m.RegionId))
	}
	if m.Index != 0 {
		n += 1 + sovEnginepb(uint64(m.Index))
	}
	if m.Term != 0 {
		n += 1 + sovEnginepb(uint64(m.Term))
	}
	if m.SyncLog {
		n += 2
	}
	if m.Destroy {
		n += 2
	}
	l = len(m.Context)
	if l > 0 {
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *CommandRequest) Size() (n int) {
	var l int
	_ = l
	if m.Header != nil {
		l = m.Header.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if len(m.Requests) > 0 {
		for _, e := range m.Requests {
			l = e.Size()
			n += 1 + l + sovEnginepb(uint64(l))
		}
	}
	if m.AdminRequest != nil {
		l = m.AdminRequest.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.AdminResponse != nil {
		l = m.AdminResponse.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *CommandRequestBatch) Size() (n int) {
	var l int
	_ = l
	if len(m.Requests) > 0 {
		for _, e := range m.Requests {
			l = e.Size()
			n += 1 + l + sovEnginepb(uint64(l))
		}
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *CommandResponseHeader) Size() (n int) {
	var l int
	_ = l
	if m.RegionId != 0 {
		n += 1 + sovEnginepb(uint64(m.RegionId))
	}
	if m.Destroyed {
		n += 2
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *CommandResponse) Size() (n int) {
	var l int
	_ = l
	if m.Header != nil {
		l = m.Header.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.ApplyState != nil {
		l = m.ApplyState.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.AppliedTerm != 0 {
		n += 1 + sovEnginepb(uint64(m.AppliedTerm))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *CommandResponseBatch) Size() (n int) {
	var l int
	_ = l
	if len(m.Responses) > 0 {
		for _, e := range m.Responses {
			l = e.Size()
			n += 1 + l + sovEnginepb(uint64(l))
		}
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *SnapshotState) Size() (n int) {
	var l int
	_ = l
	if m.Region != nil {
		l = m.Region.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.Peer != nil {
		l = m.Peer.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.ApplyState != nil {
		l = m.ApplyState.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *SnapshotData) Size() (n int) {
	var l int
	_ = l
	l = len(m.Cf)
	if l > 0 {
		n += 1 + l + sovEnginepb(uint64(l))
	}
	if m.Checksum != 0 {
		n += 1 + sovEnginepb(uint64(m.Checksum))
	}
	if len(m.Data) > 0 {
		for _, e := range m.Data {
			l = e.Size()
			n += 1 + l + sovEnginepb(uint64(l))
		}
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *SnapshotRequest) Size() (n int) {
	var l int
	_ = l
	if m.Chunk != nil {
		n += m.Chunk.Size()
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *SnapshotRequest_State) Size() (n int) {
	var l int
	_ = l
	if m.State != nil {
		l = m.State.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	return n
}
func (m *SnapshotRequest_Data) Size() (n int) {
	var l int
	_ = l
	if m.Data != nil {
		l = m.Data.Size()
		n += 1 + l + sovEnginepb(uint64(l))
	}
	return n
}
func (m *SnapshotDone) Size() (n int) {
	var l int
	_ = l
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func sovEnginepb(x uint64) (n int) {
	for {
		n++
		x >>= 7
		if x == 0 {
			break
		}
	}
	return n
}
func sozEnginepb(x uint64) (n int) {
	return sovEnginepb(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *CommandRequestHeader) 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 ErrIntOverflowEnginepb
			}
			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: CommandRequestHeader: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: CommandRequestHeader: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field RegionId", wireType)
			}
			m.RegionId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.RegionId |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
			}
			m.Index = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Index |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			m.Term = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Term |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SyncLog", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.SyncLog = bool(v != 0)
		case 5:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Destroy", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Destroy = bool(v != 0)
		case 6:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + byteLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
			if m.Context == nil {
				m.Context = []byte{}
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *CommandRequest) 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 ErrIntOverflowEnginepb
			}
			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: CommandRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: CommandRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Header == nil {
				m.Header = &CommandRequestHeader{}
			}
			if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Requests = append(m.Requests, &raft_cmdpb.Request{})
			if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field AdminRequest", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.AdminRequest == nil {
				m.AdminRequest = &raft_cmdpb.AdminRequest{}
			}
			if err := m.AdminRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field AdminResponse", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.AdminResponse == nil {
				m.AdminResponse = &raft_cmdpb.AdminResponse{}
			}
			if err := m.AdminResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *CommandRequestBatch) 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 ErrIntOverflowEnginepb
			}
			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: CommandRequestBatch: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: CommandRequestBatch: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Requests = append(m.Requests, &CommandRequest{})
			if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *CommandResponseHeader) 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 ErrIntOverflowEnginepb
			}
			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: CommandResponseHeader: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: CommandResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field RegionId", wireType)
			}
			m.RegionId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.RegionId |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Destroyed", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Destroyed = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *CommandResponse) 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 ErrIntOverflowEnginepb
			}
			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: CommandResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: CommandResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Header == nil {
				m.Header = &CommandResponseHeader{}
			}
			if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ApplyState", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.ApplyState == nil {
				m.ApplyState = &raft_serverpb.RaftApplyState{}
			}
			if err := m.ApplyState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field AppliedTerm", wireType)
			}
			m.AppliedTerm = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.AppliedTerm |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *CommandResponseBatch) 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 ErrIntOverflowEnginepb
			}
			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: CommandResponseBatch: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: CommandResponseBatch: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Responses = append(m.Responses, &CommandResponse{})
			if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SnapshotState) 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 ErrIntOverflowEnginepb
			}
			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: SnapshotState: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SnapshotState: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Region == nil {
				m.Region = &metapb.Region{}
			}
			if err := m.Region.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Peer == nil {
				m.Peer = &metapb.Peer{}
			}
			if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ApplyState", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.ApplyState == nil {
				m.ApplyState = &raft_serverpb.RaftApplyState{}
			}
			if err := m.ApplyState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SnapshotData) 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 ErrIntOverflowEnginepb
			}
			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: SnapshotData: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SnapshotData: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Cf", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				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 ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Cf = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType)
			}
			m.Checksum = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Checksum |= (uint32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Data = append(m.Data, &raft_serverpb.KeyValue{})
			if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SnapshotRequest) 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 ErrIntOverflowEnginepb
			}
			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: SnapshotRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field State", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			v := &SnapshotState{}
			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			m.Chunk = &SnapshotRequest_State{v}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEnginepb
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthEnginepb
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			v := &SnapshotData{}
			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			m.Chunk = &SnapshotRequest_Data{v}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SnapshotDone) 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 ErrIntOverflowEnginepb
			}
			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: SnapshotDone: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SnapshotDone: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		default:
			iNdEx = preIndex
			skippy, err := skipEnginepb(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthEnginepb
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipEnginepb(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, ErrIntOverflowEnginepb
			}
			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, ErrIntOverflowEnginepb
				}
				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, ErrIntOverflowEnginepb
				}
				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, ErrInvalidLengthEnginepb
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowEnginepb
					}
					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 := skipEnginepb(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 (
	ErrInvalidLengthEnginepb = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEnginepb   = fmt.Errorf("proto: integer overflow")
)

func init() { proto.RegisterFile("enginepb.proto", fileDescriptor_enginepb_3d26096a0d74b990) }

var fileDescriptor_enginepb_3d26096a0d74b990 = []byte{
	// 681 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x4c,
	0x14, 0xcd, 0xe4, 0xaf, 0xe9, 0x75, 0x92, 0xf6, 0x9b, 0xf6, 0xa3, 0x4e, 0xa0, 0x21, 0x78, 0x81,
	0x22, 0x81, 0x52, 0x14, 0x10, 0x5d, 0x81, 0x68, 0xf9, 0x51, 0x51, 0x91, 0x40, 0x53, 0x84, 0xd8,
	0x45, 0x53, 0xfb, 0xe6, 0x47, 0xad, 0x7f, 0xb0, 0x27, 0xa8, 0x79, 0x13, 0x78, 0x05, 0x04, 0xef,
	0xc1, 0x92, 0x47, 0x40, 0xe5, 0x2d, 0x58, 0x21, 0xcf, 0x8c, 0x1d, 0x27, 0x4d, 0x24, 0xd8, 0xe5,
	0x9e, 0x7b, 0x66, 0xee, 0x39, 0xe7, 0x8e, 0x03, 0x75, 0xf4, 0x86, 0x63, 0x0f, 0x83, 0xd3, 0x6e,
	0x10, 0xfa, 0xc2, 0xa7, 0x95, 0xa4, 0x6e, 0x56, 0x5d, 0x14, 0x3c, 0xc1, 0x9b, 0x9b, 0x21, 0x1f,
	0x88, 0xbe, 0xed, 0x3a, 0x29, 0xb2, 0x25, 0x91, 0x08, 0xc3, 0x8f, 0x18, 0x26, 0xa0, 0xf5, 0x95,
	0xc0, 0xf6, 0x53, 0xdf, 0x75, 0xb9, 0xe7, 0x30, 0xfc, 0x30, 0xc1, 0x48, 0x1c, 0x21, 0x77, 0x30,
	0xa4, 0xd7, 0x61, 0x3d, 0xc4, 0xe1, 0xd8, 0xf7, 0xfa, 0x63, 0xc7, 0x24, 0x6d, 0xd2, 0x29, 0xb2,
	0x8a, 0x02, 0x5e, 0x3a, 0x74, 0x1b, 0x4a, 0x63, 0xcf, 0xc1, 0x0b, 0x33, 0x2f, 0x1b, 0xaa, 0xa0,
	0x14, 0x8a, 0x02, 0x43, 0xd7, 0x2c, 0x48, 0x50, 0xfe, 0xa6, 0x0d, 0xa8, 0x44, 0x53, 0xcf, 0xee,
	0x9f, 0xfb, 0x43, 0xb3, 0xd8, 0x26, 0x9d, 0x0a, 0x5b, 0x8b, 0xeb, 0x57, 0xfe, 0x90, 0x9a, 0xb0,
	0xe6, 0x60, 0x24, 0x42, 0x7f, 0x6a, 0x96, 0x54, 0x47, 0x97, 0x71, 0xc7, 0xf6, 0x3d, 0x81, 0x17,
	0xc2, 0x2c, 0xb7, 0x49, 0xa7, 0xca, 0x92, 0xd2, 0xfa, 0x4d, 0xa0, 0x3e, 0x2f, 0x97, 0x3e, 0x84,
	0xf2, 0x48, 0x4a, 0x96, 0x2a, 0x8d, 0x5e, 0xab, 0x9b, 0x26, 0xb4, 0xcc, 0x18, 0xd3, 0x6c, 0xba,
	0x07, 0x95, 0x50, 0x35, 0x22, 0x33, 0xdf, 0x2e, 0x74, 0x8c, 0xde, 0x56, 0x37, 0x93, 0x99, 0x3e,
	0xc4, 0x52, 0x12, 0x7d, 0x04, 0x35, 0xee, 0xb8, 0x63, 0xaf, 0xaf, 0x11, 0xe9, 0xd3, 0xe8, 0x99,
	0xd9, 0x53, 0x07, 0x31, 0x21, 0x39, 0x5a, 0xe5, 0x99, 0x8a, 0x3e, 0x81, 0x7a, 0x72, 0x3c, 0x0a,
	0x7c, 0x2f, 0x42, 0x99, 0x87, 0xd1, 0x6b, 0x2c, 0x39, 0xaf, 0x08, 0xac, 0xc6, 0xb3, 0xa5, 0x75,
	0x0c, 0x5b, 0xf3, 0x8e, 0x0e, 0xb9, 0xb0, 0x47, 0xf4, 0x41, 0xc6, 0x08, 0x91, 0x46, 0xcc, 0x55,
	0x11, 0xcc, 0xdc, 0x58, 0x0c, 0xfe, 0x4f, 0x7b, 0xea, 0xfe, 0xbf, 0x59, 0xfc, 0x0d, 0x58, 0xd7,
	0x4b, 0x42, 0x47, 0x2e, 0xbf, 0xc2, 0x66, 0x80, 0xf5, 0x8d, 0xc0, 0xc6, 0xc2, 0xa5, 0x74, 0x7f,
	0x61, 0x3d, 0x37, 0x97, 0x68, 0xcb, 0xce, 0x4f, 0xf7, 0xf3, 0x18, 0x0c, 0x1e, 0x04, 0xe7, 0xd3,
	0x7e, 0x24, 0xb8, 0x40, 0x39, 0xcc, 0xe8, 0xed, 0x76, 0xe7, 0x1f, 0x31, 0xe3, 0x03, 0x71, 0x10,
	0xb3, 0x4e, 0x62, 0x12, 0x03, 0x9e, 0xfe, 0xa6, 0xb7, 0xa0, 0x1a, 0x57, 0x63, 0x74, 0xfa, 0x99,
	0x57, 0x69, 0x68, 0xec, 0x2d, 0x86, 0xae, 0xf5, 0x3a, 0xf3, 0xf6, 0x95, 0x06, 0x95, 0xe8, 0x7e,
	0x1c, 0x81, 0x02, 0x92, 0x48, 0x1b, 0x2b, 0x65, 0xb3, 0x19, 0xd7, 0xfa, 0x4c, 0xa0, 0x76, 0xe2,
	0xf1, 0x20, 0x1a, 0xf9, 0x42, 0xa9, 0xb8, 0x0d, 0x65, 0x15, 0x9e, 0xb6, 0x5f, 0xef, 0xea, 0xaf,
	0x94, 0x49, 0x94, 0xe9, 0x2e, 0x6d, 0x43, 0x31, 0x40, 0x0c, 0xb5, 0xcd, 0x6a, 0xc2, 0x7a, 0x83,
	0x18, 0x32, 0xd9, 0x59, 0xcc, 0xa3, 0xf0, 0x8f, 0x79, 0x58, 0x43, 0xa8, 0x26, 0xd2, 0x9e, 0x71,
	0xc1, 0x69, 0x1d, 0xf2, 0xf6, 0x40, 0xaa, 0x5a, 0x67, 0x79, 0x7b, 0x40, 0x9b, 0x50, 0xb1, 0x47,
	0x68, 0x9f, 0x45, 0x13, 0x57, 0xaa, 0xa8, 0xb1, 0xb4, 0xa6, 0x77, 0xa0, 0xe8, 0x70, 0xc1, 0xcd,
	0x82, 0xcc, 0x62, 0x67, 0x61, 0xe8, 0x31, 0x4e, 0xdf, 0xf1, 0xf3, 0x09, 0x32, 0x49, 0xb2, 0xa6,
	0xb0, 0x91, 0x0c, 0x4a, 0xde, 0xfe, 0x1e, 0x94, 0x94, 0x6a, 0x15, 0xc2, 0xce, 0x2c, 0xcc, 0xb9,
	0xb4, 0x8e, 0x72, 0x4c, 0xf1, 0xe8, 0x5d, 0x3d, 0x50, 0xc5, 0x71, 0xed, 0x2a, 0x3f, 0xb6, 0x70,
	0x94, 0x53, 0x13, 0x0f, 0xd7, 0xa0, 0x64, 0x8f, 0x26, 0xde, 0x99, 0x55, 0xcf, 0x78, 0xf4, 0x3d,
	0xec, 0x7d, 0x21, 0x50, 0x7e, 0x2e, 0x8f, 0xd2, 0xf7, 0xf0, 0x9f, 0x0c, 0x46, 0x6f, 0x4f, 0x2d,
	0x7a, 0x77, 0xd5, 0x87, 0x22, 0xdb, 0xcd, 0xd6, 0xca, 0xa5, 0xcb, 0xbe, 0x95, 0xeb, 0x90, 0x7b,
	0x84, 0xbe, 0x80, 0x9a, 0x8a, 0x5c, 0x4f, 0xa6, 0x8d, 0xab, 0x72, 0xf5, 0xb5, 0xcd, 0x65, 0x4e,
	0x7c, 0x0f, 0xe3, 0x9b, 0x0e, 0x37, 0xbf, 0x5f, 0xb6, 0xc8, 0x8f, 0xcb, 0x16, 0xf9, 0x79, 0xd9,
	0x22, 0x9f, 0x7e, 0xb5, 0x72, 0xa7, 0x65, 0xf9, 0x1f, 0x7d, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff,
	0xff, 0x9d, 0xc9, 0x50, 0xee, 0xf4, 0x05, 0x00, 0x00,
}
