Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename new shard-manager service to shard-distributor #6496

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/server/cadence/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import (
"github.com/uber/cadence/service/frontend"
"github.com/uber/cadence/service/history"
"github.com/uber/cadence/service/matching"
"github.com/uber/cadence/service/shardmanager"
"github.com/uber/cadence/service/sharddistributor"
"github.com/uber/cadence/service/worker"
)

Expand Down Expand Up @@ -273,8 +273,8 @@ func (s *server) startService() common.Daemon {
daemon, err = matching.NewService(&params)
case service.Worker:
daemon, err = worker.NewService(&params)
case service.ShardManager:
daemon, err = shardmanager.NewService(&params, resource.NewResourceFactory())
case service.ShardDistributor:
daemon, err = sharddistributor.NewService(&params, resource.NewResourceFactory())
}
if err != nil {
params.Logger.Fatal("Fail to start "+s.name+" service ", tag.Error(err))
Expand Down
2 changes: 1 addition & 1 deletion common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const (
History
Matching
Worker
ShardManager
ShardDistributor
NumServices
)

Expand Down
4 changes: 2 additions & 2 deletions common/service/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
return metrics.Matching
case Worker:
return metrics.Worker
case ShardManager:
return metrics.ShardManager
case ShardDistributor:
return metrics.ShardDistributor

Check warning on line 40 in common/service/metrics.go

View check run for this annotation

Codecov / codecov/patch

common/service/metrics.go#L39-L40

Added lines #L39 - L40 were not covered by tests
default:
logger.Fatal("Unknown service name for metrics!")
}
Expand Down
6 changes: 3 additions & 3 deletions common/service/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ const (
Matching = "cadence-matching"
// Worker is the name of the worker service
Worker = "cadence-worker"
// ShardManager is the name of the shard manager service
ShardManager = "cadence-shard-manager"
// ShardDistributor is the name of the shard distributor service
ShardDistributor = "cadence-shard-distributor"
)

// ListWithRing contains the list of all cadence services that has a hash ring
var ListWithRing = []string{Frontend, History, Matching, Worker}

// List contains the list of all cadence services
var List = []string{Frontend, History, Matching, Worker, ShardManager}
var List = []string{Frontend, History, Matching, Worker, ShardDistributor}

// ShortName returns cadence service name without "cadence-" prefix
func ShortName(name string) string {
Expand Down
4 changes: 2 additions & 2 deletions common/service/name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ func TestServiceNames(t *testing.T) {
assert.Equal(t, fullName, FullName(shortName))
assert.Equal(t, fullName, FullName(fullName))

assert.Equal(t, []string{"cadence-frontend", "cadence-history", "cadence-matching", "cadence-worker", "cadence-shard-manager"}, List)
assert.Equal(t, []string{"frontend", "history", "matching", "worker", "shard-manager"}, ShortNames(List))
assert.Equal(t, []string{"cadence-frontend", "cadence-history", "cadence-matching", "cadence-worker", "cadence-shard-distributor"}, List)
assert.Equal(t, []string{"frontend", "history", "matching", "worker", "shard-distributor"}, ShortNames(List))
}
2 changes: 1 addition & 1 deletion config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ services:
pprof:
port: ${WORKER_PORT_PPROF:7940}

shard-manager:
shard-distributor:
rpc:
port: 7941
bindOnLocalHost: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package shardmanager
package sharddistributor

import (
"sync/atomic"
Expand All @@ -27,10 +27,10 @@ import (
"github.com/uber/cadence/common/dynamicconfig"
"github.com/uber/cadence/common/resource"
"github.com/uber/cadence/common/service"
"github.com/uber/cadence/service/shardmanager/config"
"github.com/uber/cadence/service/sharddistributor/config"
)

// Service represents the shard manager service
// Service represents the shard distributor service
type Service struct {
resource.Resource

Expand All @@ -57,13 +57,13 @@ func NewService(

serviceResource, err := factory.NewResource(
params,
service.ShardManager,
service.ShardDistributor,
&service.Config{
PersistenceMaxQPS: serviceConfig.PersistenceMaxQPS,
PersistenceGlobalMaxQPS: serviceConfig.PersistenceGlobalMaxQPS,
ThrottledLoggerMaxRPS: serviceConfig.ThrottledLogRPS,
IsErrorRetryableFunction: common.IsServiceTransientError,
// shard manager doesn't need visibility config as it never read or write visibility
// shard distributor doesn't need visibility config as it never read or write visibility
},
)
if err != nil {
Expand All @@ -85,7 +85,7 @@ func (s *Service) Start() {
}

logger := s.GetLogger()
logger.Info("shard manager starting")
logger.Info("shard distributor starting")

// setup the handler

Expand All @@ -103,5 +103,5 @@ func (s *Service) Stop() {

s.Resource.Stop()

s.GetLogger().Info("shard manager stopped")
s.GetLogger().Info("shard distributor stopped")
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

package shardmanager
package sharddistributor

import (
"sync/atomic"
Expand Down
Loading