shard

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const InvalidVersion int64 = -1

InvalidVersion is defined as -1 since valid versions are non-negative.

Variables

View Source
var (
	ErrInvalidLengthShard = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowShard   = fmt.Errorf("proto: integer overflow")
)
View Source
var (

	// ErrCancelled is returned when an action is cancelled by the user
	ErrCancelled = fmt.Errorf("cancelled by user")
)

Functions

This section is empty.

Types

type AddServerRole

type AddServerRole struct {
	ServerRole           *ServerRole `protobuf:"bytes,1,opt,name=serverRole,proto3" json:"serverRole,omitempty"`
	Error                string      `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*AddServerRole) Descriptor

func (*AddServerRole) Descriptor() ([]byte, []int)

func (*AddServerRole) GetError added in v1.3.5

func (m *AddServerRole) GetError() string

func (*AddServerRole) GetServerRole

func (m *AddServerRole) GetServerRole() *ServerRole

func (*AddServerRole) Marshal added in v1.5.0

func (m *AddServerRole) Marshal() (dAtA []byte, err error)

func (*AddServerRole) MarshalTo added in v1.5.0

func (m *AddServerRole) MarshalTo(dAtA []byte) (int, error)

func (*AddServerRole) ProtoMessage

func (*AddServerRole) ProtoMessage()

func (*AddServerRole) Reset

func (m *AddServerRole) Reset()

func (*AddServerRole) Size added in v1.5.0

func (m *AddServerRole) Size() (n int)

func (*AddServerRole) String

func (m *AddServerRole) String() string

func (*AddServerRole) Unmarshal added in v1.5.0

func (m *AddServerRole) Unmarshal(dAtA []byte) error

func (*AddServerRole) XXX_DiscardUnknown added in v1.7.12

func (m *AddServerRole) XXX_DiscardUnknown()

func (*AddServerRole) XXX_Marshal added in v1.7.12

func (m *AddServerRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddServerRole) XXX_Merge added in v1.7.12

func (m *AddServerRole) XXX_Merge(src proto.Message)

func (*AddServerRole) XXX_Size added in v1.7.12

func (m *AddServerRole) XXX_Size() int

func (*AddServerRole) XXX_Unmarshal added in v1.7.12

func (m *AddServerRole) XXX_Unmarshal(b []byte) error

type Addresses

type Addresses struct {
	Version              int64             `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	Addresses            map[uint64]string `` /* 160-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*Addresses) Descriptor

func (*Addresses) Descriptor() ([]byte, []int)

func (*Addresses) GetAddresses

func (m *Addresses) GetAddresses() map[uint64]string

func (*Addresses) GetVersion added in v1.3.5

func (m *Addresses) GetVersion() int64

func (*Addresses) Marshal added in v1.5.0

func (m *Addresses) Marshal() (dAtA []byte, err error)

func (*Addresses) MarshalTo added in v1.5.0

func (m *Addresses) MarshalTo(dAtA []byte) (int, error)

func (*Addresses) ProtoMessage

func (*Addresses) ProtoMessage()

func (*Addresses) Reset

func (m *Addresses) Reset()

func (*Addresses) Size added in v1.5.0

func (m *Addresses) Size() (n int)

func (*Addresses) String

func (m *Addresses) String() string

func (*Addresses) Unmarshal added in v1.5.0

func (m *Addresses) Unmarshal(dAtA []byte) error

func (*Addresses) XXX_DiscardUnknown added in v1.7.12

func (m *Addresses) XXX_DiscardUnknown()

func (*Addresses) XXX_Marshal added in v1.7.12

func (m *Addresses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Addresses) XXX_Merge added in v1.7.12

func (m *Addresses) XXX_Merge(src proto.Message)

func (*Addresses) XXX_Size added in v1.7.12

func (m *Addresses) XXX_Size() int

func (*Addresses) XXX_Unmarshal added in v1.7.12

func (m *Addresses) XXX_Unmarshal(b []byte) error

type DeleteServerRole

type DeleteServerRole struct {
	ServerRole           *ServerRole `protobuf:"bytes,2,opt,name=serverRole,proto3" json:"serverRole,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*DeleteServerRole) Descriptor

func (*DeleteServerRole) Descriptor() ([]byte, []int)

func (*DeleteServerRole) GetServerRole

func (m *DeleteServerRole) GetServerRole() *ServerRole

func (*DeleteServerRole) Marshal added in v1.5.0

func (m *DeleteServerRole) Marshal() (dAtA []byte, err error)

func (*DeleteServerRole) MarshalTo added in v1.5.0

func (m *DeleteServerRole) MarshalTo(dAtA []byte) (int, error)

func (*DeleteServerRole) ProtoMessage

func (*DeleteServerRole) ProtoMessage()

func (*DeleteServerRole) Reset

func (m *DeleteServerRole) Reset()

func (*DeleteServerRole) Size added in v1.5.0

func (m *DeleteServerRole) Size() (n int)

func (*DeleteServerRole) String

func (m *DeleteServerRole) String() string

func (*DeleteServerRole) Unmarshal added in v1.5.0

func (m *DeleteServerRole) Unmarshal(dAtA []byte) error

func (*DeleteServerRole) XXX_DiscardUnknown added in v1.7.12

func (m *DeleteServerRole) XXX_DiscardUnknown()

func (*DeleteServerRole) XXX_Marshal added in v1.7.12

func (m *DeleteServerRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteServerRole) XXX_Merge added in v1.7.12

func (m *DeleteServerRole) XXX_Merge(src proto.Message)

func (*DeleteServerRole) XXX_Size added in v1.7.12

func (m *DeleteServerRole) XXX_Size() int

func (*DeleteServerRole) XXX_Unmarshal added in v1.7.12

func (m *DeleteServerRole) XXX_Unmarshal(b []byte) error

type FailedToAssignRoles

type FailedToAssignRoles struct {
	ServerStates         map[string]*ServerState `` /* 185-byte string literal not displayed */
	NumShards            uint64                  `protobuf:"varint,2,opt,name=num_shards,json=numShards,proto3" json:"num_shards,omitempty"`
	NumReplicas          uint64                  `protobuf:"varint,3,opt,name=num_replicas,json=numReplicas,proto3" json:"num_replicas,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

func (*FailedToAssignRoles) Descriptor

func (*FailedToAssignRoles) Descriptor() ([]byte, []int)

func (*FailedToAssignRoles) GetNumReplicas added in v1.3.5

func (m *FailedToAssignRoles) GetNumReplicas() uint64

func (*FailedToAssignRoles) GetNumShards added in v1.3.5

func (m *FailedToAssignRoles) GetNumShards() uint64

func (*FailedToAssignRoles) GetServerStates

func (m *FailedToAssignRoles) GetServerStates() map[string]*ServerState

func (*FailedToAssignRoles) Marshal added in v1.5.0

func (m *FailedToAssignRoles) Marshal() (dAtA []byte, err error)

func (*FailedToAssignRoles) MarshalTo added in v1.5.0

func (m *FailedToAssignRoles) MarshalTo(dAtA []byte) (int, error)

func (*FailedToAssignRoles) ProtoMessage

func (*FailedToAssignRoles) ProtoMessage()

func (*FailedToAssignRoles) Reset

func (m *FailedToAssignRoles) Reset()

func (*FailedToAssignRoles) Size added in v1.5.0

func (m *FailedToAssignRoles) Size() (n int)

func (*FailedToAssignRoles) String

func (m *FailedToAssignRoles) String() string

func (*FailedToAssignRoles) Unmarshal added in v1.5.0

func (m *FailedToAssignRoles) Unmarshal(dAtA []byte) error

func (*FailedToAssignRoles) XXX_DiscardUnknown added in v1.7.12

func (m *FailedToAssignRoles) XXX_DiscardUnknown()

func (*FailedToAssignRoles) XXX_Marshal added in v1.7.12

func (m *FailedToAssignRoles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FailedToAssignRoles) XXX_Merge added in v1.7.12

func (m *FailedToAssignRoles) XXX_Merge(src proto.Message)

func (*FailedToAssignRoles) XXX_Size added in v1.7.12

func (m *FailedToAssignRoles) XXX_Size() int

func (*FailedToAssignRoles) XXX_Unmarshal added in v1.7.12

func (m *FailedToAssignRoles) XXX_Unmarshal(b []byte) error

type FinishAssignRoles

type FinishAssignRoles struct {
	Error                string   `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FinishAssignRoles) Descriptor

func (*FinishAssignRoles) Descriptor() ([]byte, []int)

func (*FinishAssignRoles) GetError added in v1.3.5

func (m *FinishAssignRoles) GetError() string

func (*FinishAssignRoles) Marshal added in v1.5.0

func (m *FinishAssignRoles) Marshal() (dAtA []byte, err error)

func (*FinishAssignRoles) MarshalTo added in v1.5.0

func (m *FinishAssignRoles) MarshalTo(dAtA []byte) (int, error)

func (*FinishAssignRoles) ProtoMessage

func (*FinishAssignRoles) ProtoMessage()

func (*FinishAssignRoles) Reset

func (m *FinishAssignRoles) Reset()

func (*FinishAssignRoles) Size added in v1.5.0

func (m *FinishAssignRoles) Size() (n int)

func (*FinishAssignRoles) String

func (m *FinishAssignRoles) String() string

func (*FinishAssignRoles) Unmarshal added in v1.5.0

func (m *FinishAssignRoles) Unmarshal(dAtA []byte) error

func (*FinishAssignRoles) XXX_DiscardUnknown added in v1.7.12

func (m *FinishAssignRoles) XXX_DiscardUnknown()

func (*FinishAssignRoles) XXX_Marshal added in v1.7.12

func (m *FinishAssignRoles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FinishAssignRoles) XXX_Merge added in v1.7.12

func (m *FinishAssignRoles) XXX_Merge(src proto.Message)

func (*FinishAssignRoles) XXX_Size added in v1.7.12

func (m *FinishAssignRoles) XXX_Size() int

func (*FinishAssignRoles) XXX_Unmarshal added in v1.7.12

func (m *FinishAssignRoles) XXX_Unmarshal(b []byte) error

type FinishRegister

type FinishRegister struct {
	Address              string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Error                string   `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FinishRegister) Descriptor

func (*FinishRegister) Descriptor() ([]byte, []int)

func (*FinishRegister) GetAddress added in v1.3.5

func (m *FinishRegister) GetAddress() string

func (*FinishRegister) GetError added in v1.3.5

func (m *FinishRegister) GetError() string

func (*FinishRegister) Marshal added in v1.5.0

func (m *FinishRegister) Marshal() (dAtA []byte, err error)

func (*FinishRegister) MarshalTo added in v1.5.0

func (m *FinishRegister) MarshalTo(dAtA []byte) (int, error)

func (*FinishRegister) ProtoMessage

func (*FinishRegister) ProtoMessage()

func (*FinishRegister) Reset

func (m *FinishRegister) Reset()

func (*FinishRegister) Size added in v1.5.0

func (m *FinishRegister) Size() (n int)

func (*FinishRegister) String

func (m *FinishRegister) String() string

func (*FinishRegister) Unmarshal added in v1.5.0

func (m *FinishRegister) Unmarshal(dAtA []byte) error

func (*FinishRegister) XXX_DiscardUnknown added in v1.7.12

func (m *FinishRegister) XXX_DiscardUnknown()

func (*FinishRegister) XXX_Marshal added in v1.7.12

func (m *FinishRegister) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FinishRegister) XXX_Merge added in v1.7.12

func (m *FinishRegister) XXX_Merge(src proto.Message)

func (*FinishRegister) XXX_Size added in v1.7.12

func (m *FinishRegister) XXX_Size() int

func (*FinishRegister) XXX_Unmarshal added in v1.7.12

func (m *FinishRegister) XXX_Unmarshal(b []byte) error

type Frontend

type Frontend interface {
	// Version tells the Frontend a new version exists.
	// Version should block until the Frontend is done using the previous version.
	Version(version int64) error
}

A Frontend represents a frontend which receives new versions.

type FrontendState

type FrontendState struct {
	Address              string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Version              int64    `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FrontendState) Descriptor

func (*FrontendState) Descriptor() ([]byte, []int)

func (*FrontendState) GetAddress added in v1.3.5

func (m *FrontendState) GetAddress() string

func (*FrontendState) GetVersion added in v1.3.5

func (m *FrontendState) GetVersion() int64

func (*FrontendState) Marshal added in v1.5.0

func (m *FrontendState) Marshal() (dAtA []byte, err error)

func (*FrontendState) MarshalTo added in v1.5.0

func (m *FrontendState) MarshalTo(dAtA []byte) (int, error)

func (*FrontendState) ProtoMessage

func (*FrontendState) ProtoMessage()

func (*FrontendState) Reset

func (m *FrontendState) Reset()

func (*FrontendState) Size added in v1.5.0

func (m *FrontendState) Size() (n int)

func (*FrontendState) String

func (m *FrontendState) String() string

func (*FrontendState) Unmarshal added in v1.5.0

func (m *FrontendState) Unmarshal(dAtA []byte) error

func (*FrontendState) XXX_DiscardUnknown added in v1.7.12

func (m *FrontendState) XXX_DiscardUnknown()

func (*FrontendState) XXX_Marshal added in v1.7.12

func (m *FrontendState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FrontendState) XXX_Merge added in v1.7.12

func (m *FrontendState) XXX_Merge(src proto.Message)

func (*FrontendState) XXX_Size added in v1.7.12

func (m *FrontendState) XXX_Size() int

func (*FrontendState) XXX_Unmarshal added in v1.7.12

func (m *FrontendState) XXX_Unmarshal(b []byte) error

type GetAddress

type GetAddress struct {
	Shard                uint64   `protobuf:"varint,1,opt,name=shard,proto3" json:"shard,omitempty"`
	Version              int64    `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	Result               string   `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"`
	Ok                   bool     `protobuf:"varint,4,opt,name=ok,proto3" json:"ok,omitempty"`
	Error                string   `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetAddress) Descriptor

func (*GetAddress) Descriptor() ([]byte, []int)

func (*GetAddress) GetError added in v1.3.5

func (m *GetAddress) GetError() string

func (*GetAddress) GetOk added in v1.3.5

func (m *GetAddress) GetOk() bool

func (*GetAddress) GetResult added in v1.3.5

func (m *GetAddress) GetResult() string

func (*GetAddress) GetShard added in v1.3.5

func (m *GetAddress) GetShard() uint64

func (*GetAddress) GetVersion added in v1.3.5

func (m *GetAddress) GetVersion() int64

func (*GetAddress) Marshal added in v1.5.0

func (m *GetAddress) Marshal() (dAtA []byte, err error)

func (*GetAddress) MarshalTo added in v1.5.0

func (m *GetAddress) MarshalTo(dAtA []byte) (int, error)

func (*GetAddress) ProtoMessage

func (*GetAddress) ProtoMessage()

func (*GetAddress) Reset

func (m *GetAddress) Reset()

func (*GetAddress) Size added in v1.5.0

func (m *GetAddress) Size() (n int)

func (*GetAddress) String

func (m *GetAddress) String() string

func (*GetAddress) Unmarshal added in v1.5.0

func (m *GetAddress) Unmarshal(dAtA []byte) error

func (*GetAddress) XXX_DiscardUnknown added in v1.7.12

func (m *GetAddress) XXX_DiscardUnknown()

func (*GetAddress) XXX_Marshal added in v1.7.12

func (m *GetAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetAddress) XXX_Merge added in v1.7.12

func (m *GetAddress) XXX_Merge(src proto.Message)

func (*GetAddress) XXX_Size added in v1.7.12

func (m *GetAddress) XXX_Size() int

func (*GetAddress) XXX_Unmarshal added in v1.7.12

func (m *GetAddress) XXX_Unmarshal(b []byte) error

type GetShardToAddress

type GetShardToAddress struct {
	Version              int64             `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	Result               map[uint64]string `` /* 154-byte string literal not displayed */
	Error                string            `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*GetShardToAddress) Descriptor

func (*GetShardToAddress) Descriptor() ([]byte, []int)

func (*GetShardToAddress) GetError added in v1.3.5

func (m *GetShardToAddress) GetError() string

func (*GetShardToAddress) GetResult

func (m *GetShardToAddress) GetResult() map[uint64]string

func (*GetShardToAddress) GetVersion added in v1.3.5

func (m *GetShardToAddress) GetVersion() int64

func (*GetShardToAddress) Marshal added in v1.5.0

func (m *GetShardToAddress) Marshal() (dAtA []byte, err error)

func (*GetShardToAddress) MarshalTo added in v1.5.0

func (m *GetShardToAddress) MarshalTo(dAtA []byte) (int, error)

func (*GetShardToAddress) ProtoMessage

func (*GetShardToAddress) ProtoMessage()

func (*GetShardToAddress) Reset

func (m *GetShardToAddress) Reset()

func (*GetShardToAddress) Size added in v1.5.0

func (m *GetShardToAddress) Size() (n int)

func (*GetShardToAddress) String

func (m *GetShardToAddress) String() string

func (*GetShardToAddress) Unmarshal added in v1.5.0

func (m *GetShardToAddress) Unmarshal(dAtA []byte) error

func (*GetShardToAddress) XXX_DiscardUnknown added in v1.7.12

func (m *GetShardToAddress) XXX_DiscardUnknown()

func (*GetShardToAddress) XXX_Marshal added in v1.7.12

func (m *GetShardToAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetShardToAddress) XXX_Merge added in v1.7.12

func (m *GetShardToAddress) XXX_Merge(src proto.Message)

func (*GetShardToAddress) XXX_Size added in v1.7.12

func (m *GetShardToAddress) XXX_Size() int

func (*GetShardToAddress) XXX_Unmarshal added in v1.7.12

func (m *GetShardToAddress) XXX_Unmarshal(b []byte) error

type RemoveServerRole

type RemoveServerRole struct {
	ServerRole           *ServerRole `protobuf:"bytes,1,opt,name=serverRole,proto3" json:"serverRole,omitempty"`
	Error                string      `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*RemoveServerRole) Descriptor

func (*RemoveServerRole) Descriptor() ([]byte, []int)

func (*RemoveServerRole) GetError added in v1.3.5

func (m *RemoveServerRole) GetError() string

func (*RemoveServerRole) GetServerRole

func (m *RemoveServerRole) GetServerRole() *ServerRole

func (*RemoveServerRole) Marshal added in v1.5.0

func (m *RemoveServerRole) Marshal() (dAtA []byte, err error)

func (*RemoveServerRole) MarshalTo added in v1.5.0

func (m *RemoveServerRole) MarshalTo(dAtA []byte) (int, error)

func (*RemoveServerRole) ProtoMessage

func (*RemoveServerRole) ProtoMessage()

func (*RemoveServerRole) Reset

func (m *RemoveServerRole) Reset()

func (*RemoveServerRole) Size added in v1.5.0

func (m *RemoveServerRole) Size() (n int)

func (*RemoveServerRole) String

func (m *RemoveServerRole) String() string

func (*RemoveServerRole) Unmarshal added in v1.5.0

func (m *RemoveServerRole) Unmarshal(dAtA []byte) error

func (*RemoveServerRole) XXX_DiscardUnknown added in v1.7.12

func (m *RemoveServerRole) XXX_DiscardUnknown()

func (*RemoveServerRole) XXX_Marshal added in v1.7.12

func (m *RemoveServerRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoveServerRole) XXX_Merge added in v1.7.12

func (m *RemoveServerRole) XXX_Merge(src proto.Message)

func (*RemoveServerRole) XXX_Size added in v1.7.12

func (m *RemoveServerRole) XXX_Size() int

func (*RemoveServerRole) XXX_Unmarshal added in v1.7.12

func (m *RemoveServerRole) XXX_Unmarshal(b []byte) error

type Router

type Router interface {
	GetShards(version int64) (map[uint64]bool, error)
	GetClientConn(shard uint64, version int64) (*grpc.ClientConn, error)
	GetAllClientConns(version int64) ([]*grpc.ClientConn, error)
	CloseClientConns() error // close all outstanding client connections
}

Router represents a router from shard id and version to grpc connections.

func NewRouter

func NewRouter(
	sharder Sharder,
	dialer grpcutil.Dialer,
	localAddress string,
) Router

NewRouter creates a Router.

type Server

type Server interface {
	// AddShard tells the server it now has a role for a shard.
	AddShard(shard uint64) error
	// RemoveShard tells the server it no longer has a role for a shard.
	DeleteShard(shard uint64) error
}

A Server represents a server that has roles for shards.

type ServerRole

type ServerRole struct {
	Address              string          `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Version              int64           `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	Shards               map[uint64]bool `` /* 155-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*ServerRole) Descriptor

func (*ServerRole) Descriptor() ([]byte, []int)

func (*ServerRole) GetAddress added in v1.3.5

func (m *ServerRole) GetAddress() string

func (*ServerRole) GetShards

func (m *ServerRole) GetShards() map[uint64]bool

func (*ServerRole) GetVersion added in v1.3.5

func (m *ServerRole) GetVersion() int64

func (*ServerRole) Marshal added in v1.5.0

func (m *ServerRole) Marshal() (dAtA []byte, err error)

func (*ServerRole) MarshalTo added in v1.5.0

func (m *ServerRole) MarshalTo(dAtA []byte) (int, error)

func (*ServerRole) ProtoMessage

func (*ServerRole) ProtoMessage()

func (*ServerRole) Reset

func (m *ServerRole) Reset()

func (*ServerRole) Size added in v1.5.0

func (m *ServerRole) Size() (n int)

func (*ServerRole) String

func (m *ServerRole) String() string

func (*ServerRole) Unmarshal added in v1.5.0

func (m *ServerRole) Unmarshal(dAtA []byte) error

func (*ServerRole) XXX_DiscardUnknown added in v1.7.12

func (m *ServerRole) XXX_DiscardUnknown()

func (*ServerRole) XXX_Marshal added in v1.7.12

func (m *ServerRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServerRole) XXX_Merge added in v1.7.12

func (m *ServerRole) XXX_Merge(src proto.Message)

func (*ServerRole) XXX_Size added in v1.7.12

func (m *ServerRole) XXX_Size() int

func (*ServerRole) XXX_Unmarshal added in v1.7.12

func (m *ServerRole) XXX_Unmarshal(b []byte) error

type ServerState

type ServerState struct {
	Address              string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Version              int64    `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ServerState) Descriptor

func (*ServerState) Descriptor() ([]byte, []int)

func (*ServerState) GetAddress added in v1.3.5

func (m *ServerState) GetAddress() string

func (*ServerState) GetVersion added in v1.3.5

func (m *ServerState) GetVersion() int64

func (*ServerState) Marshal added in v1.5.0

func (m *ServerState) Marshal() (dAtA []byte, err error)

func (*ServerState) MarshalTo added in v1.5.0

func (m *ServerState) MarshalTo(dAtA []byte) (int, error)

func (*ServerState) ProtoMessage

func (*ServerState) ProtoMessage()

func (*ServerState) Reset

func (m *ServerState) Reset()

func (*ServerState) Size added in v1.5.0

func (m *ServerState) Size() (n int)

func (*ServerState) String

func (m *ServerState) String() string

func (*ServerState) Unmarshal added in v1.5.0

func (m *ServerState) Unmarshal(dAtA []byte) error

func (*ServerState) XXX_DiscardUnknown added in v1.7.12

func (m *ServerState) XXX_DiscardUnknown()

func (*ServerState) XXX_Marshal added in v1.7.12

func (m *ServerState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServerState) XXX_Merge added in v1.7.12

func (m *ServerState) XXX_Merge(src proto.Message)

func (*ServerState) XXX_Size added in v1.7.12

func (m *ServerState) XXX_Size() int

func (*ServerState) XXX_Unmarshal added in v1.7.12

func (m *ServerState) XXX_Unmarshal(b []byte) error

type SetAddresses

type SetAddresses struct {
	Addresses            *Addresses `protobuf:"bytes,1,opt,name=addresses,proto3" json:"addresses,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*SetAddresses) Descriptor

func (*SetAddresses) Descriptor() ([]byte, []int)

func (*SetAddresses) GetAddresses

func (m *SetAddresses) GetAddresses() *Addresses

func (*SetAddresses) Marshal added in v1.5.0

func (m *SetAddresses) Marshal() (dAtA []byte, err error)

func (*SetAddresses) MarshalTo added in v1.5.0

func (m *SetAddresses) MarshalTo(dAtA []byte) (int, error)

func (*SetAddresses) ProtoMessage

func (*SetAddresses) ProtoMessage()

func (*SetAddresses) Reset

func (m *SetAddresses) Reset()

func (*SetAddresses) Size added in v1.5.0

func (m *SetAddresses) Size() (n int)

func (*SetAddresses) String

func (m *SetAddresses) String() string

func (*SetAddresses) Unmarshal added in v1.5.0

func (m *SetAddresses) Unmarshal(dAtA []byte) error

func (*SetAddresses) XXX_DiscardUnknown added in v1.7.12

func (m *SetAddresses) XXX_DiscardUnknown()

func (*SetAddresses) XXX_Marshal added in v1.7.12

func (m *SetAddresses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetAddresses) XXX_Merge added in v1.7.12

func (m *SetAddresses) XXX_Merge(src proto.Message)

func (*SetAddresses) XXX_Size added in v1.7.12

func (m *SetAddresses) XXX_Size() int

func (*SetAddresses) XXX_Unmarshal added in v1.7.12

func (m *SetAddresses) XXX_Unmarshal(b []byte) error

type SetFrontendState

type SetFrontendState struct {
	FrontendState        *FrontendState `protobuf:"bytes,1,opt,name=frontendState,proto3" json:"frontendState,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*SetFrontendState) Descriptor

func (*SetFrontendState) Descriptor() ([]byte, []int)

func (*SetFrontendState) GetFrontendState

func (m *SetFrontendState) GetFrontendState() *FrontendState

func (*SetFrontendState) Marshal added in v1.5.0

func (m *SetFrontendState) Marshal() (dAtA []byte, err error)

func (*SetFrontendState) MarshalTo added in v1.5.0

func (m *SetFrontendState) MarshalTo(dAtA []byte) (int, error)

func (*SetFrontendState) ProtoMessage

func (*SetFrontendState) ProtoMessage()

func (*SetFrontendState) Reset

func (m *SetFrontendState) Reset()

func (*SetFrontendState) Size added in v1.5.0

func (m *SetFrontendState) Size() (n int)

func (*SetFrontendState) String

func (m *SetFrontendState) String() string

func (*SetFrontendState) Unmarshal added in v1.5.0

func (m *SetFrontendState) Unmarshal(dAtA []byte) error

func (*SetFrontendState) XXX_DiscardUnknown added in v1.7.12

func (m *SetFrontendState) XXX_DiscardUnknown()

func (*SetFrontendState) XXX_Marshal added in v1.7.12

func (m *SetFrontendState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetFrontendState) XXX_Merge added in v1.7.12

func (m *SetFrontendState) XXX_Merge(src proto.Message)

func (*SetFrontendState) XXX_Size added in v1.7.12

func (m *SetFrontendState) XXX_Size() int

func (*SetFrontendState) XXX_Unmarshal added in v1.7.12

func (m *SetFrontendState) XXX_Unmarshal(b []byte) error

type SetServerRole

type SetServerRole struct {
	ServerRole           *ServerRole `protobuf:"bytes,2,opt,name=serverRole,proto3" json:"serverRole,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*SetServerRole) Descriptor

func (*SetServerRole) Descriptor() ([]byte, []int)

func (*SetServerRole) GetServerRole

func (m *SetServerRole) GetServerRole() *ServerRole

func (*SetServerRole) Marshal added in v1.5.0

func (m *SetServerRole) Marshal() (dAtA []byte, err error)

func (*SetServerRole) MarshalTo added in v1.5.0

func (m *SetServerRole) MarshalTo(dAtA []byte) (int, error)

func (*SetServerRole) ProtoMessage

func (*SetServerRole) ProtoMessage()

func (*SetServerRole) Reset

func (m *SetServerRole) Reset()

func (*SetServerRole) Size added in v1.5.0

func (m *SetServerRole) Size() (n int)

func (*SetServerRole) String

func (m *SetServerRole) String() string

func (*SetServerRole) Unmarshal added in v1.5.0

func (m *SetServerRole) Unmarshal(dAtA []byte) error

func (*SetServerRole) XXX_DiscardUnknown added in v1.7.12

func (m *SetServerRole) XXX_DiscardUnknown()

func (*SetServerRole) XXX_Marshal added in v1.7.12

func (m *SetServerRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetServerRole) XXX_Merge added in v1.7.12

func (m *SetServerRole) XXX_Merge(src proto.Message)

func (*SetServerRole) XXX_Size added in v1.7.12

func (m *SetServerRole) XXX_Size() int

func (*SetServerRole) XXX_Unmarshal added in v1.7.12

func (m *SetServerRole) XXX_Unmarshal(b []byte) error

type SetServerState

type SetServerState struct {
	ServerState          *ServerState `protobuf:"bytes,1,opt,name=serverState,proto3" json:"serverState,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*SetServerState) Descriptor

func (*SetServerState) Descriptor() ([]byte, []int)

func (*SetServerState) GetServerState

func (m *SetServerState) GetServerState() *ServerState

func (*SetServerState) Marshal added in v1.5.0

func (m *SetServerState) Marshal() (dAtA []byte, err error)

func (*SetServerState) MarshalTo added in v1.5.0

func (m *SetServerState) MarshalTo(dAtA []byte) (int, error)

func (*SetServerState) ProtoMessage

func (*SetServerState) ProtoMessage()

func (*SetServerState) Reset

func (m *SetServerState) Reset()

func (*SetServerState) Size added in v1.5.0

func (m *SetServerState) Size() (n int)

func (*SetServerState) String

func (m *SetServerState) String() string

func (*SetServerState) Unmarshal added in v1.5.0

func (m *SetServerState) Unmarshal(dAtA []byte) error

func (*SetServerState) XXX_DiscardUnknown added in v1.7.12

func (m *SetServerState) XXX_DiscardUnknown()

func (*SetServerState) XXX_Marshal added in v1.7.12

func (m *SetServerState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetServerState) XXX_Merge added in v1.7.12

func (m *SetServerState) XXX_Merge(src proto.Message)

func (*SetServerState) XXX_Size added in v1.7.12

func (m *SetServerState) XXX_Size() int

func (*SetServerState) XXX_Unmarshal added in v1.7.12

func (m *SetServerState) XXX_Unmarshal(b []byte) error

type Sharder

type Sharder interface {
	GetAddress(shard uint64, version int64) (string, bool, error)
	GetShardToAddress(version int64) (map[uint64]string, error)

	Register(cancel chan bool, address string, servers []Server) error
	RegisterFrontends(cancel chan bool, address string, frontends []Frontend) error
	AssignRoles(address string, cancel chan bool) error
}

Sharder distributes shards between a set of servers.

func NewLocalSharder

func NewLocalSharder(addresses []string, numShards uint64) Sharder

NewLocalSharder creates a Sharder user a list of addresses.

func NewSharder

func NewSharder(discoveryClient discovery.Client, numShards uint64, namespace string) Sharder

NewSharder creates a Sharder using a discovery client.

type StartAssignRoles

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

func (*StartAssignRoles) Descriptor

func (*StartAssignRoles) Descriptor() ([]byte, []int)

func (*StartAssignRoles) Marshal added in v1.5.0

func (m *StartAssignRoles) Marshal() (dAtA []byte, err error)

func (*StartAssignRoles) MarshalTo added in v1.5.0

func (m *StartAssignRoles) MarshalTo(dAtA []byte) (int, error)

func (*StartAssignRoles) ProtoMessage

func (*StartAssignRoles) ProtoMessage()

func (*StartAssignRoles) Reset

func (m *StartAssignRoles) Reset()

func (*StartAssignRoles) Size added in v1.5.0

func (m *StartAssignRoles) Size() (n int)

func (*StartAssignRoles) String

func (m *StartAssignRoles) String() string

func (*StartAssignRoles) Unmarshal added in v1.5.0

func (m *StartAssignRoles) Unmarshal(dAtA []byte) error

func (*StartAssignRoles) XXX_DiscardUnknown added in v1.7.12

func (m *StartAssignRoles) XXX_DiscardUnknown()

func (*StartAssignRoles) XXX_Marshal added in v1.7.12

func (m *StartAssignRoles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StartAssignRoles) XXX_Merge added in v1.7.12

func (m *StartAssignRoles) XXX_Merge(src proto.Message)

func (*StartAssignRoles) XXX_Size added in v1.7.12

func (m *StartAssignRoles) XXX_Size() int

func (*StartAssignRoles) XXX_Unmarshal added in v1.7.12

func (m *StartAssignRoles) XXX_Unmarshal(b []byte) error

type StartRegister

type StartRegister struct {
	Address              string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*StartRegister) Descriptor

func (*StartRegister) Descriptor() ([]byte, []int)

func (*StartRegister) GetAddress added in v1.3.5

func (m *StartRegister) GetAddress() string

func (*StartRegister) Marshal added in v1.5.0

func (m *StartRegister) Marshal() (dAtA []byte, err error)

func (*StartRegister) MarshalTo added in v1.5.0

func (m *StartRegister) MarshalTo(dAtA []byte) (int, error)

func (*StartRegister) ProtoMessage

func (*StartRegister) ProtoMessage()

func (*StartRegister) Reset

func (m *StartRegister) Reset()

func (*StartRegister) Size added in v1.5.0

func (m *StartRegister) Size() (n int)

func (*StartRegister) String

func (m *StartRegister) String() string

func (*StartRegister) Unmarshal added in v1.5.0

func (m *StartRegister) Unmarshal(dAtA []byte) error

func (*StartRegister) XXX_DiscardUnknown added in v1.7.12

func (m *StartRegister) XXX_DiscardUnknown()

func (*StartRegister) XXX_Marshal added in v1.7.12

func (m *StartRegister) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StartRegister) XXX_Merge added in v1.7.12

func (m *StartRegister) XXX_Merge(src proto.Message)

func (*StartRegister) XXX_Size added in v1.7.12

func (m *StartRegister) XXX_Size() int

func (*StartRegister) XXX_Unmarshal added in v1.7.12

func (m *StartRegister) XXX_Unmarshal(b []byte) error

type Version

type Version struct {
	Result               int64    `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
	Error                string   `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Version) Descriptor

func (*Version) Descriptor() ([]byte, []int)

func (*Version) GetError added in v1.3.5

func (m *Version) GetError() string

func (*Version) GetResult added in v1.3.5

func (m *Version) GetResult() int64

func (*Version) Marshal added in v1.5.0

func (m *Version) Marshal() (dAtA []byte, err error)

func (*Version) MarshalTo added in v1.5.0

func (m *Version) MarshalTo(dAtA []byte) (int, error)

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) Reset

func (m *Version) Reset()

func (*Version) Size added in v1.5.0

func (m *Version) Size() (n int)

func (*Version) String

func (m *Version) String() string

func (*Version) Unmarshal added in v1.5.0

func (m *Version) Unmarshal(dAtA []byte) error

func (*Version) XXX_DiscardUnknown added in v1.7.12

func (m *Version) XXX_DiscardUnknown()

func (*Version) XXX_Marshal added in v1.7.12

func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Version) XXX_Merge added in v1.7.12

func (m *Version) XXX_Merge(src proto.Message)

func (*Version) XXX_Size added in v1.7.12

func (m *Version) XXX_Size() int

func (*Version) XXX_Unmarshal added in v1.7.12

func (m *Version) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL