Skip to content

Commit

Permalink
remove extra code
Browse files Browse the repository at this point in the history
  • Loading branch information
davepacheco committed Sep 29, 2023
1 parent ed56f03 commit 50c6227
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions nexus/inventory/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ pub struct CollectionBuilder {
baseboards: BTreeSet<Arc<BaseboardId>>,
cabooses: BTreeSet<Arc<Caboose>>,
sps: BTreeMap<Arc<BaseboardId>, ServiceProcessor>,
// ignition_found: Vec<SpIdentifier>,
// ignition_powered_off: Vec<SpIdentifier>,
// ignition_missing: Vec<SpIdentifier>,
}

impl CollectionBuilder {
Expand All @@ -52,9 +49,6 @@ impl CollectionBuilder {
baseboards: BTreeSet::new(),
cabooses: BTreeSet::new(),
sps: BTreeMap::new(),
// ignition_found: vec![],
// ignition_powered_off: vec![],
// ignition_missing: vec![],
}
}

Expand All @@ -71,56 +65,6 @@ impl CollectionBuilder {
}
}

// XXX-dap I think this just belongs in the caller.
// pub fn found_ignition(
// &mut self,
// sp_id: SpIdentifier,
// ignition: SpIgnition,
// ) {
// let mut vec = match ignition {
// SpIgnition::Yes { power: true, .. } => &mut self.ignition_found,
// SpIgnition::Yes { power: false, .. } => {
// &mut self.ignition_powered_off
// }
// SpIgnition::No => &mut self.ignition_missing,
// };
//
// vec.push(sp_id);
// }

// XXX-dap this model here, where we invoke enum_ignition() and then
// powered_on_sps() and expect to do enum_sp() after that...it's promising,
// but I think it currently assumes that SpIdentifiers will be consistent
// across MGS instances. It would be better to avoid this if we can. And
// we should be able to.
//
// I think it's really more like:
//
// - found_mgs_client(mgs_client)
// - enum_mgs_clients(): for each:
// - found_ignition(client, ignition)
// - next_wanted() returns an (mgs_client, sp_id, SpInfoWanted)
// - SpInfoWanted = State | Caboose1 | Caboose2 | ...
// - this tells the caller exactly what to do next
// - am I putting too much control flow into this struct? wasn't the
// idea to make this simple and passive and _not_ include all that
// logic? That's a nice idea but the problem is that intrinsically one
// needs the state about what information we have about what SPs and
// which MGS's we've tried in order to decide what to do next
// - but this approach is not concurrency-friendly, and I don't really
// see a way to make it concurrency-friendly without baking the whole
// thing into this struct, which, again, defeats the point.
//
// That brings me back to: let's make this thing really simple. Caller
// reports what it's found. Caller is responsible for control flow and
// figuring out what's next and in what order.
//
// Next step: rethink this struct, then go back to collector.rs and write a
// driver.
//pub fn powered_on_sps(&self) -> impl Iterator<Item = SpIdentifier> {
// self.ignition_found.iter().cloned();
//}

pub fn found_sp_state(
&mut self,
source: &str,
Expand Down

0 comments on commit 50c6227

Please sign in to comment.