Documentation ¶
Index ¶
- func NewTestServer(t *testing.T, cells []string) topo.Server
- func TabletActionPathForAlias(alias topo.TabletAlias) string
- func TabletPathForAlias(alias topo.TabletAlias) string
- type Server
- func (zkts *Server) ActionEventLoop(tabletAlias topo.TabletAlias, ...)
- func (zkts *Server) Close()
- func (zkts *Server) CreateKeyspace(keyspace string) error
- func (zkts *Server) CreateShard(keyspace, shard string, value *topo.Shard) error
- func (zkts *Server) CreateShardReplication(cell, keyspace, shard string, sr *topo.ShardReplication) error
- func (zkts *Server) CreateTablet(tablet *topo.Tablet) error
- func (zkts *Server) CreateTabletPidNode(tabletAlias topo.TabletAlias, contents string, done chan struct{}) error
- func (zkts *Server) DeleteKeyspaceShards(keyspace string) error
- func (zkts *Server) DeleteShardReplication(cell, keyspace, shard string) error
- func (zkts *Server) DeleteSrvTabletType(cell, keyspace, shard string, tabletType topo.TabletType) error
- func (zkts *Server) DeleteTablet(alias topo.TabletAlias) error
- func (zkts *Server) GetEndPoints(cell, keyspace, shard string, tabletType topo.TabletType) (*topo.EndPoints, error)
- func (zkts *Server) GetKeyspaces() ([]string, error)
- func (zkts *Server) GetKnownCells() ([]string, error)
- func (zkts *Server) GetShard(keyspace, shard string) (*topo.ShardInfo, error)
- func (zkts *Server) GetShardNames(keyspace string) ([]string, error)
- func (zkts *Server) GetShardReplication(cell, keyspace, shard string) (*topo.ShardReplicationInfo, error)
- func (zkts *Server) GetSrvKeyspace(cell, keyspace string) (*topo.SrvKeyspace, error)
- func (zkts *Server) GetSrvKeyspaceNames(cell string) ([]string, error)
- func (zkts *Server) GetSrvShard(cell, keyspace, shard string) (*topo.SrvShard, error)
- func (zkts *Server) GetSrvTabletTypesPerShard(cell, keyspace, shard string) ([]topo.TabletType, error)
- func (zkts *Server) GetSubprocessFlags() []string
- func (zkts *Server) GetTablet(alias topo.TabletAlias) (*topo.TabletInfo, error)
- func (zkts *Server) GetTabletsByCell(cell string) ([]topo.TabletAlias, error)
- func (zkts *Server) GetZConn() zk.Conn
- func (zkts *Server) LockKeyspaceForAction(keyspace, contents string, timeout time.Duration, interrupted chan struct{}) (string, error)
- func (zkts *Server) LockShardForAction(keyspace, shard, contents string, timeout time.Duration, ...) (string, error)
- func (zkts *Server) PruneActionLogs(zkActionLogPath string, keepCount int) (prunedCount int, err error)
- func (zkts *Server) PurgeActions(zkActionPath string, canBePurged func(data string) bool) error
- func (zkts *Server) PurgeTabletActions(tabletAlias topo.TabletAlias, canBePurged func(data string) bool) error
- func (zkts *Server) ReadTabletActionPath(actionPath string) (topo.TabletAlias, string, int64, error)
- func (zkts *Server) ShardActionPath(keyspace, shard string) string
- func (zkts *Server) StaleActions(zkActionPath string, maxStaleness time.Duration, ...) ([]string, error)
- func (zkts *Server) StoreTabletActionResponse(actionPath, data string) error
- func (zkts *Server) UnblockTabletAction(actionPath string) error
- func (zkts *Server) UnlockKeyspaceForAction(keyspace, lockPath, results string) error
- func (zkts *Server) UnlockShardForAction(keyspace, shard, lockPath, results string) error
- func (zkts *Server) UpdateEndPoints(cell, keyspace, shard string, tabletType topo.TabletType, ...) error
- func (zkts *Server) UpdateShard(si *topo.ShardInfo) error
- func (zkts *Server) UpdateShardReplicationFields(cell, keyspace, shard string, update func(*topo.ShardReplication) error) error
- func (zkts *Server) UpdateSrvKeyspace(cell, keyspace string, srvKeyspace *topo.SrvKeyspace) error
- func (zkts *Server) UpdateSrvShard(cell, keyspace, shard string, srvShard *topo.SrvShard) error
- func (zkts *Server) UpdateTablet(tablet *topo.TabletInfo, existingVersion int64) (int64, error)
- func (zkts *Server) UpdateTabletAction(actionPath, data string, version int64) error
- func (zkts *Server) UpdateTabletEndpoint(cell, keyspace, shard string, tabletType topo.TabletType, addr *topo.EndPoint) error
- func (zkts *Server) UpdateTabletFields(tabletAlias topo.TabletAlias, update func(*topo.Tablet) error) error
- func (zkts *Server) ValidateShard(keyspace, shard string) error
- func (zkts *Server) ValidateTablet(alias topo.TabletAlias) error
- func (zkts *Server) ValidateTabletActions(tabletAlias topo.TabletAlias) error
- func (zkts *Server) ValidateTabletPidNode(tabletAlias topo.TabletAlias) error
- func (zkts *Server) WaitForTabletAction(actionPath string, waitTime time.Duration, interrupted chan struct{}) (string, error)
- func (zkts *Server) WriteTabletAction(tabletAlias topo.TabletAlias, contents string) (string, error)
- type TestServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
NewServer can be used to create a custom Server (for tests for instance) but it cannot change the globally registered one.
func (*Server) ActionEventLoop ¶
func (zkts *Server) ActionEventLoop(tabletAlias topo.TabletAlias, dispatchAction func(actionPath, data string) error, done chan struct{})
func (*Server) CreateKeyspace ¶
func (*Server) CreateShard ¶
func (*Server) CreateShardReplication ¶
func (zkts *Server) CreateShardReplication(cell, keyspace, shard string, sr *topo.ShardReplication) error
func (*Server) CreateTabletPidNode ¶
func (zkts *Server) CreateTabletPidNode(tabletAlias topo.TabletAlias, contents string, done chan struct{}) error
func (*Server) DeleteKeyspaceShards ¶
func (*Server) DeleteShardReplication ¶
func (*Server) DeleteSrvTabletType ¶
func (zkts *Server) DeleteSrvTabletType(cell, keyspace, shard string, tabletType topo.TabletType) error
func (*Server) DeleteTablet ¶
func (zkts *Server) DeleteTablet(alias topo.TabletAlias) error
func (*Server) GetEndPoints ¶
func (*Server) GetKeyspaces ¶
func (*Server) GetKnownCells ¶
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 (*Server) GetSrvShard ¶
func (*Server) GetSrvTabletTypesPerShard ¶
func (zkts *Server) GetSrvTabletTypesPerShard(cell, keyspace, shard string) ([]topo.TabletType, error)
func (*Server) GetSubprocessFlags ¶
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) LockKeyspaceForAction ¶
func (*Server) LockShardForAction ¶
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 ¶
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) PurgeTabletActions ¶
func (*Server) ReadTabletActionPath ¶
func (*Server) ShardActionPath ¶
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) StoreTabletActionResponse ¶
StoreTabletActionResponse stores the data both in action and actionlog
func (*Server) UnblockTabletAction ¶
func (*Server) UnlockKeyspaceForAction ¶
func (*Server) UnlockShardForAction ¶
func (*Server) UpdateEndPoints ¶
func (*Server) UpdateShardReplicationFields ¶
func (*Server) UpdateSrvKeyspace ¶
func (zkts *Server) UpdateSrvKeyspace(cell, keyspace string, srvKeyspace *topo.SrvKeyspace) error
func (*Server) UpdateSrvShard ¶
func (*Server) UpdateTablet ¶
func (*Server) UpdateTabletAction ¶
func (*Server) UpdateTabletEndpoint ¶
func (*Server) UpdateTabletFields ¶
func (*Server) ValidateShard ¶
func (*Server) ValidateTablet ¶
func (zkts *Server) ValidateTablet(alias topo.TabletAlias) error
func (*Server) ValidateTabletActions ¶
func (zkts *Server) ValidateTabletActions(tabletAlias topo.TabletAlias) error
func (*Server) ValidateTabletPidNode ¶
func (zkts *Server) ValidateTabletPidNode(tabletAlias topo.TabletAlias) error
func (*Server) WaitForTabletAction ¶
func (*Server) WriteTabletAction ¶
type TestServer ¶
func (TestServer) GetKnownCells ¶
func (s TestServer) GetKnownCells() ([]string, error)