protocol

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 15 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 DecodeTask added in v0.4.5

func DecodeTask(in *PushTaskInfoRequest) *task.Task

func RegisterMasterServer

func RegisterMasterServer(s grpc.ServiceRegistrar, srv MasterServer)

func UnmarshalClickModel added in v0.2.7

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

UnmarshalClickModel unmarshal click model from gRPC.

func UnmarshalRankingModel added in v0.2.7

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

UnmarshalRankingModel unmarshal ranking model from gRPC.

Types

type Fragment added in v0.2.7

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

func (*Fragment) Descriptor deprecated added in v0.2.7

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

Deprecated: Use Fragment.ProtoReflect.Descriptor instead.

func (*Fragment) GetData added in v0.2.7

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

func (*Fragment) ProtoMessage added in v0.2.7

func (*Fragment) ProtoMessage()

func (*Fragment) ProtoReflect added in v0.2.7

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

func (*Fragment) Reset added in v0.2.7

func (x *Fragment) Reset()

func (*Fragment) String added in v0.2.7

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 added in v0.2.7

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

type Master_GetClickModelServer added in v0.2.7

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

type Master_GetRankingModelClient added in v0.2.7

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

type Master_GetRankingModelServer added in v0.2.7

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 added in v0.2.2

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 added in v0.4.2

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 added in v0.4.5

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 EncodeTask added in v0.4.5

func EncodeTask(t *task.Task) *PushTaskInfoRequest

func (*PushTaskInfoRequest) Descriptor deprecated added in v0.4.5

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

Deprecated: Use PushTaskInfoRequest.ProtoReflect.Descriptor instead.

func (*PushTaskInfoRequest) GetDone added in v0.4.5

func (x *PushTaskInfoRequest) GetDone() int64

func (*PushTaskInfoRequest) GetError added in v0.4.5

func (x *PushTaskInfoRequest) GetError() string

func (*PushTaskInfoRequest) GetFinishTime added in v0.4.5

func (x *PushTaskInfoRequest) GetFinishTime() int64

func (*PushTaskInfoRequest) GetName added in v0.4.5

func (x *PushTaskInfoRequest) GetName() string

func (*PushTaskInfoRequest) GetStartTime added in v0.4.5

func (x *PushTaskInfoRequest) GetStartTime() int64

func (*PushTaskInfoRequest) GetStatus added in v0.4.5

func (x *PushTaskInfoRequest) GetStatus() string

func (*PushTaskInfoRequest) GetTotal added in v0.4.5

func (x *PushTaskInfoRequest) GetTotal() int64

func (*PushTaskInfoRequest) ProtoMessage added in v0.4.5

func (*PushTaskInfoRequest) ProtoMessage()

func (*PushTaskInfoRequest) ProtoReflect added in v0.4.5

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

func (*PushTaskInfoRequest) Reset added in v0.4.5

func (x *PushTaskInfoRequest) Reset()

func (*PushTaskInfoRequest) String added in v0.4.5

func (x *PushTaskInfoRequest) String() string

type PushTaskInfoResponse added in v0.4.5

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

func (*PushTaskInfoResponse) Descriptor deprecated added in v0.4.5

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

Deprecated: Use PushTaskInfoResponse.ProtoReflect.Descriptor instead.

func (*PushTaskInfoResponse) ProtoMessage added in v0.4.5

func (*PushTaskInfoResponse) ProtoMessage()

func (*PushTaskInfoResponse) ProtoReflect added in v0.4.5

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

func (*PushTaskInfoResponse) Reset added in v0.4.5

func (x *PushTaskInfoResponse) Reset()

func (*PushTaskInfoResponse) String added in v0.4.5

func (x *PushTaskInfoResponse) String() string

type UnimplementedMasterServer

type UnimplementedMasterServer struct {
}

UnimplementedMasterServer must be embedded to have forward compatible implementations.

func (UnimplementedMasterServer) GetClickModel added in v0.2.2

func (UnimplementedMasterServer) GetMeta

func (UnimplementedMasterServer) GetRankingModel

func (UnimplementedMasterServer) PushTaskInfo added in v0.4.5

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 added in v0.2.7

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

func (*VersionInfo) Descriptor deprecated added in v0.2.7

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

Deprecated: Use VersionInfo.ProtoReflect.Descriptor instead.

func (*VersionInfo) GetVersion added in v0.2.7

func (x *VersionInfo) GetVersion() int64

func (*VersionInfo) ProtoMessage added in v0.2.7

func (*VersionInfo) ProtoMessage()

func (*VersionInfo) ProtoReflect added in v0.2.7

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

func (*VersionInfo) Reset added in v0.2.7

func (x *VersionInfo) Reset()

func (*VersionInfo) String added in v0.2.7

func (x *VersionInfo) String() string

Jump to

Keyboard shortcuts

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