Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
16a73dcb
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
16a73dcb
编写于
2月 03, 2020
作者:
S
slguan
提交者:
GitHub
2月 03, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1181 from taosdata/feature/#1180
Feature/#1180
上级
fdfcc4aa
69a5dcda
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
26 addition
and
3 deletion
+26
-3
src/inc/tglobalcfg.h
src/inc/tglobalcfg.h
+1
-0
src/modules/http/src/restHandle.c
src/modules/http/src/restHandle.c
+4
-1
src/system/detail/src/vnodeImport.c
src/system/detail/src/vnodeImport.c
+12
-2
src/util/src/tglobalcfg.c
src/util/src/tglobalcfg.c
+9
-0
未找到文件。
src/inc/tglobalcfg.h
浏览文件 @
16a73dcb
...
...
@@ -80,6 +80,7 @@ extern short tsNumOfVnodesPerCore;
extern
short
tsNumOfTotalVnodes
;
extern
short
tsCheckHeaderFile
;
extern
uint32_t
tsPublicIpInt
;
extern
short
tsAffectedRowsMod
;
extern
int
tsSessionsPerVnode
;
extern
int
tsAverageCacheBlocks
;
...
...
src/modules/http/src/restHandle.c
浏览文件 @
16a73dcb
...
...
@@ -67,7 +67,10 @@ bool restProcessSqlRequest(HttpContext* pContext, int timestampFmt) {
return
false
;
}
// for async test
/*
* for async test
* /
/*
if (httpCheckUsedbSql(sql)) {
httpSendErrorResp(pContext, HTTP_NO_EXEC_USEDB);
...
...
src/system/detail/src/vnodeImport.c
浏览文件 @
16a73dcb
...
...
@@ -911,6 +911,7 @@ static int vnodeMergeDataIntoFile(SImportInfo *pImport, const char *payload, int
blockIter
.
nextKey
=
maxFileKey
+
1
;
}
else
{
// Case 3. need to search the block for slot and pos
if
(
key
==
minKey
||
key
==
maxKey
)
{
if
(
tsAffectedRowsMod
)
pointsImported
++
;
payloadIter
++
;
continue
;
}
...
...
@@ -939,6 +940,7 @@ static int vnodeMergeDataIntoFile(SImportInfo *pImport, const char *payload, int
}
while
(
left
<
right
);
if
(
key
==
blockMinKey
||
key
==
blockMaxKey
)
{
// duplicate key
if
(
tsAffectedRowsMod
)
pointsImported
++
;
payloadIter
++
;
continue
;
}
...
...
@@ -955,6 +957,7 @@ static int vnodeMergeDataIntoFile(SImportInfo *pImport, const char *payload, int
if
(
key
==
importHandle
.
pBlocks
[
blockIter
.
slot
].
keyFirst
||
key
==
importHandle
.
pBlocks
[
blockIter
.
slot
].
keyLast
)
{
if
(
tsAffectedRowsMod
)
pointsImported
++
;
payloadIter
++
;
continue
;
}
...
...
@@ -976,6 +979,7 @@ static int vnodeMergeDataIntoFile(SImportInfo *pImport, const char *payload, int
importHandle
.
data
[
PRIMARYKEY_TIMESTAMP_COL_INDEX
]
->
data
,
pBlock
->
numOfPoints
,
key
,
TSQL_SO_ASC
);
assert
(
pos
!=
0
);
if
(
KEY_AT_INDEX
(
importHandle
.
data
[
PRIMARYKEY_TIMESTAMP_COL_INDEX
]
->
data
,
sizeof
(
TSKEY
),
pos
)
==
key
)
{
if
(
tsAffectedRowsMod
)
pointsImported
++
;
payloadIter
++
;
continue
;
}
...
...
@@ -1106,6 +1110,7 @@ static int vnodeMergeDataIntoFile(SImportInfo *pImport, const char *payload, int
if
(
KEY_AT_INDEX
(
payload
,
pObj
->
bytesPerPoint
,
payloadIter
)
==
KEY_AT_INDEX
(
importHandle
.
data
[
PRIMARYKEY_TIMESTAMP_COL_INDEX
]
->
data
,
sizeof
(
TSKEY
),
blockIter
.
pos
))
{
// duplicate key
if
(
tsAffectedRowsMod
)
pointsImported
++
;
payloadIter
++
;
continue
;
}
else
if
(
KEY_AT_INDEX
(
payload
,
pObj
->
bytesPerPoint
,
payloadIter
)
<
...
...
@@ -1320,7 +1325,10 @@ int vnodeImportDataToCache(SImportInfo *pImport, const char *payload, const int
pImport
->
lastKey
=
lastKey
;
for
(
payloadIter
=
0
;
payloadIter
<
rows
;
payloadIter
++
)
{
TSKEY
key
=
KEY_AT_INDEX
(
payload
,
pObj
->
bytesPerPoint
,
payloadIter
);
if
(
key
==
pObj
->
lastKey
)
continue
;
if
(
key
==
pObj
->
lastKey
)
{
if
(
tsAffectedRowsMod
)
rowsImported
++
;
continue
;
}
if
(
key
>
pObj
->
lastKey
)
{
// Just as insert
pImport
->
slot
=
pInfo
->
currentSlot
;
pImport
->
pos
=
pInfo
->
cacheBlocks
[
pImport
->
slot
]
->
numOfPoints
;
...
...
@@ -1333,11 +1341,12 @@ int vnodeImportDataToCache(SImportInfo *pImport, const char *payload, const int
}
if
(
pImport
->
firstKey
!=
pImport
->
key
)
break
;
if
(
tsAffectedRowsMod
)
rowsImported
++
;
}
}
if
(
payloadIter
==
rows
)
{
pImport
->
importedRows
=
0
;
pImport
->
importedRows
+=
rowsImported
;
code
=
0
;
goto
_exit
;
}
...
...
@@ -1470,6 +1479,7 @@ int vnodeImportDataToCache(SImportInfo *pImport, const char *payload, const int
payloadIter
++
;
}
else
{
if
(
tsAffectedRowsMod
)
rowsImported
++
;
payloadIter
++
;
continue
;
}
...
...
src/util/src/tglobalcfg.c
浏览文件 @
16a73dcb
...
...
@@ -83,6 +83,12 @@ short tsCheckHeaderFile = 0;
int
tsSessionsPerVnode
=
1000
;
int
tsCacheBlockSize
=
16384
;
// 256 columns
int
tsAverageCacheBlocks
=
TSDB_DEFAULT_AVG_BLOCKS
;
/**
* Change the meaning of affected rows:
* 0: affected rows not include those duplicate records
* 1: affected rows include those duplicate records
*/
short
tsAffectedRowsMod
=
0
;
int
tsRowsInFileBlock
=
4096
;
float
tsFileBlockMinPercent
=
0
.
05
;
...
...
@@ -535,6 +541,9 @@ static void doInitGlobalConfig() {
tsInitConfigOption
(
cfg
++
,
"alternativeRole"
,
&
tsAlternativeRole
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLUSTER
,
0
,
2
,
0
,
TSDB_CFG_UTYPE_NONE
);
tsInitConfigOption
(
cfg
++
,
"affectedRowsMod"
,
&
tsAffectedRowsMod
,
TSDB_CFG_VTYPE_SHORT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
|
TSDB_CFG_CTYPE_B_CLIENT
,
0
,
1
,
0
,
TSDB_CFG_UTYPE_NONE
);
// 0-any, 1-mgmt, 2-dnode
// timer
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录