shm
This commit is contained in:
parent
e10e8c8fec
commit
7ab2b0a8e0
|
@ -23,18 +23,19 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct SDnodeMgmt {
|
typedef struct SDnodeMgmt {
|
||||||
int64_t dver;
|
int64_t dver;
|
||||||
int64_t updateTime;
|
int64_t updateTime;
|
||||||
int8_t statusSent;
|
int8_t statusSent;
|
||||||
SEpSet mnodeEpSet;
|
SEpSet mnodeEpSet;
|
||||||
SHashObj *dnodeHash;
|
SHashObj *dnodeHash;
|
||||||
SArray *dnodeEps;
|
SArray *dnodeEps;
|
||||||
pthread_t *threadId;
|
pthread_t *threadId;
|
||||||
SRWLatch latch;
|
SRWLatch latch;
|
||||||
SDnodeWorker mgmtWorker;
|
SDnodeWorker mgmtWorker;
|
||||||
SDnodeWorker statusWorker;
|
SDnodeWorker statusWorker;
|
||||||
const char *path;
|
const char *path;
|
||||||
SDnode *pDnode;
|
SDnode *pDnode;
|
||||||
|
SMgmtWrapper *pWrapper;
|
||||||
} SDnodeMgmt;
|
} SDnodeMgmt;
|
||||||
|
|
||||||
// dmFile.c
|
// dmFile.c
|
||||||
|
|
|
@ -92,6 +92,7 @@ int32_t dmInit(SMgmtWrapper *pWrapper) {
|
||||||
pDnode->clusterId = 0;
|
pDnode->clusterId = 0;
|
||||||
pMgmt->path = pWrapper->path;
|
pMgmt->path = pWrapper->path;
|
||||||
pMgmt->pDnode = pDnode;
|
pMgmt->pDnode = pDnode;
|
||||||
|
pMgmt->pWrapper = pWrapper;
|
||||||
taosInitRWLatch(&pMgmt->latch);
|
taosInitRWLatch(&pMgmt->latch);
|
||||||
|
|
||||||
pMgmt->dnodeHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK);
|
pMgmt->dnodeHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK);
|
||||||
|
|
|
@ -53,7 +53,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
||||||
pMgmt->statusSent = 1;
|
pMgmt->statusSent = 1;
|
||||||
|
|
||||||
dTrace("send req:%s to mnode, app:%p", TMSG_INFO(rpcMsg.msgType), rpcMsg.ahandle);
|
dTrace("send req:%s to mnode, app:%p", TMSG_INFO(rpcMsg.msgType), rpcMsg.ahandle);
|
||||||
dndSendReqToMnode(pMgmt->pDnode, &rpcMsg);
|
dndSendReqToMnode(pMgmt->dnodeEps, &rpcMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dmUpdateDnodeCfg(SDnodeMgmt *pMgmt, SDnodeCfg *pCfg) {
|
static void dmUpdateDnodeCfg(SDnodeMgmt *pMgmt, SDnodeCfg *pCfg) {
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "vmFile.h"
|
#include "vmFile.h"
|
||||||
#include "vmMsg.h"
|
#include "vmMsg.h"
|
||||||
#include "vmWorker.h"
|
#include "vmWorker.h"
|
||||||
|
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
|
|
||||||
SVnodeObj *vmAcquireVnode(SVnodesMgmt *pMgmt, int32_t vgId) {
|
SVnodeObj *vmAcquireVnode(SVnodesMgmt *pMgmt, int32_t vgId) {
|
||||||
|
@ -317,6 +318,8 @@ static int32_t vmInit(SMgmtWrapper *pWrapper) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code = 0;
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
pWrapper->pMgmt = pMgmt;
|
pWrapper->pMgmt = pMgmt;
|
||||||
|
@ -329,7 +332,10 @@ _OVER:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool vmRequire(SMgmtWrapper *pWrapper) { return false; }
|
static bool vmRequire(SMgmtWrapper *pWrapper) {
|
||||||
|
SDnode *pDnode = pWrapper->pDnode;
|
||||||
|
return pDnode->numOfSupportVnodes > 0;
|
||||||
|
}
|
||||||
|
|
||||||
void vmGetMgmtFp(SMgmtWrapper *pWrapper) {
|
void vmGetMgmtFp(SMgmtWrapper *pWrapper) {
|
||||||
SMgmtFp mgmtFp = {0};
|
SMgmtFp mgmtFp = {0};
|
||||||
|
|
Loading…
Reference in New Issue