Ejemplo n.º 1
0
func (s *server) Replica(shard int) error {
	role, ok := s.roles[shard]
	require.False(s.t, ok, "Replica %d assigned when we're already %s for it.", shard, role)
	s.roles[shard] = "replica"
	return nil
}
Ejemplo n.º 2
0
func (s *server) Master(shard int) error {
	role, ok := s.roles[shard]
	require.False(s.t, ok, "Master %d assigned when we're already %s for it.", shard, role)
	s.roles[shard] = "master"
	return nil
}