NCBI C++ ToolKit
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CSpaceShrinker Class Reference

Search Toolkit Book for CSpaceShrinker

#include "storage_types.hpp"
(Private to src/app/netcache.)

+ Inheritance diagram for CSpaceShrinker:
+ Collaboration diagram for CSpaceShrinker:

Public Member Functions

 CSpaceShrinker (void)
virtual ~CSpaceShrinker (void)
- Public Member Functions inherited from CSrvTask
 CSrvTask (void)
void SetRunnable (bool boost=false)
 Set this task "runnable", i.e. More...
void RunAfter (Uint4 delay_sec)
 This call is basically equivalent to SetRunnable() but with guarantee that task will be scheduled for execution no earlier than delay_sec later (approximately, can be up to a second less if measured in absolute wall time). More...
virtual void Terminate (void)
 Stops task's execution and deletes it. More...
void SetPriority (Uint4 prty)
 Set and retrieve task's priority. More...
Uint4 GetPriority (void)
void CreateNewDiagCtx (void)
 Create new diagnostic context for this task to work in. More...
void SetDiagCtx (CRequestContext *ctx)
 Set diagnostic context for this task to work in. More...
CRequestContextGetDiagCtx (void)
 Get current diagnostic context for the task. More...
void ReleaseDiagCtx (void)
 Releases current diagnostic context of the task. More...
virtual ~CSrvTask (void)
virtual void InternalRunSlice (TSrvThreadNum thr_num)
 This is the real time slice execution method called from TaskServer. More...
- Public Member Functions inherited from CSrvTransConsumer
 CSrvTransConsumer (void)
virtual ~CSrvTransConsumer (void)
bool IsTransFinished (void)
 Check if transition completeness was consumed. More...

Private Types

typedef vector< CSrvRef< SNCDBFileInfo > > TFilesList

Private Member Functions

State x_PrepareToShrink (void)
State x_DeleteNextFile (void)
State x_StartMoves (void)
State x_MoveNextRecord (void)
State x_CheckCurVersion (void)
State x_MoveRecord (void)
State x_FinishMoveRecord (void)
State x_FinishMoves (void)
State x_FinishSession (void)
SNCDataCoord x_FindMetaCoord (SNCDataCoord coord, Uint1 max_map_depth)

Private Attributes

TFilesList m_FilesToDel
TFilesList::iterator m_CurDelFile
CSrvRef< SNCDBFileInfom_MaxFile
CSrvRef< SNCBlobVerDatam_CurVer
int m_StartTime
Uint4 m_RecNum
Uint4 m_PrevRecNum
Uint4 m_LastAlive
Uint4 m_CntProcessed
Uint4 m_CntMoved
Uint4 m_SizeMoved
bool m_Failed
bool m_MovingMeta
TFileRecsMap m_RecsMap

Additional Inherited Members

- Static Public Member Functions inherited from CSrvTask
static void PrintState (CSrvSocketTask &task)
- Public Attributes inherited from CSrvTask
TSrvTaskListHook m_TaskListHook
 Hook to put this task into TSrvTaskList. More...
TSrvThreadNum m_LastThread
 Thread number where this task was executed last time. More...
TSrvTaskFlags m_TaskFlags
 Bit-OR of flags for this task. More...
int m_LastActive
 Time (in seconds) when the task was active last time, i.e. More...
Uint4 m_Priority
 Task's priority. More...
 Current diagnostic context for this task. More...
CRequestContext ** m_DiagChain
 Nested diagnostic contexts of this task. More...
size_t m_DiagChainSize
 Timer ticket assigned to this task when it calls RunAfter(). More...
CSrvTaskTerminator m_Terminator
 Object that will delete this task after call to Terminate(). More...
- Public Attributes inherited from CSrvTransConsumer
bool m_TransFinished
 Flag showing that transition was already consumed. More...
- Protected Types inherited from CSrvStatesTask< CSpaceShrinker >
typedef CSpaceShrinker Me
 Convenient typedef to use in state pointers. More...
typedef State(Me::* FStateFunc) (void)
 State-implementing method typedef. More...
- Protected Member Functions inherited from CSrvStatesTask< CSpaceShrinker >
 CSrvStatesTask (void)
virtual ~CSrvStatesTask (void)
void SetState (State state)
 Sets current state of the machine. More...
virtual void ExecuteSlice (TSrvThreadNum)
 Time slice execution for the state machine. More...

Detailed Description

Definition at line 303 of file storage_types.hpp.

Member Typedef Documentation

◆ TFilesList

Definition at line 324 of file storage_types.hpp.

Constructor & Destructor Documentation

◆ CSpaceShrinker()

CSpaceShrinker::CSpaceShrinker ( void  )

◆ ~CSpaceShrinker()

CSpaceShrinker::~CSpaceShrinker ( void  )

Definition at line 4566 of file nc_storage.cpp.

Member Function Documentation

◆ x_CheckCurVersion()

CSpaceShrinker::State CSpaceShrinker::x_CheckCurVersion ( void  )

◆ x_DeleteNextFile()

CSpaceShrinker::State CSpaceShrinker::x_DeleteNextFile ( void  )

◆ x_FindMetaCoord()

SNCDataCoord CSpaceShrinker::x_FindMetaCoord ( SNCDataCoord  coord,
Uint1  max_map_depth 

◆ x_FinishMoveRecord()

CSpaceShrinker::State CSpaceShrinker::x_FinishMoveRecord ( void  )

◆ x_FinishMoves()

CSpaceShrinker::State CSpaceShrinker::x_FinishMoves ( void  )

◆ x_FinishSession()

CSpaceShrinker::State CSpaceShrinker::x_FinishSession ( void  )

◆ x_MoveNextRecord()

CSpaceShrinker::State CSpaceShrinker::x_MoveNextRecord ( void  )

◆ x_MoveRecord()

CSpaceShrinker::State CSpaceShrinker::x_MoveRecord ( void  )

Definition at line 3945 of file nc_storage.cpp.

References CAtomicCounter::Add(), SFileIndexRec::cache_data, CSrvRCUUser::CallRCU(), SFileIndexRec::chain_coord, SFileChunkDataRec::chunk_data, SFileChunkDataRec::chunk_idx, SFileChunkDataRec::chunk_num, SNCBlobVerData::chunks, SNCDataCoord::clear(), SNCDBFileInfo::cnt_unfinished, SNCBlobVerData::coord, SNCCacheData::coord, CSrvTime::CurSecs(), SNCBlobVerData::data_coord, DB_CORRUPTED, SNCBlobSummary::dead_time, SFileChunkMapRec::down_coords, CNCAlerts::eDebugMoveRecord0, CNCAlerts::eDebugMoveRecord1, CNCAlerts::eDebugMoveRecord2, CNCAlerts::eDebugMoveRecord3, eFileRecChunkData, eFileRecChunkMap, eFileRecMeta, SNCDataCoord::empty(), SNCDataCoord::file_id, SNCDBFileInfo::file_id, SNCDBFileInfo::file_map, CAtomicCounter::Get(), SNCCacheData::Get_ver_mgr(), i, CRef< C, Locker >::IsNull(), SNCCacheData::key, SNCCacheData::lock, CMiniMutex::Lock(), m_CacheData, m_CntMoved, m_CurVer, m_Failed, m_IndRec, m_MaxFile, m_MovingMeta, m_RecNum, m_SizeMoved, SFileChunkMapRec::map_idx, SNCBlobVerData::map_move_counter, NULL, SFileIndexRec::offset, SNCDataCoord::rec_num, SFileIndexRec::rec_size, SFileIndexRec::rec_type, CNCAlerts::Register(), s_CalcChunkAddress(), s_CalcCntMapDowns(), s_CalcMapAddress(), s_GetDBFileTry(), s_GetIndOrDeleted(), s_GetNextWriteCoord(), s_IsIndexDeleted(), s_MinMoveLife, s_MoveRecToGarbage(), s_UpdateUpCoords(), SNCDBFileInfo::type_index, CMiniMutex::Unlock(), and x_FinishMoveRecord().

Referenced by x_CheckCurVersion(), and x_MoveNextRecord().

◆ x_PrepareToShrink()

CSpaceShrinker::State CSpaceShrinker::x_PrepareToShrink ( void  )

◆ x_StartMoves()

CSpaceShrinker::State CSpaceShrinker::x_StartMoves ( void  )

Member Data Documentation

◆ m_CacheData

SNCCacheData* CSpaceShrinker::m_CacheData

Definition at line 330 of file storage_types.hpp.

Referenced by x_FinishMoveRecord(), x_MoveNextRecord(), and x_MoveRecord().

◆ m_CntMoved

Uint4 CSpaceShrinker::m_CntMoved

Definition at line 338 of file storage_types.hpp.

Referenced by x_FinishMoves(), x_MoveRecord(), and x_StartMoves().

◆ m_CntProcessed

Uint4 CSpaceShrinker::m_CntProcessed

◆ m_CurDelFile

TFilesList::iterator CSpaceShrinker::m_CurDelFile

Definition at line 327 of file storage_types.hpp.

Referenced by x_DeleteNextFile(), and x_PrepareToShrink().

◆ m_CurVer

CSrvRef<SNCBlobVerData> CSpaceShrinker::m_CurVer

Definition at line 332 of file storage_types.hpp.

Referenced by x_CheckCurVersion(), x_FinishMoveRecord(), and x_MoveRecord().

◆ m_Failed

bool CSpaceShrinker::m_Failed

◆ m_FilesToDel

TFilesList CSpaceShrinker::m_FilesToDel

Definition at line 326 of file storage_types.hpp.

Referenced by x_DeleteNextFile(), and x_PrepareToShrink().

◆ m_IndRec

SFileIndexRec* CSpaceShrinker::m_IndRec

Definition at line 329 of file storage_types.hpp.

Referenced by x_CheckCurVersion(), x_MoveNextRecord(), and x_MoveRecord().

◆ m_LastAlive

Uint4 CSpaceShrinker::m_LastAlive

Definition at line 336 of file storage_types.hpp.

Referenced by x_MoveNextRecord(), and x_StartMoves().

◆ m_MaxFile

CSrvRef<SNCDBFileInfo> CSpaceShrinker::m_MaxFile

◆ m_MovingMeta

bool CSpaceShrinker::m_MovingMeta

Definition at line 341 of file storage_types.hpp.

Referenced by x_CheckCurVersion(), x_FinishMoveRecord(), and x_MoveRecord().

◆ m_PrevRecNum

Uint4 CSpaceShrinker::m_PrevRecNum

Definition at line 335 of file storage_types.hpp.

Referenced by x_FinishMoveRecord(), x_MoveNextRecord(), and x_StartMoves().

◆ m_RecNum

Uint4 CSpaceShrinker::m_RecNum

◆ m_RecsMap

TFileRecsMap CSpaceShrinker::m_RecsMap

Definition at line 342 of file storage_types.hpp.

◆ m_SizeMoved

Uint4 CSpaceShrinker::m_SizeMoved

Definition at line 339 of file storage_types.hpp.

Referenced by x_FinishMoves(), x_MoveRecord(), and x_StartMoves().

◆ m_StartTime

int CSpaceShrinker::m_StartTime

Definition at line 333 of file storage_types.hpp.

Referenced by x_FinishSession(), and x_StartMoves().

◆ m_VerMgr

CNCBlobVerManager* CSpaceShrinker::m_VerMgr

Definition at line 331 of file storage_types.hpp.

Referenced by x_CheckCurVersion(), x_FinishMoveRecord(), and x_MoveNextRecord().

The documentation for this class was generated from the following files:
Modified on Wed Apr 17 13:10:37 2024 by rev. 669887