| 305 | |
| 306 | template<typename K> |
| 307 | size_t EstimateSize(const K& key_begin, const K& key_end) const |
| 308 | { |
| 309 | CDataStream ssKey1(SER_DISK, CLIENT_VERSION), ssKey2(SER_DISK, CLIENT_VERSION); |
| 310 | ssKey1.reserve(DBWRAPPER_PREALLOC_KEY_SIZE); |
| 311 | ssKey2.reserve(DBWRAPPER_PREALLOC_KEY_SIZE); |
| 312 | ssKey1 << key_begin; |
| 313 | ssKey2 << key_end; |
| 314 | leveldb::Slice slKey1((const char*)ssKey1.data(), ssKey1.size()); |
| 315 | leveldb::Slice slKey2((const char*)ssKey2.data(), ssKey2.size()); |
| 316 | uint64_t size = 0; |
| 317 | leveldb::Range range(slKey1, slKey2); |
| 318 | pdb->GetApproximateSizes(&range, 1, &size); |
| 319 | return size; |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * Compact a certain range of keys in the database. |
nothing calls this directly
no test coverage detected