Skip to content
This repository has been archived by the owner on Mar 14, 2020. It is now read-only.

Commit

Permalink
Make namenodeAddress part of jobTracker struct
Browse files Browse the repository at this point in the history
  • Loading branch information
dug-stripe committed Nov 3, 2017
1 parent b39d6c6 commit 7348dd3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion history.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func findHistoryAndConfFiles(client *hdfs.Client, jobID jobID, finishTime int64)
func (jt *jobTracker) updateFromHistoryFile(job *job, full bool) error {
now := time.Now()

client, err := hdfs.New(*namenodeAddress)
client, err := hdfs.New(jt.namenodeAddress)
if err != nil {
return err
}
Expand Down
4 changes: 3 additions & 1 deletion jobtracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,20 @@ type jobTracker struct {
rm string
hs string
ps string
namenodeAddress string
running chan *job
finished chan *job
backfill chan *job
updates chan *job
}

func newJobTracker(rmHost string, historyHost string, proxyHost string) *jobTracker {
func newJobTracker(rmHost string, historyHost string, proxyHost string, namenodeAddress string) *jobTracker {
return &jobTracker{
jobs: make(map[jobID]*job),
rm: rmHost,
hs: historyHost,
ps: proxyHost,
namenodeAddress: namenodeAddress,
running: make(chan *job),
finished: make(chan *job),
backfill: make(chan *job),
Expand Down
2 changes: 1 addition & 1 deletion logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

func (jt *jobTracker) testLogsDir() error {
client, err := hdfs.New(*namenodeAddress)
client, err := hdfs.New(jt.namenodeAddress)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func main() {
proxyServerURL = resourceManagerURL
}

jt = newJobTracker(*resourceManagerURL, *historyServerURL, *proxyServerURL)
jt = newJobTracker(*resourceManagerURL, *historyServerURL, *proxyServerURL, *namenodeAddress)
go jt.Loop()

if err := jt.testLogsDir(); err != nil {
Expand Down

0 comments on commit 7348dd3

Please sign in to comment.