Details
-
Story
-
Status: Resolved
-
Minor
-
Resolution: Later
-
None
-
None
-
None
Description
From tweingartner in response to https://reviews.apache.org/r/20285/:
The API seems a bit strange to me here. In particular, there is a HostMaintenance class, and methods:
HostMaintenance.start_maintenance(host_list) HostMaintenance.end_maintenance(host_list) ...Which all seems very repetitive to me. It might make more sense to have HostMaintenance's constructor take a list of hosts (already grouped) to operate on:
maint = HostMaintenance(possibly_grouped_host_list) maint.status(host_subset=None) => return status of each host in possibly_grouped_host_list, or a subset thereof if given, raise hell if subset not in possibly_grouped_host_list maint.start(host_subset=None) => return some sort of status of the operation, or nothing and just raise hell? maint.drain(host_subset=None) => return next drained batch/host, do in a loop, like using a generator maint.end(host_subset=None) => Usually given the output of maint.drain()A usecase would then look something like:
maint = HostMaintenance([ ['host1', 'host2', 'host3'], # Batch 1 ['host4', 'host5'], # Batch 2 (followed by single hosts) 'host6', 'host7', 'host8', 'host9']) print "Current status:", maint.status() maint.start() for batch in maint.drain(): for host in batch: # Do the funky chicken maint.end(batch)Possibly having a HostMaintenanceController class to batch/coordinate/etc, using the HostMaintenance class to do this low level work, taking things like a grouping function, inter-batch delays, inter-host delays, "funky chicken" function to call for each host/batch, ability to monitor progress, possibly a "big red button, PANIC stop" ability.
Attachments
Issue Links
- is related to
-
AURORA-43 Rename maintenance commands to have a consistent prefix
- Resolved