Documentation
¶
Index ¶
- func DoMarshalerRequestSync(fbc *AsyncReqFlatBinaryConn, requestID uint64, req Marshaler, ...) (msgRep *messaging.Msg, err error)
- func ValidateResponse(msgRep *messaging.Msg, hed *Header, requestID uint64) (data []byte, isFailType bool, err error)
- type Client
- func NewClient(conn net.Conn, msgRecvTimeout, msgInnerTimeout, requestTimeoutMs time.Duration, ...) (self *Client)
- func NewClientAddr(netName, commandAddr, queryAddr string, ...) (self *Client, err error)
- func NewConnectClientDefaultStart(commandAddr, queryAddr string, rcvBufferSz uint64) (self *Client, err error)
- func (self *Client) Close() (err error)
- func (self *Client) CreateIterator(handle IteratorQueryHandle)
- func (self *Client) Delete(handle DeleteCommandHandle)
- func (self *Client) DoMarshalerRequestSync(fbc *AsyncReqFlatBinaryConn, req Marshaler, messageType uint64, ...) (requestID uint64, msgRep *messaging.Msg, err error)
- func (self *Client) Echo(handle CommandHandle)
- func (self *Client) Get(handle GetQueryHandle)
- func (self *Client) GetSettings(handle SettingsQueryHandle)
- func (self *Client) Iterate(handle IteratorQueryHandle)
- func (self *Client) IterateBase(handle IteratorQueryHandle, messageType uint64)
- func (self *Client) ModifyIterator(handle IteratorQueryHandle)
- func (self *Client) Pipelined(handle PipelineCommandHandle)
- func (self *Client) Put(handle PutCommandHandle)
- func (self *Client) Start() (err error)
- func (self *Client) WriteBatch(handle WriteCommandHandle) WriteBatch
- func (self *Client) WriteWriteBatch(batch WriteBatch) (err error)
- type ClientStore
- type IteratorHandler
- type PlainServer
- func (self *PlainServer) Close() (err error)
- func (self *PlainServer) DefaultFlatBinaryServer() *DefaultFlatBinaryServer
- func (self *PlainServer) OnConnectionError(err error)
- func (self *PlainServer) SendMsgResponse(fbc *FlatBinaryConn, chksumHash hash.Hash64, hed Header, rep Marshaler, ...) (err error)
- func (self *PlainServer) SendRep(fbc *FlatBinaryConn, hed *Header, rep Marshaler, chksumHash hash.Hash64) (err error)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoMarshalerRequestSync ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an asynchronous client using the flatbinary protocol to request iterator data at its target/server.
func NewClient ¶
func NewClient( conn net.Conn, msgRecvTimeout, msgInnerTimeout, requestTimeoutMs time.Duration, rcvBufferSz uint64, tryReconnectMax time.Duration) (self *Client)
NewClient allocates a new Client with the given data.
func NewClientAddr ¶
func NewClientAddr( netName, commandAddr, queryAddr string, msgRecvTimeout, msgInnerTimeout, requestTimeoutMs time.Duration, rcvBufferSz uint64, tryReconnectMax time.Duration) (self *Client, err error)
NewClientAddr allocates a new Client with the given data, initializes it. two connections are established if commandAddr != queryAddr otherwise a single connection is used.
func NewConnectClientDefaultStart ¶
func NewConnectClientDefaultStart(commandAddr, queryAddr string, rcvBufferSz uint64) (self *Client, err error)
NewConnectClientDefaultStart allocates a new Client with the given data, initializes and starts it.
func (*Client) CreateIterator ¶
func (self *Client) CreateIterator(handle IteratorQueryHandle)
CreateIterator creates a new iterator for the handle.
func (*Client) DoMarshalerRequestSync ¶
func (*Client) GetSettings ¶
func (self *Client) GetSettings(handle SettingsQueryHandle)
GetSettings currently returns the settings of the command store.
func (*Client) IterateBase ¶
func (*Client) ModifyIterator ¶
func (self *Client) ModifyIterator(handle IteratorQueryHandle)
ModifyIterator modifies the handle iterator if necessary. Not implemented here
func (*Client) Pipelined ¶
func (self *Client) Pipelined(handle PipelineCommandHandle)
Pipelined currently only for command and not for queries.
func (*Client) WriteBatch ¶
func (self *Client) WriteBatch(handle WriteCommandHandle) WriteBatch
WriteBatch returns allocates and returns a new WriteBatch according to the settings given with the handle.
func (*Client) WriteWriteBatch ¶
type ClientStore ¶
type ClientStore struct { Client store.KVStoreToDirectHandle }
func NewClientStoreInit ¶
func NewClientStoreInit(client *Client) (self *ClientStore, err error)
func NewClientStoreInitDefaultStart ¶
func NewClientStoreInitDefaultStart(commandAddr, queryAddr string, rcvBufferSz uint64) (self *ClientStore, err error)
func (*ClientStore) Close ¶
func (self *ClientStore) Close() (err error)
func (*ClientStore) ColumnFamilyHandleByName ¶
func (self *ClientStore) ColumnFamilyHandleByName(cfName string) (cf CFHandle, index int)
ColumnFamilyHandleByName returns a column family handle by name and index, or nil if not exists.
func (*ClientStore) ColumnFamilyHandles ¶
func (self *ClientStore) ColumnFamilyHandles() (cfs []CFHandle)
ColumnFamilyHandles returns all column family handles.
func (*ClientStore) SetupSettings ¶
func (self *ClientStore) SetupSettings() (err error)
type IteratorHandler ¶
type IteratorHandler struct {
// contains filtered or unexported fields
}
func IteratorHandlerNew ¶
func IteratorHandlerNew(provider DirectIteratorQueryStore) (self *IteratorHandler)
func (*IteratorHandler) Close ¶
func (self *IteratorHandler) Close() (err error)
func (*IteratorHandler) OnIteratorRequest ¶
func (self *IteratorHandler) OnIteratorRequest(handle IteratorQueryHandle) (data []byte)
OnIteratorRequest handles an IteratorQueryHandle which is the result of a request.
func (*IteratorHandler) Start ¶
func (self *IteratorHandler) Start() (err error)
type PlainServer ¶
type PlainServer struct {
// contains filtered or unexported fields
}
PlainServer implements a DefaultFlatBinaryPlainServer to be used for iterator requests
func CreatePlainServer ¶
func CreatePlainServer(fbs DefaultFlatBinaryServer, fnOnConnectionError func(err error)) (self PlainServer)
CreatePlainServer returns a PlainServer.
func (*PlainServer) Close ¶
func (self *PlainServer) Close() (err error)
Close closes the underlying listener and handler.
func (*PlainServer) DefaultFlatBinaryServer ¶
func (self *PlainServer) DefaultFlatBinaryServer() *DefaultFlatBinaryServer
DefaultFlatBinaryServer returns the underlying DefaultFlatBinaryServer
func (*PlainServer) OnConnectionError ¶
func (self *PlainServer) OnConnectionError(err error)
OnConnectionError is called when a connection has an error.
func (*PlainServer) SendMsgResponse ¶
func (self *PlainServer) SendMsgResponse(fbc *FlatBinaryConn, chksumHash hash.Hash64, hed Header, rep Marshaler, cerr error, errs []*DefaultError) (err error)
SendMsgResponse is the standard method to send a response. if cerr is nil and len(errs) == 0 MsgType_DefaultSuccess is sent else MsgType_DefaultFail.
type Server ¶
type Server struct { PlainServer // contains filtered or unexported fields }
Server implements a DefaultFlatBinaryServer to be used for KV requests.
func NewServer ¶
func NewServer(lis net.Listener, sc DirectKVRequestStore, writable bool, fnOnError func(err error), fnOnConnectionError func(err error), maxMsgSz, rcvBufSz uint32, ) (self *Server)
NewServerAddr allocates a Server object with the given data.
func NewServerAddr ¶
func NewServerAddr(netName string, addr *string, sc DirectKVRequestStore, writable bool, fnOnError func(err error), fnOnConnectionError func(err error), maxMsgSz, rcvBufSz uint32, ) (self *Server, err error)
NewServerAddr allocates and initializes a Server object with the given data. Afterwards Run or Start must be called.