| 584 | } |
| 585 | |
| 586 | QByteArray RedisCluster::singleCommand(QString &str, int index) |
| 587 | { |
| 588 | str = str.trimmed(); |
| 589 | //str.replace(QRegExp("[\\s]+"), " "); |
| 590 | |
| 591 | if(str.isEmpty()) |
| 592 | return "-command is empty\r\n"; |
| 593 | |
| 594 | if(index == -1) { |
| 595 | if(_redisClient) |
| 596 | return _redisClient->command(str); |
| 597 | } else if(index > -1 && index < _vClusterClients.size()) { |
| 598 | if(_vClusterClients[index]._client) |
| 599 | return _vClusterClients[index]._client->command(str); |
| 600 | } |
| 601 | return "-client is empty\r\n"; |
| 602 | } |
| 603 | |
| 604 | RedisClient * RedisCluster::getClient(const QString &key) { |
| 605 | _byteArray = key.toLocal8Bit(); |