Skip to content

Commit

Permalink
feat(node): Remove node type
Browse files Browse the repository at this point in the history
  • Loading branch information
therne committed Sep 27, 2021
1 parent 1b6b326 commit 5ebad2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions cluster/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,17 @@ import (
"github.com/ab180/lrmr/coordinator"
)

type Type string

const (
Master Type = "master"
Worker Type = "executor"
)

type Node struct {
Host string `json:"host"`
Type Type `json:"type"`
Executors int `json:"executors"`

// Tag is used for affinity rules (e.g. resource locality, ...)
Tag map[string]string `json:"tag,omitempty"`
}

func New(host string, typ Type) *Node {
func New(host string) *Node {
return &Node{
Host: host,
Type: typ,
Executors: runtime.NumCPU(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (w *Executor) register() error {
_, actualPort, _ := net.SplitHostPort(lis.Addr().String())
advHost += actualPort
}
n := node.New(advHost, w.opt.NodeType)
n := node.New(advHost)
n.Tag = w.opt.NodeTags
n.Executors = w.opt.Concurrency

Expand Down

0 comments on commit 5ebad2e

Please sign in to comment.