Refactor Merger/Executor API
The Merger and executor APIs have a lot in common, but they behave slightly differently. A merger needs to sometimes return results. An executor needs to have separate queues for zones and be able to pause or cancel jobs. This refactors them both into a common class which can handle job state changes (like pause/cancel) and return results if requested. The MergerApi can subclass this fairly trivially. The ExecutorApi adds an intermediate layer which uses a DefaultKeyDict to maintain a distinct queue for every zone and then transparently dispatches method calls to the queue object for that zone. The ZK paths for both are significantly altered in this change. Change-Id: I3adedcc4ea293e43070ba6ef0fe29e7889a0b502
This commit is contained in:
@@ -441,9 +441,9 @@ class EventResultFuture(ZooKeeperSimpleBase):
|
||||
return True
|
||||
|
||||
|
||||
class MergerEventResultFuture(EventResultFuture):
|
||||
class JobResultFuture(EventResultFuture):
|
||||
|
||||
log = logging.getLogger("zuul.zk.event_queues.ManagementEventResultFuture")
|
||||
log = logging.getLogger("zuul.JobResultFuture")
|
||||
|
||||
def __init__(self, client, result_path, waiter_path):
|
||||
super().__init__(client, result_path)
|
||||
|
||||
Reference in New Issue
Block a user