add rpc update interface
This commit is contained in:
parent
ad5639df89
commit
bc27d245b1
|
@ -162,6 +162,7 @@ int rpcSendRequestWithCtx(void *thandle, const SEpSet *pEpSet, SRpcMsg *pMsg,
|
||||||
int rpcSendRecv(void *shandle, SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp);
|
int rpcSendRecv(void *shandle, SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp);
|
||||||
int rpcSetDefaultAddr(void *thandle, const char *ip, const char *fqdn);
|
int rpcSetDefaultAddr(void *thandle, const char *ip, const char *fqdn);
|
||||||
void *rpcAllocHandle();
|
void *rpcAllocHandle();
|
||||||
|
void rpcSetIpWhite(void *thandl, void *arg);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,12 @@ static void dmConvertErrCode(tmsg_t msgType) {
|
||||||
terrno = TSDB_CODE_VND_STOPPED;
|
terrno = TSDB_CODE_VND_STOPPED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static void dmUpdateRpcIpWhite(SRpcMsg *pRpc) {
|
||||||
|
SUpdateIpWhite ipWhite;
|
||||||
|
tDeserializeSUpdateIpWhite(pRpc->pCont, pRpc->contLen, &ipWhite);
|
||||||
|
|
||||||
|
tFreeSUpdateIpWhiteReq(&ipWhite);
|
||||||
|
}
|
||||||
static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
|
static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
|
||||||
SDnodeTrans *pTrans = &pDnode->trans;
|
SDnodeTrans *pTrans = &pDnode->trans;
|
||||||
int32_t code = -1;
|
int32_t code = -1;
|
||||||
|
@ -96,7 +102,9 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
|
||||||
if (pEpSet != NULL) {
|
if (pEpSet != NULL) {
|
||||||
dmSetMnodeEpSet(&pDnode->data, pEpSet);
|
dmSetMnodeEpSet(&pDnode->data, pEpSet);
|
||||||
}
|
}
|
||||||
break;
|
case TDMT_MND_RETRIEVE_IP_WHITE_RSP: {
|
||||||
|
dmUpdateRpcIpWhite(pRpc);
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ extern "C" {
|
||||||
#include "ttrace.h"
|
#include "ttrace.h"
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
|
|
||||||
|
typedef bool (*FilteFunc)(void* arg);
|
||||||
|
|
||||||
typedef void* queue[2];
|
typedef void* queue[2];
|
||||||
/* Private macros. */
|
/* Private macros. */
|
||||||
#define QUEUE_NEXT(q) (*(queue**)&((*(q))[0]))
|
#define QUEUE_NEXT(q) (*(queue**)&((*(q))[0]))
|
||||||
|
|
|
@ -183,6 +183,8 @@ int rpcSetDefaultAddr(void* thandle, const char* ip, const char* fqdn) {
|
||||||
return transSetDefaultAddr(thandle, ip, fqdn);
|
return transSetDefaultAddr(thandle, ip, fqdn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rpcSetIpWhite(void* thandl, void* arg) { return ; }
|
||||||
|
|
||||||
void* rpcAllocHandle() { return (void*)transAllocHandle(); }
|
void* rpcAllocHandle() { return (void*)transAllocHandle(); }
|
||||||
|
|
||||||
int32_t rpcInit() {
|
int32_t rpcInit() {
|
||||||
|
|
|
@ -18,7 +18,6 @@ static TdThreadOnce transModuleInit = PTHREAD_ONCE_INIT;
|
||||||
|
|
||||||
static char* notify = "a";
|
static char* notify = "a";
|
||||||
|
|
||||||
typedef bool (*FilteFunc)(void* arg);
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int notifyCount; //
|
int notifyCount; //
|
||||||
int init; // init or not
|
int init; // init or not
|
||||||
|
|
Loading…
Reference in New Issue