Documentation ¶
Index ¶
- type Mpc
- type P2P
- type PredictHandler
- type Rpc
- type RpcClient
- func (rc *RpcClient) StepPredict(req *pb.PredictRequest, peerName string) (*pb.PredictResponse, error)
- func (rc *RpcClient) StepPredictWithRetry(req *pb.PredictRequest, peerName string, times int, inteSec int64) (*pb.PredictResponse, error)
- func (rc *RpcClient) StepTrain(req *pb.TrainRequest, peerName string) (*pb.TrainResponse, error)
- func (rc *RpcClient) StepTrainWithRetry(req *pb.TrainRequest, peerName string, times int, inteSec int64) (*pb.TrainResponse, error)
- type Service
- type TrainHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mpc ¶
type Mpc interface { Predict(*pb.PredictRequest) (*pb.PredictResponse, error) Train(*pb.TrainRequest) (*pb.TrainResponse, error) }
Mpc is used to handle requests for training and prediction
type P2P ¶
P2P is used to get rpc connection to remote cluster nodes, remember to call FreePeer() when rpc requests finish
type PredictHandler ¶
type PredictHandler interface { StepPredict(req *pb.PredictRequest, peerName string) (*pb.PredictResponse, error) // StepPredictWithRetry sends prediction message to remote mpc-node // retries 2 times at most // inteSec indicates the interval between retry requests, in seconds StepPredictWithRetry(req *pb.PredictRequest, peerName string, times int, inteSec int64) (*pb.PredictResponse, error) }
type Rpc ¶
type Rpc interface { PredictHandler TrainHandler }
Rpc performs remote procedure calls to remote cluster nodes.
PredictHandler could be called during prediction TrainHandler could be called during training
type RpcClient ¶
type RpcClient struct {
// contains filtered or unexported fields
}
RpcClient implements Rpc interface,
performs remote procedure calls to remote cluster nodes.
func (*RpcClient) StepPredict ¶
func (rc *RpcClient) StepPredict(req *pb.PredictRequest, peerName string) (*pb.PredictResponse, error)
func (*RpcClient) StepPredictWithRetry ¶
func (rc *RpcClient) StepPredictWithRetry(req *pb.PredictRequest, peerName string, times int, inteSec int64) (*pb.PredictResponse, error)
StepPredictWithRetry sends prediction message to remote mpc-node retries 2 times at most inteSec indicates the interval between retry requests, in seconds
func (*RpcClient) StepTrain ¶
func (rc *RpcClient) StepTrain(req *pb.TrainRequest, peerName string) (*pb.TrainResponse, error)
func (*RpcClient) StepTrainWithRetry ¶
func (rc *RpcClient) StepTrainWithRetry(req *pb.TrainRequest, peerName string, times int, inteSec int64) (*pb.TrainResponse, error)
StepTrainWithRetry sends training message to remote mpc-node retries 2 times at most inteSec indicates the interval between retry requests, in seconds
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is implementation for mpc.Cluster
func (*Service) RegisterClusterServer ¶
RegisterClusterServer to register mpc.cluster.Service to grpcServer
func (*Service) Step ¶
func (s *Service) Step(ctx context.Context, in *pb.StepRequest) (resp *pb.StepResponse, err error)
Step @implementation mpc.Cluster.Step
type TrainHandler ¶
type TrainHandler interface { StepTrain(req *pb.TrainRequest, peerName string) (*pb.TrainResponse, error) // StepTrainWithRetry sends training message to remote mpc-node // retries 2 times at most // inteSec indicates the interval between retry requests, in seconds StepTrainWithRetry(req *pb.TrainRequest, peerName string, times int, inteSec int64) (*pb.TrainResponse, error) }