helpers

package
v2.0.0-alpha3+incompat... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2015 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Overview

Package helpers contains a few utility classes to handle topo.Server objects, and transitions from one topo implementation to another.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyKeyspaces

func CopyKeyspaces(ctx context.Context, fromTS, toTS topo.Impl)

CopyKeyspaces will create the keyspaces in the destination topo

func CopyShardReplications

func CopyShardReplications(ctx context.Context, fromTS, toTS topo.Impl)

CopyShardReplications will create the ShardReplication objects in the destination topo

func CopyShards

func CopyShards(ctx context.Context, fromTS, toTS topo.Impl, deleteKeyspaceShards bool)

CopyShards will create the shards in the destination topo

func CopyTablets

func CopyTablets(ctx context.Context, fromTS, toTS topo.Impl)

CopyTablets will create the tablets in the destination topo

Types

type Tee

type Tee struct {
	// contains filtered or unexported fields
}

Tee is an implementation of topo.Server 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 - 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 NewTee

func NewTee(primary, secondary topo.Impl, reverseLockOrder bool) *Tee

NewTee returns a new topo.Impl object

func (*Tee) Close

func (tee *Tee) Close()

Close is part of the topo.Server interface

func (*Tee) CreateEndPoints

func (tee *Tee) CreateEndPoints(ctx context.Context, cell, keyspace, shard string, tabletType pb.TabletType, addrs *pb.EndPoints) error

CreateEndPoints is part of the topo.Server interface

func (*Tee) CreateKeyspace

func (tee *Tee) CreateKeyspace(ctx context.Context, keyspace string, value *pb.Keyspace) error

CreateKeyspace is part of the topo.Server interface

func (*Tee) CreateShard

func (tee *Tee) CreateShard(ctx context.Context, keyspace, shard string, value *pb.Shard) error

CreateShard is part of the topo.Server interface

func (*Tee) CreateTablet

func (tee *Tee) CreateTablet(ctx context.Context, tablet *pb.Tablet) error

CreateTablet is part of the topo.Server interface

func (*Tee) DeleteEndPoints

func (tee *Tee) DeleteEndPoints(ctx context.Context, cell, keyspace, shard string, tabletType pb.TabletType, existingVersion int64) error

DeleteEndPoints is part of the topo.Server interface

func (*Tee) DeleteKeyspace

func (tee *Tee) DeleteKeyspace(ctx context.Context, keyspace string) error

DeleteKeyspace is part of the topo.Server interface

func (*Tee) DeleteKeyspaceReplication

func (tee *Tee) DeleteKeyspaceReplication(ctx context.Context, cell, keyspace string) error

DeleteKeyspaceReplication is part of the topo.Server interface

func (*Tee) DeleteKeyspaceShards

func (tee *Tee) DeleteKeyspaceShards(ctx context.Context, keyspace string) error

DeleteKeyspaceShards is part of the topo.Server interface

func (*Tee) DeleteShard

func (tee *Tee) DeleteShard(ctx context.Context, keyspace, shard string) error

DeleteShard is part of the topo.Server interface

func (*Tee) DeleteShardReplication

func (tee *Tee) DeleteShardReplication(ctx context.Context, cell, keyspace, shard string) error

DeleteShardReplication is part of the topo.Server interface

func (*Tee) DeleteSrvKeyspace

func (tee *Tee) DeleteSrvKeyspace(ctx context.Context, cell, keyspace string) error

DeleteSrvKeyspace is part of the topo.Server interface

func (*Tee) DeleteSrvShard

func (tee *Tee) DeleteSrvShard(ctx context.Context, cell, keyspace, shard string) error

DeleteSrvShard is part of the topo.Server interface

func (*Tee) DeleteTablet

func (tee *Tee) DeleteTablet(ctx context.Context, alias *pb.TabletAlias) error

DeleteTablet is part of the topo.Server interface

func (*Tee) GetEndPoints

func (tee *Tee) GetEndPoints(ctx context.Context, cell, keyspace, shard string, tabletType pb.TabletType) (*pb.EndPoints, int64, error)

GetEndPoints is part of the topo.Server interface

func (*Tee) GetKeyspace

func (tee *Tee) GetKeyspace(ctx context.Context, keyspace string) (*pb.Keyspace, int64, error)

GetKeyspace is part of the topo.Server interface

func (*Tee) GetKeyspaces

func (tee *Tee) GetKeyspaces(ctx context.Context) ([]string, error)

GetKeyspaces is part of the topo.Server interface

func (*Tee) GetKnownCells

func (tee *Tee) GetKnownCells(ctx context.Context) ([]string, error)

GetKnownCells is part of the topo.Server interface

func (*Tee) GetShard

func (tee *Tee) GetShard(ctx context.Context, keyspace, shard string) (*pb.Shard, int64, error)

GetShard is part of the topo.Server interface

func (*Tee) GetShardNames

func (tee *Tee) GetShardNames(ctx context.Context, keyspace string) ([]string, error)

GetShardNames is part of the topo.Server interface

func (*Tee) GetShardReplication

func (tee *Tee) GetShardReplication(ctx context.Context, cell, keyspace, shard string) (*topo.ShardReplicationInfo, error)

GetShardReplication is part of the topo.Server interface

func (*Tee) GetSrvKeyspace

func (tee *Tee) GetSrvKeyspace(ctx context.Context, cell, keyspace string) (*pb.SrvKeyspace, error)

GetSrvKeyspace is part of the topo.Server interface

func (*Tee) GetSrvKeyspaceNames

func (tee *Tee) GetSrvKeyspaceNames(ctx context.Context, cell string) ([]string, error)

GetSrvKeyspaceNames is part of the topo.Server interface

func (*Tee) GetSrvShard

func (tee *Tee) GetSrvShard(ctx context.Context, cell, keyspace, shard string) (*pb.SrvShard, error)

GetSrvShard is part of the topo.Server interface

func (*Tee) GetSrvTabletTypesPerShard

func (tee *Tee) GetSrvTabletTypesPerShard(ctx context.Context, cell, keyspace, shard string) ([]pb.TabletType, error)

GetSrvTabletTypesPerShard is part of the topo.Server interface

func (*Tee) GetTablet

func (tee *Tee) GetTablet(ctx context.Context, alias *pb.TabletAlias) (*pb.Tablet, int64, error)

GetTablet is part of the topo.Server interface

func (*Tee) GetTabletsByCell

func (tee *Tee) GetTabletsByCell(ctx context.Context, cell string) ([]*pb.TabletAlias, error)

GetTabletsByCell is part of the topo.Server interface

func (*Tee) GetVSchema

func (tee *Tee) GetVSchema(ctx context.Context) (string, error)

GetVSchema is part of the topo.Server interface

func (*Tee) LockKeyspaceForAction

func (tee *Tee) LockKeyspaceForAction(ctx context.Context, keyspace, contents string) (string, error)

LockKeyspaceForAction is part of the topo.Server interface

func (*Tee) LockShardForAction

func (tee *Tee) LockShardForAction(ctx context.Context, keyspace, shard, contents string) (string, error)

LockShardForAction is part of the topo.Server interface

func (*Tee) LockSrvShardForAction

func (tee *Tee) LockSrvShardForAction(ctx context.Context, cell, keyspace, shard, contents string) (string, error)

LockSrvShardForAction is part of the topo.Server interface

func (*Tee) SaveVSchema

func (tee *Tee) SaveVSchema(ctx context.Context, contents string) error

SaveVSchema is part of the topo.Server interface

func (*Tee) UnlockKeyspaceForAction

func (tee *Tee) UnlockKeyspaceForAction(ctx context.Context, keyspace, lockPath, results string) error

UnlockKeyspaceForAction is part of the topo.Server interface

func (*Tee) UnlockShardForAction

func (tee *Tee) UnlockShardForAction(ctx context.Context, keyspace, shard, lockPath, results string) error

UnlockShardForAction is part of the topo.Server interface

func (*Tee) UnlockSrvShardForAction

func (tee *Tee) UnlockSrvShardForAction(ctx context.Context, cell, keyspace, shard, lockPath, results string) error

UnlockSrvShardForAction is part of the topo.Server interface

func (*Tee) UpdateEndPoints

func (tee *Tee) UpdateEndPoints(ctx context.Context, cell, keyspace, shard string, tabletType pb.TabletType, addrs *pb.EndPoints, existingVersion int64) error

UpdateEndPoints is part of the topo.Server interface

func (*Tee) UpdateKeyspace

func (tee *Tee) UpdateKeyspace(ctx context.Context, keyspace string, value *pb.Keyspace, existingVersion int64) (newVersion int64, err error)

UpdateKeyspace is part of the topo.Server interface

func (*Tee) UpdateShard

func (tee *Tee) UpdateShard(ctx context.Context, keyspace, shard string, value *pb.Shard, existingVersion int64) (newVersion int64, err error)

UpdateShard is part of the topo.Server interface

func (*Tee) UpdateShardReplicationFields

func (tee *Tee) UpdateShardReplicationFields(ctx context.Context, cell, keyspace, shard string, update func(*pb.ShardReplication) error) error

UpdateShardReplicationFields is part of the topo.Server interface

func (*Tee) UpdateSrvKeyspace

func (tee *Tee) UpdateSrvKeyspace(ctx context.Context, cell, keyspace string, srvKeyspace *pb.SrvKeyspace) error

UpdateSrvKeyspace is part of the topo.Server interface

func (*Tee) UpdateSrvShard

func (tee *Tee) UpdateSrvShard(ctx context.Context, cell, keyspace, shard string, srvShard *pb.SrvShard) error

UpdateSrvShard is part of the topo.Server interface

func (*Tee) UpdateTablet

func (tee *Tee) UpdateTablet(ctx context.Context, tablet *pb.Tablet, existingVersion int64) (newVersion int64, err error)

UpdateTablet is part of the topo.Server interface

func (*Tee) UpdateTabletFields

func (tee *Tee) UpdateTabletFields(ctx context.Context, tabletAlias *pb.TabletAlias, update func(*pb.Tablet) error) (*pb.Tablet, error)

UpdateTabletFields is part of the topo.Server interface

func (*Tee) ValidateShard

func (tee *Tee) ValidateShard(ctx context.Context, keyspace, shard string) error

ValidateShard is part of the topo.Server interface

func (*Tee) WatchSrvKeyspace

func (tee *Tee) WatchSrvKeyspace(ctx context.Context, cell, keyspace string) (<-chan *pb.SrvKeyspace, chan<- struct{}, error)

WatchSrvKeyspace is part of the topo.Server interface. We only watch for changes on the primary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL