Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yiicenne
TDengine
提交
44620e05
TDengine
项目概览
yiicenne
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
44620e05
编写于
4月 07, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-98] support iplist
上级
fa5e2698
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
36 addition
and
44 deletion
+36
-44
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+0
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+27
-13
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-3
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+2
-2
src/query/src/queryExecutor.c
src/query/src/queryExecutor.c
+3
-15
src/vnode/tsdb/src/tsdbRead.c
src/vnode/tsdb/src/tsdbRead.c
+2
-9
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
44620e05
...
...
@@ -351,7 +351,7 @@ typedef struct SSqlObj {
char
*
sqlstr
;
char
retry
;
char
maxRetry
;
SRpcIpSet
*
ipList
;
SRpcIpSet
ipList
;
char
freed
:
4
;
char
listed
:
4
;
tsem_t
rspSem
;
...
...
src/client/src/tscSQLParser.c
浏览文件 @
44620e05
...
...
@@ -209,7 +209,6 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
int32_t
code
=
tscGetQueryInfoDetailSafely
(
pCmd
,
pCmd
->
clauseIndex
,
&
pQueryInfo
);
// assert(pQueryInfo->numOfTables == 0);
STableMetaInfo
*
pTableMetaInfo
=
NULL
;
if
(
pQueryInfo
->
numOfTables
==
0
)
{
...
...
src/client/src/tscServer.c
浏览文件 @
44620e05
...
...
@@ -169,17 +169,27 @@ void tscProcessActivityTimer(void *handle, void *tmrId) {
}
int
tscSendMsgToServer
(
SSqlObj
*
pSql
)
{
char
*
pMsg
=
rpcMallocCont
(
pSql
->
cmd
.
payloadLen
);
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
char
*
pMsg
=
rpcMallocCont
(
pCmd
->
payloadLen
);
if
(
NULL
==
pMsg
)
{
tscError
(
"%p msg:%s malloc fail"
,
pSql
,
taosMsg
[
pSql
->
cmd
.
msgType
]);
return
TSDB_CODE_CLI_OUT_OF_MEMORY
;
}
pSql
->
ipList
->
ip
[
0
]
=
inet_addr
(
tsPrivateIp
);
if
(
pSql
->
cmd
.
command
<
TSDB_SQL_MGMT
)
{
pSql
->
ipList
->
port
=
tsDnodeShellPort
;
tscPrint
(
"%p msg:%s is sent to server %d"
,
pSql
,
taosMsg
[
pSql
->
cmd
.
msgType
],
pSql
->
ipList
->
port
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
pSql
->
ipList
.
numOfIps
=
pTableMeta
->
numOfVpeers
;
pSql
->
ipList
.
port
=
tsDnodeShellPort
;
pSql
->
ipList
.
inUse
=
0
;
for
(
int32_t
i
=
0
;
i
<
pTableMeta
->
numOfVpeers
;
++
i
)
{
pSql
->
ipList
.
ip
[
i
]
=
pTableMeta
->
vpeerDesc
[
i
].
ip
;
}
tscPrint
(
"%p msg:%s is sent to server %d"
,
pSql
,
taosMsg
[
pSql
->
cmd
.
msgType
],
pSql
->
ipList
.
port
);
memcpy
(
pMsg
,
pSql
->
cmd
.
payload
+
tsRpcHeadSize
,
pSql
->
cmd
.
payloadLen
);
SRpcMsg
rpcMsg
=
{
...
...
@@ -189,10 +199,12 @@ int tscSendMsgToServer(SSqlObj *pSql) {
.
handle
=
pSql
,
.
code
=
0
};
rpcSendRequest
(
pVnodeConn
,
pSql
->
ipList
,
&
rpcMsg
);
rpcSendRequest
(
pVnodeConn
,
&
pSql
->
ipList
,
&
rpcMsg
);
}
else
{
pSql
->
ipList
->
port
=
tsMnodeShellPort
;
tscTrace
(
"%p msg:%s is sent to server %d"
,
pSql
,
taosMsg
[
pSql
->
cmd
.
msgType
],
pSql
->
ipList
->
port
);
pSql
->
ipList
=
tscMgmtIpList
;
pSql
->
ipList
.
port
=
tsMnodeShellPort
;
tscTrace
(
"%p msg:%s is sent to server %d"
,
pSql
,
taosMsg
[
pSql
->
cmd
.
msgType
],
pSql
->
ipList
.
port
);
memcpy
(
pMsg
,
pSql
->
cmd
.
payload
,
pSql
->
cmd
.
payloadLen
);
SRpcMsg
rpcMsg
=
{
.
msgType
=
pSql
->
cmd
.
msgType
,
...
...
@@ -201,7 +213,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
.
handle
=
pSql
,
.
code
=
0
};
rpcSendRequest
(
pTscMgmtConn
,
pSql
->
ipList
,
&
rpcMsg
);
rpcSendRequest
(
pTscMgmtConn
,
&
pSql
->
ipList
,
&
rpcMsg
);
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -405,7 +417,7 @@ int tscProcessSql(SSqlObj *pSql) {
}
// temp
pSql
->
ipList
=
&
tscMgmtIpList
;
// pSql->ipList =
tscMgmtIpList;
// if (UTIL_TABLE_IS_NOMRAL_TABLE(pTableMetaInfo)) {
// pSql->index = pTableMetaInfo->pTableMeta->index;
// } else { // it must be the parent SSqlObj for super table query
...
...
@@ -417,7 +429,7 @@ int tscProcessSql(SSqlObj *pSql) {
// }
// }
}
else
if
(
pSql
->
cmd
.
command
<
TSDB_SQL_LOCAL
)
{
pSql
->
ipList
=
&
tscMgmtIpList
;
pSql
->
ipList
=
tscMgmtIpList
;
}
else
{
// local handler
return
(
*
tscProcessMsgRsp
[
pCmd
->
command
])(
pSql
);
}
...
...
@@ -532,9 +544,9 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pShellMsg
->
numOfBlocks
=
htonl
(
pSql
->
cmd
.
numOfTablesInSubmit
);
// number of meters to be inserted
// pSql->cmd.payloadLen is set during copying data into payl
ao
d
// pSql->cmd.payloadLen is set during copying data into payl
oa
d
pSql
->
cmd
.
msgType
=
TSDB_MSG_TYPE_SUBMIT
;
tscTrace
(
"%p build submit msg, vgId:%d numOfVnodes:%d"
,
pSql
,
pTableMeta
->
vgId
,
hton
s
(
pMsgDesc
->
numOfVnodes
));
tscTrace
(
"%p build submit msg, vgId:%d numOfVnodes:%d"
,
pSql
,
pTableMeta
->
vgId
,
hton
l
(
pMsgDesc
->
numOfVnodes
));
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1836,6 +1848,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
for
(
int
i
=
0
;
i
<
TSDB_VNODES_SUPPORT
;
++
i
)
{
pMetaMsg
->
vpeerDesc
[
i
].
vgId
=
htonl
(
pMetaMsg
->
vpeerDesc
[
i
].
vgId
);
pMetaMsg
->
vpeerDesc
[
i
].
ip
=
htonl
(
pMetaMsg
->
vpeerDesc
[
i
].
ip
);
pMetaMsg
->
vpeerDesc
[
i
].
dnodeId
=
htonl
(
pMetaMsg
->
vpeerDesc
[
i
].
dnodeId
);
}
SSchema
*
pSchema
=
pMetaMsg
->
schema
;
...
...
src/client/src/tscUtil.c
浏览文件 @
44620e05
...
...
@@ -860,12 +860,10 @@ int tscAllocPayload(SSqlCmd* pCmd, int size) {
pCmd
->
allocSize
=
size
;
}
memset
(
pCmd
->
payload
,
0
,
pCmd
->
payloadLen
);
memset
(
pCmd
->
payload
,
0
,
pCmd
->
allocSize
);
}
//memset(pCmd->payload, 0, pCmd->allocSize);
assert
(
pCmd
->
allocSize
>=
size
);
return
TSDB_CODE_SUCCESS
;
}
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
44620e05
...
...
@@ -1508,9 +1508,9 @@ static int32_t mgmtDoGetChildTableMeta(SQueuedMsg *pMsg, STableMetaMsg *pMeta) {
for
(
int32_t
i
=
0
;
i
<
TSDB_VNODES_SUPPORT
;
++
i
)
{
if
(
usePublicIp
)
{
pMeta
->
vpeerDesc
[
i
].
ip
=
pVgroup
->
vnodeGid
[
i
].
publicIp
;
pMeta
->
vpeerDesc
[
i
].
ip
=
htonl
(
pVgroup
->
vnodeGid
[
i
].
publicIp
)
;
}
else
{
pMeta
->
vpeerDesc
[
i
].
ip
=
pVgroup
->
vnodeGid
[
i
].
privateIp
;
pMeta
->
vpeerDesc
[
i
].
ip
=
htonl
(
pVgroup
->
vnodeGid
[
i
].
privateIp
)
;
}
pMeta
->
vpeerDesc
[
i
].
vgId
=
htonl
(
pVgroup
->
vgId
);
pMeta
->
vpeerDesc
[
i
].
dnodeId
=
htonl
(
pVgroup
->
vnodeGid
[
i
].
dnodeId
);
...
...
src/query/src/queryExecutor.c
浏览文件 @
44620e05
...
...
@@ -2480,12 +2480,11 @@ SArray *loadDataBlockOnDemand(SQueryRuntimeEnv *pRuntimeEnv, SDataBlockInfo *pBl
}
if
(
r
==
BLK_DATA_NO_NEEDED
)
{
// qTrace("QInfo:%p vid:%d sid:%d id:%s, slot:%d, data block ignored, brange:%" PRId64 "-%" PRId64 ",
// rows:%d", GET_QINFO_ADDR(pQuery), pMeterObj->vnode, pMeterObj->sid, pMeterObj->meterId, pQuery->slot,
// pBlock->keyFirst, pBlock->keyLast, pBlock->numOfPoints);
qTrace
(
"QInfo:%p slot:%d, data block ignored, brange:%"
PRId64
"-%"
PRId64
", rows:%d"
,
GET_QINFO_ADDR
(
pRuntimeEnv
),
pBlockInfo
->
window
.
skey
,
pBlockInfo
->
window
.
ekey
,
pBlockInfo
->
size
);
}
else
if
(
r
==
BLK_DATA_FILEDS_NEEDED
)
{
if
(
tsdbRetrieveDataBlockStatisInfo
(
pRuntimeEnv
->
pQueryHandle
,
pStatis
)
!=
TSDB_CODE_SUCCESS
)
{
//
return DISK_DATA_LOAD_FAILED;
//
return DISK_DATA_LOAD_FAILED;
}
if
(
*
pStatis
==
NULL
)
{
...
...
@@ -5908,14 +5907,6 @@ static void freeQInfo(SQInfo *pQInfo) {
tfree
(
pQuery
->
sdata
[
col
]);
}
// for (int col = 0; col < pQuery->numOfCols; ++col) {
// vnodeFreeColumnInfo(&pQuery->colList[col].data);
// }
//
// if (pQuery->colList[0].colIdx != PRIMARYKEY_TIMESTAMP_COL_INDEX) {
// tfree(pQuery->tsData);
// }
sem_destroy
(
&
(
pQInfo
->
dataReady
));
teardownQueryRuntimeEnv
(
&
pQInfo
->
runtimeEnv
);
...
...
@@ -6125,9 +6116,6 @@ void qTableQuery(SQInfo *pQInfo) {
dTrace
(
"QInfo:%p query task is launched"
,
pQInfo
);
// sem_post(&pQInfo->dataReady);
// pQInfo->runtimeEnv.pQuery->status = QUERY_OVER;
int32_t
numOfTables
=
taosArrayGetSize
(
pQInfo
->
pTableIdList
);
if
(
numOfTables
==
1
)
{
singleTableQueryImpl
(
pQInfo
);
...
...
src/vnode/tsdb/src/tsdbRead.c
浏览文件 @
44620e05
...
...
@@ -37,10 +37,6 @@ typedef struct SField {
// todo need the definition
}
SField
;
typedef
struct
SHeaderFileInfo
{
int32_t
fileId
;
}
SHeaderFileInfo
;
typedef
struct
SQueryFilePos
{
int32_t
fid
;
int32_t
slot
;
...
...
@@ -380,11 +376,12 @@ static bool loadQualifiedDataFromFileBlock(STsdbQueryHandle *pQueryHandle) {
SArray
*
sa
=
getDefaultLoadColumns
(
pQueryHandle
,
true
);
if
(
QUERY_IS_ASC_QUERY
(
pQueryHandle
->
order
))
{
// query ended in current block
if
(
pQueryHandle
->
window
.
ekey
<
pBlock
->
keyLast
)
{
doLoadDataFromFileBlock
(
pQueryHandle
);
filterDataInDataBlock
(
pQueryHandle
,
pCheckInfo
->
pDataCols
,
sa
);
}
else
{
// the whole block is loaded in to buffer
pQueryHandle
->
realNumOfRows
=
pBlock
->
numOfPoints
;
}
}
else
{
// todo desc query
if
(
pQueryHandle
->
window
.
ekey
>
pBlock
->
keyFirst
)
{
...
...
@@ -932,10 +929,6 @@ SArray *tsdbRetrieveDataBlock(tsdb_query_handle_t *pQueryHandle, SArray *pIdList
STsdbQueryHandle
*
pHandle
=
(
STsdbQueryHandle
*
)
pQueryHandle
;
if
(
pHandle
->
cur
.
fid
<
0
)
{
return
pHandle
->
pColumns
;
}
else
{
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pHandle
->
pTableCheckInfo
,
pHandle
->
activeIndex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录