Skip to content

Commit

Permalink
discovery,election(engine): remove unused code (#7166)
Browse files Browse the repository at this point in the history
ref #6849
  • Loading branch information
sleepymole authored Sep 22, 2022
1 parent 73a7ac8 commit 55eb2f4
Show file tree
Hide file tree
Showing 34 changed files with 7 additions and 3,191 deletions.
2 changes: 0 additions & 2 deletions deployments/engine/docker-compose/config/master.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
etcd-endpoints = ["etcd-standalone:2379"]

[framework-meta]
endpoints = ["mysql-standalone:3306"]
schema = "test_framework"
Expand Down
2 changes: 0 additions & 2 deletions deployments/engine/docker-compose/config/master_with_tls.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
etcd-endpoints = ["etcd-standalone:2379"]

[framework-meta]
endpoints = ["mysql-standalone:3306"]
schema = "test_framework"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name = "master-test" # Corresponding command line: --name
addr = "127.0.0.1:10240" # Corresponding command line: --addr
advertise-addr = "127.0.0.1:10240" # Corresponding command line: --advertise-addr
etcd-endpoints = ["127.0.0.1:2379"] # Corresponding command line: ---etcd-endpoints

[log]
level = "info" # Corresponding command line: --log-level
Expand Down
1 change: 0 additions & 1 deletion deployments/engine/helm/tiflow/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

{{- define "tiflow.configmap.data" -}}
server-master: |-
etcd-endpoints = ["{{ include "tiflow.name" . }}-metastore-etcd:12479"]
framework-meta.endpoints = ["{{ include "tiflow.name" . }}-metastore-mysql:3306"]
business-meta.endpoints = ["{{ include "tiflow.name" . }}-metastore-mysql:3306"]
{{- if .Values.master.config }}
Expand Down
29 changes: 0 additions & 29 deletions engine/model/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@

package model

import (
"encoding/json"

"github.com/pingcap/errors"
"github.com/pingcap/tiflow/engine/pkg/adapter"
)

// RescUnit is the min unit of resource that we count.
type RescUnit int

Expand All @@ -29,28 +22,6 @@ type DeployNodeID string
// ExecutorID is an alias for executor when NodeType is NodeTypeExecutor.
type ExecutorID = DeployNodeID

// NodeInfo describes the information of server instance.
// Deprecated: only used for servermaster and will be removed soon.
type NodeInfo struct {
ID DeployNodeID `json:"id"`
Addr string `json:"addr"`
Name string `json:"name"`
}

// EtcdKey return encoded key for a node used in service discovery etcd
func (e *NodeInfo) EtcdKey() string {
return adapter.NodeInfoKeyAdapter.Encode(string(e.ID))
}

// ToJSON returns json marshal of a node info
func (e *NodeInfo) ToJSON() (string, error) {
data, err := json.Marshal(e)
if err != nil {
return "", errors.Trace(err)
}
return string(data), nil
}

// ExecutorStatus describes the node aliveness status of an executor
type ExecutorStatus int32

Expand Down
37 changes: 0 additions & 37 deletions engine/model/cluster_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions engine/pkg/cmd/master/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func (o *options) addFlags(cmd *cobra.Command) {
cmd.Flags().StringVar(&o.masterConfig.Addr, "addr", o.masterConfig.Addr, "Set the listening address for server master")
cmd.Flags().StringVar(&o.masterConfig.AdvertiseAddr, "advertise-addr", o.masterConfig.AdvertiseAddr, "Set the advertise listening address for client communication")

cmd.Flags().StringSliceVar(&o.masterConfig.ETCDEndpoints, "etcd-endpoints", o.masterConfig.ETCDEndpoints, "etcd endpoints")
cmd.Flags().StringSliceVar(&o.masterConfig.FrameworkMeta.Endpoints, "framework-meta-endpoints", o.masterConfig.FrameworkMeta.Endpoints, "framework metastore endpoint")
cmd.Flags().StringSliceVar(&o.masterConfig.BusinessMeta.Endpoints, "business-meta-endpoints", o.masterConfig.BusinessMeta.Endpoints, "business metastore endpoint")

Expand Down Expand Up @@ -112,8 +111,6 @@ func (o *options) complete(cmd *cobra.Command) error {
cfg.Addr = o.masterConfig.Addr
case "advertise-addr":
cfg.AdvertiseAddr = o.masterConfig.AdvertiseAddr
case "etcd-endpoints":
cfg.ETCDEndpoints = o.masterConfig.ETCDEndpoints
case "framework-meta-endpoints":
cfg.FrameworkMeta.Endpoints = o.masterConfig.FrameworkMeta.Endpoints
case "business-meta-endpoints":
Expand Down
166 changes: 0 additions & 166 deletions engine/pkg/etcdutil/config.go

This file was deleted.

23 changes: 0 additions & 23 deletions engine/pkg/etcdutil/main_test.go

This file was deleted.

82 changes: 0 additions & 82 deletions engine/pkg/etcdutil/service.go

This file was deleted.

Loading

0 comments on commit 55eb2f4

Please sign in to comment.