Documentation ¶
Index ¶
- Variables
- func Application(addr string, stats int, timeout int, maxvbs int, config c.Config, ...)
- func ProtobufVersion() byte
- type Average
- type Client
- type ConnectionError
- type RouterEndpoint
- func (endpoint *RouterEndpoint) Close() error
- func (endpoint *RouterEndpoint) GetStatistics() map[string]interface{}
- func (endpoint *RouterEndpoint) Ping() bool
- func (endpoint *RouterEndpoint) ResetConfig(config c.Config) error
- func (endpoint *RouterEndpoint) Send(data interface{}) error
- func (endpoint *RouterEndpoint) WaitForExit() error
- type Server
Constants ¶
This section is empty.
Variables ¶
var ErrorClientEmptyKeys = errors.New("dataport.clientEmptyKeys")
ErrorClientEmptyKeys
var ErrorDaemonExit = errors.New("dataport.daemonExit")
ErrorDaemonExit
var ErrorDuplicateClient = errors.New("dataport.duplicateClient")
ErrorDuplicateClient
var ErrorDuplicateStreamBegin = errors.New("dataport.duplicateStreamBegin")
ErrorDuplicateStreamBegin
var ErrorMissingPayload = errors.New("dataport.missingPlayload")
ErrorMissingPayload
var ErrorMissingStreamBegin = errors.New("dataport.missingStreamBegin")
ErrorMissingStreamBegin
var ErrorPayload = errors.New("dataport.daemonPayload")
ErrorPayload
var ErrorTransportVersion = errors.New("dataport.transportVersion")
ErrorTransportVersion
var ErrorWorkerKilled = errors.New("dataport.workerKilled")
ErrorWorkerKilled
Functions ¶
func Application ¶
func Application( addr string, stats int, timeout int, maxvbs int, config c.Config, callb func(string, interface{}) bool, )
Application starts a new dataport application to receive mutations from the other end. Optionally it can print statistics and do callback for every mutation received.
func ProtobufVersion ¶
func ProtobufVersion() byte
ProtobufVersion return version of protobuf schema used in packet transport.
Types ¶
type Average ¶
type Average struct {
// contains filtered or unexported fields
}
Average maintains the average and variance of a stream of numbers in a space-efficient manner.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an active client for each remote host, and there can be multiple connections opened with remote host for the same endpoint.
func NewClient ¶
func NewClient( cluster, topic, raddr string, flags transport.TransportFlag, maxvbs int, config common.Config) (c *Client, err error)
NewClient returns a pool of connection. Multiple connections, based on parameter `n`, can be used to speed up mutation transport across network. A vbucket is always binded to a connection and ensure that mutations within a vbucket are serialized.
func (*Client) Close ¶
Close client and all its active connection with downstream. asynchronous call.
func (*Client) Getcontext ¶
Getcontext from dataport client, synchronous call.
func (*Client) SendKeyVersions ¶
func (c *Client) SendKeyVersions(vbs []*common.VbKeyVersions, block bool) error
SendKeyVersions for one or more vbuckets to the other end, asynchronous call.
type ConnectionError ¶
ConnectionError to application
func NewConnectionError ¶
func NewConnectionError() ConnectionError
NewConnectionError makes a new connection-error map.
func (ConnectionError) Append ¶
func (ce ConnectionError) Append(hostUuids keeper, raddr string) keeper
Append {buckets,vbuckets} for connection error.
type RouterEndpoint ¶
type RouterEndpoint struct {
// contains filtered or unexported fields
}
RouterEndpoint structure, per topic, to gather key-versions / mutations from one or more vbuckets and push them downstream to a specific node.
func NewRouterEndpoint ¶
func NewRouterEndpoint( cluster, topic, raddr string, maxvbs int, config c.Config) (*RouterEndpoint, error)
NewRouterEndpoint instantiate a new RouterEndpoint routine and return its reference.
func (*RouterEndpoint) GetStatistics ¶
func (endpoint *RouterEndpoint) GetStatistics() map[string]interface{}
GetStatistics for this endpoint, synchronous call.
func (*RouterEndpoint) Ping ¶
func (endpoint *RouterEndpoint) Ping() bool
Ping whether endpoint is active, synchronous call.
func (*RouterEndpoint) ResetConfig ¶
func (endpoint *RouterEndpoint) ResetConfig(config c.Config) error
ResetConfig synchronous call.
func (*RouterEndpoint) Send ¶
func (endpoint *RouterEndpoint) Send(data interface{}) error
Send KeyVersions to other end, asynchronous call. Asynchronous call. Return ErrorChannelFull that can be used by caller.
func (*RouterEndpoint) WaitForExit ¶
func (endpoint *RouterEndpoint) WaitForExit() error
WaitForExit will block until endpoint exits.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server handles an active dataport server of mutation for all vbuckets.