NCBI C++ ToolKit
Static Public Member Functions | Private Member Functions | List of all members
CWriteBackControl Class Reference

Search Toolkit Book for CWriteBackControl

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

+ Inheritance diagram for CWriteBackControl:
+ Collaboration diagram for CWriteBackControl:

Static Public Member Functions

static void Initialize (void)
static void ReadState (SNCStateStat &state)
static void AnotherServerMain (void)
static void StartSyncBlob (Uint8 create_time)
static void RecordNotifyUpdateBlob (Uint8 update_received)
static void ResetStatCounters (void)
- Static Public Member Functions inherited from CSrvTask
static void PrintState (CSrvSocketTask &task)

Private Member Functions

 CWriteBackControl (void)
virtual ~CWriteBackControl (void)
virtual void ExecuteSlice (TSrvThreadNum thr_num)
 This is the main method to do all work this task should do. More...

Additional Inherited Members

- 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 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...

Detailed Description

Definition at line 269 of file nc_storage_blob.hpp.

Constructor & Destructor Documentation

◆ CWriteBackControl()

CWriteBackControl::CWriteBackControl ( void  )

Definition at line 464 of file nc_storage_blob.cpp.

Referenced by Initialize().

◆ ~CWriteBackControl()

CWriteBackControl::~CWriteBackControl ( void  )

Definition at line 471 of file nc_storage_blob.cpp.

Member Function Documentation

◆ AnotherServerMain()

void CWriteBackControl::AnotherServerMain ( void  )

Definition at line 548 of file nc_storage_blob.cpp.

References AtomicAdd(), and s_AnotherServerMain.

Referenced by CNCMessageHandler::x_GetCurSlotServers().

◆ ExecuteSlice()

void CWriteBackControl::ExecuteSlice ( TSrvThreadNum  thr_num)

This is the main method to do all work this task should do.

This method will be called periodically while somebody calls SetRunnable() or RunAfter() on this task. But number of calls to this method won't match number of calls to SetRunnable() – if several calls to SetRunnable() are made before ExecuteSlice() had a chance to execute it will be called only once. Task's code inside ExecuteSlice() should understand itself how much work it needs to do and call SetRunnable() again if needed (or do all the work before returning from ExecuteSlice()). Parameter thr_num is number of thread on which ExecuteSlice() is called.

Implements CSrvTask.

Definition at line 487 of file nc_storage_blob.cpp.

References ACCESS_ONCE, CTaskServer::GetMaxRunningThreads(), i, CTaskServer::IsInShutdown(), kNCMaxBlobChunkSize, CSrvTask::RunAfter(), s_CntConsumers, s_CollectWBData(), s_NotifyConsumers(), s_ProcessWBAddDel(), s_ReleaseMemory(), s_WBCurSize, s_WBData, s_WBSoftSizeLimit, and s_WBToDelList.

◆ Initialize()

void CWriteBackControl::Initialize ( void  )

◆ ReadState()

void CWriteBackControl::ReadState ( SNCStateStat state)

◆ RecordNotifyUpdateBlob()

void CWriteBackControl::RecordNotifyUpdateBlob ( Uint8  update_received)

◆ ResetStatCounters()

void CWriteBackControl::ResetStatCounters ( void  )

Definition at line 595 of file nc_storage_blob.cpp.

References s_BlobSync, s_BlobSyncMaxTDiff, and s_BlobSyncTDiff.

Referenced by CNCPeerControl::RegisterConnError().

◆ StartSyncBlob()

void CWriteBackControl::StartSyncBlob ( Uint8  create_time)

The documentation for this class was generated from the following files:
Modified on Fri May 24 14:51:42 2024 by rev. 669887