If the file already exists, pageSize might be different than desiredPageSize Use pageCacheSizeBytes == 0 to use default from flow knobs If memoryOnly is true, the pager will exist only in memory and once the cache is full writes will fail. Note that ownership is not taken for keyProvider and it must outlive the pager
| 2209 | // If memoryOnly is true, the pager will exist only in memory and once the cache is full writes will fail. |
| 2210 | // Note that ownership is not taken for keyProvider and it must outlive the pager |
| 2211 | DWALPager(int desiredPageSize, |
| 2212 | int desiredExtentSize, |
| 2213 | std::string filename, |
| 2214 | int64_t pageCacheSizeBytes, |
| 2215 | int64_t remapCleanupWindowBytes, |
| 2216 | int concurrentExtentReads, |
| 2217 | bool memoryOnly, |
| 2218 | std::shared_ptr<IEncryptionKeyProvider> keyProvider, |
| 2219 | Promise<Void> errorPromise = {}) |
| 2220 | : keyProvider(keyProvider), ioLock(FLOW_KNOBS->MAX_OUTSTANDING, ioMaxPriority, FLOW_KNOBS->MAX_OUTSTANDING / 2), |
| 2221 | pageCacheBytes(pageCacheSizeBytes), desiredPageSize(desiredPageSize), desiredExtentSize(desiredExtentSize), |
| 2222 | filename(filename), memoryOnly(memoryOnly), errorPromise(errorPromise), |
| 2223 | remapCleanupWindowBytes(remapCleanupWindowBytes), concurrentExtentReads(new FlowLock(concurrentExtentReads)) { |
| 2224 | |
| 2225 | if (keyProvider == nullptr) { |
| 2226 | keyProvider = std::make_shared<NullKeyProvider>(); |
| 2227 | } |
| 2228 | |
| 2229 | // This sets the page cache size for all PageCacheT instances using the same evictor |
| 2230 | pageCache.evictor().sizeLimit = pageCacheBytes; |
| 2231 | |
| 2232 | if (!g_redwoodMetricsActor.isValid()) { |
| 2233 | g_redwoodMetricsActor = redwoodMetricsLogger(); |
| 2234 | } |
| 2235 | |
| 2236 | commitFuture = Void(); |
| 2237 | recoverFuture = forwardError(recover(this), errorPromise); |
| 2238 | } |
| 2239 | |
| 2240 | std::string getName() const override { return filename; } |
| 2241 |
no test coverage detected