Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
80c3d406
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看板
提交
80c3d406
编写于
9月 22, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact
上级
bddec203
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
125 addition
and
68 deletion
+125
-68
include/os/os.h
include/os/os.h
+3
-1
include/os/osEndian.h
include/os/osEndian.h
+30
-0
include/util/tcoding.h
include/util/tcoding.h
+2
-4
src/CMakeLists.txt
src/CMakeLists.txt
+1
-0
src/dnode/CMakeLists.txt
src/dnode/CMakeLists.txt
+6
-63
src/dnode/CMakeLists.txt.in
src/dnode/CMakeLists.txt.in
+63
-0
src/dnode/source/dnode.c
src/dnode/source/dnode.c
+20
-0
未找到文件。
include/os/os.h
浏览文件 @
80c3d406
...
...
@@ -20,12 +20,14 @@
extern
"C"
{
#endif
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "osEndian.h"
#include "osMemory.h"
#ifdef __cplusplus
...
...
include/os/osEndian.h
0 → 100644
浏览文件 @
80c3d406
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_OS_ENDIAN_H_
#define _TD_OS_ENDIAN_H_
#ifdef __cplusplus
extern
"C"
{
#endif
static
const
int32_t
endian_test_var
=
1
;
#define IS_LITTLE_ENDIAN() (*(uint8_t *)(&endian_test_var) != 0)
#ifdef __cplusplus
}
#endif
#endif
/*_TD_OS_ENDIAN_H_*/
\ No newline at end of file
include/util/tcoding.h
浏览文件 @
80c3d406
...
...
@@ -19,11 +19,9 @@
extern
"C"
{
#endif
// TODO: move this to a platform file
#define ENCODE_LIMIT (((uint8_t)1) << 7)
static
const
int32_t
TNUMBER
=
1
;
#define IS_LITTLE_ENDIAN() (*(uint8_t *)(&TNUMBER) != 0)
#include "os.h "
#define ENCODE_LIMIT (((uint8_t)1) << 7)
#define ZIGZAGE(T, v) ((u##T)((v) >> (sizeof(T) * 8 - 1))) ^ (((u##T)(v)) << 1) // zigzag encode
#define ZIGZAGD(T, v) ((v) >> 1) ^ -((T)((v)&1)) // zigzag decode
...
...
src/CMakeLists.txt
浏览文件 @
80c3d406
add_subdirectory
(
os
)
add_subdirectory
(
util
)
# add_subdirectory(common)
add_subdirectory
(
dnode
)
src/dnode/CMakeLists.txt
浏览文件 @
80c3d406
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8...3.20
)
PROJECT
(
TDengine
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/mnode/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/tsdb/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/sync/inc
)
INCLUDE_DIRECTORIES
(
${
TD_ENTERPRISE_DIR
}
/src/inc
)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
IF
(
TD_LINUX_64 AND JEMALLOC_ENABLED
)
ADD_DEFINITIONS
(
-DTD_JEMALLOC_ENABLED -I
${
CMAKE_BINARY_DIR
}
/build/include -L
${
CMAKE_BINARY_DIR
}
/build/lib -Wl,-rpath,
${
CMAKE_BINARY_DIR
}
/build/lib -ljemalloc
)
SET
(
LINK_JEMALLOC
"-L
${
CMAKE_BINARY_DIR
}
/build/lib -ljemalloc"
)
ELSE
()
SET
(
LINK_JEMALLOC
""
)
ENDIF
()
ADD_EXECUTABLE
(
taosd
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lua lz4 balance sync
${
LINK_JEMALLOC
}
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosd taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
taosd taos
)
ENDIF
()
IF
(
TD_ACCOUNT
)
TARGET_LINK_LIBRARIES
(
taosd account
)
ENDIF
()
IF
(
TD_GRANT
)
TARGET_LINK_LIBRARIES
(
taosd grant
)
ENDIF
()
IF
(
TD_MQTT
)
TARGET_LINK_LIBRARIES
(
taosd mqtt
)
ENDIF
()
IF
(
TD_TOPIC
)
TARGET_LINK_LIBRARIES
(
taosd topic
)
ENDIF
()
IF
(
TD_MODULE AND TD_LINUX
)
TARGET_LINK_LIBRARIES
(
taosd module dl
)
ENDIF
()
SET
(
PREPARE_ENV_CMD
"prepare_env_cmd"
)
SET
(
PREPARE_ENV_TARGET
"prepare_env_target"
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
PREPARE_ENV_CMD
}
POST_BUILD
COMMAND echo
"make test directory"
DEPENDS taosd
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/log/
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/data/
COMMAND
${
CMAKE_COMMAND
}
-E echo dataDir
${
TD_TESTS_OUTPUT_DIR
}
/data >
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo logDir
${
TD_TESTS_OUTPUT_DIR
}
/log >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo charset UTF-8 >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo monitor 0 >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMENT
"prepare taosd environment"
)
ADD_CUSTOM_TARGET
(
${
PREPARE_ENV_TARGET
}
ALL WORKING_DIRECTORY
${
TD_EXECUTABLE_OUTPUT_PATH
}
DEPENDS
${
PREPARE_ENV_CMD
}
)
aux_source_directory
(
source DNODE_SRC
)
add_executable
(
taosd
${
DNODE_SRC
}
)
target_link_libraries
(
taosd
PRIVATE os
)
\ No newline at end of file
src/dnode/CMakeLists.txt.in
0 → 100644
浏览文件 @
80c3d406
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20)
PROJECT(TDengine)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/tsdb/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/sync/inc)
INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
INCLUDE_DIRECTORIES(inc)
AUX_SOURCE_DIRECTORY(src SRC)
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
ADD_DEFINITIONS(-DTD_JEMALLOC_ENABLED -I${CMAKE_BINARY_DIR}/build/include -L${CMAKE_BINARY_DIR}/build/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/build/lib -ljemalloc)
SET(LINK_JEMALLOC "-L${CMAKE_BINARY_DIR}/build/lib -ljemalloc")
ELSE ()
SET(LINK_JEMALLOC "")
ENDIF ()
ADD_EXECUTABLE(taosd ${SRC})
TARGET_LINK_LIBRARIES(taosd mnode monitor http tsdb twal vnode cJson lua lz4 balance sync ${LINK_JEMALLOC})
IF (TD_SOMODE_STATIC)
TARGET_LINK_LIBRARIES(taosd taos_static)
ELSE ()
TARGET_LINK_LIBRARIES(taosd taos)
ENDIF ()
IF (TD_ACCOUNT)
TARGET_LINK_LIBRARIES(taosd account)
ENDIF ()
IF (TD_GRANT)
TARGET_LINK_LIBRARIES(taosd grant)
ENDIF ()
IF (TD_MQTT)
TARGET_LINK_LIBRARIES(taosd mqtt)
ENDIF ()
IF (TD_TOPIC)
TARGET_LINK_LIBRARIES(taosd topic)
ENDIF ()
IF (TD_MODULE AND TD_LINUX)
TARGET_LINK_LIBRARIES(taosd module dl)
ENDIF ()
SET(PREPARE_ENV_CMD "prepare_env_cmd")
SET(PREPARE_ENV_TARGET "prepare_env_target")
ADD_CUSTOM_COMMAND(OUTPUT ${PREPARE_ENV_CMD}
POST_BUILD
COMMAND echo "make test directory"
DEPENDS taosd
COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/cfg/
COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/log/
COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/data/
COMMAND ${CMAKE_COMMAND} -E echo dataDir ${TD_TESTS_OUTPUT_DIR}/data > ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
COMMAND ${CMAKE_COMMAND} -E echo logDir ${TD_TESTS_OUTPUT_DIR}/log >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
COMMAND ${CMAKE_COMMAND} -E echo charset UTF-8 >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
COMMAND ${CMAKE_COMMAND} -E echo monitor 0 >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
COMMENT "prepare taosd environment")
ADD_CUSTOM_TARGET(${PREPARE_ENV_TARGET} ALL WORKING_DIRECTORY ${TD_EXECUTABLE_OUTPUT_PATH} DEPENDS ${PREPARE_ENV_CMD})
src/dnode/source/dnode.c
0 → 100644
浏览文件 @
80c3d406
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os.h"
int
main
(
int
argc
,
char
const
*
argv
[])
{
printf
(
"Hello world!
\n
"
);
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录