Documentation ¶
Index ¶
- func GetHostRequestAddr() string
- func GetHostTCPAddr() string
- func GetHostUDPAddr() string
- func GetPeerTCPAddr() []string
- func GetPeerUDPAddr() []string
- func NewClientRequest(req *Request, reply **Reply) error
- func NewEnv(config string) (err error)
- func RunOnce() int
- func RunServer(config string) error
- type Config
- type EmbeddedServer
- func RunEmbeddedServer(msgAddr string) (*EmbeddedServer, error)
- func RunEmbeddedServerWithCustomHandler(msgAddr string, notifier action.EventNotifier, ...) (*EmbeddedServer, error)
- func RunEmbeddedServerWithCustomHandler2(msgAddr string, notifier action.EventNotifier, ...) (*EmbeddedServer, error)
- func RunEmbeddedServerWithCustomHandler3(msgAddr string, notifier action.EventNotifier, ...) (*EmbeddedServer, error)
- func RunEmbeddedServerWithNotifier(msgAddr string, notifier action.EventNotifier) (*EmbeddedServer, error)
- func (s *EmbeddedServer) Broadcast(key string, value []byte) error
- func (s *EmbeddedServer) Delete(key string) error
- func (s *EmbeddedServer) DeleteConfigValue(key string) error
- func (s *EmbeddedServer) DeleteValue(key string)
- func (s *EmbeddedServer) GetConfigValue(key string) (string, error)
- func (s *EmbeddedServer) GetEnsembleSize() uint64
- func (s *EmbeddedServer) GetFollowerId() string
- func (s *EmbeddedServer) GetIterator(startKey, endKey string) (*r.RepoIterator, error)
- func (s *EmbeddedServer) GetServerConfigIterator(startKey, endKey string) (*r.RepoIterator, error)
- func (s *EmbeddedServer) GetStatus() protocol.PeerStatus
- func (s *EmbeddedServer) GetValue(key string) ([]byte, error)
- func (s *EmbeddedServer) HasQuorum(count int) bool
- func (s *EmbeddedServer) IsActive() bool
- func (s *EmbeddedServer) IsDone() bool
- func (s *EmbeddedServer) MakeAsyncRequest(op common.OpCode, key string, value []byte) error
- func (s *EmbeddedServer) MakeRequest(op common.OpCode, key string, value []byte) error
- func (s *EmbeddedServer) ResetConnections() error
- func (s *EmbeddedServer) Set(key string, value []byte) error
- func (s *EmbeddedServer) SetConfigValue(key string, value string) error
- func (s *EmbeddedServer) SetValue(key string, value []byte)
- func (s *EmbeddedServer) Terminate()
- func (s *EmbeddedServer) UpdateStateOnCommit(txnid common.Txnid, key string)
- func (s *EmbeddedServer) UpdateStateOnNewProposal(proposal protocol.ProposalMsg)
- func (s *EmbeddedServer) UpdateStateOnRespond(fid string, reqId uint64, err string, content []byte)
- func (s *EmbeddedServer) UpdateWinningEpoch(epoch uint32)
- type Env
- type Node
- type Reply
- type Request
- type RequestListener
- type RequestReceiver
- type Server
- func (s *Server) GetEnsembleSize() uint64
- func (s *Server) GetFollowerId() string
- func (s *Server) GetHostTCPAddr() string
- func (s *Server) GetPeerUDPAddr() []string
- func (s *Server) GetStatus() protocol.PeerStatus
- func (s *Server) GetValue(key string) ([]byte, error)
- func (s *Server) HasQuorum(count int) bool
- func (s *Server) IsDone() bool
- func (s *Server) Terminate()
- func (s *Server) UpdateStateOnCommit(txnid common.Txnid, key string)
- func (s *Server) UpdateStateOnNewProposal(proposal protocol.ProposalMsg)
- func (s *Server) UpdateStateOnRespond(fid string, reqId uint64, err string, content []byte)
- func (s *Server) UpdateWinningEpoch(epoch uint32)
- type ServerState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHostRequestAddr ¶
func GetHostRequestAddr() string
func GetHostTCPAddr ¶
func GetHostTCPAddr() string
func GetHostUDPAddr ¶
func GetHostUDPAddr() string
func GetPeerTCPAddr ¶
func GetPeerTCPAddr() []string
func GetPeerUDPAddr ¶
func GetPeerUDPAddr() []string
func NewClientRequest ¶
This is the API for client that is co-located withe gometa server in the same process.
Types ¶
type EmbeddedServer ¶
type EmbeddedServer struct {
// contains filtered or unexported fields
}
func RunEmbeddedServer ¶
func RunEmbeddedServer(msgAddr string) (*EmbeddedServer, error)
func RunEmbeddedServerWithCustomHandler ¶
func RunEmbeddedServerWithCustomHandler(msgAddr string, notifier action.EventNotifier, reqHandler protocol.CustomRequestHandler, repoName string, memory_quota uint64) (*EmbeddedServer, error)
func RunEmbeddedServerWithCustomHandler2 ¶
func RunEmbeddedServerWithCustomHandler2(msgAddr string, notifier action.EventNotifier, reqHandler protocol.CustomRequestHandler, repoName string, memory_quota uint64, sleepDur uint64, threshold uint8, minFileSize uint64) (*EmbeddedServer, error)
func RunEmbeddedServerWithCustomHandler3 ¶
func RunEmbeddedServerWithCustomHandler3(msgAddr string, notifier action.EventNotifier, reqHandler protocol.CustomRequestHandler, repoName string, memory_quota uint64, sleepDur uint64, threshold uint8, minFileSize uint64, authfn common.ServerAuthFunction) (*EmbeddedServer, error)
func RunEmbeddedServerWithNotifier ¶
func RunEmbeddedServerWithNotifier(msgAddr string, notifier action.EventNotifier) (*EmbeddedServer, error)
func (*EmbeddedServer) Broadcast ¶
func (s *EmbeddedServer) Broadcast(key string, value []byte) error
Broadcast value
func (*EmbeddedServer) DeleteConfigValue ¶
func (s *EmbeddedServer) DeleteConfigValue(key string) error
func (*EmbeddedServer) GetConfigValue ¶
func (s *EmbeddedServer) GetConfigValue(key string) (string, error)
func (*EmbeddedServer) GetEnsembleSize ¶
func (s *EmbeddedServer) GetEnsembleSize() uint64
func (*EmbeddedServer) GetFollowerId ¶
func (s *EmbeddedServer) GetFollowerId() string
func (*EmbeddedServer) GetIterator ¶
func (s *EmbeddedServer) GetIterator(startKey, endKey string) (*r.RepoIterator, error)
Create a new iterator
func (*EmbeddedServer) GetServerConfigIterator ¶
func (s *EmbeddedServer) GetServerConfigIterator(startKey, endKey string) (*r.RepoIterator, error)
func (*EmbeddedServer) GetStatus ¶
func (s *EmbeddedServer) GetStatus() protocol.PeerStatus
func (*EmbeddedServer) GetValue ¶
func (s *EmbeddedServer) GetValue(key string) ([]byte, error)
Retrieve value
func (*EmbeddedServer) HasQuorum ¶
func (s *EmbeddedServer) HasQuorum(count int) bool
func (*EmbeddedServer) IsActive ¶
func (s *EmbeddedServer) IsActive() bool
Check if server is active
func (*EmbeddedServer) IsDone ¶
func (s *EmbeddedServer) IsDone() bool
Check if server is terminated
func (*EmbeddedServer) MakeAsyncRequest ¶
func (*EmbeddedServer) MakeRequest ¶
Set value
func (*EmbeddedServer) ResetConnections ¶
func (s *EmbeddedServer) ResetConnections() error
Reset Connections
func (*EmbeddedServer) SetConfigValue ¶
func (s *EmbeddedServer) SetConfigValue(key string, value string) error
func (*EmbeddedServer) SetValue ¶
func (s *EmbeddedServer) SetValue(key string, value []byte)
Set value
func (*EmbeddedServer) UpdateStateOnCommit ¶
func (s *EmbeddedServer) UpdateStateOnCommit(txnid common.Txnid, key string)
Callback when a commit arrives
func (*EmbeddedServer) UpdateStateOnNewProposal ¶
func (s *EmbeddedServer) UpdateStateOnNewProposal(proposal protocol.ProposalMsg)
Callback when a new proposal arrives
func (*EmbeddedServer) UpdateStateOnRespond ¶
func (s *EmbeddedServer) UpdateStateOnRespond(fid string, reqId uint64, err string, content []byte)
func (*EmbeddedServer) UpdateWinningEpoch ¶
func (s *EmbeddedServer) UpdateWinningEpoch(epoch uint32)
type RequestListener ¶
type RequestListener struct {
// contains filtered or unexported fields
}
func StartRequestListener ¶
func StartRequestListener(laddr string, server *Server) (*RequestListener, error)
Start a new RequestListener for listening to new client request. laddr - local network address (host:port)
func (*RequestListener) Close ¶
func (li *RequestListener) Close()
Close the listener. This does not reclaim the exisiting client conection immediately, but it will stop new connection.
type RequestReceiver ¶
type RequestReceiver struct {
// contains filtered or unexported fields
}
func (*RequestReceiver) NewRequest ¶
func (s *RequestReceiver) NewRequest(req *Request, reply **Reply) error
Handle a new incoming request
func (s *RequestReceiver) NewRequest(message []byte, reply *[]byte) error {
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetEnsembleSize ¶
func (*Server) GetFollowerId ¶
func (*Server) GetHostTCPAddr ¶
func (*Server) GetPeerUDPAddr ¶
func (*Server) GetStatus ¶
func (s *Server) GetStatus() protocol.PeerStatus
func (*Server) UpdateStateOnCommit ¶
Callback when a commit arrives
func (*Server) UpdateStateOnNewProposal ¶
func (s *Server) UpdateStateOnNewProposal(proposal protocol.ProposalMsg)
Callback when a new proposal arrives
func (*Server) UpdateStateOnRespond ¶
func (*Server) UpdateWinningEpoch ¶
type ServerState ¶
type ServerState struct {
// contains filtered or unexported fields
}
func (*ServerState) AddPendingRequest ¶
func (s *ServerState) AddPendingRequest(handle *protocol.RequestHandle)
func (*ServerState) CleanupOnError ¶
func (s *ServerState) CleanupOnError()
func (*ServerState) GetRequestChannel ¶
func (s *ServerState) GetRequestChannel() <-chan *protocol.RequestHandle