Documentation ¶
Index ¶
- type EPaxosClient
- type EPaxosServer
- func (ps *EPaxosServer) DeliverMessage(stream transpb.EPaxosTransport_DeliverMessageServer) error
- func (ps *EPaxosServer) Msgs() <-chan *epaxospb.Message
- func (ps *EPaxosServer) Read(ctx context.Context, req *transpb.KVReadRequest) (*transpb.KVResult, error)
- func (ps *EPaxosServer) Requests() <-chan Request
- func (ps *EPaxosServer) Serve() error
- func (ps *EPaxosServer) Stop()
- func (ps *EPaxosServer) Write(ctx context.Context, req *transpb.KVWriteRequest) (*transpb.KVResult, error)
- type ExternalClient
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EPaxosClient ¶
type EPaxosClient struct { transpb.EPaxosTransportClient *grpc.ClientConn }
EPaxosClient is a client stub implementing the EPaxosTransportClient interface.
func NewEPaxosClient ¶
func NewEPaxosClient(addr string) (*EPaxosClient, error)
NewEPaxosClient creates a new EPaxosClient.
type EPaxosServer ¶
type EPaxosServer struct {
// contains filtered or unexported fields
}
EPaxosServer handles internal and external RPC messages for an EPaxos node.
func NewEPaxosServer ¶
func NewEPaxosServer(port int) (*EPaxosServer, error)
NewEPaxosServer creates a new EPaxosServer.
func (*EPaxosServer) DeliverMessage ¶
func (ps *EPaxosServer) DeliverMessage( stream transpb.EPaxosTransport_DeliverMessageServer, ) error
DeliverMessage implements the PaxosTransportServer interface. It receives each message from the client stream and passes it to the server's message channel.
func (*EPaxosServer) Msgs ¶
func (ps *EPaxosServer) Msgs() <-chan *epaxospb.Message
Msgs returns the channel that all Paxos messages will be delivered from the server on.
func (*EPaxosServer) Read ¶
func (ps *EPaxosServer) Read( ctx context.Context, req *transpb.KVReadRequest, ) (*transpb.KVResult, error)
Read implements the KVServiceServer interface. It receives the KVReadRequest from the client and passes it as a Request on the server's update channel. The method will block until the update is globally ordered.
func (*EPaxosServer) Requests ¶
func (ps *EPaxosServer) Requests() <-chan Request
Requests returns the channel that all client requests will be delivered from the server on.
func (*EPaxosServer) Serve ¶
func (ps *EPaxosServer) Serve() error
Serve begins serving on server, blocking until Stop is called or an error is observed.
func (*EPaxosServer) Write ¶
func (ps *EPaxosServer) Write( ctx context.Context, req *transpb.KVWriteRequest, ) (*transpb.KVResult, error)
Write implements the KVServiceServer interface. It receives the KVWriteRequest from the client and passes it as a Request on the server's update channel. The method will block until the update is globally ordered and applied.
type ExternalClient ¶
type ExternalClient struct { transpb.KVServiceClient *grpc.ClientConn }
ExternalClient is a client stub implementing the KVServiceClient interface.
func NewExternalClient ¶
func NewExternalClient(addr string) (*ExternalClient, error)
NewExternalClient creates a new PaxosClient.
Directories ¶
Path | Synopsis |
---|---|
Package transportpb is a generated protocol buffer package.
|
Package transportpb is a generated protocol buffer package. |