55 ::ll::TypedStorage<8, 112, ::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<::DBStorage::Options>> mOptions;
132 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::leveldb::DecompressAllocator>> mDecompressAllocator;
133 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::leveldb::DB>> mDb;
134 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mIOTaskGroup;
135 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mCompactionTaskGroup;
136 ::ll::TypedStorage<8, 16, ::Bedrock::Threading::Async<void>> mCompactionTask;
137 ::ll::TypedStorage<8, 16, ::Bedrock::Threading::Async<void>> mWriteTask;
138 ::ll::TypedStorage<8, 40, ::Core::LevelStorageResult> mState;
139 ::ll::TypedStorage<8, 8, ::ContentIdentity const*> mContentIdentity;
140 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mFullPath;
141 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mDbPath;
142 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
143 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mCompactionMutex;
144 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mWriteCacheMutex;
145 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mCacheFlushMutex;
146 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastCompactionStartTime;
147 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mCompactionInterval;
148 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mWriteFlushInterval;
149 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mAllowFlush;
150 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mSavingInProgress;
151 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mSnapshotInProgress;
152 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mShutdownStarted;
153 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mNoMoreWrites;
154 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mShutdownDone;
155 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mOutstandingJobs;
156 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::SaveTransactionManager>> mSaveTransactionManager;
157 ::ll::TypedStorage<8, 64, ::std::function<void()>> mCriticalSyncSaveCallback;
158 ::ll::TypedStorage<8, 64, ::std::function<void(::CompactionStatus)>> mExternallyRegisteredCompactionCallback;
164 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::LevelStorageObserver>>> mObservers;
165 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mDestructorInProgress;
166 ::ll::TypedStorage<1, 1, bool> mForceCorrupt;
167 ::ll::TypedStorage<1, 1, bool const> mStorageEnabled;
168 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mDbSubfolder;
169 ::ll::TypedStorage<8, 128, ::LevelStorageWriteBatch> mSingleKeyWrites;
170 ::ll::TypedStorage<8, 24, ::std::vector<::LevelStorageWriteBatch>> mBatchWrites;
171 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelStorageEventing>> mEventing;
172 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv>> mLevelDbEnv;
173 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::DBStorageFolderWatcher>>> mFolderTelemetryWatcher;
174 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNextSizeTelemetryCaptureTime;
175 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds const> mSizeTelemetryCaptureInterval;
176 ::ll::TypedStorage<8, 192, ::DBStoragePerformanceTelemetry> mDBStoragePerformanceTelemetry;
190 virtual void addStorageObserver(::std::unique_ptr<::LevelStorageObserver> observer) ;
193 virtual bool loadedSuccessfully() const ;
196 virtual ::Core::LevelStorageResult getState() const ;
200 createChunkStorage(::
std::unique_ptr<::
ChunkSource>, ::StorageVersion) ;
203 virtual ::Core::PathBuffer<::
std::
string> const& getFullPath() const ;
207 getCompoundTag(::
std::
string const& key, ::DBHelpers::Category category) ;
210 virtual
bool hasKey(::
std::string_view key, ::DBHelpers::Category category) const ;
213 virtual
bool loadLevelData(::
LevelData& data) ;
216 virtual
void saveLevelData(::
LevelData const& levelData) ;
219 virtual ::Bedrock::Threading::Async<
void>
220 saveData(::
std::
string const& key, ::
std::
string&& data, ::DBHelpers::Category category) ;
226 virtual ::Bedrock::Threading::Async<
void>
227 deleteData(::
std::
string const& key, ::DBHelpers::Category category) ;
230 virtual
bool loadData(::
std::string_view key, ::
std::
string&
buffer, ::DBHelpers::Category category) const
234 virtual
void forEachKeyWithPrefix(
235 ::
std::string_view prefix,
236 ::DBHelpers::Category category,
237 ::
std::function<
void(::
std::string_view, ::
std::string_view)> const& callback
241 virtual ::Core::LevelStorageResult getLevelStorageState() const ;
247 virtual
void startShutdown() ;
250 virtual
bool isShuttingDown() const ;
253 virtual
bool checkShutdownDone() ;
256 virtual
void getStatistics(::
std::
string& outStats, ::
LevelStorage::StatsType statsType) const ;
260 createSnapshot(::
std::
string const& filePrefix,
bool flushWriteCache) ;
263 virtual
void releaseSnapshot() ;
266 virtual ::Bedrock::Threading::Async<
void> compactStorage() ;
269 virtual
void syncAndSuspendStorage() ;
272 virtual
void resumeStorage() ;
275 virtual
void setFlushAllowed(
bool flushAllowed) ;
278 virtual
void flushToPermanentStorage() ;
281 virtual
void freeCaches() ;
284 virtual
void setCompactionCallback(::
std::function<
void(::CompactionStatus)> callback) ;
287 virtual
void setCriticalSyncSaveCallback(::
std::function<
void()> callback) ;
295 MCAPI ::
TaskResult _flushWriteCacheToLevelDB();
299 MCAPI ::
std::
string _getTelemetryMessage(::leveldb::Status const& status) const;
301 MCAPI
void _handleErrorStatus(::leveldb::Status const& status);
303 MCAPI
void _markAsCorrupted(::
std::string_view message) const;
307 MCAPI
void _mergeIntoWriteCache(::
std::
string const& key, ::
std::
string&& data, ::DBHelpers::Category category);
309 MCAPI
void _queueSaveCallback(
bool invokeImmediately);
312 ::
std::string_view prefix,
313 ::DBHelpers::Category category,
314 ::
std::function<
void(::
std::string_view, ::
std::string_view)> const& callback
318 _readPendingWrite(::
std::
string const& key, ::DBHelpers::Category category) const;
320 MCAPI
void _removeCorruptedMark() const;
322 MCAPI
void _scheduleNextAutoCompaction();
324 MCAPI
bool _suspendAndPerformSaveAction(
325 ::brstd::move_only_function<::
TaskResult()> action,
326 ::brstd::move_only_function<
void()> callback
329 MCAPI
bool tryRepair(::Core::
Path const& path) const;
349 MCFOLD
bool $loadedSuccessfully() const;
351 MCFOLD ::Core::LevelStorageResult $getState() const;
353 MCAPI ::Core::PathBuffer<::
std::
string> const& $getFullPath() const;
355 MCAPI ::
std::unique_ptr<::
CompoundTag> $getCompoundTag(::
std::
string const& key, ::DBHelpers::Category category);
357 MCAPI
bool $hasKey(::
std::string_view key, ::DBHelpers::Category category) const;
359 MCAPI
bool $loadLevelData(::
LevelData& data);
361 MCAPI
void $saveLevelData(::
LevelData const& levelData);
363 MCAPI ::Bedrock::Threading::Async<
void>
364 $saveData(::
std::
string const& key, ::
std::
string&& data, ::DBHelpers::Category category);
368 MCAPI ::Bedrock::Threading::Async<
void> $deleteData(::
std::
string const& key, ::DBHelpers::Category category);
370 MCAPI
bool $loadData(::
std::string_view key, ::
std::
string&
buffer, ::DBHelpers::Category category) const;
372 MCAPI
void $forEachKeyWithPrefix(
373 ::
std::string_view prefix,
374 ::DBHelpers::Category category,
375 ::
std::function<
void(::
std::string_view, ::
std::string_view)> const& callback
378 MCFOLD ::Core::LevelStorageResult $getLevelStorageState() const;
382 MCAPI
void $startShutdown();
384 MCAPI
bool $isShuttingDown() const;
386 MCAPI
bool $checkShutdownDone();
388 MCAPI
void $getStatistics(::
std::
string& outStats, ::
LevelStorage::StatsType statsType) const;
391 $createSnapshot(::
std::
string const& filePrefix,
bool flushWriteCache);
393 MCAPI
void $releaseSnapshot();
395 MCAPI ::Bedrock::Threading::Async<
void> $compactStorage();
397 MCAPI
void $syncAndSuspendStorage();
399 MCAPI
void $resumeStorage();
401 MCAPI
void $setFlushAllowed(
bool flushAllowed);
403 MCAPI
void $flushToPermanentStorage();
405 MCAPI
void $freeCaches();
407 MCAPI
void $setCompactionCallback(::
std::function<
void(::CompactionStatus)> callback);
409 MCAPI
void $setCriticalSyncSaveCallback(::
std::function<
void()> callback);