| 116 | } |
| 117 | |
| 118 | bool RocksDBStorageProvider::erase(const char *key, size_t cchKey) |
| 119 | { |
| 120 | rocksdb::Status status; |
| 121 | std::unique_lock<fastlock> l(m_lock); |
| 122 | std::string prefixed_key = prefixKey(key, cchKey); |
| 123 | if (!FKeyExists(prefixed_key)) |
| 124 | return false; |
| 125 | if (m_spbatch != nullptr) |
| 126 | { |
| 127 | status = m_spbatch->Delete(m_spcolfamily.get(), rocksdb::Slice(prefixed_key)); |
| 128 | } |
| 129 | else |
| 130 | { |
| 131 | status = m_spdb->Delete(WriteOptions(), m_spcolfamily.get(), rocksdb::Slice(prefixed_key)); |
| 132 | } |
| 133 | if (status.ok()) |
| 134 | --m_count; |
| 135 | return status.ok(); |
| 136 | } |
| 137 | |
| 138 | void RocksDBStorageProvider::retrieve(const char *key, size_t cchKey, callbackSingle fn) const |
| 139 | { |