Ejemplo n.º 1
0
// Rebuild the serving graph data while locking out other changes.
func (wr *Wrangler) RebuildKeyspaceGraph(keyspace string, cells []string) error {
	actionNode := actionnode.RebuildKeyspace()
	lockPath, err := wr.lockKeyspace(keyspace, actionNode)
	if err != nil {
		return err
	}

	err = wr.rebuildKeyspace(keyspace, cells)
	return wr.unlockKeyspace(keyspace, actionNode, lockPath, err)
}
Ejemplo n.º 2
0
// RebuildKeyspace rebuilds the serving graph data while locking out other changes.
func RebuildKeyspace(ctx context.Context, log logutil.Logger, ts topo.Server, keyspace string, cells []string, rebuildSrvShards bool) error {
	node := actionnode.RebuildKeyspace()
	lockPath, err := node.LockKeyspace(ctx, ts, keyspace)
	if err != nil {
		return err
	}

	err = rebuildKeyspace(ctx, log, ts, keyspace, cells, rebuildSrvShards)
	return node.UnlockKeyspace(ctx, ts, keyspace, lockPath, err)
}
Ejemplo n.º 3
0
// Rebuild the serving graph data while locking out other changes.
// If some shards were recently read / updated, pass them in the cache so
// we don't read them again (and possible get stale replicated data)
func (wr *Wrangler) RebuildKeyspaceGraph(keyspace string, cells []string, shardCache map[string]*topo.ShardInfo) error {
	actionNode := actionnode.RebuildKeyspace()
	lockPath, err := wr.lockKeyspace(keyspace, actionNode)
	if err != nil {
		return err
	}

	err = wr.rebuildKeyspace(keyspace, cells, shardCache)
	return wr.unlockKeyspace(keyspace, actionNode, lockPath, err)
}
Ejemplo n.º 4
0
// RebuildKeyspaceGraph rebuilds the serving graph data while locking out other changes.
// If some shards were recently read / updated, pass them in the cache so
// we don't read them again (and possible get stale replicated data)
func (wr *Wrangler) RebuildKeyspaceGraph(ctx context.Context, keyspace string, cells []string, rebuildSrvShards bool) error {
	actionNode := actionnode.RebuildKeyspace()
	lockPath, err := wr.lockKeyspace(ctx, keyspace, actionNode)
	if err != nil {
		return err
	}

	err = wr.rebuildKeyspace(ctx, keyspace, cells, rebuildSrvShards)
	return wr.unlockKeyspace(ctx, keyspace, actionNode, lockPath, err)
}