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

Crozzy auto config #41

Merged
merged 7 commits into from
Apr 12, 2016
Merged

Crozzy auto config #41

merged 7 commits into from
Apr 12, 2016

Conversation

crozzy
Copy link

@crozzy crozzy commented Apr 11, 2016

Hey @colinmarc , I think this is a little cleaner. Let me know if you have some other suggestions.

@crozzy
Copy link
Author

crozzy commented Apr 11, 2016

also, feel free to reject #38

"strings"
)

type Property struct {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and Result don't need to be capitalized, since they aren't exported. Also I would name Result something like propertyList.

@colinmarc
Copy link
Owner

Ok - left a bazillion comments, sorry =) Thanks again for your work on this! I'll close #38.


type HadoopConf map[string]string

var ErrUnresolvedNamenode = errors.New("Couldn't find a namenode address in any config.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go errors should be shorthand, uncapitalized and unpunctuated, like "no namenode address in config".

@crozzy
Copy link
Author

crozzy commented Apr 11, 2016

No problem! Let know if there are some more changes for this PR.

if nnErr != nil {
return "", nnErr
}
return namenodes[len(namenodes)-1], nil
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be namenodes[0]

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I guess that's slightly better (but if we have multiple I'm not really sure what the behavior should be, outside of HA support).

if hadoopHome != "" {
hdfsPath := path.Join(hadoopHome, "conf", "hdfs-site.xml")
corePath := path.Join(hadoopHome, "conf", "core-site.xml")
tryPaths = append(tryPaths, []string{hdfsPath, corePath}...)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can just be append(tryPaths, confHdfsPath, confCorePath) (and the same below)

@colinmarc
Copy link
Owner

Ok, looks awesome. A couple more minor changes and then I'll be happy to merge!

@crozzy
Copy link
Author

crozzy commented Apr 12, 2016

Sweet! Thanks for the tips.

@colinmarc
Copy link
Owner

Yay! Thank you so much for the PR.

@colinmarc colinmarc merged commit 1afc235 into colinmarc:master Apr 12, 2016
@colinmarc colinmarc mentioned this pull request Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants