diff options
| author | Milind Changire <mchangir@redhat.com> | 2016-09-05 21:51:19 +0530 | 
|---|---|---|
| committer | Aravinda VK <avishwan@redhat.com> | 2016-09-08 22:48:51 -0700 | 
| commit | 40135e9811efe2fb4cbdff302d5a2c461e4147d4 (patch) | |
| tree | 8f5ee7cf91dd4cb015f9131e285c37ee6804a0ce /cli/src/cli-cmd-volume.c | |
| parent | 001b2080de3793d02d988825db97fd2d4cba4829 (diff) | |
cluster/tier: add tiering events
Add events for:
* tier attach and detach
* tier pause and resume
* tier rising and dropping hi and lo watermarks
Update eventskeygen.py with tiering events.
Update cli help with:
* attach: add optional force argument
* detach: make force available as non-optional argument on its own
> Reviewed-on: http://review.gluster.org/15232
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
> Tested-by: Dan Lambright <dlambrig@redhat.com>
(cherry picked from commit cd23242b8953040b231f402c334f16520ac8029f)
Change-Id: I43990d3a8742151a4a7889bafa19cb572fe661bd
BUG: 1374324
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: http://review.gluster.org/15431
Tested-by: Atin Mukherjee <amukherj@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
| -rw-r--r-- | cli/src/cli-cmd-volume.c | 23 | 
1 files changed, 21 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index eb3b2c50fa3..e87669cd75d 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1115,6 +1115,7 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,          rpc_clnt_procedure_t    *proc    = NULL;          cli_local_t             *local   = NULL;          int                      i       = 0; +        eventtypes_t            event    = EVENT_LAST;          if (wordcount < 4) {                  cli_usage_out (word->pattern); @@ -1133,6 +1134,15 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,                  ret = do_cli_cmd_volume_detach_tier (state, word,                                                       words, wordcount-1); +                if (!strcmp (words[wordcount-2], "commit")) { +                        event = EVENT_TIER_DETACH_COMMIT; +                } else if (!strcmp (words[wordcount-2], "start")) { +                        event = EVENT_TIER_DETACH_START; +                } else if (!strcmp (words[wordcount-2], "stop")) { +                        event = EVENT_TIER_DETACH_STOP; +                } else if (!strcmp (words[wordcount-2], "force")) { +                        event = EVENT_TIER_DETACH_FORCE; +                }                  goto out;          } else if (!strcmp(words[1], "attach-tier")) { @@ -1145,6 +1155,11 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,                  ret = do_cli_cmd_volume_attach_tier (state, word,                                                       words, wordcount-1); +                if (!strcmp (words[wordcount-2], "force")) { +                        event = EVENT_TIER_ATTACH_FORCE; +                } else { +                        event = EVENT_TIER_ATTACH; +                }                  goto out;          } @@ -1169,6 +1184,10 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,  out:          if (ret) {                  cli_out ("Tier command failed"); +        } else { +                if (event != EVENT_LAST) { +                        gf_event (event, "vol=%s", words[2]); +                }          }          if (options)                  dict_unref (options); @@ -2939,8 +2958,8 @@ struct cli_cmd volume_cmds[] = {  #if !defined(__NetBSD__)          { "volume tier <VOLNAME> status\n"          "volume tier <VOLNAME> start [force]\n" -        "volume tier <VOLNAME> attach [<replica COUNT>] <NEW-BRICK>...\n" -        "volume tier <VOLNAME> detach <start|stop|status|commit|[force]>\n", +        "volume tier <VOLNAME> attach [<replica COUNT>] <NEW-BRICK>... [force]\n" +        "volume tier <VOLNAME> detach <start|stop|status|commit|force>\n",          cli_cmd_volume_tier_cbk,          "Tier translator specific operations."},  | 
