Merge pull request #11819 from taosdata/3.0_udfd
udfc open/close in vm init/cleanup
This commit is contained in:
commit
7468d948f5
|
@ -322,6 +322,20 @@ struct SUdfInfo;
|
||||||
void qAddUdfInfo(uint64_t id, struct SUdfInfo* pUdfInfo);
|
void qAddUdfInfo(uint64_t id, struct SUdfInfo* pUdfInfo);
|
||||||
void qRemoveUdfInfo(uint64_t id, struct SUdfInfo* pUdfInfo);
|
void qRemoveUdfInfo(uint64_t id, struct SUdfInfo* pUdfInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create udfd proxy, called once in process that call setupUdf/callUdfxxx/teardownUdf
|
||||||
|
* @return error code
|
||||||
|
*/
|
||||||
|
int32_t udfcOpen();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* destroy udfd proxy
|
||||||
|
* @return error code
|
||||||
|
*/
|
||||||
|
int32_t udfcClose();
|
||||||
|
|
||||||
|
typedef void *UdfcFuncHandle;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "vmInt.h"
|
#include "vmInt.h"
|
||||||
|
#include "libs/function/function.h"
|
||||||
|
|
||||||
SVnodeObj *vmAcquireVnode(SVnodesMgmt *pMgmt, int32_t vgId) {
|
SVnodeObj *vmAcquireVnode(SVnodesMgmt *pMgmt, int32_t vgId) {
|
||||||
SVnodeObj *pVnode = NULL;
|
SVnodeObj *pVnode = NULL;
|
||||||
|
@ -275,7 +276,7 @@ static void vmCleanup(SMgmtWrapper *pWrapper) {
|
||||||
pWrapper->pMgmt = NULL;
|
pWrapper->pMgmt = NULL;
|
||||||
|
|
||||||
// syncCleanUp();
|
// syncCleanUp();
|
||||||
|
udfcClose();
|
||||||
dInfo("vnode-mgmt is cleaned up");
|
dInfo("vnode-mgmt is cleaned up");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,6 +340,10 @@ static int32_t vmInit(SMgmtWrapper *pWrapper) {
|
||||||
}
|
}
|
||||||
dmReportStartup(pDnode, "vnode-vnodes", "initialized");
|
dmReportStartup(pDnode, "vnode-vnodes", "initialized");
|
||||||
|
|
||||||
|
if (udfcOpen() != 0) {
|
||||||
|
dError("failed to open udfc in dnode");
|
||||||
|
}
|
||||||
|
|
||||||
code = 0;
|
code = 0;
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
|
|
|
@ -42,19 +42,7 @@ enum {
|
||||||
UDFC_CODE_INVALID_STATE = -5
|
UDFC_CODE_INVALID_STATE = -5
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void *UdfcFuncHandle;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* create udfd proxy, called once in process that call setupUdf/callUdfxxx/teardownUdf
|
|
||||||
* @return error code
|
|
||||||
*/
|
|
||||||
int32_t udfcOpen();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* destroy udfd proxy
|
|
||||||
* @return error code
|
|
||||||
*/
|
|
||||||
int32_t udfcClose();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue