multiple

package
v0.0.0-...-ddd91b3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetMulMachineTopN

func GetMulMachineTopN(minkey, maxkey int64, topn int)

GetMulMachineTopN user interface

func InitUser

func InitUser(masterAddr string)

InitUser init service addr

func MasterInit

func MasterInit()

MasterInit initialize service

func RegisterGetTopNServer

func RegisterGetTopNServer(s *grpc.Server, srv GetTopNServer)

func RegisterGetWorkerTopNServer

func RegisterGetWorkerTopNServer(s *grpc.Server, srv GetWorkerTopNServer)

func StartMaster

func StartMaster(masterAddr string, workerAddrs []string)

StartMaster start master instance only once

func StartWorker

func StartWorker(workerAddr string)

StartWorker start worker instance only once

func WorkerInit

func WorkerInit(workerAddr string)

WorkerInit initialize service

Types

type GetTopNClient

type GetTopNClient interface {
	// user interface, return topn by range[minkey,maxkey] in global data
	GetAllTopN(ctx context.Context, in *TopNReq, opts ...grpc.CallOption) (*TopNRsp, error)
}

GetTopNClient is the client API for GetTopN service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewGetTopNClient

func NewGetTopNClient(cc grpc.ClientConnInterface) GetTopNClient

type GetTopNServer

type GetTopNServer interface {
	// user interface, return topn by range[minkey,maxkey] in global data
	GetAllTopN(context.Context, *TopNReq) (*TopNRsp, error)
}

GetTopNServer is the server API for GetTopN service.

type GetWorkerTopNClient

type GetWorkerTopNClient interface {
	// master interface, return topn by range[minkey, maxkey] in worker
	GetWorkerTopN(ctx context.Context, in *TopNReq, opts ...grpc.CallOption) (*TopNRsp, error)
}

GetWorkerTopNClient is the client API for GetWorkerTopN service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type GetWorkerTopNServer

type GetWorkerTopNServer interface {
	// master interface, return topn by range[minkey, maxkey] in worker
	GetWorkerTopN(context.Context, *TopNReq) (*TopNRsp, error)
}

GetWorkerTopNServer is the server API for GetWorkerTopN service.

type KV

type KV struct {
	Key   int64  `protobuf:"varint,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*KV) Descriptor deprecated

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

Deprecated: Use KV.ProtoReflect.Descriptor instead.

func (*KV) GetKey

func (x *KV) GetKey() int64

func (*KV) GetValue

func (x *KV) GetValue() []byte

func (*KV) ProtoMessage

func (*KV) ProtoMessage()

func (*KV) ProtoReflect

func (x *KV) ProtoReflect() protoreflect.Message

func (*KV) Reset

func (x *KV) Reset()

func (*KV) String

func (x *KV) String() string

type TopNReq

type TopNReq struct {
	MinKey int64 `protobuf:"varint,1,opt,name=minKey,proto3" json:"minKey,omitempty"`
	MaxKey int64 `protobuf:"varint,2,opt,name=maxKey,proto3" json:"maxKey,omitempty"`
	Topn   int64 `protobuf:"varint,3,opt,name=topn,proto3" json:"topn,omitempty"`
	// contains filtered or unexported fields
}

func (*TopNReq) Descriptor deprecated

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

Deprecated: Use TopNReq.ProtoReflect.Descriptor instead.

func (*TopNReq) GetMaxKey

func (x *TopNReq) GetMaxKey() int64

func (*TopNReq) GetMinKey

func (x *TopNReq) GetMinKey() int64

func (*TopNReq) GetTopn

func (x *TopNReq) GetTopn() int64

func (*TopNReq) ProtoMessage

func (*TopNReq) ProtoMessage()

func (*TopNReq) ProtoReflect

func (x *TopNReq) ProtoReflect() protoreflect.Message

func (*TopNReq) Reset

func (x *TopNReq) Reset()

func (*TopNReq) String

func (x *TopNReq) String() string

type TopNRsp

type TopNRsp struct {
	KvList []*KV `protobuf:"bytes,1,rep,name=kvList,proto3" json:"kvList,omitempty"`
	// contains filtered or unexported fields
}

func (*TopNRsp) Descriptor deprecated

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

Deprecated: Use TopNRsp.ProtoReflect.Descriptor instead.

func (*TopNRsp) GetKvList

func (x *TopNRsp) GetKvList() []*KV

func (*TopNRsp) ProtoMessage

func (*TopNRsp) ProtoMessage()

func (*TopNRsp) ProtoReflect

func (x *TopNRsp) ProtoReflect() protoreflect.Message

func (*TopNRsp) Reset

func (x *TopNRsp) Reset()

func (*TopNRsp) String

func (x *TopNRsp) String() string

type UnimplementedGetTopNServer

type UnimplementedGetTopNServer struct {
}

UnimplementedGetTopNServer can be embedded to have forward compatible implementations.

func (*UnimplementedGetTopNServer) GetAllTopN

type UnimplementedGetWorkerTopNServer

type UnimplementedGetWorkerTopNServer struct {
}

UnimplementedGetWorkerTopNServer can be embedded to have forward compatible implementations.

func (*UnimplementedGetWorkerTopNServer) GetWorkerTopN

Jump to

Keyboard shortcuts

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