Documentation ¶
Overview ¶
Package mirror provides a range assignment mirror, which can maintain a map of all range assignments via the streaming Node.Ranges endpoint provided by the rangelet. This is useful for proxies and clients wishing to forward requests to the relevant node(s).
Note that this interface is eventually consistent, in that the orchestrator doesn't wait for clients to ack changes to the keyspace or anything like it. This interface doesn't even care what the orchestrator or even keyspace say; it simply reports what placements nodes report when probed or in response to actuations. The clients' mirror will thus always be a bit out of date.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoSuchClientConn = errors.New("no such connection")
Functions ¶
This section is empty.
Types ¶
type Mirror ¶
type Mirror struct {
// contains filtered or unexported fields
}
func New ¶
func New(disc discovery.Discoverer) *Mirror
func (*Mirror) Conn ¶
Conn returns a connection to the given node ID. This is just a convenience for callers; the mirror needs to have a connection to every node in order to receive their range assignments, so callers may wish to reuse it to exchange other RPCs rather than creating a new one.
Note that because the connection is owned by the Mirror, may be closed while the user is trying to use it. If that isn't acceptable, callers should manage their own connections.