epset and retrieve so from mnode
This commit is contained in:
parent
3bc432a52e
commit
3799c5c62f
|
@ -83,8 +83,8 @@ int32_t udfdFillUdfInfoFromMNode(void *clientRpc, SEpSet *pEpSet, char *udfName,
|
||||||
int32_t udfdLoadUdf(char *udfName, SEpSet *pEpSet, SUdf *udf) {
|
int32_t udfdLoadUdf(char *udfName, SEpSet *pEpSet, SUdf *udf) {
|
||||||
strcpy(udf->name, udfName);
|
strcpy(udf->name, udfName);
|
||||||
|
|
||||||
//udfdFillUdfInfoFromMNode(global.clientRpc, pEpSet, udf->name, udf);
|
udfdFillUdfInfoFromMNode(global.clientRpc, pEpSet, udf->name, udf);
|
||||||
strcpy(udf->path, "/home/slzhou/TDengine/debug/build/lib/libudf1.so");
|
//strcpy(udf->path, "/home/slzhou/TDengine/debug/build/lib/libudf1.so");
|
||||||
int err = uv_dlopen(udf->path, &udf->lib);
|
int err = uv_dlopen(udf->path, &udf->lib);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
fnError("can not load library %s. error: %s", udf->path, uv_strerror(err));
|
fnError("can not load library %s. error: %s", udf->path, uv_strerror(err));
|
||||||
|
@ -417,7 +417,7 @@ int32_t udfdFillUdfInfoFromMNode(void *clientRpc, SEpSet *pEpSet, char *udfName,
|
||||||
SFuncInfo *pFuncInfo = (SFuncInfo *)taosArrayGet(retrieveRsp.pFuncInfos, 0);
|
SFuncInfo *pFuncInfo = (SFuncInfo *)taosArrayGet(retrieveRsp.pFuncInfos, 0);
|
||||||
|
|
||||||
char path[PATH_MAX] = {0};
|
char path[PATH_MAX] = {0};
|
||||||
taosGetTmpfilePath("/tmp", "libudf", path);
|
snprintf(path, sizeof(path), "%s/lib%s.so", "/tmp", udfName);
|
||||||
TdFilePtr file = taosOpenFile(path, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_READ | TD_FILE_TRUNC);
|
TdFilePtr file = taosOpenFile(path, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_READ | TD_FILE_TRUNC);
|
||||||
// TODO check for failure of flush to disk
|
// TODO check for failure of flush to disk
|
||||||
taosWriteFile(file, pFuncInfo->pCode, pFuncInfo->codeSize);
|
taosWriteFile(file, pFuncInfo->pCode, pFuncInfo->codeSize);
|
||||||
|
|
|
@ -23,6 +23,10 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
UdfcFuncHandle handle;
|
UdfcFuncHandle handle;
|
||||||
SEpSet epSet;
|
SEpSet epSet;
|
||||||
|
epSet.inUse = 0;
|
||||||
|
taosGetFqdnPortFromEp("localhost:7100", &epSet.eps[0]);
|
||||||
|
taosGetFqdnPortFromEp("localhost:7200", &epSet.eps[1]);
|
||||||
|
epSet.numOfEps = 2;
|
||||||
setupUdf(udfc, "udf1", &epSet, &handle);
|
setupUdf(udfc, "udf1", &epSet, &handle);
|
||||||
|
|
||||||
SSDataBlock block = {0};
|
SSDataBlock block = {0};
|
||||||
|
|
Loading…
Reference in New Issue