| 198 | } |
| 199 | |
| 200 | bool SSDBClient::DelKey( const std::string& key ) |
| 201 | { |
| 202 | Base::Mutex::ScopedLock scopedLock(m_oMutex); |
| 203 | std::string realKey = RealKey(key); |
| 204 | std::string type; |
| 205 | if (!Type(key, type)) return false; |
| 206 | if (type == "string") |
| 207 | { |
| 208 | m_Client->del(realKey); |
| 209 | } |
| 210 | else if (type == "hash") |
| 211 | { |
| 212 | int64_t size; |
| 213 | m_Client->hclear(realKey, &size); |
| 214 | } |
| 215 | else if (type == "zset") |
| 216 | { |
| 217 | int64_t size; |
| 218 | m_Client->zclear(realKey, &size); |
| 219 | } |
| 220 | else if (type == "queue") |
| 221 | { |
| 222 | m_Client->request("qclear", realKey); |
| 223 | } |
| 224 | return true; |
| 225 | } |
| 226 | |
| 227 | bool SSDBClient::UpdateData( const std::string& key, |
| 228 | const std::string& oldValue, |