Example #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
}
Example #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
}