Documentation ¶
Overview ¶
Package helpers contains a few utility classes to handle topo.Server objects, and transitions from one topo implementation to another.
Index ¶
- func CopyKeyspaces(ctx context.Context, fromTS, toTS *topo.Server)
- func CopyShardReplications(ctx context.Context, fromTS, toTS *topo.Server)
- func CopyShards(ctx context.Context, fromTS, toTS *topo.Server)
- func CopyTablets(ctx context.Context, fromTS, toTS *topo.Server)
- func NewTee(primary, secondary *topo.Server, reverseLockOrder bool) (*topo.Server, error)
- type TeeConn
- func (c *TeeConn) Close()
- func (c *TeeConn) Create(ctx context.Context, filePath string, contents []byte) (topo.Version, error)
- func (c *TeeConn) Delete(ctx context.Context, filePath string, version topo.Version) error
- func (c *TeeConn) Get(ctx context.Context, filePath string) ([]byte, topo.Version, error)
- func (c *TeeConn) ListDir(ctx context.Context, dirPath string, full bool) ([]topo.DirEntry, error)
- func (c *TeeConn) Lock(ctx context.Context, dirPath, contents string) (topo.LockDescriptor, error)
- func (c *TeeConn) NewMasterParticipation(name, id string) (topo.MasterParticipation, error)
- func (c *TeeConn) Update(ctx context.Context, filePath string, contents []byte, version topo.Version) (topo.Version, error)
- func (c *TeeConn) Watch(ctx context.Context, filePath string) (*topo.WatchData, <-chan *topo.WatchData, topo.CancelFunc)
- type TeeFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyKeyspaces ¶
CopyKeyspaces will create the keyspaces in the destination topo.
func CopyShardReplications ¶
CopyShardReplications will create the ShardReplication objects in the destination topo.
func CopyShards ¶
CopyShards will create the shards in the destination topo.
func CopyTablets ¶
CopyTablets will create the tablets in the destination topo.
Types ¶
type TeeConn ¶
type TeeConn struct {
// contains filtered or unexported fields
}
TeeConn implements the topo.Conn interface.
func (*TeeConn) Create ¶
func (c *TeeConn) Create(ctx context.Context, filePath string, contents []byte) (topo.Version, error)
Create is part of the topo.Conn interface.
func (*TeeConn) NewMasterParticipation ¶
func (c *TeeConn) NewMasterParticipation(name, id string) (topo.MasterParticipation, error)
NewMasterParticipation is part of the topo.Conn interface.
type TeeFactory ¶
type TeeFactory struct {
// contains filtered or unexported fields
}
TeeFactory is an implementation of topo.Factory that uses a primary underlying topo.Server for all changes, but also duplicates the changes to a secondary topo.Server. It also locks both topo servers when needed. It is meant to be used during transitions from one topo.Server to another.
- primary: we read everything from it, and write to it. We also create MasterParticipation from it.
- secondary: we write to it as well, but we usually don't fail.
- we lock primary/secondary if reverseLockOrder is False,
or secondary/primary if reverseLockOrder is True.
func (*TeeFactory) Create ¶
func (f *TeeFactory) Create(cell, serverAddr, root string) (topo.Conn, error)
Create is part of the topo.Factory interface.
func (*TeeFactory) HasGlobalReadOnlyCell ¶
func (f *TeeFactory) HasGlobalReadOnlyCell(serverAddr, root string) bool
HasGlobalReadOnlyCell is part of the topo.Factory interface.