return g
@cmd
-def set_param(mc, type, key, val, vbucket):
+def set_param(mc, type, key, val):
engine_param = None
if type == 'checkpoint_param':
engine_param = memcacheConstants.ENGINE_PARAM_CHECKPOINT
val = str(int(float(_x_)*(_quota_)/100))
try:
+ mc.set_param(0, key, val, engine_param)
+ print 'set %s to %s' %(key, val)
+ except mc_bin_client.MemcachedError, error:
+ print 'Error: %s' % error.msg
+ except mc_bin_client.TimeoutError, error:
+ print error
+ except Exception, e:
+ print 'Generic error (%s)' % e
+
+@cmd
+def set_vbucket_param(mc, key, vbucket, val):
+ engine_param = memcacheConstants.ENGINE_PARAM_VBUCKET
+
+ try:
mc.set_param(int(vbucket), key, val, engine_param)
print 'set %s to %s' %(key, val)
except mc_bin_client.MemcachedError, error:
dcp_consumer_process_buffered_messages_batch_size - The number of items the
DCP processor will consume
in a single batch.
- Available params for "set vbucket_param":
+
+Available params for "set_vbucket_param:
max_cas - Change the max_cas of a vbucket. The value and vbucket are specified as decimal
integers. The new-value is interpretted as an unsigned 64-bit integer.
- cbepctl host:port -b default set vbucket_param max_cas <new-value> <vbucket-id>
+ cbepctl host:port -b default set_vbucket_param max_cas <vbucket-id> <new-value>
""")
c.addCommand('drain', drain, "drain")
- c.addCommand('set', set_param, 'set type param value vbucket')
+ c.addCommand('set', set_param, 'set type param value')
+ c.addCommand('set_vbucket_param', set_vbucket_param, 'type vbucket value')
c.addCommand('start', start, 'start')
c.addCommand('stop', stop, 'stop')
c.addFlag('-a', 'allBuckets', 'iterate over all buckets (requires admin u/p)')