Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1946f39a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
1946f39a
编写于
6月 09, 2022
作者:
dengyihao
提交者:
GitHub
6月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13638 from taosdata/enh/refactorTrans
enh: refactor trans
上级
ba205a18
d9c83f63
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
73 addition
and
82 deletion
+73
-82
include/libs/index/index.h
include/libs/index/index.h
+4
-4
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+1
-0
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+13
-13
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+1
-1
source/libs/index/inc/indexInt.h
source/libs/index/inc/indexInt.h
+1
-1
source/libs/index/src/index.c
source/libs/index/src/index.c
+1
-1
source/libs/index/src/indexCache.c
source/libs/index/src/indexCache.c
+4
-4
source/libs/index/src/indexFilter.c
source/libs/index/src/indexFilter.c
+1
-1
source/libs/index/src/indexJson.c
source/libs/index/src/indexJson.c
+4
-4
source/libs/index/test/jsonUT.cc
source/libs/index/test/jsonUT.cc
+35
-35
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+8
-18
未找到文件。
include/libs/index/index.h
浏览文件 @
1946f39a
...
@@ -136,14 +136,14 @@ int indexRebuild(SIndex* index, SIndexOpts* opt);
...
@@ -136,14 +136,14 @@ int indexRebuild(SIndex* index, SIndexOpts* opt);
* @param index (output, index json object)
* @param index (output, index json object)
* @return error code
* @return error code
*/
*/
int
tI
ndexJsonOpen
(
SIndexJsonOpts
*
opts
,
const
char
*
path
,
SIndexJson
**
index
);
int
i
ndexJsonOpen
(
SIndexJsonOpts
*
opts
,
const
char
*
path
,
SIndexJson
**
index
);
/*
/*
* close index
* close index
* @param index (input, index to be closed)
* @param index (input, index to be closed)
* @return void
* @return void
*/
*/
void
tI
ndexJsonClose
(
SIndexJson
*
index
);
void
i
ndexJsonClose
(
SIndexJson
*
index
);
/*
/*
* insert terms into index
* insert terms into index
...
@@ -152,7 +152,7 @@ void tIndexJsonClose(SIndexJson* index);
...
@@ -152,7 +152,7 @@ void tIndexJsonClose(SIndexJson* index);
* @param uid (input, uid of terms)
* @param uid (input, uid of terms)
* @return error code
* @return error code
*/
*/
int
tI
ndexJsonPut
(
SIndexJson
*
index
,
SIndexJsonMultiTerm
*
terms
,
uint64_t
uid
);
int
i
ndexJsonPut
(
SIndexJson
*
index
,
SIndexJsonMultiTerm
*
terms
,
uint64_t
uid
);
/*
/*
* search index
* search index
* @param index (input, index object)
* @param index (input, index object)
...
@@ -161,7 +161,7 @@ int tIndexJsonPut(SIndexJson* index, SIndexJsonMultiTerm* terms, uint64_t uid);
...
@@ -161,7 +161,7 @@ int tIndexJsonPut(SIndexJson* index, SIndexJsonMultiTerm* terms, uint64_t uid);
* @return error code
* @return error code
*/
*/
int
tI
ndexJsonSearch
(
SIndexJson
*
index
,
SIndexJsonMultiTermQuery
*
query
,
SArray
*
result
);
int
i
ndexJsonSearch
(
SIndexJson
*
index
,
SIndexJsonMultiTermQuery
*
query
,
SArray
*
result
);
/*
/*
* @param
* @param
* @param
* @param
...
...
include/libs/transport/trpc.h
浏览文件 @
1946f39a
...
@@ -46,6 +46,7 @@ typedef struct SRpcHandleInfo {
...
@@ -46,6 +46,7 @@ typedef struct SRpcHandleInfo {
int32_t
noResp
;
// has response or not(default 0, 0: resp, 1: no resp);
int32_t
noResp
;
// has response or not(default 0, 0: resp, 1: no resp);
int32_t
persistHandle
;
// persist handle or not
int32_t
persistHandle
;
// persist handle or not
SRpcConnInfo
connInfo
;
// app info
// app info
void
*
ahandle
;
// app handle set by client
void
*
ahandle
;
// app handle set by client
void
*
wrapper
;
// wrapper handle
void
*
wrapper
;
// wrapper handle
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
1946f39a
...
@@ -22,17 +22,17 @@ static void dmSendRsp(SRpcMsg *pMsg);
...
@@ -22,17 +22,17 @@ static void dmSendRsp(SRpcMsg *pMsg);
static
void
dmBuildMnodeRedirectRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
static
void
dmBuildMnodeRedirectRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
static
inline
int32_t
dmBuildNodeMsg
(
SRpcMsg
*
pMsg
,
SRpcMsg
*
pRpc
)
{
static
inline
int32_t
dmBuildNodeMsg
(
SRpcMsg
*
pMsg
,
SRpcMsg
*
pRpc
)
{
SRpcConnInfo
connInfo
=
{
0
}
;
SRpcConnInfo
*
pConnInfo
=
&
(
pRpc
->
info
.
connInfo
)
;
if
(
IsReq
(
pRpc
)
&&
rpcGetConnInfo
(
pRpc
->
info
.
handle
,
&
connInfo
)
!=
0
)
{
// if (IsReq(pRpc)
) {
terrno
=
TSDB_CODE_MND_NO_USER_FROM_CONN
;
//
terrno = TSDB_CODE_MND_NO_USER_FROM_CONN;
dError
(
"failed to build msg since %s, app:%p handle:%p"
,
terrstr
(),
pRpc
->
info
.
ahandle
,
pRpc
->
info
.
handle
);
//
dError("failed to build msg since %s, app:%p handle:%p", terrstr(), pRpc->info.ahandle, pRpc->info.handle);
return
-
1
;
//
return -1;
}
//
}
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
memcpy
(
pMsg
->
conn
.
user
,
connInfo
.
user
,
TSDB_USER_LEN
);
memcpy
(
pMsg
->
conn
.
user
,
pConnInfo
->
user
,
TSDB_USER_LEN
);
pMsg
->
conn
.
clientIp
=
connInfo
.
clientIp
;
pMsg
->
conn
.
clientIp
=
pConnInfo
->
clientIp
;
pMsg
->
conn
.
clientPort
=
connInfo
.
clientPort
;
pMsg
->
conn
.
clientPort
=
pConnInfo
->
clientPort
;
return
0
;
return
0
;
}
}
...
@@ -49,9 +49,9 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) {
...
@@ -49,9 +49,9 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) {
}
}
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
;
SRpcMsg
*
pMsg
=
NULL
;
SRpcMsg
*
pMsg
=
NULL
;
SMgmtWrapper
*
pWrapper
=
NULL
;
SMgmtWrapper
*
pWrapper
=
NULL
;
SDnodeHandle
*
pHandle
=
&
pTrans
->
msgHandles
[
TMSG_INDEX
(
pRpc
->
msgType
)];
SDnodeHandle
*
pHandle
=
&
pTrans
->
msgHandles
[
TMSG_INDEX
(
pRpc
->
msgType
)];
...
@@ -167,11 +167,11 @@ int32_t dmInitMsgHandle(SDnode *pDnode) {
...
@@ -167,11 +167,11 @@ int32_t dmInitMsgHandle(SDnode *pDnode) {
for
(
EDndNodeType
ntype
=
DNODE
;
ntype
<
NODE_END
;
++
ntype
)
{
for
(
EDndNodeType
ntype
=
DNODE
;
ntype
<
NODE_END
;
++
ntype
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
ntype
];
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
ntype
];
SArray
*
pArray
=
(
*
pWrapper
->
func
.
getHandlesFp
)();
SArray
*
pArray
=
(
*
pWrapper
->
func
.
getHandlesFp
)();
if
(
pArray
==
NULL
)
return
-
1
;
if
(
pArray
==
NULL
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pArray
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pArray
);
++
i
)
{
SMgmtHandle
*
pMgmt
=
taosArrayGet
(
pArray
,
i
);
SMgmtHandle
*
pMgmt
=
taosArrayGet
(
pArray
,
i
);
SDnodeHandle
*
pHandle
=
&
pTrans
->
msgHandles
[
TMSG_INDEX
(
pMgmt
->
msgType
)];
SDnodeHandle
*
pHandle
=
&
pTrans
->
msgHandles
[
TMSG_INDEX
(
pMgmt
->
msgType
)];
if
(
pMgmt
->
needCheckVgId
)
{
if
(
pMgmt
->
needCheckVgId
)
{
pHandle
->
needCheckVgId
=
pMgmt
->
needCheckVgId
;
pHandle
->
needCheckVgId
=
pMgmt
->
needCheckVgId
;
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
1946f39a
...
@@ -99,7 +99,7 @@ static int metaSaveJsonVarToIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const
...
@@ -99,7 +99,7 @@ static int metaSaveJsonVarToIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
}
}
}
}
tI
ndexJsonPut
(
pMeta
->
pTagIvtIdx
,
terms
,
tuid
);
i
ndexJsonPut
(
pMeta
->
pTagIvtIdx
,
terms
,
tuid
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
#endif
#endif
return
0
;
return
0
;
...
...
source/libs/index/inc/indexInt.h
浏览文件 @
1946f39a
...
@@ -131,7 +131,7 @@ typedef struct TFileCacheKey {
...
@@ -131,7 +131,7 @@ typedef struct TFileCacheKey {
char
*
colName
;
char
*
colName
;
int32_t
nColName
;
int32_t
nColName
;
}
ICacheKey
;
}
ICacheKey
;
int
i
nde
xFlushCacheToTFile
(
SIndex
*
sIdx
,
void
*
,
bool
quit
);
int
i
d
xFlushCacheToTFile
(
SIndex
*
sIdx
,
void
*
,
bool
quit
);
int64_t
indexAddRef
(
void
*
p
);
int64_t
indexAddRef
(
void
*
p
);
int32_t
indexRemoveRef
(
int64_t
ref
);
int32_t
indexRemoveRef
(
int64_t
ref
);
...
...
source/libs/index/src/index.c
浏览文件 @
1946f39a
...
@@ -455,7 +455,7 @@ static void idxDestroyFinalRslt(SArray* result) {
...
@@ -455,7 +455,7 @@ static void idxDestroyFinalRslt(SArray* result) {
taosArrayDestroy
(
result
);
taosArrayDestroy
(
result
);
}
}
int
i
nde
xFlushCacheToTFile
(
SIndex
*
sIdx
,
void
*
cache
,
bool
quit
)
{
int
i
d
xFlushCacheToTFile
(
SIndex
*
sIdx
,
void
*
cache
,
bool
quit
)
{
if
(
sIdx
==
NULL
)
{
if
(
sIdx
==
NULL
)
{
return
-
1
;
return
-
1
;
}
}
...
...
source/libs/index/src/indexCache.c
浏览文件 @
1946f39a
...
@@ -69,7 +69,7 @@ static int32_t (*cacheSearch[][QUERY_MAX])(void* cache, SIndexTerm* ct, SIdxTRsl
...
@@ -69,7 +69,7 @@ static int32_t (*cacheSearch[][QUERY_MAX])(void* cache, SIndexTerm* ct, SIdxTRsl
cacheSearchRange_JSON
}};
cacheSearchRange_JSON
}};
static
void
doMergeWork
(
SSchedMsg
*
msg
);
static
void
doMergeWork
(
SSchedMsg
*
msg
);
static
bool
i
nde
xCacheIteratorNext
(
Iterate
*
itera
);
static
bool
i
d
xCacheIteratorNext
(
Iterate
*
itera
);
static
int32_t
cacheSearchTerm
(
void
*
cache
,
SIndexTerm
*
term
,
SIdxTRslt
*
tr
,
STermValueType
*
s
)
{
static
int32_t
cacheSearchTerm
(
void
*
cache
,
SIndexTerm
*
term
,
SIdxTRslt
*
tr
,
STermValueType
*
s
)
{
if
(
cache
==
NULL
)
{
if
(
cache
==
NULL
)
{
...
@@ -476,7 +476,7 @@ Iterate* indexCacheIteratorCreate(IndexCache* cache) {
...
@@ -476,7 +476,7 @@ Iterate* indexCacheIteratorCreate(IndexCache* cache) {
iiter
->
val
.
val
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
iiter
->
val
.
val
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
iiter
->
val
.
colVal
=
NULL
;
iiter
->
val
.
colVal
=
NULL
;
iiter
->
iter
=
tbl
!=
NULL
?
tSkipListCreateIter
(
tbl
->
mem
)
:
NULL
;
iiter
->
iter
=
tbl
!=
NULL
?
tSkipListCreateIter
(
tbl
->
mem
)
:
NULL
;
iiter
->
next
=
i
nde
xCacheIteratorNext
;
iiter
->
next
=
i
d
xCacheIteratorNext
;
iiter
->
getValue
=
indexCacheIteratorGetValue
;
iiter
->
getValue
=
indexCacheIteratorGetValue
;
taosThreadMutexUnlock
(
&
cache
->
mtx
);
taosThreadMutexUnlock
(
&
cache
->
mtx
);
...
@@ -748,9 +748,9 @@ static void doMergeWork(SSchedMsg* msg) {
...
@@ -748,9 +748,9 @@ static void doMergeWork(SSchedMsg* msg) {
int
quit
=
msg
->
thandle
?
true
:
false
;
int
quit
=
msg
->
thandle
?
true
:
false
;
taosMemoryFree
(
msg
->
thandle
);
taosMemoryFree
(
msg
->
thandle
);
i
nde
xFlushCacheToTFile
(
sidx
,
pCache
,
quit
);
i
d
xFlushCacheToTFile
(
sidx
,
pCache
,
quit
);
}
}
static
bool
i
nde
xCacheIteratorNext
(
Iterate
*
itera
)
{
static
bool
i
d
xCacheIteratorNext
(
Iterate
*
itera
)
{
SSkipListIterator
*
iter
=
itera
->
iter
;
SSkipListIterator
*
iter
=
itera
->
iter
;
if
(
iter
==
NULL
)
{
if
(
iter
==
NULL
)
{
return
false
;
return
false
;
...
...
source/libs/index/src/indexFilter.c
浏览文件 @
1946f39a
...
@@ -355,7 +355,7 @@ static int32_t sifDoIndex(SIFParam *left, SIFParam *right, int8_t operType, SIFP
...
@@ -355,7 +355,7 @@ static int32_t sifDoIndex(SIFParam *left, SIFParam *right, int8_t operType, SIFP
SIndexMultiTermQuery
*
mtm
=
indexMultiTermQueryCreate
(
MUST
);
SIndexMultiTermQuery
*
mtm
=
indexMultiTermQueryCreate
(
MUST
);
indexMultiTermQueryAdd
(
mtm
,
tm
,
qtype
);
indexMultiTermQueryAdd
(
mtm
,
tm
,
qtype
);
ret
=
tI
ndexJsonSearch
(
arg
->
ivtIdx
,
mtm
,
output
->
result
);
ret
=
i
ndexJsonSearch
(
arg
->
ivtIdx
,
mtm
,
output
->
result
);
}
else
{
}
else
{
bool
reverse
;
bool
reverse
;
Filter
filterFunc
=
sifGetFilterFunc
(
qtype
,
&
reverse
);
Filter
filterFunc
=
sifGetFilterFunc
(
qtype
,
&
reverse
);
...
...
source/libs/index/src/indexJson.c
浏览文件 @
1946f39a
...
@@ -15,11 +15,11 @@
...
@@ -15,11 +15,11 @@
#include "index.h"
#include "index.h"
#include "indexInt.h"
#include "indexInt.h"
int
tI
ndexJsonOpen
(
SIndexJsonOpts
*
opts
,
const
char
*
path
,
SIndexJson
**
index
)
{
int
i
ndexJsonOpen
(
SIndexJsonOpts
*
opts
,
const
char
*
path
,
SIndexJson
**
index
)
{
// handle
// handle
return
indexOpen
(
opts
,
path
,
index
);
return
indexOpen
(
opts
,
path
,
index
);
}
}
int
tI
ndexJsonPut
(
SIndexJson
*
index
,
SIndexJsonMultiTerm
*
terms
,
uint64_t
uid
)
{
int
i
ndexJsonPut
(
SIndexJson
*
index
,
SIndexJsonMultiTerm
*
terms
,
uint64_t
uid
)
{
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
terms
);
i
++
)
{
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
terms
);
i
++
)
{
SIndexJsonTerm
*
p
=
taosArrayGetP
(
terms
,
i
);
SIndexJsonTerm
*
p
=
taosArrayGetP
(
terms
,
i
);
if
(
p
->
colType
==
TSDB_DATA_TYPE_BOOL
)
{
if
(
p
->
colType
==
TSDB_DATA_TYPE_BOOL
)
{
...
@@ -36,7 +36,7 @@ int tIndexJsonPut(SIndexJson *index, SIndexJsonMultiTerm *terms, uint64_t uid) {
...
@@ -36,7 +36,7 @@ int tIndexJsonPut(SIndexJson *index, SIndexJsonMultiTerm *terms, uint64_t uid) {
return
indexPut
(
index
,
terms
,
uid
);
return
indexPut
(
index
,
terms
,
uid
);
}
}
int
tI
ndexJsonSearch
(
SIndexJson
*
index
,
SIndexJsonMultiTermQuery
*
tq
,
SArray
*
result
)
{
int
i
ndexJsonSearch
(
SIndexJson
*
index
,
SIndexJsonMultiTermQuery
*
tq
,
SArray
*
result
)
{
SArray
*
terms
=
tq
->
query
;
SArray
*
terms
=
tq
->
query
;
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
terms
);
i
++
)
{
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
terms
);
i
++
)
{
SIndexJsonTerm
*
p
=
taosArrayGetP
(
terms
,
i
);
SIndexJsonTerm
*
p
=
taosArrayGetP
(
terms
,
i
);
...
@@ -54,7 +54,7 @@ int tIndexJsonSearch(SIndexJson *index, SIndexJsonMultiTermQuery *tq, SArray *re
...
@@ -54,7 +54,7 @@ int tIndexJsonSearch(SIndexJson *index, SIndexJsonMultiTermQuery *tq, SArray *re
return
indexSearch
(
index
,
tq
,
result
);
return
indexSearch
(
index
,
tq
,
result
);
}
}
void
tI
ndexJsonClose
(
SIndexJson
*
index
)
{
void
i
ndexJsonClose
(
SIndexJson
*
index
)
{
// handle close
// handle close
return
indexClose
(
index
);
return
indexClose
(
index
);
}
}
source/libs/index/test/jsonUT.cc
浏览文件 @
1946f39a
...
@@ -56,11 +56,11 @@ class JsonEnv : public ::testing::Test {
...
@@ -56,11 +56,11 @@ class JsonEnv : public ::testing::Test {
initLog
();
initLog
();
opts
=
indexOptsCreate
();
opts
=
indexOptsCreate
();
int
ret
=
tI
ndexJsonOpen
(
opts
,
dir
.
c_str
(),
&
index
);
int
ret
=
i
ndexJsonOpen
(
opts
,
dir
.
c_str
(),
&
index
);
assert
(
ret
==
0
);
assert
(
ret
==
0
);
}
}
virtual
void
TearDown
()
{
virtual
void
TearDown
()
{
tI
ndexJsonClose
(
index
);
i
ndexJsonClose
(
index
);
indexOptsDestroy
(
opts
);
indexOptsDestroy
(
opts
);
printf
(
"destory
\n
"
);
printf
(
"destory
\n
"
);
taosMsleep
(
1000
);
taosMsleep
(
1000
);
...
@@ -75,7 +75,7 @@ static void WriteData(SIndexJson* index, const std::string& colName, int8_t dtyp
...
@@ -75,7 +75,7 @@ static void WriteData(SIndexJson* index, const std::string& colName, int8_t dtyp
(
const
char
*
)
data
,
dlen
);
(
const
char
*
)
data
,
dlen
);
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
(
int64_t
)
tableId
);
i
ndexJsonPut
(
index
,
terms
,
(
int64_t
)
tableId
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
...
@@ -86,7 +86,7 @@ static void delData(SIndexJson* index, const std::string& colName, int8_t dtype,
...
@@ -86,7 +86,7 @@ static void delData(SIndexJson* index, const std::string& colName, int8_t dtype,
(
const
char
*
)
data
,
dlen
);
(
const
char
*
)
data
,
dlen
);
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
(
int64_t
)
tableId
);
i
ndexJsonPut
(
index
,
terms
,
(
int64_t
)
tableId
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
...
@@ -99,7 +99,7 @@ static void Search(SIndexJson* index, const std::string& colNam, int8_t dtype, v
...
@@ -99,7 +99,7 @@ static void Search(SIndexJson* index, const std::string& colNam, int8_t dtype, v
SArray
*
res
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
res
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
(
EIndexQueryType
)
filterType
);
indexMultiTermQueryAdd
(
mq
,
q
,
(
EIndexQueryType
)
filterType
);
tI
ndexJsonSearch
(
index
,
mq
,
res
);
i
ndexJsonSearch
(
index
,
mq
,
res
);
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
*
result
=
res
;
*
result
=
res
;
}
}
...
@@ -112,7 +112,7 @@ TEST_F(JsonEnv, testWrite) {
...
@@ -112,7 +112,7 @@ TEST_F(JsonEnv, testWrite) {
colVal
.
c_str
(),
colVal
.
size
());
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -125,7 +125,7 @@ TEST_F(JsonEnv, testWrite) {
...
@@ -125,7 +125,7 @@ TEST_F(JsonEnv, testWrite) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -138,7 +138,7 @@ TEST_F(JsonEnv, testWrite) {
...
@@ -138,7 +138,7 @@ TEST_F(JsonEnv, testWrite) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -152,7 +152,7 @@ TEST_F(JsonEnv, testWrite) {
...
@@ -152,7 +152,7 @@ TEST_F(JsonEnv, testWrite) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_TERM
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_TERM
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
100
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
100
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -167,7 +167,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
...
@@ -167,7 +167,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -182,7 +182,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
...
@@ -182,7 +182,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -196,7 +196,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
...
@@ -196,7 +196,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -210,7 +210,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
...
@@ -210,7 +210,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_TERM
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_TERM
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
10
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
10
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -225,7 +225,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
...
@@ -225,7 +225,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_THAN
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_THAN
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -240,7 +240,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
...
@@ -240,7 +240,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_EQUAL
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_EQUAL
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
10
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
10
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -258,7 +258,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -258,7 +258,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -271,7 +271,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -271,7 +271,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -284,7 +284,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -284,7 +284,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -297,7 +297,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -297,7 +297,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -310,7 +310,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -310,7 +310,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_TERM
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_TERM
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -324,7 +324,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -324,7 +324,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_THAN
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_THAN
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -339,7 +339,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -339,7 +339,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_EQUAL
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_EQUAL
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -354,7 +354,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -354,7 +354,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_LESS_THAN
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_LESS_THAN
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -369,7 +369,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
...
@@ -369,7 +369,7 @@ TEST_F(JsonEnv, testWriteJsonNumberData) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_LESS_EQUAL
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_LESS_EQUAL
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -385,7 +385,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -385,7 +385,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -398,7 +398,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -398,7 +398,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -412,7 +412,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -412,7 +412,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_TERM
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_TERM
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -426,7 +426,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -426,7 +426,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_THAN
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_THAN
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -441,7 +441,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -441,7 +441,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_EQUAL
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_EQUAL
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -455,7 +455,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -455,7 +455,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_THAN
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_THAN
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -469,7 +469,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -469,7 +469,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_LESS_EQUAL
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_LESS_EQUAL
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
1000
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -483,7 +483,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -483,7 +483,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
);
i
ndexJsonPut
(
index
,
terms
,
i
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -498,7 +498,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -498,7 +498,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_LESS_THAN
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_LESS_THAN
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
0
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
@@ -511,7 +511,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -511,7 +511,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
indexMultiTermAdd
(
terms
,
term
);
tI
ndexJsonPut
(
index
,
terms
,
i
+
1000
);
i
ndexJsonPut
(
index
,
terms
,
i
+
1000
);
indexMultiTermDestroy
(
terms
);
indexMultiTermDestroy
(
terms
);
}
}
}
}
...
@@ -526,7 +526,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
...
@@ -526,7 +526,7 @@ TEST_F(JsonEnv, testWriteJsonTfileAndCache_INT) {
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_EQUAL
);
indexMultiTermQueryAdd
(
mq
,
q
,
QUERY_GREATER_EQUAL
);
tI
ndexJsonSearch
(
index
,
mq
,
result
);
i
ndexJsonSearch
(
index
,
mq
,
result
);
EXPECT_EQ
(
2000
,
taosArrayGetSize
(
result
));
EXPECT_EQ
(
2000
,
taosArrayGetSize
(
result
));
indexMultiTermQueryDestroy
(
mq
);
indexMultiTermQueryDestroy
(
mq
);
}
}
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
1946f39a
...
@@ -307,6 +307,13 @@ static void uvHandleReq(SSvrConn* pConn) {
...
@@ -307,6 +307,13 @@ static void uvHandleReq(SSvrConn* pConn) {
if
(
pHead
->
noResp
==
1
)
{
if
(
pHead
->
noResp
==
1
)
{
transMsg
.
info
.
refId
=
-
1
;
transMsg
.
info
.
refId
=
-
1
;
}
}
// set up conn info
SRpcConnInfo
*
pConnInfo
=
&
(
transMsg
.
info
.
connInfo
);
pConnInfo
->
clientIp
=
(
uint32_t
)(
pConn
->
addr
.
sin_addr
.
s_addr
);
pConnInfo
->
clientPort
=
ntohs
(
pConn
->
addr
.
sin_port
);
tstrncpy
(
pConnInfo
->
user
,
pConn
->
user
,
sizeof
(
pConnInfo
->
user
));
transReleaseExHandle
(
refMgt
,
pConn
->
refId
);
transReleaseExHandle
(
refMgt
,
pConn
->
refId
);
STrans
*
pTransInst
=
pConn
->
pTransInst
;
STrans
*
pTransInst
=
pConn
->
pTransInst
;
...
@@ -1153,23 +1160,6 @@ _return2:
...
@@ -1153,23 +1160,6 @@ _return2:
rpcFreeCont
(
msg
->
pCont
);
rpcFreeCont
(
msg
->
pCont
);
}
}
int
transGetConnInfo
(
void
*
thandle
,
STransHandleInfo
*
pInfo
)
{
int
transGetConnInfo
(
void
*
thandle
,
STransHandleInfo
*
pConnInfo
)
{
return
-
1
;
}
if
(
thandle
==
NULL
)
{
tTrace
(
"invalid handle %p, failed to Get Conn info"
,
thandle
);
return
-
1
;
}
SExHandle
*
ex
=
thandle
;
SSvrConn
*
pConn
=
ex
->
handle
;
if
(
pConn
==
NULL
)
{
tTrace
(
"invalid handle %p, failed to Get Conn info"
,
thandle
);
return
-
1
;
}
struct
sockaddr_in
addr
=
pConn
->
addr
;
pInfo
->
clientIp
=
(
uint32_t
)(
addr
.
sin_addr
.
s_addr
);
pInfo
->
clientPort
=
ntohs
(
addr
.
sin_port
);
tstrncpy
(
pInfo
->
user
,
pConn
->
user
,
sizeof
(
pInfo
->
user
));
return
0
;
}
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录