Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
169338ea
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
169338ea
编写于
8月 06, 2019
作者:
陶建辉(Jeff)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix issue #280
上级
2470e3f5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
25 deletion
+27
-25
src/system/src/vnodeImport.c
src/system/src/vnodeImport.c
+27
-25
未找到文件。
src/system/src/vnodeImport.c
浏览文件 @
169338ea
...
...
@@ -41,7 +41,7 @@ typedef struct {
}
SHeadInfo
;
typedef
struct
{
void
*
signature
;
void
*
signature
;
SShellObj
*
pShell
;
SMeterObj
*
pObj
;
int
retry
;
...
...
@@ -58,9 +58,10 @@ typedef struct {
int
numOfPoints
;
int
fileId
;
int64_t
offset
;
// offset in data file
SData
*
sdata
[
TSDB_MAX_COLUMNS
];
char
*
buffer
;
char
*
payload
;
SData
*
sdata
[
TSDB_MAX_COLUMNS
];
char
*
buffer
;
char
*
payload
;
char
*
opayload
;
// allocated space for payload from client
int
rows
;
}
SImportInfo
;
...
...
@@ -176,9 +177,9 @@ int vnodeProcessLastBlock(SImportInfo *pImport, SHeadInfo *pHinfo, SData *data[]
}
int
vnodeOpenFileForImport
(
SImportInfo
*
pImport
,
char
*
payload
,
SHeadInfo
*
pHinfo
,
SData
*
data
[])
{
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SVnodeCfg
*
pCfg
=
&
pVnode
->
cfg
;
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SVnodeCfg
*
pCfg
=
&
pVnode
->
cfg
;
TSKEY
firstKey
=
*
((
TSKEY
*
)
payload
);
struct
stat
filestat
;
int
sid
,
rowsBefore
=
0
;
...
...
@@ -276,10 +277,10 @@ void vnodeProcessImportTimer(void *param, void *tmrId) {
return
;
}
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SCachePool
*
pPool
=
(
SCachePool
*
)
pVnode
->
pCachePool
;
SShellObj
*
pShell
=
pImport
->
pShell
;
SShellObj
*
pShell
=
pImport
->
pShell
;
pImport
->
retry
++
;
...
...
@@ -334,18 +335,18 @@ void vnodeProcessImportTimer(void *param, void *tmrId) {
}
pImport
->
signature
=
NULL
;
free
(
pImport
->
payload
);
free
(
pImport
->
o
payload
);
free
(
pImport
);
}
int
vnodeImportToFile
(
SImportInfo
*
pImport
)
{
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SVnodeCfg
*
pCfg
=
&
pVnode
->
cfg
;
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SVnodeCfg
*
pCfg
=
&
pVnode
->
cfg
;
SHeadInfo
headInfo
;
int
code
=
0
,
col
;
SCompBlock
compBlock
;
char
*
payload
=
pImport
->
payload
;
char
*
payload
=
pImport
->
payload
;
int
rows
=
pImport
->
rows
;
SCachePool
*
pPool
=
(
SCachePool
*
)
pVnode
->
pCachePool
;
...
...
@@ -516,9 +517,9 @@ _exit:
}
int
vnodeImportToCache
(
SImportInfo
*
pImport
,
char
*
payload
,
int
rows
)
{
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SVnodeCfg
*
pCfg
=
&
pVnode
->
cfg
;
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SVnodeCfg
*
pCfg
=
&
pVnode
->
cfg
;
int
code
=
-
1
;
SCacheInfo
*
pInfo
=
(
SCacheInfo
*
)
pObj
->
pCache
;
int
slot
,
pos
,
row
,
col
,
points
,
tpoints
;
...
...
@@ -627,8 +628,8 @@ _exit:
}
int
vnodeFindKeyInFile
(
SImportInfo
*
pImport
,
int
order
)
{
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SMeterObj
*
pObj
=
pImport
->
pObj
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
int
code
=
-
1
;
SQuery
query
;
SColumnFilter
colList
[
TSDB_MAX_COLUMNS
]
=
{
0
};
...
...
@@ -720,7 +721,7 @@ int vnodeFindKeyInFile(SImportInfo *pImport, int order) {
}
int
vnodeFindKeyInCache
(
SImportInfo
*
pImport
,
int
order
)
{
SMeterObj
*
pObj
=
pImport
->
pObj
;
SMeterObj
*
pObj
=
pImport
->
pObj
;
int
code
=
0
;
SQuery
query
;
SCacheInfo
*
pInfo
=
(
SCacheInfo
*
)
pObj
->
pCache
;
...
...
@@ -847,12 +848,12 @@ int vnodeImportWholeToCache(SImportInfo *pImport, char *payload, int rows) {
int
vnodeImportPoints
(
SMeterObj
*
pObj
,
char
*
cont
,
int
contLen
,
char
source
,
void
*
param
,
int
sversion
,
int
*
pNumOfPoints
)
{
SSubmitMsg
*
pSubmit
=
(
SSubmitMsg
*
)
cont
;
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
int
rows
;
char
*
payload
;
char
*
payload
;
int
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
SCachePool
*
pPool
=
(
SCachePool
*
)
pVnode
->
pCachePool
;
SShellObj
*
pShell
=
(
SShellObj
*
)
param
;
SShellObj
*
pShell
=
(
SShellObj
*
)
param
;
int
pointsImported
=
0
;
rows
=
htons
(
pSubmit
->
numOfRows
);
...
...
@@ -923,6 +924,7 @@ int vnodeImportPoints(SMeterObj *pObj, char *cont, int contLen, char source, voi
pNew
->
signature
=
pNew
;
int
payloadLen
=
contLen
-
sizeof
(
SSubmitMsg
);
pNew
->
payload
=
malloc
(
payloadLen
);
pNew
->
opayload
=
pNew
->
payload
;
memcpy
(
pNew
->
payload
,
payload
,
payloadLen
);
dTrace
(
"vid:%d sid:%d id:%s, import later, commit in process:%d, numOfQueries:%d"
,
pObj
->
vnode
,
pObj
->
sid
,
...
...
@@ -963,7 +965,7 @@ int vnodeImportData(SMeterObj *pObj, SImportInfo *pImport) {
code
=
vnodeImportStartToFile
(
pImport
,
pImport
->
payload
,
pImport
->
rows
);
}
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SVnodeObj
*
pVnode
=
&
vnodeList
[
pObj
->
vnode
];
SCachePool
*
pPool
=
(
SCachePool
*
)
pVnode
->
pCachePool
;
pPool
->
commitInProcess
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录