helpers

package
v0.0.0-...-d271c08 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2014 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

helpers package 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(fromTS, toTS topo.Server)

CopyKeyspaces will create the keyspaces in the destination topo

func CopyShardReplications

func CopyShardReplications(fromTS, toTS topo.Server)

CopyShardReplications will create the ShardReplication objects in the destination topo

func CopyShards

func CopyShards(fromTS, toTS topo.Server, deleteKeyspaceShards bool)

CopyShards will create the shards in the destination topo

func CopyTablets

func CopyTablets(fromTS, toTS topo.Server)

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.Server, reverseLockOrder bool) *Tee

func (*Tee) Close

func (tee *Tee) Close()

func (*Tee) CreateKeyspace

func (tee *Tee) CreateKeyspace(keyspace string, value *topo.Keyspace) error

func (*Tee) CreateShard

func (tee *Tee) CreateShard(keyspace, shard string, value *topo.Shard) error

func (*Tee) CreateTablet

func (tee *Tee) CreateTablet(tablet *topo.Tablet) error

func (*Tee) CreateTabletPidNode

func (tee *Tee) CreateTabletPidNode(tabletAlias topo.TabletAlias, contents string, done chan struct{}) error

func (*Tee) DeleteEndPoints

func (tee *Tee) DeleteEndPoints(cell, keyspace, shard string, tabletType topo.TabletType) error

func (*Tee) DeleteKeyspaceShards

func (tee *Tee) DeleteKeyspaceShards(keyspace string) error

func (*Tee) DeleteShard

func (tee *Tee) DeleteShard(keyspace, shard string) error

func (*Tee) DeleteShardReplication

func (tee *Tee) DeleteShardReplication(cell, keyspace, shard string) error

func (*Tee) DeleteSrvShard

func (tee *Tee) DeleteSrvShard(cell, keyspace, shard string) error

func (*Tee) DeleteTablet

func (tee *Tee) DeleteTablet(alias topo.TabletAlias) error

func (*Tee) GetEndPoints

func (tee *Tee) GetEndPoints(cell, keyspace, shard string, tabletType topo.TabletType) (*topo.EndPoints, error)

func (*Tee) GetKeyspace

func (tee *Tee) GetKeyspace(keyspace string) (*topo.KeyspaceInfo, error)

func (*Tee) GetKeyspaces

func (tee *Tee) GetKeyspaces() ([]string, error)

func (*Tee) GetKnownCells

func (tee *Tee) GetKnownCells() ([]string, error)

func (*Tee) GetShard

func (tee *Tee) GetShard(keyspace, shard string) (*topo.ShardInfo, error)

func (*Tee) GetShardNames

func (tee *Tee) GetShardNames(keyspace string) ([]string, error)

func (*Tee) GetShardReplication

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

func (*Tee) GetSrvKeyspace

func (tee *Tee) GetSrvKeyspace(cell, keyspace string) (*topo.SrvKeyspace, error)

func (*Tee) GetSrvKeyspaceNames

func (tee *Tee) GetSrvKeyspaceNames(cell string) ([]string, error)

func (*Tee) GetSrvShard

func (tee *Tee) GetSrvShard(cell, keyspace, shard string) (*topo.SrvShard, error)

func (*Tee) GetSrvTabletTypesPerShard

func (tee *Tee) GetSrvTabletTypesPerShard(cell, keyspace, shard string) ([]topo.TabletType, error)

func (*Tee) GetSubprocessFlags

func (tee *Tee) GetSubprocessFlags() []string

func (*Tee) GetTablet

func (tee *Tee) GetTablet(alias topo.TabletAlias) (*topo.TabletInfo, error)

func (*Tee) GetTabletsByCell

func (tee *Tee) GetTabletsByCell(cell string) ([]topo.TabletAlias, error)

func (*Tee) LockKeyspaceForAction

func (tee *Tee) LockKeyspaceForAction(keyspace, contents string, timeout time.Duration, interrupted chan struct{}) (string, error)

func (*Tee) LockShardForAction

func (tee *Tee) LockShardForAction(keyspace, shard, contents string, timeout time.Duration, interrupted chan struct{}) (string, error)

func (*Tee) LockSrvShardForAction

func (tee *Tee) LockSrvShardForAction(cell, keyspace, shard, contents string, timeout time.Duration, interrupted chan struct{}) (string, error)

func (*Tee) UnlockKeyspaceForAction

func (tee *Tee) UnlockKeyspaceForAction(keyspace, lockPath, results string) error

func (*Tee) UnlockShardForAction

func (tee *Tee) UnlockShardForAction(keyspace, shard, lockPath, results string) error

func (*Tee) UnlockSrvShardForAction

func (tee *Tee) UnlockSrvShardForAction(cell, keyspace, shard, lockPath, results string) error

func (*Tee) UpdateEndPoints

func (tee *Tee) UpdateEndPoints(cell, keyspace, shard string, tabletType topo.TabletType, addrs *topo.EndPoints) error

func (*Tee) UpdateKeyspace

func (tee *Tee) UpdateKeyspace(ki *topo.KeyspaceInfo, existingVersion int64) (newVersion int64, err error)

func (*Tee) UpdateShard

func (tee *Tee) UpdateShard(si *topo.ShardInfo, existingVersion int64) (newVersion int64, err error)

func (*Tee) UpdateShardReplicationFields

func (tee *Tee) UpdateShardReplicationFields(cell, keyspace, shard string, update func(*topo.ShardReplication) error) error

func (*Tee) UpdateSrvKeyspace

func (tee *Tee) UpdateSrvKeyspace(cell, keyspace string, srvKeyspace *topo.SrvKeyspace) error

func (*Tee) UpdateSrvShard

func (tee *Tee) UpdateSrvShard(cell, keyspace, shard string, srvShard *topo.SrvShard) error

func (*Tee) UpdateTablet

func (tee *Tee) UpdateTablet(tablet *topo.TabletInfo, existingVersion int64) (newVersion int64, err error)

func (*Tee) UpdateTabletEndpoint

func (tee *Tee) UpdateTabletEndpoint(cell, keyspace, shard string, tabletType topo.TabletType, addr *topo.EndPoint) error

func (*Tee) UpdateTabletFields

func (tee *Tee) UpdateTabletFields(tabletAlias topo.TabletAlias, update func(*topo.Tablet) error) error

func (*Tee) ValidateShard

func (tee *Tee) ValidateShard(keyspace, shard string) error

func (*Tee) ValidateTablet

func (tee *Tee) ValidateTablet(alias topo.TabletAlias) error

func (*Tee) ValidateTabletPidNode

func (tee *Tee) ValidateTabletPidNode(tabletAlias topo.TabletAlias) error

Jump to

Keyboard shortcuts

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