protocol

package
v0.4.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NodeType_name = map[int32]string{
		0: "ServerNode",
		1: "WorkerNode",
		2: "ClientNode",
	}
	NodeType_value = map[string]int32{
		"ServerNode": 0,
		"WorkerNode": 1,
		"ClientNode": 2,
	}
)

Enum value maps for NodeType.

View Source
var File_protocol_proto protoreflect.FileDescriptor
View Source
var Master_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protocol.Master",
	HandlerType: (*MasterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetMeta",
			Handler:    _Master_GetMeta_Handler,
		},
		{
			MethodName: "PushTaskInfo",
			Handler:    _Master_PushTaskInfo_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetRankingModel",
			Handler:       _Master_GetRankingModel_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "GetClickModel",
			Handler:       _Master_GetClickModel_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "protocol.proto",
}

Master_ServiceDesc is the grpc.ServiceDesc for Master service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterMasterServer

func RegisterMasterServer(s grpc.ServiceRegistrar, srv MasterServer)

func UnmarshalClickModel

func UnmarshalClickModel(receiver Master_GetClickModelClient) (click.FactorizationMachine, error)

UnmarshalClickModel unmarshal click model from gRPC.

func UnmarshalRankingModel

func UnmarshalRankingModel(receiver Master_GetRankingModelClient) (ranking.MatrixFactorization, error)

UnmarshalRankingModel unmarshal ranking model from gRPC.

Types

type Fragment

type Fragment struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Fragment) Descriptor deprecated

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

Deprecated: Use Fragment.ProtoReflect.Descriptor instead.

func (*Fragment) GetData

func (x *Fragment) GetData() []byte

func (*Fragment) ProtoMessage

func (*Fragment) ProtoMessage()

func (*Fragment) ProtoReflect

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

func (*Fragment) Reset

func (x *Fragment) Reset()

func (*Fragment) String

func (x *Fragment) String() string

type MasterClient

type MasterClient interface {
	// meta distribute
	GetMeta(ctx context.Context, in *NodeInfo, opts ...grpc.CallOption) (*Meta, error)
	// data distribute
	GetRankingModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (Master_GetRankingModelClient, error)
	GetClickModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (Master_GetClickModelClient, error)
	// task management
	PushTaskInfo(ctx context.Context, in *PushTaskInfoRequest, opts ...grpc.CallOption) (*PushTaskInfoResponse, error)
}

MasterClient is the client API for Master service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewMasterClient

func NewMasterClient(cc grpc.ClientConnInterface) MasterClient

type MasterServer

type MasterServer interface {
	// meta distribute
	GetMeta(context.Context, *NodeInfo) (*Meta, error)
	// data distribute
	GetRankingModel(*VersionInfo, Master_GetRankingModelServer) error
	GetClickModel(*VersionInfo, Master_GetClickModelServer) error
	// task management
	PushTaskInfo(context.Context, *PushTaskInfoRequest) (*PushTaskInfoResponse, error)
	// contains filtered or unexported methods
}

MasterServer is the server API for Master service. All implementations must embed UnimplementedMasterServer for forward compatibility

type Master_GetClickModelClient

type Master_GetClickModelClient interface {
	Recv() (*Fragment, error)
	grpc.ClientStream
}

type Master_GetClickModelServer

type Master_GetClickModelServer interface {
	Send(*Fragment) error
	grpc.ServerStream
}

type Master_GetRankingModelClient

type Master_GetRankingModelClient interface {
	Recv() (*Fragment, error)
	grpc.ClientStream
}

type Master_GetRankingModelServer

type Master_GetRankingModelServer interface {
	Send(*Fragment) error
	grpc.ServerStream
}

type Meta

type Meta struct {
	Config              string   `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	RankingModelVersion int64    `protobuf:"varint,3,opt,name=ranking_model_version,json=rankingModelVersion,proto3" json:"ranking_model_version,omitempty"`
	ClickModelVersion   int64    `protobuf:"varint,4,opt,name=click_model_version,json=clickModelVersion,proto3" json:"click_model_version,omitempty"`
	Me                  string   `protobuf:"bytes,5,opt,name=me,proto3" json:"me,omitempty"`
	Servers             []string `protobuf:"bytes,6,rep,name=servers,proto3" json:"servers,omitempty"`
	Workers             []string `protobuf:"bytes,7,rep,name=workers,proto3" json:"workers,omitempty"`
	// contains filtered or unexported fields
}

func (*Meta) Descriptor deprecated

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

Deprecated: Use Meta.ProtoReflect.Descriptor instead.

func (*Meta) GetClickModelVersion

func (x *Meta) GetClickModelVersion() int64

func (*Meta) GetConfig

func (x *Meta) GetConfig() string

func (*Meta) GetMe

func (x *Meta) GetMe() string

func (*Meta) GetRankingModelVersion

func (x *Meta) GetRankingModelVersion() int64

func (*Meta) GetServers

func (x *Meta) GetServers() []string

func (*Meta) GetWorkers

func (x *Meta) GetWorkers() []string

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) ProtoReflect

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

func (*Meta) Reset

func (x *Meta) Reset()

func (*Meta) String

func (x *Meta) String() string

type NodeInfo

type NodeInfo struct {
	NodeType      NodeType `protobuf:"varint,1,opt,name=node_type,json=nodeType,proto3,enum=protocol.NodeType" json:"node_type,omitempty"`
	NodeName      string   `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
	HttpPort      int64    `protobuf:"varint,3,opt,name=http_port,json=httpPort,proto3" json:"http_port,omitempty"`
	BinaryVersion string   `protobuf:"bytes,4,opt,name=binary_version,json=binaryVersion,proto3" json:"binary_version,omitempty"`
	// contains filtered or unexported fields
}

func (*NodeInfo) Descriptor deprecated

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

Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead.

func (*NodeInfo) GetBinaryVersion

func (x *NodeInfo) GetBinaryVersion() string

func (*NodeInfo) GetHttpPort

func (x *NodeInfo) GetHttpPort() int64

func (*NodeInfo) GetNodeName

func (x *NodeInfo) GetNodeName() string

func (*NodeInfo) GetNodeType

func (x *NodeInfo) GetNodeType() NodeType

func (*NodeInfo) ProtoMessage

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) ProtoReflect

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

func (*NodeInfo) Reset

func (x *NodeInfo) Reset()

func (*NodeInfo) String

func (x *NodeInfo) String() string

type NodeType

type NodeType int32
const (
	NodeType_ServerNode NodeType = 0
	NodeType_WorkerNode NodeType = 1
	NodeType_ClientNode NodeType = 2
)

func (NodeType) Descriptor

func (NodeType) Descriptor() protoreflect.EnumDescriptor

func (NodeType) Enum

func (x NodeType) Enum() *NodeType

func (NodeType) EnumDescriptor deprecated

func (NodeType) EnumDescriptor() ([]byte, []int)

Deprecated: Use NodeType.Descriptor instead.

func (NodeType) Number

func (x NodeType) Number() protoreflect.EnumNumber

func (NodeType) String

func (x NodeType) String() string

func (NodeType) Type

type PushTaskInfoRequest

type PushTaskInfoRequest struct {
	Name       string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Status     string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	Done       int64  `protobuf:"varint,3,opt,name=done,proto3" json:"done,omitempty"`
	Total      int64  `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"`
	StartTime  int64  `protobuf:"varint,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	FinishTime int64  `protobuf:"varint,6,opt,name=finish_time,json=finishTime,proto3" json:"finish_time,omitempty"`
	Error      string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*PushTaskInfoRequest) Descriptor deprecated

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

Deprecated: Use PushTaskInfoRequest.ProtoReflect.Descriptor instead.

func (*PushTaskInfoRequest) GetDone

func (x *PushTaskInfoRequest) GetDone() int64

func (*PushTaskInfoRequest) GetError

func (x *PushTaskInfoRequest) GetError() string

func (*PushTaskInfoRequest) GetFinishTime

func (x *PushTaskInfoRequest) GetFinishTime() int64

func (*PushTaskInfoRequest) GetName

func (x *PushTaskInfoRequest) GetName() string

func (*PushTaskInfoRequest) GetStartTime

func (x *PushTaskInfoRequest) GetStartTime() int64

func (*PushTaskInfoRequest) GetStatus

func (x *PushTaskInfoRequest) GetStatus() string

func (*PushTaskInfoRequest) GetTotal

func (x *PushTaskInfoRequest) GetTotal() int64

func (*PushTaskInfoRequest) ProtoMessage

func (*PushTaskInfoRequest) ProtoMessage()

func (*PushTaskInfoRequest) ProtoReflect

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

func (*PushTaskInfoRequest) Reset

func (x *PushTaskInfoRequest) Reset()

func (*PushTaskInfoRequest) String

func (x *PushTaskInfoRequest) String() string

type PushTaskInfoResponse

type PushTaskInfoResponse struct {
	// contains filtered or unexported fields
}

func (*PushTaskInfoResponse) Descriptor deprecated

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

Deprecated: Use PushTaskInfoResponse.ProtoReflect.Descriptor instead.

func (*PushTaskInfoResponse) ProtoMessage

func (*PushTaskInfoResponse) ProtoMessage()

func (*PushTaskInfoResponse) ProtoReflect

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

func (*PushTaskInfoResponse) Reset

func (x *PushTaskInfoResponse) Reset()

func (*PushTaskInfoResponse) String

func (x *PushTaskInfoResponse) String() string

type UnimplementedMasterServer

type UnimplementedMasterServer struct {
}

UnimplementedMasterServer must be embedded to have forward compatible implementations.

func (UnimplementedMasterServer) GetClickModel

func (UnimplementedMasterServer) GetMeta

func (UnimplementedMasterServer) GetRankingModel

func (UnimplementedMasterServer) PushTaskInfo

type UnsafeMasterServer

type UnsafeMasterServer interface {
	// contains filtered or unexported methods
}

UnsafeMasterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MasterServer will result in compilation errors.

type VersionInfo

type VersionInfo struct {
	Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*VersionInfo) Descriptor deprecated

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

Deprecated: Use VersionInfo.ProtoReflect.Descriptor instead.

func (*VersionInfo) GetVersion

func (x *VersionInfo) GetVersion() int64

func (*VersionInfo) ProtoMessage

func (*VersionInfo) ProtoMessage()

func (*VersionInfo) ProtoReflect

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

func (*VersionInfo) Reset

func (x *VersionInfo) Reset()

func (*VersionInfo) String

func (x *VersionInfo) String() string

Jump to

Keyboard shortcuts

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