Modify the location of the cache count
This commit is contained in:
parent
d0c37df8bb
commit
125636e9a5
|
@ -20,6 +20,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "taosmsg.h"
|
||||
#include "textbuffer.h"
|
||||
#include "tinterpolation.h"
|
||||
#include "tlosertree.h"
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <tsclient.h>
|
||||
#include <unistd.h>
|
||||
#include <wchar.h>
|
||||
#include <wordexp.h>
|
||||
|
|
|
@ -3949,7 +3949,8 @@ int32_t parseCreateDBOptions(SCreateDBInfo* pCreateDbSql, SSqlCmd* pCmd) {
|
|||
|
||||
if (pCreateDbSql->keep != NULL) {
|
||||
switch (pCreateDbSql->keep->nExpr) {
|
||||
case 1:pMsg->daysToKeep = htonl(pCreateDbSql->keep->a[0].pVar.i64Key);
|
||||
case 1:
|
||||
pMsg->daysToKeep = htonl(pCreateDbSql->keep->a[0].pVar.i64Key);
|
||||
break;
|
||||
case 2: {
|
||||
pMsg->daysToKeep = htonl(pCreateDbSql->keep->a[0].pVar.i64Key);
|
||||
|
|
|
@ -521,10 +521,12 @@ void *taosGetDataFromCache(void *handle, char *key) {
|
|||
|
||||
pthread_rwlock_rdlock(&pObj->lock);
|
||||
SDataNode *ptNode = taosGetNodeFromHashTable(handle, key, keyLen);
|
||||
if (ptNode != NULL) {
|
||||
ptNode->refCount += 1;
|
||||
}
|
||||
pthread_rwlock_unlock(&pObj->lock);
|
||||
|
||||
if (ptNode != NULL) {
|
||||
__sync_add_and_fetch_32(&ptNode->refCount, 1);
|
||||
__sync_add_and_fetch_32(&pObj->statistics.hitCount, 1);
|
||||
|
||||
pTrace("key:%s is retrieved from cache,refcnt:%d", key, ptNode->refCount);
|
||||
|
|
Loading…
Reference in New Issue