Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b890676a
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b890676a
编写于
7月 06, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feat/tsdb_refact' of github.com:taosdata/tdengine into feat/tsdb_refact
上级
ddb71ed0
1c7f6bf2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
12 deletion
+24
-12
include/common/trow.h
include/common/trow.h
+1
-1
source/common/src/trow.c
source/common/src/trow.c
+19
-7
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+4
-4
未找到文件。
include/common/trow.h
浏览文件 @
b890676a
...
@@ -322,7 +322,7 @@ STSRow *mergeTwoRows(void *buffer, STSRow *row1, STSRow *row2, STSchema *pSchema
...
@@ -322,7 +322,7 @@ STSRow *mergeTwoRows(void *buffer, STSRow *row1, STSRow *row2, STSchema *pSchema
int32_t
tdGetColDataOfRow
(
SCellVal
*
pVal
,
SDataCol
*
pCol
,
int32_t
row
,
int8_t
bitmapMode
);
int32_t
tdGetColDataOfRow
(
SCellVal
*
pVal
,
SDataCol
*
pCol
,
int32_t
row
,
int8_t
bitmapMode
);
bool
tdSTpRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
col_type_t
colType
,
int32_t
flen
,
uint32_t
offset
,
col_id_t
colIdx
,
bool
tdSTpRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
col_type_t
colType
,
int32_t
flen
,
uint32_t
offset
,
col_id_t
colIdx
,
SCellVal
*
pVal
);
SCellVal
*
pVal
);
bool
tdSKvRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
uint32_t
offset
,
col_id_t
colIdx
,
SCellVal
*
pVal
);
bool
tdSKvRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
col_id_t
colIdx
,
SCellVal
*
pVal
);
int32_t
dataColGetNEleLen
(
SDataCol
*
pDataCol
,
int32_t
rows
,
int8_t
bitmapMode
);
int32_t
dataColGetNEleLen
(
SDataCol
*
pDataCol
,
int32_t
rows
,
int8_t
bitmapMode
);
void
tdSCellValPrint
(
SCellVal
*
pVal
,
int8_t
colType
);
void
tdSCellValPrint
(
SCellVal
*
pVal
,
int8_t
colType
);
void
tdSRowPrint
(
STSRow
*
row
,
STSchema
*
pSchema
,
const
char
*
tag
);
void
tdSRowPrint
(
STSRow
*
row
,
STSchema
*
pSchema
,
const
char
*
tag
);
...
...
source/common/src/trow.c
浏览文件 @
b890676a
...
@@ -34,6 +34,7 @@ const uint8_t tdVTypeByte[2][3] = {{
...
@@ -34,6 +34,7 @@ const uint8_t tdVTypeByte[2][3] = {{
// declaration
// declaration
static
uint8_t
tdGetBitmapByte
(
uint8_t
byte
);
static
uint8_t
tdGetBitmapByte
(
uint8_t
byte
);
static
int32_t
tdCompareColId
(
const
void
*
arg1
,
const
void
*
arg2
);
static
int32_t
tdCompareColId
(
const
void
*
arg1
,
const
void
*
arg2
);
static
FORCE_INLINE
int32_t
compareKvRowColId
(
const
void
*
key1
,
const
void
*
key2
);
// static void dataColSetNEleNull(SDataCol *pCol, int nEle);
// static void dataColSetNEleNull(SDataCol *pCol, int nEle);
...
@@ -1045,13 +1046,28 @@ int32_t dataColGetNEleLen(SDataCol *pDataCol, int32_t rows, int8_t bitmapMode) {
...
@@ -1045,13 +1046,28 @@ int32_t dataColGetNEleLen(SDataCol *pDataCol, int32_t rows, int8_t bitmapMode) {
return
result
;
return
result
;
}
}
bool
tdSKvRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
uint32_t
offset
,
col_id_t
colIdx
,
SCellVal
*
pVal
)
{
bool
tdSKvRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
col_id_t
colIdx
,
SCellVal
*
pVal
)
{
if
(
colId
==
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
if
(
colId
==
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
tdRowSetVal
(
pVal
,
TD_VTYPE_NORM
,
TD_ROW_KEY_ADDR
(
pRow
));
tdRowSetVal
(
pVal
,
TD_VTYPE_NORM
,
TD_ROW_KEY_ADDR
(
pRow
));
return
true
;
return
true
;
}
}
int16_t
nCols
=
tdRowGetNCols
(
pRow
)
-
1
;
if
(
nCols
<=
0
)
{
pVal
->
valType
=
TD_VTYPE_NONE
;
return
true
;
}
SKvRowIdx
*
pColIdx
=
(
SKvRowIdx
*
)
taosbsearch
(
&
colId
,
TD_ROW_COL_IDX
(
pRow
),
nCols
,
sizeof
(
SKvRowIdx
),
compareKvRowColId
,
TD_EQ
);
if
(
!
pColIdx
)
{
pVal
->
valType
=
TD_VTYPE_NONE
;
return
true
;
}
void
*
pBitmap
=
tdGetBitmapAddrKv
(
pRow
,
tdRowGetNCols
(
pRow
));
void
*
pBitmap
=
tdGetBitmapAddrKv
(
pRow
,
tdRowGetNCols
(
pRow
));
tdGetKvRowValOfCol
(
pVal
,
pRow
,
pBitmap
,
offset
,
colIdx
);
tdGetKvRowValOfCol
(
pVal
,
pRow
,
pBitmap
,
pColIdx
->
offset
,
POINTER_DISTANCE
(
pColIdx
,
TD_ROW_COL_IDX
(
pRow
))
/
sizeof
(
SKvRowIdx
));
return
true
;
return
true
;
}
}
...
@@ -1687,7 +1703,6 @@ int32_t tdAppendColValToTpRow(SRowBuilder *pBuilder, TDRowValT valType, const vo
...
@@ -1687,7 +1703,6 @@ int32_t tdAppendColValToTpRow(SRowBuilder *pBuilder, TDRowValT valType, const vo
int32_t
tdSRowSetExtendedInfo
(
SRowBuilder
*
pBuilder
,
int32_t
nCols
,
int32_t
nBoundCols
,
int32_t
flen
,
int32_t
tdSRowSetExtendedInfo
(
SRowBuilder
*
pBuilder
,
int32_t
nCols
,
int32_t
nBoundCols
,
int32_t
flen
,
int32_t
allNullLen
,
int32_t
boundNullLen
)
{
int32_t
allNullLen
,
int32_t
boundNullLen
)
{
#if 0
if
((
boundNullLen
>
0
)
&&
(
allNullLen
>
0
)
&&
(
nBoundCols
>
0
))
{
if
((
boundNullLen
>
0
)
&&
(
allNullLen
>
0
)
&&
(
nBoundCols
>
0
))
{
uint32_t
tpLen
=
allNullLen
;
uint32_t
tpLen
=
allNullLen
;
uint32_t
kvLen
=
sizeof
(
col_id_t
)
+
sizeof
(
SKvRowIdx
)
*
nBoundCols
+
boundNullLen
;
uint32_t
kvLen
=
sizeof
(
col_id_t
)
+
sizeof
(
SKvRowIdx
)
*
nBoundCols
+
boundNullLen
;
...
@@ -1700,8 +1715,6 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
...
@@ -1700,8 +1715,6 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
}
else
{
}
else
{
pBuilder
->
rowType
=
TD_ROW_TP
;
pBuilder
->
rowType
=
TD_ROW_TP
;
}
}
#endif
pBuilder
->
rowType
=
TD_ROW_TP
;
pBuilder
->
flen
=
flen
;
pBuilder
->
flen
=
flen
;
pBuilder
->
nCols
=
nCols
;
pBuilder
->
nCols
=
nCols
;
pBuilder
->
nBoundCols
=
nBoundCols
;
pBuilder
->
nBoundCols
=
nBoundCols
;
...
@@ -1976,8 +1989,7 @@ void tTSRowGetVal(STSRow *pRow, STSchema *pTSchema, int16_t iCol, SColVal *pColV
...
@@ -1976,8 +1989,7 @@ void tTSRowGetVal(STSRow *pRow, STSchema *pTSchema, int16_t iCol, SColVal *pColV
tdSTpRowGetVal
(
pRow
,
pTColumn
->
colId
,
pTColumn
->
type
,
pTSchema
->
flen
,
pTColumn
->
offset
,
iCol
-
1
,
&
cv
);
tdSTpRowGetVal
(
pRow
,
pTColumn
->
colId
,
pTColumn
->
type
,
pTSchema
->
flen
,
pTColumn
->
offset
,
iCol
-
1
,
&
cv
);
}
else
if
(
TD_IS_KV_ROW
(
pRow
))
{
}
else
if
(
TD_IS_KV_ROW
(
pRow
))
{
ASSERT
(
iCol
>
0
);
ASSERT
(
iCol
>
0
);
SKvRowIdx
*
pColIdx
=
tdKvRowColIdxAt
(
pRow
,
iCol
-
1
);
tdSKvRowGetVal
(
pRow
,
pTColumn
->
colId
,
iCol
-
1
,
&
cv
);
tdSKvRowGetVal
(
pRow
,
pTColumn
->
colId
,
pColIdx
->
offset
,
iCol
-
1
,
&
cv
);
}
else
{
}
else
{
ASSERT
(
0
);
ASSERT
(
0
);
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
b890676a
...
@@ -226,8 +226,8 @@ int32_t tGetBlockIdx(uint8_t *p, void *ph) {
...
@@ -226,8 +226,8 @@ int32_t tGetBlockIdx(uint8_t *p, void *ph) {
}
}
int32_t
tCmprBlockIdx
(
void
const
*
lhs
,
void
const
*
rhs
)
{
int32_t
tCmprBlockIdx
(
void
const
*
lhs
,
void
const
*
rhs
)
{
SBlockIdx
*
lBlockIdx
=
*
(
SBlockIdx
*
*
)
lhs
;
SBlockIdx
*
lBlockIdx
=
(
SBlockIdx
*
)
lhs
;
SBlockIdx
*
rBlockIdx
=
*
(
SBlockIdx
*
*
)
rhs
;
SBlockIdx
*
rBlockIdx
=
(
SBlockIdx
*
)
rhs
;
if
(
lBlockIdx
->
suid
<
rBlockIdx
->
suid
)
{
if
(
lBlockIdx
->
suid
<
rBlockIdx
->
suid
)
{
return
-
1
;
return
-
1
;
...
@@ -382,8 +382,8 @@ int32_t tBlockColCmprFn(const void *p1, const void *p2) {
...
@@ -382,8 +382,8 @@ int32_t tBlockColCmprFn(const void *p1, const void *p2) {
// SDelIdx ======================================================
// SDelIdx ======================================================
int32_t
tCmprDelIdx
(
void
const
*
lhs
,
void
const
*
rhs
)
{
int32_t
tCmprDelIdx
(
void
const
*
lhs
,
void
const
*
rhs
)
{
SDelIdx
*
lDelIdx
=
*
(
SDelIdx
*
*
)
lhs
;
SDelIdx
*
lDelIdx
=
(
SDelIdx
*
)
lhs
;
SDelIdx
*
rDelIdx
=
*
(
SDelIdx
*
*
)
rhs
;
SDelIdx
*
rDelIdx
=
(
SDelIdx
*
)
rhs
;
if
(
lDelIdx
->
suid
<
rDelIdx
->
suid
)
{
if
(
lDelIdx
->
suid
<
rDelIdx
->
suid
)
{
return
-
1
;
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录