根据传入的client列表构造高可用的redis缓存管理器

@param clients

@return
511377
public static RedisCacheManager of(List<RedisClient> clients) {
        RedisCacheManager redisCacheMgr = new RedisCacheManager();
        redisCacheMgr.setClientList(clients);
        return redisCacheMgr;
    }
1128640
def get_client_data(self, client):
        
        data = self._request('GET', '/clients/{}'.format(client))
        return data.json()
348159
protected JedisClientPool createRedisClientPool(String host, int port, String username,
            String password) {
        return createRedisClientPool(host, port, username, password, null);
    }
984944
protected function createClients(array $servers, array $options = [])
	{
		$clients = [];
		
		foreach ($servers as $key => $server) {
			
			$redis = new \Redis;
			//长连接为pconnect,长连接要注意执行close关闭
			$func =Arr::get($server,'persistent',false) ? 'pconnect' : 'connect';
			
			$redis->connect(Arr::get($server, 'host',''), Arr::get($server, 'port'), $this->timeOut);
			//有配置密码的，进行auth操作
			if ($pwd = Arr::get($server, 'password', '')) {
				$redis->auth($pwd);
			}
			
			$redis->select(Arr::get($server,'database'));
			//设置redis的option,如Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE
			foreach ($options as $key => $val) {
				$redis->setOption($key, $val);
			}
			
			$clients[$key] = $redis;
		}
		
		return $clients;
	}
672886
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients", method = RequestMethod.GET)
    public
    @ResponseBody
    HashMap<String, Object> getClientList(Model model,
                                          @PathVariable("profileIdentifier") String profileIdentifier) throws Exception {

        Integer profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
        return Utils.getJQGridJSON(clientService.findAllClients(profileId), "clients");
    }
2561
protected Map<ProviderInfo, ClientTransport> clearProviders() {
        providerLock.lock();
        try {
            // 当前存活+重试的
            HashMap<ProviderInfo, ClientTransport> all = new HashMap<ProviderInfo, ClientTransport>(aliveConnections);
            all.putAll(subHealthConnections);
            all.putAll(retryConnections);
            all.putAll(uninitializedConnections);
            subHealthConnections.clear();
            aliveConnections.clear();
            retryConnections.clear();
            uninitializedConnections.clear();
            return all;
        } finally {
            providerLock.unlock();
        }
    }
612664
public static RedissonClient create() {
        Config config = new Config();
        config.useSingleServer()
        .setTimeout(1000000)
        .setAddress("redis://127.0.0.1:6379");
//        config.useMasterSlaveConnection().setMasterAddress("127.0.0.1:6379").addSlaveAddress("127.0.0.1:6389").addSlaveAddress("127.0.0.1:6399");
//        config.useSentinelConnection().setMasterName("mymaster").addSentinelAddress("127.0.0.1:26389", "127.0.0.1:26379");
//        config.useClusterServers().addNodeAddress("127.0.0.1:7000");
        return create(config);
    }
1043103
public java.util.List<TargetNetwork> getClientVpnTargetNetworks() {
        if (clientVpnTargetNetworks == null) {
            clientVpnTargetNetworks = new com.amazonaws.internal.SdkInternalList<TargetNetwork>();
        }
        return clientVpnTargetNetworks;
    }
801003
function RedisStore (options) {
  options = options || {};
  this._host = options.host || '127.0.0.1';
  this._port = options.port || 6379;
  this._db = options.db || 0;
  this._prefix = options.prefix || '';
  this._pool = options.pool = (options.pool > 1 ? options.pool : 1);

  debug('create: host=%s, port=%s, db=%s, prefix=%s', this._host, this._port, this._db, this._prefix);

  // 兼容旧的redis模块配置
  options.password = options.password || options.auth_pass;

  this._clients = [];
  this._clientIndex = -1;
  for (var i = 0; i < options.pool; i++) {
    this._clients.push(new Redis(options));
  }

  return this;
}
44391
def parse_client_table(redis_client):
    
    NIL_CLIENT_ID = ray.ObjectID.nil().binary()
    message = redis_client.execute_command("RAY.TABLE_LOOKUP",
                                           ray.gcs_utils.TablePrefix.CLIENT,
                                           "", NIL_CLIENT_ID)

    # Handle the case where no clients are returned. This should only
    # occur potentially immediately after the cluster is started.
    if message is None:
        return []

    node_info = {}
    gcs_entry = ray.gcs_utils.GcsTableEntry.GetRootAsGcsTableEntry(message, 0)

    ordered_client_ids = []

    # Since GCS entries are append-only, we override so that
    # only the latest entries are kept.
    for i in range(gcs_entry.EntriesLength()):
        client = (ray.gcs_utils.ClientTableData.GetRootAsClientTableData(
            gcs_entry.Entries(i), 0))

        resources = {
            decode(client.ResourcesTotalLabel(i)):
            client.ResourcesTotalCapacity(i)
            for i in range(client.ResourcesTotalLabelLength())
        }
        client_id = ray.utils.binary_to_hex(client.ClientId())

        # If this client is being removed, then it must
        # have previously been inserted, and
        # it cannot have previously been removed.
        if not client.IsInsertion():
            assert client_id in node_info, "Client removed not found!"
            assert node_info[client_id]["IsInsertion"], (
                "Unexpected duplicate removal of client.")
        else:
            ordered_client_ids.append(client_id)

        node_info[client_id] = {
            "ClientID": client_id,
            "IsInsertion": client.IsInsertion(),
            "NodeManagerAddress": decode(
                client.NodeManagerAddress(), allow_none=True),
            "NodeManagerPort": client.NodeManagerPort(),
            "ObjectManagerPort": client.ObjectManagerPort(),
            "ObjectStoreSocketName": decode(
                client.ObjectStoreSocketName(), allow_none=True),
            "RayletSocketName": decode(
                client.RayletSocketName(), allow_none=True),
            "Resources": resources
        }
    # NOTE: We return the list comprehension below instead of simply doing
    # 'list(node_info.values())' in order to have the nodes appear in the order
    # that they joined the cluster. Python dictionaries do not preserve
    # insertion order. We could use an OrderedDict, but then we'd have to be
    # sure to only insert a given node a single time (clients that die appear
    # twice in the GCS log).
    return [node_info[client_id] for client_id in ordered_client_ids]
57124
private <T> T execute(RedisCallBack<T> redisCallBack, List<RedisClient> clients, Object key, boolean isRead) {
        for (int i = 0; i < getRetryTimes(); i++) {
            boolean result = redisCallBack.doInRedis(clients, isRead, key);
            if (result) {
                return redisCallBack.getResult();
            }
        }

        Throwable e = redisCallBack.getException();
        if (e != null) {
            logger.error("Return null because exception occurs: " + e.getMessage(), e);
        }
        return null;
    }
1038600
public static ArrayList<QueueModel> getQueues(Client client) throws IOException {
        return getQueues(client, null, null, null);
    }
1339732
func GetClients(query map[string]string, lastModifiedSince string) (*Clients, string, error) {
	clients := new(Clients)

	if lastModified, err := executeRequest("clients", query, lastModifiedSince, &clients); err != nil {
		return nil, "", err
	} else {
		return clients, lastModified, nil
	}
}
190647
public static List<RedisClusterNode> sortByClientCount(Iterable<RedisClusterNode> clusterNodes) {

        LettuceAssert.notNull(clusterNodes, "Cluster nodes must not be null");

        List<RedisClusterNode> ordered = LettuceLists.newList(clusterNodes);
        ordered.sort(ClientCountComparator.INSTANCE);
        return ordered;
    }
879241
public Client getClient(int clientId) throws Exception {
        Client client = null;

        PreparedStatement statement = null;
        ResultSet results = null;
        try (Connection sqlConnection = sqlService.getConnection()) {
            String queryString = "SELECT * FROM " + Constants.DB_TABLE_CLIENT +
                " WHERE " + Constants.GENERIC_ID + " = ?";

            statement = sqlConnection.prepareStatement(queryString);
            statement.setInt(1, clientId);

            results = statement.executeQuery();
            if (results.next()) {
                client = this.getClientFromResultSet(results);
            }
        } catch (Exception e) {
            throw e;
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }

        return client;
    }
46816
public static List<Integer> msgsPerClient(int numMsgs, int numClients) {
        List<Integer> counts = new ArrayList<Integer>(numClients);
        if (numClients == 0 || numMsgs == 0) {
            return counts;
        }
        int mc = numMsgs / numClients;
        for (int i = 0; i < numClients; i++) {
            counts.add(mc);
        }
        int extra = numMsgs % numClients;
        for (int i = 0; i < extra; i++) {
            counts.set(i, counts.get(i) + 1);
        }
        return counts;
    }
543475
def get_active_clients():
    """"""
    global drivers

    if not drivers:
        return jsonify([])

    result = {client: get_client_info(client) for client in drivers}
    return jsonify(result)