Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7960dbe1
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
7960dbe1
编写于
1月 25, 2021
作者:
F
freemine
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. sem_xxx -> tsem_xxx
2. SystemUid
上级
17de4655
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
51 deletion
+20
-51
src/mnode/src/mnodeCluster.c
src/mnode/src/mnodeCluster.c
+0
-8
src/os/src/darwin/darwinSysInfo.c
src/os/src/darwin/darwinSysInfo.c
+12
-1
src/tsdb/inc/tsdbMain.h
src/tsdb/inc/tsdbMain.h
+1
-5
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+1
-5
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+3
-20
src/tsdb/src/tsdbMemTable.c
src/tsdb/src/tsdbMemTable.c
+3
-12
未找到文件。
src/mnode/src/mnodeCluster.c
浏览文件 @
7960dbe1
...
...
@@ -138,14 +138,6 @@ void mnodeDecClusterRef(SClusterObj *pCluster) {
sdbDecRef
(
tsClusterSdb
,
pCluster
);
}
#ifdef __APPLE__
bool
taosGetSystemUid
(
char
*
uid
)
{
fprintf
(
stderr
,
"%s[%d]%s(): not implemented yet!
\n
"
,
basename
(
__FILE__
),
__LINE__
,
__func__
);
abort
();
return
false
;
}
#endif // __APPLE__
static
int32_t
mnodeCreateCluster
()
{
int64_t
numOfClusters
=
sdbGetNumOfRows
(
tsClusterSdb
);
if
(
numOfClusters
!=
0
)
return
TSDB_CODE_SUCCESS
;
...
...
src/os/src/darwin/darwinSysInfo.c
浏览文件 @
7960dbe1
...
...
@@ -103,4 +103,15 @@ int taosSystem(const char *cmd) {
void
taosSetCoreDump
()
{}
char
*
taosGetCmdlineByPID
(
int
pid
)
{
return
""
;
}
\ No newline at end of file
char
*
taosGetCmdlineByPID
(
int
pid
)
{
return
"[not supported yet]"
;
}
bool
taosGetSystemUid
(
char
*
uid
)
{
uuid_t
uuid
=
{
0
};
uuid_generate
(
uuid
);
// it's caller's responsibility to make enough space for `uid`, that's 36-char + 1-null
uuid_unparse
(
uuid
,
uid
);
return
true
;
}
src/tsdb/inc/tsdbMain.h
浏览文件 @
7960dbe1
...
...
@@ -233,11 +233,7 @@ typedef struct {
SMemTable
*
mem
;
SMemTable
*
imem
;
STsdbFileH
*
tsdbFileH
;
#ifdef __APPLE__
sem_t
*
readyToCommit
;
#else // __APPLE__
sem_t
readyToCommit
;
#endif // __APPLE__
tsem_t
readyToCommit
;
pthread_mutex_t
mutex
;
bool
repoLocked
;
int32_t
code
;
// Commit code
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
7960dbe1
...
...
@@ -166,11 +166,7 @@ static void tsdbEndCommit(STsdbRepo *pRepo, int eno) {
pRepo
->
imem
=
NULL
;
tsdbUnlockRepo
(
pRepo
);
tsdbUnRefMemTable
(
pRepo
,
pIMem
);
#ifdef __APPLE__
sem_post
(
pRepo
->
readyToCommit
);
#else // __APPLE__
sem_post
(
&
(
pRepo
->
readyToCommit
));
#endif // __APPLE__
tsem_post
(
&
(
pRepo
->
readyToCommit
));
}
static
int
tsdbHasDataToCommit
(
SCommitIter
*
iters
,
int
nIters
,
TSKEY
minKey
,
TSKEY
maxKey
)
{
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
7960dbe1
...
...
@@ -146,11 +146,7 @@ int tsdbCloseRepo(TSDB_REPO_T *repo, int toCommit) {
if
(
toCommit
)
{
tsdbAsyncCommit
(
pRepo
);
#ifdef __APPLE__
sem_wait
(
pRepo
->
readyToCommit
);
#else // __APPLE__
sem_wait
(
&
(
pRepo
->
readyToCommit
));
#endif // __APPLE__
tsem_wait
(
&
(
pRepo
->
readyToCommit
));
terrno
=
pRepo
->
code
;
}
tsdbUnRefMemTable
(
pRepo
,
pRepo
->
mem
);
...
...
@@ -647,21 +643,12 @@ static STsdbRepo *tsdbNewRepo(char *rootDir, STsdbAppH *pAppH, STsdbCfg *pCfg) {
goto
_err
;
}
#ifdef __APPLE__
pRepo
->
readyToCommit
=
sem_open
(
NULL
,
O_CREAT
,
0644
,
1
);
if
(
pRepo
->
readyToCommit
==
SEM_FAILED
)
{
code
=
errno
;
terrno
=
TAOS_SYSTEM_ERROR
(
code
);
goto
_err
;
}
#else // __APPLE__
code
=
sem_init
(
&
(
pRepo
->
readyToCommit
),
0
,
1
);
code
=
tsem_init
(
&
(
pRepo
->
readyToCommit
),
0
,
1
);
if
(
code
!=
0
)
{
code
=
errno
;
terrno
=
TAOS_SYSTEM_ERROR
(
code
);
goto
_err
;
}
#endif // __APPLE__
pRepo
->
repoLocked
=
false
;
...
...
@@ -707,11 +694,7 @@ static void tsdbFreeRepo(STsdbRepo *pRepo) {
// tsdbFreeMemTable(pRepo->mem);
// tsdbFreeMemTable(pRepo->imem);
tfree
(
pRepo
->
rootDir
);
#ifdef __APPLE__
sem_close
(
pRepo
->
readyToCommit
);
#else // __APPLE__
sem_destroy
(
&
(
pRepo
->
readyToCommit
));
#endif // __APPLE__
tsem_destroy
(
&
(
pRepo
->
readyToCommit
));
pthread_mutex_destroy
(
&
pRepo
->
mutex
);
free
(
pRepo
);
}
...
...
src/tsdb/src/tsdbMemTable.c
浏览文件 @
7960dbe1
...
...
@@ -207,11 +207,7 @@ void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) {
int
tsdbAsyncCommit
(
STsdbRepo
*
pRepo
)
{
if
(
pRepo
->
mem
==
NULL
)
return
0
;
#ifdef __APPLE__
sem_wait
(
pRepo
->
readyToCommit
);
#else // __APPLE__
sem_wait
(
&
(
pRepo
->
readyToCommit
));
#endif // __APPLE__
tsem_wait
(
&
(
pRepo
->
readyToCommit
));
ASSERT
(
pRepo
->
imem
==
NULL
);
...
...
@@ -233,13 +229,8 @@ int tsdbSyncCommit(TSDB_REPO_T *repo) {
STsdbRepo
*
pRepo
=
(
STsdbRepo
*
)
repo
;
tsdbAsyncCommit
(
pRepo
);
#ifdef __APPLE__
sem_wait
(
pRepo
->
readyToCommit
);
sem_post
(
pRepo
->
readyToCommit
);
#else // __APPLE__
sem_wait
(
&
(
pRepo
->
readyToCommit
));
sem_post
(
&
(
pRepo
->
readyToCommit
));
#endif // __APPLE__
tsem_wait
(
&
(
pRepo
->
readyToCommit
));
tsem_post
(
&
(
pRepo
->
readyToCommit
));
if
(
pRepo
->
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
pRepo
->
code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录