protocol

package
v0.0.0-...-70f0bbd Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Master_GetMeta_FullMethodName         = "/protocol.Master/GetMeta"
	Master_GetRankingModel_FullMethodName = "/protocol.Master/GetRankingModel"
	Master_GetClickModel_FullMethodName   = "/protocol.Master/GetClickModel"
	Master_PushProgress_FullMethodName    = "/protocol.Master/PushProgress"
)

Variables

View Source
var Master_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protocol.Master",
	HandlerType: (*MasterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetMeta",
			Handler:    _Master_GetMeta_Handler,
		},
		{
			MethodName: "PushProgress",
			Handler:    _Master_PushProgress_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)

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

Functions

func DecodeProgress

func DecodeProgress(in *PushProgressRequest) []progress.Progress

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Fragment) Descriptor

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

func (*Fragment) GetData

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

func (*Fragment) ProtoMessage

func (*Fragment) ProtoMessage()

func (*Fragment) Reset

func (m *Fragment) Reset()

func (*Fragment) String

func (m *Fragment) String() string

func (*Fragment) XXX_DiscardUnknown

func (m *Fragment) XXX_DiscardUnknown()

func (*Fragment) XXX_Marshal

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

func (*Fragment) XXX_Merge

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

func (*Fragment) XXX_Size

func (m *Fragment) XXX_Size() int

func (*Fragment) XXX_Unmarshal

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

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)
	PushProgress(ctx context.Context, in *PushProgressRequest, opts ...grpc.CallOption) (*PushProgressResponse, 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
	PushProgress(context.Context, *PushProgressRequest) (*PushProgressResponse, 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Meta) Descriptor

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

func (*Meta) GetClickModelVersion

func (m *Meta) GetClickModelVersion() int64

func (*Meta) GetConfig

func (m *Meta) GetConfig() string

func (*Meta) GetMe

func (m *Meta) GetMe() string

func (*Meta) GetRankingModelVersion

func (m *Meta) GetRankingModelVersion() int64

func (*Meta) GetServers

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

func (*Meta) GetWorkers

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

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) Reset

func (m *Meta) Reset()

func (*Meta) String

func (m *Meta) String() string

func (*Meta) XXX_DiscardUnknown

func (m *Meta) XXX_DiscardUnknown()

func (*Meta) XXX_Marshal

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

func (*Meta) XXX_Merge

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

func (*Meta) XXX_Size

func (m *Meta) XXX_Size() int

func (*Meta) XXX_Unmarshal

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

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*NodeInfo) Descriptor

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

func (*NodeInfo) GetBinaryVersion

func (m *NodeInfo) GetBinaryVersion() string

func (*NodeInfo) GetHttpPort

func (m *NodeInfo) GetHttpPort() int64

func (*NodeInfo) GetNodeName

func (m *NodeInfo) GetNodeName() string

func (*NodeInfo) GetNodeType

func (m *NodeInfo) GetNodeType() NodeType

func (*NodeInfo) ProtoMessage

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) Reset

func (m *NodeInfo) Reset()

func (*NodeInfo) String

func (m *NodeInfo) String() string

func (*NodeInfo) XXX_DiscardUnknown

func (m *NodeInfo) XXX_DiscardUnknown()

func (*NodeInfo) XXX_Marshal

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

func (*NodeInfo) XXX_Merge

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

func (*NodeInfo) XXX_Size

func (m *NodeInfo) XXX_Size() int

func (*NodeInfo) XXX_Unmarshal

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

type NodeType

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

func (NodeType) EnumDescriptor

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

func (NodeType) String

func (x NodeType) String() string

type Progress

type Progress struct {
	Tracer               string   `protobuf:"bytes,1,opt,name=tracer,proto3" json:"tracer,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	Error                string   `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
	Count                int64    `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"`
	Total                int64    `protobuf:"varint,6,opt,name=total,proto3" json:"total,omitempty"`
	StartTime            int64    `protobuf:"varint,7,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	FinishTime           int64    `protobuf:"varint,8,opt,name=finish_time,json=finishTime,proto3" json:"finish_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Progress) Descriptor

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

func (*Progress) GetCount

func (m *Progress) GetCount() int64

func (*Progress) GetError

func (m *Progress) GetError() string

func (*Progress) GetFinishTime

func (m *Progress) GetFinishTime() int64

func (*Progress) GetName

func (m *Progress) GetName() string

func (*Progress) GetStartTime

func (m *Progress) GetStartTime() int64

func (*Progress) GetStatus

func (m *Progress) GetStatus() string

func (*Progress) GetTotal

func (m *Progress) GetTotal() int64

func (*Progress) GetTracer

func (m *Progress) GetTracer() string

func (*Progress) ProtoMessage

func (*Progress) ProtoMessage()

func (*Progress) Reset

func (m *Progress) Reset()

func (*Progress) String

func (m *Progress) String() string

func (*Progress) XXX_DiscardUnknown

func (m *Progress) XXX_DiscardUnknown()

func (*Progress) XXX_Marshal

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

func (*Progress) XXX_Merge

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

func (*Progress) XXX_Size

func (m *Progress) XXX_Size() int

func (*Progress) XXX_Unmarshal

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

type PushProgressRequest

type PushProgressRequest struct {
	Progress             []*Progress `protobuf:"bytes,1,rep,name=progress,proto3" json:"progress,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func EncodeProgress

func EncodeProgress(progressList []progress.Progress) *PushProgressRequest

func (*PushProgressRequest) Descriptor

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

func (*PushProgressRequest) GetProgress

func (m *PushProgressRequest) GetProgress() []*Progress

func (*PushProgressRequest) ProtoMessage

func (*PushProgressRequest) ProtoMessage()

func (*PushProgressRequest) Reset

func (m *PushProgressRequest) Reset()

func (*PushProgressRequest) String

func (m *PushProgressRequest) String() string

func (*PushProgressRequest) XXX_DiscardUnknown

func (m *PushProgressRequest) XXX_DiscardUnknown()

func (*PushProgressRequest) XXX_Marshal

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

func (*PushProgressRequest) XXX_Merge

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

func (*PushProgressRequest) XXX_Size

func (m *PushProgressRequest) XXX_Size() int

func (*PushProgressRequest) XXX_Unmarshal

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

type PushProgressResponse

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

func (*PushProgressResponse) Descriptor

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

func (*PushProgressResponse) ProtoMessage

func (*PushProgressResponse) ProtoMessage()

func (*PushProgressResponse) Reset

func (m *PushProgressResponse) Reset()

func (*PushProgressResponse) String

func (m *PushProgressResponse) String() string

func (*PushProgressResponse) XXX_DiscardUnknown

func (m *PushProgressResponse) XXX_DiscardUnknown()

func (*PushProgressResponse) XXX_Marshal

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

func (*PushProgressResponse) XXX_Merge

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

func (*PushProgressResponse) XXX_Size

func (m *PushProgressResponse) XXX_Size() int

func (*PushProgressResponse) XXX_Unmarshal

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

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) PushProgress

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*VersionInfo) Descriptor

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

func (*VersionInfo) GetVersion

func (m *VersionInfo) GetVersion() int64

func (*VersionInfo) ProtoMessage

func (*VersionInfo) ProtoMessage()

func (*VersionInfo) Reset

func (m *VersionInfo) Reset()

func (*VersionInfo) String

func (m *VersionInfo) String() string

func (*VersionInfo) XXX_DiscardUnknown

func (m *VersionInfo) XXX_DiscardUnknown()

func (*VersionInfo) XXX_Marshal

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

func (*VersionInfo) XXX_Merge

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

func (*VersionInfo) XXX_Size

func (m *VersionInfo) XXX_Size() int

func (*VersionInfo) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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