Reset a Redis Cluster node

        If 'soft' is True then it will send 'SOFT' argument
        If 'soft' is False then it will send 'HARD' argument

        Sends to specefied node
549693
async def cluster_reset(self, node_id, soft=True):
        
        option = 'SOFT' if soft else 'HARD'
        return await self.execute_command('CLUSTER RESET', option, node_id=node_id)
346773
def set(msg_id, suffix, value)
      with_failover { redis.set(key(msg_id, suffix), value) }
    end
48181
public function back_reload($node_name)
    {
        if (get_instance()->isCluster()) {
            ProcessManager::getInstance()->getRpcCall(ClusterProcess::class, true)->my_reload($node_name);
        } else {
            get_instance()->server->reload();
        }
        $this->autoSend("ok");
    }
674040
async def reset_all(self, full=True):
        
        conn = await self.redis()

        if full:
            await conn.flushdb()
        else:
            keys = await conn.keys(self.generate_key('*'))
            await conn.delete(*keys)
234569
def reset(self):
        """"""
        if self._topology_type == TOPOLOGY_TYPE.ReplicaSetWithPrimary:
            topology_type = TOPOLOGY_TYPE.ReplicaSetNoPrimary
        else:
            topology_type = self._topology_type

        # The default ServerDescription's type is Unknown.
        sds = dict((address, ServerDescription(address))
                   for address in self._server_descriptions)

        return TopologyDescription(
            topology_type,
            sds,
            self._replica_set_name,
            self._max_set_version,
            self._max_election_id,
            self._topology_settings)
1135826
def reset(self):
        
        self.report("sending reset")
        try:
            self.p.stdin.write(bytes("T\n","utf-8"))
            self.p.stdin.flush()
        except IOError:
            self.report("could not send reset command")
604201
def reset(type = 'cold')
      if ['cold', 'warm'].include?(type)
        key = "#{type}-reset"
        command(key)
      else
        logger.error("reset type: #{type} is not a valid choice, use warm or cold") if logger
        raise "reset type: #{type} is not a valid choice, use warm or cold"
      end
    end
868673
def restart_cluster(name):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Restarting cluster'
        return ret

    __salt__['trafficserver.restart_cluster']()

    ret['result'] = True
    ret['comment'] = 'Restarted cluster'
    return ret
1317117
def reboot(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The stop action must be called with -a or --action.'
        )

    log.info('Rebooting node %s', name)

    instance_id = _get_node(name)['InstanceId']

    params = {'Action': 'RebootInstance',
              'InstanceId': instance_id}
    result = query(params)

    return result
1024374
def reload(self):
        """"""
        status = self.get_status()
        if status != 'running':
            raise ClusterError('cannot reload: cluster is not running')

        process = subprocess.run(
            [self._pg_ctl, 'reload', '-D', self._data_dir],
            stdout=subprocess.PIPE, stderr=subprocess.PIPE)

        stderr = process.stderr

        if process.returncode != 0:
            raise ClusterError(
                'pg_ctl stop exited with status {:d}: {}'.format(
                    process.returncode, stderr.decode()))
881907
def reconnect():
    
    post_save.connect(node_created_handler, sender=Node)
    node_status_changed.connect(node_status_changed_handler)
    pre_delete.connect(node_deleted_handler, sender=Node)
561599
def reset(resources, *args, **kwargs):
    
    test = kwargs.pop('test', False)
    client = redis.Redis(decode_responses=True, **kwargs)
    resources = resources if resources else find_resources(client)

    for resource in resources:
        # investigate sequences
        queue = Queue(client=client, resource=resource)
        values = client.mget(queue.keys.indicator, queue.keys.dispenser)
        try:
            indicator, dispenser = map(int, values)
        except TypeError:
            print('No such queue: "{}".'.format(resource))
            continue

        # do a bump if there appears to be a queue
        if dispenser - indicator + 1:
            queue.message('Reset tool bumps.')
            indicator = queue.bump()

        # do not reset when there is still a queue
        size = dispenser - indicator + 1
        if size:
            print('"{}" is in use by {} user(s).'.format(resource, size))
            continue

        # reset, except when someone is incoming
        with client.pipeline() as pipe:
            try:
                pipe.watch(queue.keys.dispenser)
                if test:
                    time.sleep(0.02)
                pipe.multi()
                pipe.delete(queue.keys.dispenser, queue.keys.indicator)
                pipe.execute()
            except redis.WatchError:
                print('Activity detected for "{}".'.format(resource))
20381
def reset
      self.user_agent         = DEFAULT_USER_AGENT
      self.environment        = DEFAULT_ENVIRONMENT
      self.api_version        = DEFAULT_API_VERSION
      self.server_url         = DEFAULT_SERVER_URL
      self.client_name        = DEFAULT_CLIENT_NAME
      self.client_key         = DEFAULT_CLIENT_KEY
      self.connection_options = DEFAULT_CONNECTION_OPTIONS
      self.middleware         = DEFAULT_MIDDLEWARE
      self.accept             = DEFAULT_ACCEPT
      self
    end
1351953
function(key, dest, containerName) {

      // Attempt to connect to redis
      return getRedisClient()

      // Run the redis query and then quit
      .then(function(redis) {
        log.debug(format('Setting DNS. %s => %s', key, dest));
        return Promise.fromNode(function(cb) {
          redis.multi()
          .del(key)
          .rpush(key, containerName)
          .rpush(key, dest)
          .exec(cb);
        })
        .then(function() {
          redis.quit();
        });
      });

    }
1323087
def _reset_on_error(self, server, func, *args, **kwargs):
        
        try:
            return func(*args, **kwargs)
        except NetworkTimeout:
            # The socket has been closed. Don't reset the server.
            raise
        except ConnectionFailure:
            self.__reset_server(server.description.address)
            raise
738555
function fork() {
            cluster.fork().on('message', function(message) {
                if (message.cmd === 'restart' && message.pid && restartQueue.indexOf(message.pid) === -1) {
                    // When worker asks to restart gracefully in cluster, then add it to restart queue.
                    log('Cluster graceful shutdown: queued. pid=' + message.pid);
                    restartQueue.push(message.pid);
                    checkRestartQueue();
                }
            });
        }
964017
def reset_cooldown(self, ctx):
        
        if self._buckets.valid:
            bucket = self._buckets.get_bucket(ctx.message)
            bucket.reset()