Skip to content

Commit

Permalink
x-server: remove the X Server (#9038)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored and zz-jason committed Jan 15, 2019
1 parent 463d44c commit 41838ce
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 299 deletions.
13 changes: 0 additions & 13 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ type Config struct {
Security Security `toml:"security" json:"security"`
Status Status `toml:"status" json:"status"`
Performance Performance `toml:"performance" json:"performance"`
XProtocol XProtocol `toml:"xprotocol" json:"xprotocol"`
PreparedPlanCache PreparedPlanCache `toml:"prepared-plan-cache" json:"prepared-plan-cache"`
OpenTracing OpenTracing `toml:"opentracing" json:"opentracing"`
ProxyProtocol ProxyProtocol `toml:"proxy-protocol" json:"proxy-protocol"`
Expand Down Expand Up @@ -163,14 +162,6 @@ type Performance struct {
ForcePriority string `toml:"force-priority" json:"force-priority"`
}

// XProtocol is the XProtocol section of the config.
type XProtocol struct {
XServer bool `toml:"xserver" json:"xserver"`
XHost string `toml:"xhost" json:"xhost"`
XPort uint `toml:"xport" json:"xport"`
XSocket string `toml:"xsocket" json:"xsocket"`
}

// PlanCache is the PlanCache section of the config.
type PlanCache struct {
Enabled bool `toml:"enabled" json:"enabled"`
Expand Down Expand Up @@ -319,10 +310,6 @@ var defaultConf = Config{
PseudoEstimateRatio: 0.8,
ForcePriority: "NO_PRIORITY",
},
XProtocol: XProtocol{
XHost: "",
XPort: 0,
},
ProxyProtocol: ProxyProtocol{
Networks: "",
HeaderTimeout: 5,
Expand Down
22 changes: 0 additions & 22 deletions tidb-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import (
"github.com/pingcap/tidb/util/printer"
"github.com/pingcap/tidb/util/signal"
"github.com/pingcap/tidb/util/systimemon"
"github.com/pingcap/tidb/x-server"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/push"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -127,7 +126,6 @@ var (
storage kv.Storage
dom *domain.Domain
svr *server.Server
xsvr *xserver.Server
graceful bool
)

Expand Down Expand Up @@ -394,10 +392,6 @@ func validateConfig() {
log.Errorf("log max-size should not be larger than %d MB", config.MaxLogFileSize)
os.Exit(-1)
}
if cfg.XProtocol.XServer {
log.Error("X Server is not available")
os.Exit(-1)
}
cfg.OOMAction = strings.ToLower(cfg.OOMAction)

// lower_case_table_names is allowed to be 0, 1, 2
Expand Down Expand Up @@ -482,24 +476,12 @@ func createServer() {
svr, err = server.NewServer(cfg, driver)
// Both domain and storage have started, so we have to clean them before exiting.
terror.MustNil(err, closeDomainAndStorage)
if cfg.XProtocol.XServer {
xcfg := &xserver.Config{
Addr: fmt.Sprintf("%s:%d", cfg.XProtocol.XHost, cfg.XProtocol.XPort),
Socket: cfg.XProtocol.XSocket,
TokenLimit: cfg.TokenLimit,
}
xsvr, err = xserver.NewServer(xcfg)
terror.MustNil(err, closeDomainAndStorage)
}
}

func serverShutdown(isgraceful bool) {
if isgraceful {
graceful = true
}
if xsvr != nil {
xsvr.Close() // Should close xserver before server.
}
svr.Close()
}

Expand Down Expand Up @@ -544,10 +526,6 @@ func setupTracing() {
func runServer() {
err := svr.Run()
terror.MustNil(err)
if cfg.XProtocol.XServer {
err := xsvr.Run()
terror.MustNil(err)
}
}

func closeDomainAndStorage() {
Expand Down
22 changes: 0 additions & 22 deletions x-server/config.go

This file was deleted.

103 changes: 0 additions & 103 deletions x-server/conn.go

This file was deleted.

139 changes: 0 additions & 139 deletions x-server/server.go

This file was deleted.

0 comments on commit 41838ce

Please sign in to comment.