Example #1
0
 def get_stats(self, host, port, bucket, stats):
     proxy_port = self.test_config.bucket.proxy_port
     if proxy_port is None:
         mc = MemcachedClient(host=host, port=port)
         mc.sasl_auth_plain(user=bucket, password=self.password)
     else:
         mc = MemcachedClient(host=host, port=proxy_port)
     return mc.stats(stats)
Example #2
0
 def mc_iterator(self):
     password = self.test_config.bucket.password
     for host_port in self.cluster_spec.yield_servers():
         host = host_port.split(':')[0]
         memcached_port = self.rest.get_memcached_port(host_port)
         for bucket in self.test_config.buckets:
             mc = MemcachedClient(host=host, port=memcached_port)
             try:
                 mc.sasl_auth_plain(user=bucket, password=password)
                 yield mc
             except MemcachedError:
                 logger.warn('Auth failure')
Example #3
0
    def get_tap_conn(self, host, port, bucket, password):
        tap_conn = MemcachedClient(host, port)
        tap_conn.sasl_auth_cram_md5(bucket, password)
        tap_conn.tap_fix_flag_byteorder = True

        tap_opts = {Constants.TAP_FLAG_DUMP: '',
                    Constants.TAP_FLAG_SUPPORT_ACK: '',
                    Constants.TAP_FLAG_TAP_FIX_FLAG_BYTEORDER: ''}

        ext, val = self.encode_tap_connect_opts(tap_opts)
        tap_conn._sendCmd(Constants.CMD_TAP_CONNECT, self.tap_name, val, 0, ext)
        return tap_conn
Example #4
0
 def set_flusher_param(self, host, port, bucket, key, value):
     logger.info('Changing flusher params: {}={}'.format(key, value))
     mc = MemcachedClient(host=host, port=port)
     mc.sasl_auth_plain(user=bucket, password=self.password)
     mc.set_param(key, value, memcacheConstants.ENGINE_PARAM_FLUSH)