// Getcontext from dataport client, synchronous call. func (c *Client) Getcontext() ([]interface{}, error) { respch := make(chan []interface{}, 1) cmd := []interface{}{clientCmdGetcontext, respch} resp, err := common.FailsafeOp(c.reqch, respch, cmd, c.finch) if err != nil { return nil, err } return resp, nil }
// Ping whether endpoint is active, synchronous call. func (endpoint *RouterEndpoint) Ping() bool { respch := make(chan []interface{}, 1) cmd := []interface{}{endpCmdPing, respch} resp, err := c.FailsafeOp(endpoint.ch, respch, cmd, endpoint.finch) if err != nil { return false } return resp[0].(bool) }
// GetStatistics for vr vbucket // synchronous call. func (vr *VbucketRoutine) GetStatistics() (map[string]interface{}, error) { respch := make(chan []interface{}, 1) cmd := []interface{}{vrCmdGetStatistics, respch} resp, err := c.FailsafeOp(vr.reqch, respch, cmd, vr.finch) if err != nil { return nil, err } return resp[0].(map[string]interface{}), nil }
// AddEngines update active set of engines and endpoints // synchronous call. func (vr *VbucketRoutine) AddEngines( opaque uint16, engines map[uint64]*Engine, endpoints map[string]c.RouterEndpoint) (uint64, error) { respch := make(chan []interface{}, 1) cmd := []interface{}{vrCmdAddEngines, opaque, engines, endpoints, respch} resp, err := c.FailsafeOp(vr.reqch, respch, cmd, vr.finch) if err = c.OpError(err, resp, 1); err != nil { return 0, err } return resp[0].(uint64), nil }
// AddEngines and endpoints, synchronous call. func (kvdata *KVData) AddEngines( opaque uint16, engines map[uint64]*Engine, endpoints map[string]c.RouterEndpoint) (map[uint16]uint64, error) { // copy them to local map and then pass down the reference. eps := make(map[string]c.RouterEndpoint) for k, v := range endpoints { eps[k] = v } respch := make(chan []interface{}, 1) cmd := []interface{}{kvCmdAddEngines, opaque, engines, eps, respch} resp, err := c.FailsafeOp(kvdata.sbch, respch, cmd, kvdata.finch) if err = c.OpError(err, resp, 1); err != nil { return nil, err } return resp[0].(map[uint16]uint64), nil }
// Close this endpoint. func (endpoint *RouterEndpoint) Close() error { respch := make(chan []interface{}, 1) cmd := []interface{}{endpCmdClose, respch} resp, err := c.FailsafeOp(endpoint.ch, respch, cmd, endpoint.finch) return c.OpError(err, resp, 0) }
// GetStatistics for this endpoint, synchronous call. func (endpoint *RouterEndpoint) GetStatistics() map[string]interface{} { respch := make(chan []interface{}, 1) cmd := []interface{}{endpCmdGetStatistics, respch} resp, _ := c.FailsafeOp(endpoint.ch, respch, cmd, endpoint.finch) return resp[0].(map[string]interface{}) }
// ResetConfig synchronous call. func (endpoint *RouterEndpoint) ResetConfig(config c.Config) error { respch := make(chan []interface{}, 1) cmd := []interface{}{endpCmdResetConfig, config, respch} _, err := c.FailsafeOp(endpoint.ch, respch, cmd, endpoint.finch) return err }
// Close vbucket-routine, synchronous call. func (vr *VbucketRoutine) Close() error { respch := make(chan []interface{}, 1) cmd := []interface{}{vrCmdClose, respch} _, err := c.FailsafeOp(vr.reqch, respch, cmd, vr.finch) return err }
// UpdateTs with new set of {vbno,seqno}, synchronous call. func (kvdata *KVData) UpdateTs(opaque uint16, ts *protobuf.TsVbuuid) error { respch := make(chan []interface{}, 1) cmd := []interface{}{kvCmdTs, opaque, ts, respch} _, err := c.FailsafeOp(kvdata.sbch, respch, cmd, kvdata.finch) return err }
// DeleteEngines delete engines and update endpoints // synchronous call. func (vr *VbucketRoutine) DeleteEngines(opaque uint16, engines []uint64) error { respch := make(chan []interface{}, 1) cmd := []interface{}{vrCmdDeleteEngines, opaque, engines, respch} _, err := c.FailsafeOp(vr.reqch, respch, cmd, vr.finch) return err }
// Close kvdata kv data path, synchronous call. func (kvdata *KVData) Close() error { respch := make(chan []interface{}, 1) cmd := []interface{}{kvCmdClose, respch} _, err := c.FailsafeOp(kvdata.sbch, respch, cmd, kvdata.finch) return err }
// ReloadHeartbeat for kvdata. func (kvdata *KVData) ReloadHeartbeat() error { respch := make(chan []interface{}, 1) cmd := []interface{}{kvCmdReloadHeartBeat, respch} _, err := c.FailsafeOp(kvdata.sbch, respch, cmd, kvdata.finch) return err }
// ResetConfig for kvdata. func (kvdata *KVData) ResetConfig(config c.Config) error { respch := make(chan []interface{}, 1) cmd := []interface{}{kvCmdResetConfig, config, respch} _, err := c.FailsafeOp(kvdata.sbch, respch, cmd, kvdata.finch) return err }
// GetStatistics from kv data path, synchronous call. func (kvdata *KVData) GetStatistics() map[string]interface{} { respch := make(chan []interface{}, 1) cmd := []interface{}{kvCmdGetStats, respch} resp, _ := c.FailsafeOp(kvdata.sbch, respch, cmd, kvdata.finch) return resp[0].(map[string]interface{}) }
// SendVbmap vbmap for this connection to the other end, // synchronous call. func (c *Client) SendVbmap(vbmap *common.VbConnectionMap) error { respch := make(chan []interface{}, 1) cmd := []interface{}{clientCmdSendVbmap, vbmap, respch} resp, err := common.FailsafeOp(c.reqch, respch, cmd, c.finch) return common.OpError(err, resp, 0) }
// ResetConfig for vbucket-routine. func (vr *VbucketRoutine) ResetConfig(config c.Config) error { respch := make(chan []interface{}, 1) cmd := []interface{}{vrCmdResetConfig, config, respch} _, err := c.FailsafeOp(vr.reqch, respch, cmd, vr.finch) return err }
// DeleteEngines synchronous call. func (kvdata *KVData) DeleteEngines(opaque uint16, engineKeys []uint64) error { respch := make(chan []interface{}, 1) cmd := []interface{}{kvCmdDelEngines, opaque, engineKeys, respch} _, err := c.FailsafeOp(kvdata.sbch, respch, cmd, kvdata.finch) return err }