LeviLamina
Loading...
Searching...
No Matches
DBStorage Class Reference
+ Inheritance diagram for DBStorage:

Classes

struct  CommitOperation
 
class  DBStorageToken
 
class  Options
 
struct  PendingWriteResult
 

Public Types

enum class  StatsType : uint {
  Level0 = 0 , Level1 = 1 , Level2 = 2 , Memory = 3 ,
  Default = 0
}
 

Public Member Functions

virtual void addStorageObserver (::std::unique_ptr<::LevelStorageObserver > observer)
 
virtual bool loadedSuccessfully () const
 
virtual::Core::LevelStorageResult getState () const
 
virtual ::std::unique_ptr<::ChunkSourcecreateChunkStorage (::std::unique_ptr<::ChunkSource >, ::StorageVersion)
 
virtual ::Core::PathBuffer<::std::string > const & getFullPath () const
 
virtual ::std::unique_ptr<::CompoundTaggetCompoundTag (::std::string const &key, ::DBHelpers::Category category)
 
virtual bool hasKey (::std::string_view key, ::DBHelpers::Category category) const
 
virtual bool loadLevelData (::LevelData &data)
 
virtual void saveLevelData (::LevelData const &levelData)
 
virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > saveData (::std::string const &key, ::std::string &&data, ::DBHelpers::Category category)
 
virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > saveData (::LevelStorageWriteBatch const &batch)
 
virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > deleteData (::std::string const &key, ::DBHelpers::Category category)
 
virtual bool loadData (::std::string_view key, ::std::string &buffer, ::DBHelpers::Category category) const
 
virtual void forEachKeyWithPrefix (::std::string_view prefix, ::DBHelpers::Category category, ::std::function< void(::std::string_view, ::std::string_view)> const &callback) const
 
virtual::Core::LevelStorageResult getLevelStorageState () const
 
virtual::ContentIdentity const * getContentIdentity () const
 
virtual void startShutdown ()
 
virtual bool isShuttingDown () const
 
virtual bool checkShutdownDone ()
 
virtual void getStatistics (::std::string &outStats, ::LevelStorage::StatsType statsType) const
 
virtual ::std::vector<::SnapshotFilenameAndLengthcreateSnapshot (::std::string const &filePrefix, bool flushWriteCache)
 
virtual void releaseSnapshot ()
 
virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > compactStorage ()
 
virtual void syncAndSuspendStorage ()
 
virtual void resumeStorage ()
 
virtual void setFlushAllowed (bool flushAllowed)
 
virtual void flushToPermanentStorage ()
 
virtual void freeCaches ()
 
virtual void setCompactionCallback (::std::function< void(::CompactionStatus)> callback)
 
virtual void setCriticalSyncSaveCallback (::std::function< void()> callback)
 
MCAPI DBStorage (::DBStorageConfig config, ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv > levelDbEnv)
 
MCAPI::TaskResult _flushWriteCacheToLevelDB ()
 
MCAPI ::std::map<::std::string, ::DBStorage::PendingWriteResult_getAllPendingWrites () const
 
MCAPI::std::string _getTelemetryMessage (::leveldb::Status const &status) const
 
MCAPI void _handleErrorStatus (::leveldb::Status const &status)
 
MCAPI void _markAsCorrupted (::std::string_view message) const
 
MCAPI void _mergeIntoWriteCache (::LevelStorageWriteBatch const &batchToMerge)
 
MCAPI void _mergeIntoWriteCache (::std::string const &key, ::std::string &&data, ::DBHelpers::Category category)
 
MCAPI void _queueSaveCallback (bool invokeImmediately)
 
MCAPI void _read (::std::string_view prefix, ::DBHelpers::Category category, ::std::function< void(::std::string_view, ::std::string_view)> const &callback) const
 
MCAPI::DBStorage::PendingWriteResult _readPendingWrite (::std::string const &key, ::DBHelpers::Category category) const
 
MCAPI void _scheduleNextAutoCompaction ()
 
MCAPI bool _suspendAndPerformSaveAction (::brstd::move_only_function<::TaskResult()> action, ::brstd::move_only_function< void()> callback)
 
MCAPI bool tryRepair (::Core::Path const &path) const
 
MCAPI void * $ctor (::DBStorageConfig config, ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv > levelDbEnv)
 
MCAPI void $dtor ()
 
MCAPI void $addStorageObserver (::std::unique_ptr<::LevelStorageObserver > observer)
 
MCAPI bool $loadedSuccessfully () const
 
MCFOLD::Core::LevelStorageResult $getState () const
 
MCFOLD ::Core::PathBuffer<::std::string > const & $getFullPath () const
 
MCAPI ::std::unique_ptr<::CompoundTag$getCompoundTag (::std::string const &key, ::DBHelpers::Category category)
 
MCAPI bool $hasKey (::std::string_view key, ::DBHelpers::Category category) const
 
MCAPI bool $loadLevelData (::LevelData &data)
 
MCAPI void $saveLevelData (::LevelData const &levelData)
 
MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > $saveData (::std::string const &key, ::std::string &&data, ::DBHelpers::Category category)
 
MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > $saveData (::LevelStorageWriteBatch const &batch)
 
MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > $deleteData (::std::string const &key, ::DBHelpers::Category category)
 
MCAPI bool $loadData (::std::string_view key, ::std::string &buffer, ::DBHelpers::Category category) const
 
MCAPI void $forEachKeyWithPrefix (::std::string_view prefix, ::DBHelpers::Category category, ::std::function< void(::std::string_view, ::std::string_view)> const &callback) const
 
MCFOLD::Core::LevelStorageResult $getLevelStorageState () const
 
MCFOLD::ContentIdentity const * $getContentIdentity () const
 
MCAPI void $startShutdown ()
 
MCAPI bool $isShuttingDown () const
 
MCAPI bool $checkShutdownDone ()
 
MCAPI void $getStatistics (::std::string &outStats, ::LevelStorage::StatsType statsType) const
 
MCAPI ::std::vector<::SnapshotFilenameAndLength$createSnapshot (::std::string const &filePrefix, bool flushWriteCache)
 
MCAPI void $releaseSnapshot ()
 
MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > $compactStorage ()
 
MCAPI void $syncAndSuspendStorage ()
 
MCAPI void $resumeStorage ()
 
MCAPI void $setFlushAllowed (bool flushAllowed)
 
MCAPI void $flushToPermanentStorage ()
 
MCAPI void $freeCaches ()
 
MCAPI void $setCompactionCallback (::std::function< void(::CompactionStatus)> callback)
 
MCAPI void $setCriticalSyncSaveCallback (::std::function< void()> callback)
 
MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > saveData (::std::string const &key, ::CompoundTag const &tag, ::DBHelpers::Category category)
 
virtual bool clonePlayerData (::std::string_view fromKey, ::std::string_view toKey)
 
virtual void corruptLevel ()
 
MCAPI::std::string getServerId (::Player const &client, bool isXboxLive)
 
MCAPI ::std::vector<::std::string > loadAllPlayerIDs (bool includeLocalPlayer) const
 
MCAPI ::std::unique_ptr<::CompoundTagloadServerPlayerData (::Player const &client, bool isXboxLive)
 
MCAPI void save (::Player &player)
 
MCAPI bool $clonePlayerData (::std::string_view fromKey, ::std::string_view toKey)
 
MCFOLD void $corruptLevel ()
 

Static Public Member Functions

static MCAPI void ** $vftable ()
 
static MCAPI ::std::string const & LEGACY_CONSOLE_PLAYER_PREFIX ()
 
static MCAPI ::std::string const & LOCAL_PLAYER_TAG ()
 

Public Attributes

::ll::TypedStorage< 8, 8, ::std::unique_ptr<::DBStorageEnvironmentChain > > mEnvChain
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::leveldb::Cache > > mCache
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::leveldb::FilterPolicy const > > mFilterPolicy
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::leveldb::Compressor > > mCompressor
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::leveldb::Compressor > > mLegacyCompressor
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::DBStorage::Options > > mOptions
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::leveldb::DecompressAllocator > > mDecompressAllocator
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::leveldb::DB > > mDb
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::TaskGroup > > mIOTaskGroup
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::TaskGroup > > mCompactionTaskGroup
 
::ll::TypedStorage< 8, 16, ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > > mCompactionTask
 
::ll::TypedStorage< 8, 16, ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > > mWriteTask
 
::ll::TypedStorage< 8, 40, ::Core::LevelStorageResultmState
 
::ll::TypedStorage< 8, 8, ::ContentIdentity const * > mContentIdentity
 
::ll::TypedStorage< 8, 32, ::Core::PathBuffer<::std::string > > mFullPath
 
::ll::TypedStorage< 8, 32, ::Core::PathBuffer<::std::string > > mDbPath
 
::ll::TypedStorage< 8, 32, ::std::string > mLevelId
 
::ll::TypedStorage< 8, 80, ::Bedrock::Threading::MutexmCompactionMutex
 
::ll::TypedStorage< 8, 8, ::std::shared_mutex > mWriteCacheMutex
 
::ll::TypedStorage< 8, 80, ::Bedrock::Threading::MutexmCacheFlushMutex
 
::ll::TypedStorage< 8, 8, ::std::chrono::steady_clock::time_point > mLastCompactionStartTime
 
::ll::TypedStorage< 8, 8, ::std::chrono::nanoseconds > mCompactionInterval
 
::ll::TypedStorage< 8, 8, ::std::chrono::nanoseconds > mWriteFlushInterval
 
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mAllowFlush
 
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mSavingInProgress
 
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mSnapshotInProgress
 
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mShutdownStarted
 
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mNoMoreWrites
 
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mShutdownDone
 
::ll::TypedStorage< 4, 4, ::std::atomic< int > > mOutstandingJobs
 
::ll::TypedStorage< 8, 24, ::Bedrock::NonOwnerPointer<::SaveTransactionManager > > mSaveTransactionManager
 
::ll::TypedStorage< 8, 64, ::std::function< void()> > mCriticalSyncSaveCallback
 
::ll::TypedStorage< 8, 64, ::std::function< void(::CompactionStatus)> > mExternallyRegisteredCompactionCallback
 
::ll::TypedStorage< 8, 40, ::brstd::flat_set<::DBChunkStorage *, ::std::less<::DBChunkStorage * >, ::std::vector<::DBChunkStorage * > > > mChunkStorages
 
::ll::TypedStorage< 8, 24, ::std::vector<::std::unique_ptr<::LevelStorageObserver > > > mObservers
 
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mDestructorInProgress
 
::ll::TypedStorage< 1, 1, bool > mForceCorrupt
 
::ll::TypedStorage< 1, 1, bool const > mStorageEnabled
 
::ll::TypedStorage< 8, 32, ::Core::PathBuffer<::std::string > > mDbSubfolder
 
::ll::TypedStorage< 8, 128, ::LevelStorageWriteBatchmSingleKeyWrites
 
::ll::TypedStorage< 8, 24, ::std::vector<::LevelStorageWriteBatch > > mBatchWrites
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::LevelStorageEventing > > mEventing
 
::ll::TypedStorage< 8, 24, ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv > > mLevelDbEnv
 
::ll::TypedStorage< 8, 8, ::gsl::not_null<::std::unique_ptr<::DBStorageFolderWatcher > > > mFolderTelemetryWatcher
 
::ll::TypedStorage< 8, 8, ::std::chrono::steady_clock::time_point > mNextSizeTelemetryCaptureTime
 
::ll::TypedStorage< 8, 8, ::std::chrono::nanoseconds const > mSizeTelemetryCaptureInterval
 
::ll::TypedStorage< 8, 192, ::DBStoragePerformanceTelemetrymDBStoragePerformanceTelemetry
 

Member Function Documentation

◆ addStorageObserver()

virtual void DBStorage::addStorageObserver ( ::std::unique_ptr<::LevelStorageObserver > observer)
virtual

Implements LevelStorage.

◆ loadedSuccessfully()

virtual bool DBStorage::loadedSuccessfully ( ) const
virtual

Reimplemented from LevelStorage.

◆ getState()

virtual::Core::LevelStorageResult DBStorage::getState ( ) const
virtual

Implements LevelStorage.

◆ createChunkStorage()

virtual ::std::unique_ptr<::ChunkSource > DBStorage::createChunkStorage ( ::std::unique_ptr<::ChunkSource > ,
::StorageVersion  )
virtual

Implements LevelStorage.

◆ getFullPath()

virtual ::Core::PathBuffer<::std::string > const & DBStorage::getFullPath ( ) const
virtual

Implements LevelStorage.

◆ getCompoundTag()

virtual ::std::unique_ptr<::CompoundTag > DBStorage::getCompoundTag ( ::std::string const & key,
::DBHelpers::Category category )
virtual

Implements LevelStorage.

◆ hasKey()

virtual bool DBStorage::hasKey ( ::std::string_view key,
::DBHelpers::Category category ) const
virtual

Implements LevelStorage.

◆ loadLevelData()

virtual bool DBStorage::loadLevelData ( ::LevelData & data)
virtual

Implements LevelStorage.

◆ saveLevelData()

virtual void DBStorage::saveLevelData ( ::LevelData const & levelData)
virtual

Implements LevelStorage.

◆ saveData() [1/2]

virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > DBStorage::saveData ( ::std::string const & key,
::std::string && data,
::DBHelpers::Category category )
virtual

Implements LevelStorage.

◆ saveData() [2/2]

virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > DBStorage::saveData ( ::LevelStorageWriteBatch const & batch)
virtual

Implements LevelStorage.

◆ deleteData()

virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > DBStorage::deleteData ( ::std::string const & key,
::DBHelpers::Category category )
virtual

Implements LevelStorage.

◆ loadData()

virtual bool DBStorage::loadData ( ::std::string_view key,
::std::string & buffer,
::DBHelpers::Category category ) const
virtual

Reimplemented from LevelStorage.

◆ forEachKeyWithPrefix()

virtual void DBStorage::forEachKeyWithPrefix ( ::std::string_view prefix,
::DBHelpers::Category category,
::std::function< void(::std::string_view, ::std::string_view)> const & callback ) const
virtual

Implements LevelStorage.

◆ getLevelStorageState()

virtual::Core::LevelStorageResult DBStorage::getLevelStorageState ( ) const
virtual

Implements LevelStorage.

◆ getContentIdentity()

virtual::ContentIdentity const * DBStorage::getContentIdentity ( ) const
virtual

Implements LevelStorage.

◆ startShutdown()

virtual void DBStorage::startShutdown ( )
virtual

Implements LevelStorage.

◆ isShuttingDown()

virtual bool DBStorage::isShuttingDown ( ) const
virtual

Implements LevelStorage.

◆ checkShutdownDone()

virtual bool DBStorage::checkShutdownDone ( )
virtual

Implements LevelStorage.

◆ getStatistics()

virtual void DBStorage::getStatistics ( ::std::string & outStats,
::LevelStorage::StatsType statsType ) const
virtual

Implements LevelStorage.

◆ createSnapshot()

virtual ::std::vector<::SnapshotFilenameAndLength > DBStorage::createSnapshot ( ::std::string const & filePrefix,
bool flushWriteCache )
virtual

Implements LevelStorage.

◆ releaseSnapshot()

virtual void DBStorage::releaseSnapshot ( )
virtual

Implements LevelStorage.

◆ compactStorage()

virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult< void > > DBStorage::compactStorage ( )
virtual

Implements LevelStorage.

◆ syncAndSuspendStorage()

virtual void DBStorage::syncAndSuspendStorage ( )
virtual

Implements LevelStorage.

◆ resumeStorage()

virtual void DBStorage::resumeStorage ( )
virtual

Implements LevelStorage.

◆ setFlushAllowed()

virtual void DBStorage::setFlushAllowed ( bool flushAllowed)
virtual

Implements LevelStorage.

◆ flushToPermanentStorage()

virtual void DBStorage::flushToPermanentStorage ( )
virtual

Implements LevelStorage.

◆ freeCaches()

virtual void DBStorage::freeCaches ( )
virtual

Reimplemented from LevelStorage.

◆ setCompactionCallback()

virtual void DBStorage::setCompactionCallback ( ::std::function< void(::CompactionStatus)> callback)
virtual

Implements LevelStorage.

◆ setCriticalSyncSaveCallback()

virtual void DBStorage::setCriticalSyncSaveCallback ( ::std::function< void()> callback)
virtual

Implements LevelStorage.

◆ $vftable()

static MCAPI void ** DBStorage::$vftable ( )
static
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

The documentation for this class was generated from the following file: