MCPcopy Create free account
hub / github.com/Tencent/phxsql / Init

Method Init

phxsqlclient/utils/leakybucket.cpp:101–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101int MmapLeakyBucket::Init(Config_t * ptConfig, const char * sPath) {
102 m_tConfig = *ptConfig;
103
104 int isNew = 0;
105 m_ptBucket = (Bucket_t *) getMmapPtr(sPath, sizeof(Bucket_t), &isNew);
106
107 if (NULL == m_ptBucket)
108 return -1;
109
110 m_poLock = new phxsql::FileLock();
111
112 if (!m_poLock->Open(sPath))
113 return -1;
114
115 return 0;
116}
117
118int MmapLeakyBucket::Refill(int iBucketSize) {
119 if (NULL == m_poLock || NULL == m_ptBucket)

Callers 3

mysqld_mainFunction · 0.45
GetEndPointMethod · 0.45
ReportEndPointMethod · 0.45

Calls 1

OpenMethod · 0.80

Tested by

no test coverage detected