diff options
author | Bartosz Zurkowski <b.zurkowski@samsung.com> | 2019-04-29 12:45:10 +0200 |
---|---|---|
committer | Lingxian Kong <anlin.kong@gmail.com> | 2019-05-12 02:06:42 +0000 |
commit | 59e8cb7e75e33da0b37a3dfa250bf1bc9a9cd0b9 (patch) | |
tree | 6bf06787ae6d385f93295dd066303aa064b7db8b /trove/taskmanager/manager.py | |
parent | d5d84653cf71a016250165c7ad8d66cb4f0e1d26 (diff) | |
download | trove-59e8cb7e75e33da0b37a3dfa250bf1bc9a9cd0b9.tar.gz |
Extend cluster events
This patch extends adds a new field 'instance_ids' in payloads of two
cluster events:
- DBaaSClusterShrink (during start and end notification),
- DBaaSClusterGrow (during end notification).
Moreover, additional end notifications after growing and shrinking
cluster have been added.
The purpose of this change if to enable better integration with
tools for monitoring resources usage.
Change-Id: I2c39b2c3bff65f88e46944eda22209bdc92803bc
Signed-off-by: Kasper Hasior <k.hasior@samsung.com>
Co-Authored-By: Kasper Hasior <k.hasior@samsung.com>
Story: #2005520
Task: #30639
Diffstat (limited to 'trove/taskmanager/manager.py')
-rw-r--r-- | trove/taskmanager/manager.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/trove/taskmanager/manager.py b/trove/taskmanager/manager.py index 7559c1ec..8d8ac1b6 100644 --- a/trove/taskmanager/manager.py +++ b/trove/taskmanager/manager.py @@ -428,12 +428,16 @@ class Manager(periodic_task.PeriodicTasks): cluster_tasks.create_cluster(context, cluster_id) def grow_cluster(self, context, cluster_id, new_instance_ids): - cluster_tasks = models.load_cluster_tasks(context, cluster_id) - cluster_tasks.grow_cluster(context, cluster_id, new_instance_ids) + with EndNotification(context, cluster_id=cluster_id, + instance_ids=new_instance_ids): + cluster_tasks = models.load_cluster_tasks(context, cluster_id) + cluster_tasks.grow_cluster(context, cluster_id, new_instance_ids) def shrink_cluster(self, context, cluster_id, instance_ids): - cluster_tasks = models.load_cluster_tasks(context, cluster_id) - cluster_tasks.shrink_cluster(context, cluster_id, instance_ids) + with EndNotification(context, cluster_id=cluster_id, + instance_ids=instance_ids): + cluster_tasks = models.load_cluster_tasks(context, cluster_id) + cluster_tasks.shrink_cluster(context, cluster_id, instance_ids) def restart_cluster(self, context, cluster_id): cluster_tasks = models.load_cluster_tasks(context, cluster_id) |