-
Notifications
You must be signed in to change notification settings - Fork 3
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
Binary! #14
Binary! #14
Conversation
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.
I like where this is going.
Firefly, | ||
Hammer, | ||
Jewel, | ||
} |
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.
Are we going to support the intermediate versions?
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.
These are currently only used for setting the tunables
|
||
pub fn id(&self) -> i32 { | ||
match *self { | ||
BucketTypes::Unknown => 65536, |
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.
this could be set to i32::max_value()
@@ -307,3 +343,97 @@ pub struct CrushMap { | |||
/// device fails. | |||
pub chooseleaf_stable: Option<u8>, | |||
} | |||
|
|||
impl CrushMap { | |||
pub fn with_tunables(mut self, version: CephVersion) -> Self { |
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.
I like this! Nice
} | ||
#[derive(Clone, Debug, Eq, PartialEq, RustcDecodable, RustcEncodable)] | ||
pub struct CephDisk { | ||
pub name: Option<String>, |
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.
Why are these fields optional? I would think they shouldn't be
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.
We can change that but the crushmap itself has them as optional
|
||
#[derive(Clone, Debug, Eq, PartialEq, RustcDecodable, RustcEncodable)] | ||
pub struct CephHost { | ||
pub hostname: Option<String>, |
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.
Same here. If you make a host shouldn't be required that it have a name? I can see disks being optional if the host will be used for rgw or something
} | ||
} | ||
|
||
fn main() { |
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.
Just a general comment, could you remove the unwraps so we fail cleaner?
match mode { | ||
Mode::compile => { | ||
let mut input = String::new(); | ||
io::stdin().read_to_string(&mut input).unwrap(); |
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.
This is probably fine. I doubt we'll ever get a crushmap input that is bigger than the heap size on the machine.
This adds in a basic binary that will convert between json and binary formats for the
CrushMap