Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
59462d35
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
59462d35
编写于
12月 23, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
new ASSERT add tdiest.c and tcompression.c
上级
232c4f4a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
23 deletion
+23
-23
source/util/src/tcompression.c
source/util/src/tcompression.c
+19
-19
source/util/src/tdigest.c
source/util/src/tdigest.c
+4
-4
未找到文件。
source/util/src/tcompression.c
浏览文件 @
59462d35
...
...
@@ -470,7 +470,7 @@ int32_t tsDecompressStringImp(const char *const input, int32_t compressedSize, c
// TODO: Take care here, we assumes little endian encoding.
int32_t
tsCompressTimestampImp
(
const
char
*
const
input
,
const
int32_t
nelements
,
char
*
const
output
)
{
int32_t
_pos
=
1
;
assert
(
nelements
>=
0
);
ASSERTS
(
nelements
>=
0
,
"nelements is negative"
);
if
(
nelements
==
0
)
return
0
;
...
...
@@ -565,7 +565,7 @@ _exit_over:
}
int32_t
tsDecompressTimestampImp
(
const
char
*
const
input
,
const
int32_t
nelements
,
char
*
const
output
)
{
assert
(
nelements
>=
0
);
ASSERTS
(
nelements
>=
0
,
"nelements is negative"
);
if
(
nelements
==
0
)
return
0
;
if
(
input
[
0
]
==
0
)
{
...
...
@@ -629,7 +629,7 @@ int32_t tsDecompressTimestampImp(const char *const input, const int32_t nelement
}
}
else
{
assert
(
0
);
ASSERT
(
0
);
return
-
1
;
}
}
...
...
@@ -2146,7 +2146,7 @@ int32_t tsCompressTimestamp(void *pIn, int32_t nIn, int32_t nEle, void *pOut, in
int32_t
len
=
tsCompressTimestampImp
(
pIn
,
nEle
,
pBuf
);
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo not one or two stage"
);
return
-
1
;
}
}
...
...
@@ -2159,7 +2159,7 @@ int32_t tsDecompressTimestamp(void *pIn, int32_t nIn, int32_t nEle, void *pOut,
if
(
tsDecompressStringImp
(
pIn
,
nIn
,
pBuf
,
nBuf
)
<
0
)
return
-
1
;
return
tsDecompressTimestampImp
(
pBuf
,
nEle
,
pOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2180,7 +2180,7 @@ int32_t tsCompressFloat(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32_
int32_t
len
=
tsCompressFloatImp
(
pIn
,
nEle
,
pBuf
);
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
#ifdef TD_TSZ
...
...
@@ -2203,7 +2203,7 @@ int32_t tsDecompressFloat(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int3
if
(
tsDecompressStringImp
(
pIn
,
nIn
,
pBuf
,
nBuf
)
<
0
)
return
-
1
;
return
tsDecompressFloatImp
(
pBuf
,
nEle
,
pOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
#ifdef TD_TSZ
...
...
@@ -2227,7 +2227,7 @@ int32_t tsCompressDouble(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32
int32_t
len
=
tsCompressDoubleImp
(
pIn
,
nEle
,
pBuf
);
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
#ifdef TD_TSZ
...
...
@@ -2250,7 +2250,7 @@ int32_t tsDecompressDouble(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int
if
(
tsDecompressStringImp
(
pIn
,
nIn
,
pBuf
,
nBuf
)
<
0
)
return
-
1
;
return
tsDecompressDoubleImp
(
pBuf
,
nEle
,
pOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
#ifdef TD_TSZ
...
...
@@ -2281,7 +2281,7 @@ int32_t tsCompressBool(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32_t
}
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2294,7 +2294,7 @@ int32_t tsDecompressBool(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32
if
(
tsDecompressStringImp
(
pIn
,
nIn
,
pBuf
,
nBuf
)
<
0
)
return
-
1
;
return
tsDecompressBoolImp
(
pBuf
,
nEle
,
pOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2308,7 +2308,7 @@ int32_t tsCompressTinyint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int3
int32_t
len
=
tsCompressINTImp
(
pIn
,
nEle
,
pBuf
,
TSDB_DATA_TYPE_TINYINT
);
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2321,7 +2321,7 @@ int32_t tsDecompressTinyint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, in
if
(
tsDecompressStringImp
(
pIn
,
nIn
,
pBuf
,
nBuf
)
<
0
)
return
-
1
;
return
tsDecompressINTImp
(
pBuf
,
nEle
,
pOut
,
TSDB_DATA_TYPE_TINYINT
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2335,7 +2335,7 @@ int32_t tsCompressSmallint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int
int32_t
len
=
tsCompressINTImp
(
pIn
,
nEle
,
pBuf
,
TSDB_DATA_TYPE_SMALLINT
);
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2348,7 +2348,7 @@ int32_t tsDecompressSmallint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, i
if
(
tsDecompressStringImp
(
pIn
,
nIn
,
pBuf
,
nBuf
)
<
0
)
return
-
1
;
return
tsDecompressINTImp
(
pBuf
,
nEle
,
pOut
,
TSDB_DATA_TYPE_SMALLINT
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2362,7 +2362,7 @@ int32_t tsCompressInt(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32_t
int32_t
len
=
tsCompressINTImp
(
pIn
,
nEle
,
pBuf
,
TSDB_DATA_TYPE_INT
);
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2375,7 +2375,7 @@ int32_t tsDecompressInt(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32_
if
(
tsDecompressStringImp
(
pIn
,
nIn
,
pBuf
,
nBuf
)
<
0
)
return
-
1
;
return
tsDecompressINTImp
(
pBuf
,
nEle
,
pOut
,
TSDB_DATA_TYPE_INT
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2389,7 +2389,7 @@ int32_t tsCompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32
int32_t
len
=
tsCompressINTImp
(
pIn
,
nEle
,
pBuf
,
TSDB_DATA_TYPE_BIGINT
);
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
...
...
@@ -2402,7 +2402,7 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int
if
(
tsDecompressStringImp
(
pIn
,
nIn
,
pBuf
,
nBuf
)
<
0
)
return
-
1
;
return
tsDecompressINTImp
(
pBuf
,
nEle
,
pOut
,
TSDB_DATA_TYPE_BIGINT
);
}
else
{
assert
(
0
);
ASSERTS
(
0
,
"compress algo invalid"
);
return
-
1
;
}
}
source/util/src/tdigest.c
浏览文件 @
59462d35
...
...
@@ -135,24 +135,24 @@ void tdigestCompress(TDigest *t) {
if
(
a
->
mean
<=
b
->
mean
)
{
mergeCentroid
(
&
args
,
a
);
assert
(
args
.
idx
<
t
->
size
);
ASSERTS
(
args
.
idx
<
t
->
size
,
"idx over size"
);
i
++
;
}
else
{
mergeCentroid
(
&
args
,
b
);
assert
(
args
.
idx
<
t
->
size
);
ASSERTS
(
args
.
idx
<
t
->
size
,
"idx over size"
);
j
++
;
}
}
while
(
i
<
num_unmerged
)
{
mergeCentroid
(
&
args
,
&
unmerged_centroids
[
i
++
]);
assert
(
args
.
idx
<
t
->
size
);
ASSERTS
(
args
.
idx
<
t
->
size
,
"idx over size"
);
}
taosMemoryFree
((
void
*
)
unmerged_centroids
);
while
(
j
<
t
->
num_centroids
)
{
mergeCentroid
(
&
args
,
&
t
->
centroids
[
j
++
]);
assert
(
args
.
idx
<
t
->
size
);
ASSERTS
(
args
.
idx
<
t
->
size
,
"idx over size"
);
}
if
(
t
->
total_weight
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录