NCBI C++ ToolKit
Classes | Typedefs | Functions | Variables
nc_storage_blob.cpp File Reference
#include "nc_pch.hpp"
#include <corelib/request_ctx.hpp>
#include "netcached.hpp"
#include "distribution_conf.hpp"
#include "nc_storage_blob.hpp"
#include "nc_storage.hpp"
#include "storage_types.hpp"
#include "nc_stat.hpp"
#include <set>
+ Include dependency graph for nc_storage_blob.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SWriteBackData
 

Typedefs

typedef map< string, Uint8TForgets
 

Functions

static bool s_IsCurVerOlder (const SNCBlobVerData *cur_ver, const SNCBlobVerData *new_ver)
 
Uint8 GetWBSoftSizeLimit (void)
 
Uint8 GetWBHardSizeLimit (void)
 
int GetWBWriteTimeout (void)
 
int GetWBFailedWriteDelay (void)
 
void SetWBSoftSizeLimit (Uint8 limit)
 
void SetWBHardSizeLimit (Uint8 limit)
 
void SetWBWriteTimeout (int timeout1, int timeout2)
 
void SetWBInitialSyncComplete (void)
 
void SetWBFailedWriteDelay (int delay)
 
static SWriteBackDatas_GetWBData (void)
 
static size_t s_CalcVerDataSize (SNCBlobVerData *ver_data)
 
static size_t s_CalcChunkMapsSize (Uint2 map_size)
 
static void s_AddCurrentMem (size_t mem_size)
 
static void s_SubCurrentMem (size_t mem_size)
 
static void s_AddReleasableMem (SNCBlobVerData *ver_data, size_t add_releasable, size_t sub_releasing)
 
static void s_SubReleasableMem (size_t mem_size)
 
static void s_AddReleasingMem (size_t add_releasing, size_t sub_releasable)
 
static void s_SubReleasingMem (size_t mem_size)
 
static void s_ScheduleVerDelete (SNCBlobVerData *ver_data)
 
static char * s_AllocWriteBackMem (Uint4 mem_size, CSrvTransConsumer *consumer)
 
static void s_NotifyConsumers (void)
 
static char * s_ReallocWriteBackMem (char *mem, Uint4 old_size, Uint4 new_size)
 
static void s_FreeWriteBackMem (char *mem, Uint4 mem_size, Uint4 sub_releasing)
 
static void s_ReleaseMemory (size_t soft_limit)
 
static void s_TransferVerList (vector< SNCBlobVerData * > &from_list, vector< SNCBlobVerData * > &to_list)
 
static void s_CollectWBData (SWriteBackData *wb_data)
 
static void s_ProcessWBAddDel (Uint4 was_del_size)
 

Variables

Uint4 s_TaskPriorityWbMemRelease
 
static size_t s_WBSoftSizeLimit = NCBI_CONST_UINT8(2000000000)
 
static size_t s_WBHardSizeLimit = NCBI_CONST_UINT8(3000000000)
 
static int s_WBWriteTimeout = 1000
 
static int s_WBWriteTimeout2 = 1000
 
static Uint2 s_WBFailedWriteDelay = 2
 
static ssize_t s_WBCurSize = 0
 
static ssize_t s_WBReleasableSize = 0
 
static ssize_t s_WBReleasingSize = 0
 
static SWriteBackDatas_WBData = NULL
 
static CWriteBackControls_WBControl = NULL
 
static TVerDataMaps_VersMap = NULL
 
static CMiniMutex s_ConsListLock
 
static Uint4 s_CntConsumers = 0
 
static TSrvConsList s_ConsList
 
vector< SNCBlobVerData * > s_WBToAddList
 
vector< SNCBlobVerData * > s_WBToDelList
 
static TForgets s_Forgets
 
static TForgets s_ForgetKeys
 
static Uint8 s_LatestPurge = 0
 
static CBulkCleaners_BulkCleaner = NULL
 
static bool s_FailMonitor = false
 
static CMiniMutex s_FailedListLock
 
static int s_FailedReserve =0
 
static CAtomicCounter s_FailedCounter
 
static set< strings_FailedKeys
 
static Uint8 s_AnotherServerMain = 0
 
static Uint8 s_BlobSync = 0
 
static Uint8 s_BlobSyncTDiff = 0
 
static Uint8 s_BlobSyncMaxTDiff = 0
 
static Uint8 s_BlobNotify = 0
 
static Uint8 s_BlobNotifyTDiff = 0
 
static Uint8 s_BlobNotifyMaxTDiff = 0
 
static const size_t kVerManagerSize
 
static const size_t kDefChunkMapsSize
 

Typedef Documentation

◆ TForgets

typedef map<string, Uint8> TForgets

Definition at line 77 of file nc_storage_blob.cpp.

Function Documentation

◆ GetWBFailedWriteDelay()

int GetWBFailedWriteDelay ( void  )

Definition at line 143 of file nc_storage_blob.cpp.

References s_WBFailedWriteDelay.

Referenced by CNCBlobStorage::WriteSetup().

◆ GetWBHardSizeLimit()

Uint8 GetWBHardSizeLimit ( void  )

Definition at line 137 of file nc_storage_blob.cpp.

References s_WBHardSizeLimit.

Referenced by CNCBlobStorage::WriteSetup().

◆ GetWBSoftSizeLimit()

Uint8 GetWBSoftSizeLimit ( void  )

Definition at line 134 of file nc_storage_blob.cpp.

References s_WBSoftSizeLimit.

Referenced by CNCBlobStorage::WriteSetup().

◆ GetWBWriteTimeout()

int GetWBWriteTimeout ( void  )

Definition at line 140 of file nc_storage_blob.cpp.

References s_WBWriteTimeout.

Referenced by CNCBlobStorage::WriteSetup().

◆ s_AddCurrentMem()

static void s_AddCurrentMem ( size_t  mem_size)
static

◆ s_AddReleasableMem()

static void s_AddReleasableMem ( SNCBlobVerData ver_data,
size_t  add_releasable,
size_t  sub_releasing 
)
static

◆ s_AddReleasingMem()

static void s_AddReleasingMem ( size_t  add_releasing,
size_t  sub_releasable 
)
static

◆ s_AllocWriteBackMem()

static char* s_AllocWriteBackMem ( Uint4  mem_size,
CSrvTransConsumer consumer 
)
static

◆ s_CalcChunkMapsSize()

static size_t s_CalcChunkMapsSize ( Uint2  map_size)
static

◆ s_CalcVerDataSize()

static size_t s_CalcVerDataSize ( SNCBlobVerData ver_data)
inlinestatic

◆ s_CollectWBData()

static void s_CollectWBData ( SWriteBackData wb_data)
static

◆ s_FreeWriteBackMem()

static void s_FreeWriteBackMem ( char *  mem,
Uint4  mem_size,
Uint4  sub_releasing 
)
static

◆ s_GetWBData()

static SWriteBackData* s_GetWBData ( void  )
inlinestatic

◆ s_IsCurVerOlder()

static bool s_IsCurVerOlder ( const SNCBlobVerData cur_ver,
const SNCBlobVerData new_ver 
)
static

◆ s_NotifyConsumers()

static void s_NotifyConsumers ( void  )
static

◆ s_ProcessWBAddDel()

static void s_ProcessWBAddDel ( Uint4  was_del_size)
static

◆ s_ReallocWriteBackMem()

static char* s_ReallocWriteBackMem ( char *  mem,
Uint4  old_size,
Uint4  new_size 
)
static

Definition at line 314 of file nc_storage_blob.cpp.

References s_SubCurrentMem().

Referenced by CNCBlobAccessor::Finalize().

◆ s_ReleaseMemory()

static void s_ReleaseMemory ( size_t  soft_limit)
static

◆ s_ScheduleVerDelete()

static void s_ScheduleVerDelete ( SNCBlobVerData ver_data)
static

◆ s_SubCurrentMem()

static void s_SubCurrentMem ( size_t  mem_size)
static

◆ s_SubReleasableMem()

static void s_SubReleasableMem ( size_t  mem_size)
static

◆ s_SubReleasingMem()

static void s_SubReleasingMem ( size_t  mem_size)
static

◆ s_TransferVerList()

static void s_TransferVerList ( vector< SNCBlobVerData * > &  from_list,
vector< SNCBlobVerData * > &  to_list 
)
static

Definition at line 365 of file nc_storage_blob.cpp.

References NULL.

Referenced by s_CollectWBData().

◆ SetWBFailedWriteDelay()

void SetWBFailedWriteDelay ( int  delay)

Definition at line 172 of file nc_storage_blob.cpp.

References s_WBFailedWriteDelay.

Referenced by s_ReadVariableParams().

◆ SetWBHardSizeLimit()

void SetWBHardSizeLimit ( Uint8  limit)

Definition at line 154 of file nc_storage_blob.cpp.

References max(), s_WBHardSizeLimit, and s_WBSoftSizeLimit.

Referenced by s_ReadVariableParams().

◆ SetWBInitialSyncComplete()

void SetWBInitialSyncComplete ( void  )

Definition at line 166 of file nc_storage_blob.cpp.

References s_WBWriteTimeout, and s_WBWriteTimeout2.

Referenced by CNCServer::InitialSyncComplete().

◆ SetWBSoftSizeLimit()

void SetWBSoftSizeLimit ( Uint8  limit)

Definition at line 148 of file nc_storage_blob.cpp.

References s_WBSoftSizeLimit.

Referenced by s_ReadVariableParams().

◆ SetWBWriteTimeout()

void SetWBWriteTimeout ( int  timeout1,
int  timeout2 
)

Definition at line 160 of file nc_storage_blob.cpp.

References s_WBWriteTimeout, and s_WBWriteTimeout2.

Referenced by s_ReadVariableParams().

Variable Documentation

◆ kDefChunkMapsSize

const size_t kDefChunkMapsSize
static
Initial value:
= sizeof(SNCChunkMaps)
* (sizeof(SNCChunkMapInfo)
+ (kNCMaxChunksInMap - 1) * sizeof(SNCDataCoord))
static const Uint2 kNCMaxChunksInMap
Definition: nc_db_info.hpp:55
static const Uint1 kNCMaxBlobMapsDepth
Definition: nc_db_info.hpp:57

Definition at line 103 of file nc_storage_blob.cpp.

Referenced by s_CalcChunkMapsSize().

◆ kVerManagerSize

const size_t kVerManagerSize
static

◆ s_AnotherServerMain

Uint8 s_AnotherServerMain = 0
static

◆ s_BlobNotify

Uint8 s_BlobNotify = 0
static

◆ s_BlobNotifyMaxTDiff

Uint8 s_BlobNotifyMaxTDiff = 0
static

◆ s_BlobNotifyTDiff

Uint8 s_BlobNotifyTDiff = 0
static

◆ s_BlobSync

Uint8 s_BlobSync = 0
static

◆ s_BlobSyncMaxTDiff

Uint8 s_BlobSyncMaxTDiff = 0
static

◆ s_BlobSyncTDiff

Uint8 s_BlobSyncTDiff = 0
static

◆ s_BulkCleaner

CBulkCleaner* s_BulkCleaner = NULL
static

Definition at line 81 of file nc_storage_blob.cpp.

Referenced by CWriteBackControl::Initialize().

◆ s_CntConsumers

Uint4 s_CntConsumers = 0
static

Definition at line 69 of file nc_storage_blob.cpp.

Referenced by CWriteBackControl::ExecuteSlice(), and s_AllocWriteBackMem().

◆ s_ConsList

TSrvConsList s_ConsList
static

Definition at line 70 of file nc_storage_blob.cpp.

Referenced by s_AllocWriteBackMem(), and s_NotifyConsumers().

◆ s_ConsListLock

CMiniMutex s_ConsListLock
static

◆ s_FailedCounter

CAtomicCounter s_FailedCounter
static

◆ s_FailedKeys

set<string> s_FailedKeys
static

◆ s_FailedListLock

CMiniMutex s_FailedListLock
static

◆ s_FailedReserve

int s_FailedReserve =0
static

◆ s_FailMonitor

bool s_FailMonitor = false
static

◆ s_ForgetKeys

TForgets s_ForgetKeys
static

◆ s_Forgets

TForgets s_Forgets
static

◆ s_LatestPurge

Uint8 s_LatestPurge = 0
static

Definition at line 80 of file nc_storage_blob.cpp.

Referenced by CNCBlobAccessor::IsPurged(), and CNCBlobAccessor::Purge().

◆ s_TaskPriorityWbMemRelease

Uint4 s_TaskPriorityWbMemRelease
extern

◆ s_VersMap

TVerDataMap* s_VersMap = NULL
static

◆ s_WBControl

CWriteBackControl* s_WBControl = NULL
static

Definition at line 65 of file nc_storage_blob.cpp.

Referenced by CWriteBackControl::Initialize().

◆ s_WBCurSize

ssize_t s_WBCurSize = 0
static

◆ s_WBData

SWriteBackData* s_WBData = NULL
static

◆ s_WBFailedWriteDelay

Uint2 s_WBFailedWriteDelay = 2
static

◆ s_WBHardSizeLimit

size_t s_WBHardSizeLimit = NCBI_CONST_UINT8(3000000000)
static

Definition at line 56 of file nc_storage_blob.cpp.

Referenced by GetWBHardSizeLimit(), s_AllocWriteBackMem(), and SetWBHardSizeLimit().

◆ s_WBReleasableSize

ssize_t s_WBReleasableSize = 0
static

◆ s_WBReleasingSize

ssize_t s_WBReleasingSize = 0
static

◆ s_WBSoftSizeLimit

size_t s_WBSoftSizeLimit = NCBI_CONST_UINT8(2000000000)
static

◆ s_WBToAddList

vector<SNCBlobVerData*> s_WBToAddList

Definition at line 71 of file nc_storage_blob.cpp.

Referenced by s_CollectWBData(), and s_ProcessWBAddDel().

◆ s_WBToDelList

vector<SNCBlobVerData*> s_WBToDelList

◆ s_WBWriteTimeout

int s_WBWriteTimeout = 1000
static

◆ s_WBWriteTimeout2

int s_WBWriteTimeout2 = 1000
static

Definition at line 58 of file nc_storage_blob.cpp.

Referenced by SetWBInitialSyncComplete(), and SetWBWriteTimeout().

Modified on Mon Apr 22 04:02:31 2024 by modify_doxy.py rev. 669887