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
Generate masterN.mesos record for current leader #169
Conversation
} | ||
if rtype == "A" { | ||
val := rg.As[name] | ||
rg.As[name] = append(val, host) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of making this a nested map?
if _, ok := rg.records[rtype]; !ok {
rg.records[rtype] = map[string][]string{}
}
rg.records[rtype][name] = append(rg.records[rtype][name], host)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even better:
if _, ok := rg.records[rtype]; !ok {
rg.records[rtype] = map[string]map[string]struct{}{}
}
if _, ok := rg.records[rtype][name]; !ok {
rg.records[rtype][name] = map[string]struct{}{}
rg.records[rtype][host] = map[string]struct{}{}
}
rg.records[rtype][name][host] = struct{}{}
rg.records[rtype][host][name] = struct{}{}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good suggestions. if the system wasn't about to undergo major re-implementation to support new features, i'd agree to an approach like this.
Not ready for merge, needs additional work. On Thu, Jun 11, 2015 at 1:38 PM, Christos Kozyrakis <
|
…if there *is* a fallback master list
LGTM in regards to the scope of the PR. Let's review the other suggestions after we have this through. |
Generate masterN.mesos record for current leader
Fixes #165