Skip to content

Commit

Permalink
Merge branch 'master' into refactor-building
Browse files Browse the repository at this point in the history
  • Loading branch information
dutor committed Dec 31, 2019
2 parents 5411cf6 + 089405b commit 64c9632
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 61 deletions.
36 changes: 23 additions & 13 deletions cmake/FindPCHSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
EXEC_PROGRAM(
${CMAKE_CXX_COMPILER}
ARGS --version
ARGS --version
OUTPUT_VARIABLE _compiler_output)
STRING(REGEX REPLACE ".* ([0-9]\\.[0-9]\\.[0-9]) .*" "\\1"
gcc_compiler_version ${_compiler_output})
Expand All @@ -36,9 +36,11 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input)

GET_FILENAME_COMPONENT(_name ${_input} NAME)
SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
SET(_output "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.gch")
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(_compiler_FLAGS ${${_flags_var_name}})
GET_DIRECTORY_PROPERTY(_directory_compile_options COMPILE_OPTIONS)
LIST(APPEND _compiler_FLAGS ${_directory_compile_options})

GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
SET(_system_INCLUDE_DIRS "/usr/include" "/usr/local/include")
Expand All @@ -47,36 +49,44 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
LIST(FIND _system_INCLUDE_DIRS ${item} _index)
IF(NOT ${_index} EQUAL -1)
continue()
ENDIF(NOT ${_index} EQUAL -1)
ENDIF()

IF(item MATCHES "^${PROJECT_SOURCE_DIR}.*")
# Directories in this project
IF(item MATCHES "^${PROJECT_SOURCE_DIR}/third-party.*")
IF(item MATCHES "^${PROJECT_SOURCE_DIR}/.*third-party.*")
# third-party
LIST(APPEND _compiler_FLAGS "-isystem ${item}")
ELSE(item MATCHES "^${PROJECT_SOURCE_DIR}/third-party.*")
ELSE()
# Our own directories
LIST(APPEND _compiler_FLAGS "-I ${item}")
ENDIF(item MATCHES "^${PROJECT_SOURCE_DIR}/third-party.*")
ELSE(item MATCHES "^${PROJECT_SOURCE_DIR}.*")
ENDIF()
ELSE()
# All of others
LIST(APPEND _compiler_FLAGS "-isystem ${item}")
ENDIF(item MATCHES "^${PROJECT_SOURCE_DIR}.*")
ENDIF()
ENDFOREACH(item)

GET_DIRECTORY_PROPERTY(_directory_flags COMPILE_DEFINITIONS)
GET_DIRECTORY_PROPERTY(_directory_flags COMPILE_DEFINITIONS)
FOREACH(item ${_directory_flags})
LIST(APPEND _compiler_FLAGS "-D${item}")
IF(NOT ${item} MATCHES "^GIT_INFO_SHA")
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDIF()
ENDFOREACH(item)

SEPARATE_ARGUMENTS(_compiler_FLAGS)
MESSAGE("Precompile header file " ${_source} " into " ${_output})
IF(CMAKE_CXX_EXTENSIONS OR NOT DEFINED CMAKE_CXX_EXTENSIONS)
SET(_cxx_standard "gnu++${CMAKE_CXX_STANDARD}")
ELSE()
SET(_cxx_standard "c++${CMAKE_CXX_STANDARD}")
ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND ${CMAKE_CXX_COMPILER}
${_compiler_FLAGS}
-x c++-header
-o ${_output} ${_source}
${_compiler_FLAGS}
-x c++-header
-std=${_cxx_standard}
-o ${_output} ${_source}
MAIN_DEPENDENCY ${_source})
ADD_CUSTOM_TARGET(${_targetName}_gch DEPENDS ${_output})
ADD_DEPENDENCIES(${_targetName} ${_targetName}_gch)
Expand Down
12 changes: 6 additions & 6 deletions docs/manual-CN/1.overview/2.quick-start/2.FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ nebula> scripts/nebula.service start graphd

### 当创建 tag 或者 edge 类型后,插入数据时报错

可能原因, `load_data_interval_secs` 设置了从 meta server 获取元数据时间间隔。更改方式:
可能原因, `heartbeat_interval_secs` 设置了从 meta server 获取元数据时间间隔。更改方式:

如果 meta 注册过配置,请在 console 中运行以下命令查看参数 `load_data_interval_secs` 的值。
如果 meta 注册过配置,请在 console 中运行以下命令查看参数 `heartbeat_interval_secs` 的值。

```ngql
nebula> GET CONFIGS storage:load_data_interval_secs
nebula> GET CONFIGS graph:load_data_interval_secs
nebula> GET CONFIGS storage:heartbeat_interval_secs
nebula> GET CONFIGS graph:heartbeat_interval_secs
```

如果值过大,运行以下命令将值更改为 1s

```ngql
nebula> UPDATE CONFIGS storage:load_data_interval_secs=1
nebula> UPDATE CONFIGS graph:load_data_interval_secs=1
nebula> UPDATE CONFIGS storage:heartbeat_interval_secs=1
nebula> UPDATE CONFIGS graph:heartbeat_interval_secs=1
```

> 注意,更改不会立即生效,需在下个周期生效。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,23 @@ GET CONFIGS [graph|meta|storage :] var
例如

```ngql
nebula> GET CONFIGS storage:load_data_interval_secs
=================================================================
| module | name | type | mode | value |
=================================================================
| STORAGE | load_data_interval_secs | INT64 | MUTABLE | 120 |
-----------------------------------------------------------------
nebula> GET CONFIGS storage:local_ip
=======================================================
| module | name | type | mode | value |
=======================================================
| STORAGE | local_ip | STRING | IMMUTABLE | 127.0.0.1 |
-------------------------------------------------------
```

```ngql
nebula> GET CONFIGS load_data_interval_secs
nebula> GET CONFIGS heartbeat_interval_secs
=================================================================
| module | name | type | mode | value |
=================================================================
| GRAPH | load_data_interval_secs | INT64 | MUTABLE | 120 |
-----------------------------------------------------------------
| META | load_data_interval_secs | INT64 | IMMUTABLE | 120 |
| GRAPH | heartbeat_interval_secs | INT64 | MUTABLE | 10 |
-----------------------------------------------------------------
| STORAGE | load_data_interval_secs | INT64 | MUTABLE | 120 |
| STORAGE | heartbeat_interval_secs | INT64 | MUTABLE | 10 |
-----------------------------------------------------------------
Got 3 rows (Time spent: 1449/2339 us)
```

### 更新变量
Expand All @@ -117,13 +114,11 @@ UPDATE CONFIGS [graph|meta|storage :] var = value
例如

```ngql
nebula> UPDATE CONFIGS storage:load_data_interval_secs=1
Execution succeeded (Time spent: 1750/2484 us)
nebula> GET CONFIGS storage:load_data_interval_secs
nebula> UPDATE CONFIGS storage:heartbeat_interval_secs=1
nebula> GET CONFIGS storage:heartbeat_interval_secs
===============================================================
| module | name | type | mode | value |
===============================================================
| STORAGE | load_data_interval_secs | INT64 | MUTABLE | 1 |
| STORAGE | heartbeat_interval_secs | INT64 | MUTABLE | 1 |
---------------------------------------------------------------
Got 1 rows (Time spent: 1678/3420 us)
```
12 changes: 6 additions & 6 deletions docs/manual-EN/1.overview/2.quick-start/2.FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ nebula> scripts/nebula.service start graphd

### Errors Thrown When Inserting Data After Tag or Edge is Created

This is likely caused by setting the `load_data_interval_secs` value to fetch data from the meta server. Conduct the following steps to resolve:
This is likely caused by setting the `heartbeat_interval_secs` value to fetch data from the meta server. Conduct the following steps to resolve:

If meta has registered, check `load_data_interval_secs` value in console with the following command.
If meta has registered, check `heartbeat_interval_secs` value in console with the following command.

```ngql
nebula> GET CONFIGS storage:load_data_interval_secs
nebula> GET CONFIGS graph:load_data_interval_secs
nebula> GET CONFIGS storage:heartbeat_interval_secs
nebula> GET CONFIGS graph:heartbeat_interval_secs
```

If the value is large, change it to 1s with the following command.

```ngql
nebula> UPDATE CONFIGS storage:load_data_interval_secs=1
nebula> UPDATE CONFIGS graph:load_data_interval_secs=1
nebula> UPDATE CONFIGS storage:heartbeat_interval_secs=1
nebula> UPDATE CONFIGS graph:heartbeat_interval_secs=1
```

> Note the changes take effect in the next period.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,23 @@ GET CONFIGS [graph|meta|storage :] var
For example

```ngql
nebula> GET CONFIGS storage:load_data_interval_secs
=================================================================
| module | name | type | mode | value |
=================================================================
| STORAGE | load_data_interval_secs | INT64 | MUTABLE | 120 |
-----------------------------------------------------------------
nebula> GET CONFIGS storage:local_ip
=======================================================
| module | name | type | mode | value |
=======================================================
| STORAGE | local_ip | STRING | IMMUTABLE | 127.0.0.1 |
-------------------------------------------------------
```

```ngql
nebula> GET CONFIGS load_data_interval_secs
nebula> GET CONFIGS heartbeat_interval_secs
=================================================================
| module | name | type | mode | value |
=================================================================
| GRAPH | load_data_interval_secs | INT64 | MUTABLE | 120 |
-----------------------------------------------------------------
| META | load_data_interval_secs | INT64 | IMMUTABLE | 120 |
| GRAPH | heartbeat_interval_secs | INT64 | MUTABLE | 10 |
-----------------------------------------------------------------
| STORAGE | load_data_interval_secs | INT64 | MUTABLE | 120 |
| STORAGE | heartbeat_interval_secs | INT64 | MUTABLE | 10 |
-----------------------------------------------------------------
Got 3 rows (Time spent: 1449/2339 us)
```

## Update CONFIGS
Expand All @@ -116,13 +113,11 @@ UPDATE CONFIGS [graph|meta|storage :] var = value
For example

```ngql
nebula> UPDATE CONFIGS storage:load_data_interval_secs=1
Execution succeeded (Time spent: 1750/2484 us)
nebula> GET CONFIGS storage:load_data_interval_secs
nebula> UPDATE CONFIGS storage:heartbeat_interval_secs=1
nebula> GET CONFIGS storage:heartbeat_interval_secs
===============================================================
| module | name | type | mode | value |
===============================================================
| STORAGE | load_data_interval_secs | INT64 | MUTABLE | 1 |
| STORAGE | heartbeat_interval_secs | INT64 | MUTABLE | 1 |
---------------------------------------------------------------
Got 1 rows (Time spent: 1678/3420 us)
```
4 changes: 2 additions & 2 deletions src/common/time/detail/TscHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/

#include "base/Base.h"

#ifndef COMMON_TIME_DETAIL_TSCHELPER_H_
#define COMMON_TIME_DETAIL_TSCHELPER_H_

#include "base/Base.h"

namespace nebula {
namespace time {

Expand Down

0 comments on commit 64c9632

Please sign in to comment.