55 ::ll::TypedStorage<8, 2152, ::leveldb::Options> options;
56 ::ll::TypedStorage<8, 24, ::leveldb::ReadOptions> read;
57 ::ll::TypedStorage<1, 1, ::leveldb::WriteOptions> write;
65 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::std::string const>> mLatestValue;
66 ::ll::TypedStorage<1, 1, bool> mIsDeleted;
86 ::ll::TypedStorage<8, 8, ::std::atomic<int>*> mRefCounter;
106 ::ll::TypedStorage<8, 32, ::std::string> mKey;
107 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::std::string>> mValue;
108 ::ll::TypedStorage<4, 4, ::DBHelpers::Category> mCategory;
109 ::ll::TypedStorage<1, 1, bool> mIsDelete;
128 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DBStorageEnvironmentChain>> mEnvChain;
129 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::leveldb::Cache>> mCache;
130 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::leveldb::FilterPolicy const>> mFilterPolicy;
131 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::leveldb::Compressor>> mCompressor;
132 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::leveldb::Compressor>> mLegacyCompressor;
133 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DBStorage::Options>> mOptions;
134 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::leveldb::DecompressAllocator>> mDecompressAllocator;
135 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::leveldb::DB>> mDb;
136 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mIOTaskGroup;
137 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mCompactionTaskGroup;
138 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>>> mCompactionTask;
139 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>>> mWriteTask;
140 ::ll::TypedStorage<8, 40, ::Core::LevelStorageResult> mState;
141 ::ll::TypedStorage<8, 8, ::ContentIdentity const*> mContentIdentity;
142 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mFullPath;
143 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mDbPath;
144 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
145 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mCompactionMutex;
146 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mWriteCacheMutex;
147 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mCacheFlushMutex;
148 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastCompactionStartTime;
149 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mCompactionInterval;
150 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mWriteFlushInterval;
151 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mAllowFlush;
152 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mSavingInProgress;
153 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mSnapshotInProgress;
154 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mShutdownStarted;
155 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mNoMoreWrites;
156 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mShutdownDone;
157 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mOutstandingJobs;
158 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::SaveTransactionManager>> mSaveTransactionManager;
159 ::ll::TypedStorage<8, 64, ::std::function<void()>> mCriticalSyncSaveCallback;
160 ::ll::TypedStorage<8, 64, ::std::function<void(::CompactionStatus)>> mExternallyRegisteredCompactionCallback;
166 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::LevelStorageObserver>>> mObservers;
167 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mDestructorInProgress;
168 ::ll::TypedStorage<1, 1, bool> mForceCorrupt;
169 ::ll::TypedStorage<1, 1, bool const> mStorageEnabled;
170 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mDbSubfolder;
171 ::ll::TypedStorage<8, 128, ::LevelStorageWriteBatch> mSingleKeyWrites;
172 ::ll::TypedStorage<8, 24, ::std::vector<::LevelStorageWriteBatch>> mBatchWrites;
173 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelStorageEventing>> mEventing;
174 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv>> mLevelDbEnv;
175 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::DBStorageFolderWatcher>>> mFolderTelemetryWatcher;
176 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNextSizeTelemetryCaptureTime;
177 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds const> mSizeTelemetryCaptureInterval;
178 ::ll::TypedStorage<8, 192, ::DBStoragePerformanceTelemetry> mDBStoragePerformanceTelemetry;
192 virtual void addStorageObserver(::std::unique_ptr<::LevelStorageObserver> observer) ;
195 virtual bool loadedSuccessfully() const ;
198 virtual ::Core::LevelStorageResult getState() const ;
202 createChunkStorage(::
std::unique_ptr<::
ChunkSource>, ::StorageVersion) ;
205 virtual ::Core::PathBuffer<::
std::
string> const& getFullPath() const ;
209 getCompoundTag(::
std::
string const& key, ::DBHelpers::Category category) ;
212 virtual
bool hasKey(::
std::string_view key, ::DBHelpers::Category category) const ;
215 virtual
bool loadLevelData(::
LevelData& data) ;
218 virtual
void saveLevelData(::
LevelData const& levelData) ;
221 virtual ::
std::shared_ptr<::Bedrock::Threading::IAsyncResult<
void>>
222 saveData(::
std::
string const& key, ::
std::
string&& data, ::DBHelpers::Category category) ;
225 virtual ::
std::shared_ptr<::Bedrock::Threading::IAsyncResult<
void>>
229 virtual ::
std::shared_ptr<::Bedrock::Threading::IAsyncResult<
void>>
230 deleteData(::
std::
string const& key, ::DBHelpers::Category category) ;
233 virtual
bool loadData(::
std::string_view key, ::
std::
string&
buffer, ::DBHelpers::Category category) const
237 virtual
void forEachKeyWithPrefix(
238 ::
std::string_view prefix,
239 ::DBHelpers::Category category,
240 ::
std::function<
void(::
std::string_view, ::
std::string_view)> const& callback
244 virtual ::Core::LevelStorageResult getLevelStorageState() const ;
250 virtual
void startShutdown() ;
253 virtual
bool isShuttingDown() const ;
256 virtual
bool checkShutdownDone() ;
259 virtual
void getStatistics(::
std::
string& outStats, ::
LevelStorage::StatsType statsType) const ;
263 createSnapshot(::
std::
string const& filePrefix,
bool flushWriteCache) ;
266 virtual
void releaseSnapshot() ;
269 virtual ::
std::shared_ptr<::Bedrock::Threading::IAsyncResult<
void>> compactStorage() ;
272 virtual
void syncAndSuspendStorage() ;
275 virtual
void resumeStorage() ;
278 virtual
void setFlushAllowed(
bool flushAllowed) ;
281 virtual
void flushToPermanentStorage() ;
284 virtual
void freeCaches() ;
287 virtual
void setCompactionCallback(::
std::function<
void(::CompactionStatus)> callback) ;
290 virtual
void setCriticalSyncSaveCallback(::
std::function<
void()> callback) ;
298 MCAPI ::
TaskResult _flushWriteCacheToLevelDB();
302 MCAPI ::
std::
string _getTelemetryMessage(::leveldb::Status const& status) const;
304 MCAPI
void _handleErrorStatus(::leveldb::Status const& status);
306 MCAPI
void _markAsCorrupted(::
std::string_view message) const;
310 MCAPI
void _mergeIntoWriteCache(::
std::
string const& key, ::
std::
string&& data, ::DBHelpers::Category category);
312 MCAPI
void _queueSaveCallback(
bool invokeImmediately);
315 ::
std::string_view prefix,
316 ::DBHelpers::Category category,
317 ::
std::function<
void(::
std::string_view, ::
std::string_view)> const& callback
321 _readPendingWrite(::
std::
string const& key, ::DBHelpers::Category category) const;
323 MCAPI
void _scheduleNextAutoCompaction();
325 MCAPI
bool _suspendAndPerformSaveAction(
326 ::brstd::move_only_function<::
TaskResult()> action,
327 ::brstd::move_only_function<
void()> callback
330 MCAPI
bool tryRepair(::Core::
Path const& path) const;
350 MCAPI
bool $loadedSuccessfully() const;
352 MCFOLD ::Core::LevelStorageResult $getState() const;
354 MCFOLD ::Core::PathBuffer<::
std::
string> const& $getFullPath() const;
356 MCAPI ::
std::unique_ptr<::
CompoundTag> $getCompoundTag(::
std::
string const& key, ::DBHelpers::Category category);
358 MCAPI
bool $hasKey(::
std::string_view key, ::DBHelpers::Category category) const;
360 MCAPI
bool $loadLevelData(::
LevelData& data);
362 MCAPI
void $saveLevelData(::
LevelData const& levelData);
364 MCAPI ::
std::shared_ptr<::Bedrock::Threading::IAsyncResult<
void>>
365 $saveData(::
std::
string const& key, ::
std::
string&& data, ::DBHelpers::Category category);
369 MCAPI ::
std::shared_ptr<::Bedrock::Threading::IAsyncResult<
void>>
370 $deleteData(::
std::
string const& key, ::DBHelpers::Category category);
372 MCAPI
bool $loadData(::
std::string_view key, ::
std::
string&
buffer, ::DBHelpers::Category category) const;
374 MCAPI
void $forEachKeyWithPrefix(
375 ::
std::string_view prefix,
376 ::DBHelpers::Category category,
377 ::
std::function<
void(::
std::string_view, ::
std::string_view)> const& callback
380 MCFOLD ::Core::LevelStorageResult $getLevelStorageState() const;
384 MCAPI
void $startShutdown();
386 MCAPI
bool $isShuttingDown() const;
388 MCAPI
bool $checkShutdownDone();
390 MCAPI
void $getStatistics(::
std::
string& outStats, ::
LevelStorage::StatsType statsType) const;
393 $createSnapshot(::
std::
string const& filePrefix,
bool flushWriteCache);
395 MCAPI
void $releaseSnapshot();
397 MCAPI ::
std::shared_ptr<::Bedrock::Threading::IAsyncResult<
void>> $compactStorage();
399 MCAPI
void $syncAndSuspendStorage();
401 MCAPI
void $resumeStorage();
403 MCAPI
void $setFlushAllowed(
bool flushAllowed);
405 MCAPI
void $flushToPermanentStorage();
407 MCAPI
void $freeCaches();
409 MCAPI
void $setCompactionCallback(::
std::function<
void(::CompactionStatus)> callback);
411 MCAPI
void $setCriticalSyncSaveCallback(::
std::function<
void()> callback);