zktopo

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestServer

func NewTestServer(t *testing.T, cells []string) topo.Server

func TabletActionPathForAlias

func TabletActionPathForAlias(alias topo.TabletAlias) string

func TabletPathForAlias

func TabletPathForAlias(alias topo.TabletAlias) string

Types

type Server

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

Server is the zookeeper topo.Server implementation.

func NewServer

func NewServer(zconn zk.Conn) *Server

NewServer can be used to create a custom Server (for tests for instance) but it cannot change the globally registered one.

func (*Server) Close

func (zkts *Server) Close()

func (*Server) CreateKeyspace

func (zkts *Server) CreateKeyspace(keyspace string, value *topo.Keyspace) error

func (*Server) CreateShard

func (zkts *Server) CreateShard(keyspace, shard string, value *topo.Shard) error

func (*Server) CreateTablet

func (zkts *Server) CreateTablet(tablet *topo.Tablet) error

func (*Server) CreateTabletPidNode

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

func (*Server) DeleteEndPoints

func (zkts *Server) DeleteEndPoints(cell, keyspace, shard string, tabletType topo.TabletType) error

func (*Server) DeleteKeyspaceShards

func (zkts *Server) DeleteKeyspaceShards(keyspace string) error

func (*Server) DeleteShard

func (zkts *Server) DeleteShard(keyspace, shard string) error

func (*Server) DeleteShardReplication

func (zkts *Server) DeleteShardReplication(cell, keyspace, shard string) error

func (*Server) DeleteSrvShard

func (zkts *Server) DeleteSrvShard(cell, keyspace, shard string) error

func (*Server) DeleteTablet

func (zkts *Server) DeleteTablet(alias topo.TabletAlias) error

func (*Server) GetEndPoints

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

func (*Server) GetKeyspace

func (zkts *Server) GetKeyspace(keyspace string) (*topo.KeyspaceInfo, error)

func (*Server) GetKeyspaces

func (zkts *Server) GetKeyspaces() ([]string, error)

func (*Server) GetKnownCells

func (zkts *Server) GetKnownCells() ([]string, error)

func (*Server) GetShard

func (zkts *Server) GetShard(keyspace, shard string) (*topo.ShardInfo, error)

func (*Server) GetShardNames

func (zkts *Server) GetShardNames(keyspace string) ([]string, error)

func (*Server) GetShardReplication

func (zkts *Server) GetShardReplication(cell, keyspace, shard string) (*topo.ShardReplicationInfo, error)

func (*Server) GetSrvKeyspace

func (zkts *Server) GetSrvKeyspace(cell, keyspace string) (*topo.SrvKeyspace, error)

func (*Server) GetSrvKeyspaceNames

func (zkts *Server) GetSrvKeyspaceNames(cell string) ([]string, error)

func (*Server) GetSrvShard

func (zkts *Server) GetSrvShard(cell, keyspace, shard string) (*topo.SrvShard, error)

func (*Server) GetSrvTabletTypesPerShard

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

func (*Server) GetSubprocessFlags

func (zkts *Server) GetSubprocessFlags() []string

func (*Server) GetTablet

func (zkts *Server) GetTablet(alias topo.TabletAlias) (*topo.TabletInfo, error)

func (*Server) GetTabletsByCell

func (zkts *Server) GetTabletsByCell(cell string) ([]topo.TabletAlias, error)

func (*Server) GetZConn

func (zkts *Server) GetZConn() zk.Conn

func (*Server) LockKeyspaceForAction

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

func (*Server) LockShardForAction

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

func (*Server) LockSrvShardForAction

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

func (*Server) PruneActionLogs

func (zkts *Server) PruneActionLogs(zkActionLogPath string, keepCount int) (prunedCount int, err error)

PruneActionLogs prunes old actionlog entries. Returns how many entries were purged (even if there was an error).

There is a chance some processes might still be waiting for action results, but it is very very small.

func (*Server) PurgeActions

func (zkts *Server) PurgeActions(zkActionPath string, canBePurged func(data string) bool) error

PurgeActions removes all queued actions, leaving the action node itself in place.

This inherently breaks the locking mechanism of the action queue, so this is a rare cleanup action, not a normal part of the flow.

This can be used for tablets, shards and keyspaces.

func (*Server) ShardActionPath

func (zkts *Server) ShardActionPath(keyspace, shard string) string

func (*Server) StaleActions

func (zkts *Server) StaleActions(zkActionPath string, maxStaleness time.Duration, isStale func(data string) bool) ([]string, error)

StaleActions returns a list of queued actions that have been sitting for more than some amount of time.

func (*Server) UnlockKeyspaceForAction

func (zkts *Server) UnlockKeyspaceForAction(keyspace, lockPath, results string) error

func (*Server) UnlockShardForAction

func (zkts *Server) UnlockShardForAction(keyspace, shard, lockPath, results string) error

func (*Server) UnlockSrvShardForAction

func (zkts *Server) UnlockSrvShardForAction(cell, keyspace, shard, lockPath, results string) error

func (*Server) UpdateEndPoints

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

func (*Server) UpdateKeyspace

func (zkts *Server) UpdateKeyspace(ki *topo.KeyspaceInfo, existingVersion int64) (int64, error)

func (*Server) UpdateShard

func (zkts *Server) UpdateShard(si *topo.ShardInfo, existingVersion int64) (int64, error)

func (*Server) UpdateShardReplicationFields

func (zkts *Server) UpdateShardReplicationFields(cell, keyspace, shard string, update func(*topo.ShardReplication) error) error

func (*Server) UpdateSrvKeyspace

func (zkts *Server) UpdateSrvKeyspace(cell, keyspace string, srvKeyspace *topo.SrvKeyspace) error

func (*Server) UpdateSrvShard

func (zkts *Server) UpdateSrvShard(cell, keyspace, shard string, srvShard *topo.SrvShard) error

func (*Server) UpdateTablet

func (zkts *Server) UpdateTablet(tablet *topo.TabletInfo, existingVersion int64) (int64, error)

func (*Server) UpdateTabletEndpoint

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

func (*Server) UpdateTabletFields

func (zkts *Server) UpdateTabletFields(tabletAlias topo.TabletAlias, update func(*topo.Tablet) error) error

func (*Server) ValidateShard

func (zkts *Server) ValidateShard(keyspace, shard string) error

func (*Server) ValidateTablet

func (zkts *Server) ValidateTablet(alias topo.TabletAlias) error

func (*Server) ValidateTabletPidNode

func (zkts *Server) ValidateTabletPidNode(tabletAlias topo.TabletAlias) error

type TestServer

type TestServer struct {
	topo.Server
	// contains filtered or unexported fields
}

func (TestServer) GetKnownCells

func (s TestServer) GetKnownCells() ([]string, error)

Jump to

Keyboard shortcuts

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