Skip to content

Commit

Permalink
Merge branch 'master' into fix-3029-0
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisChu authored Oct 15, 2021
2 parents 0b93e1b + fb3be74 commit e695a57
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Auto
Standard: c++17
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
Expand Down
24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE/bugfix.md

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ jobs:
-DENABLE_COVERAGE=on \
-B build
echo "::set-output name=j::10"
echo "::set-output name=t::10"
echo "::set-output name=t::6"
- name: Make
run: |
ccache -z
cmake --build build/ -j $(nproc) --target nebula-metad nebula-storaged nebula-graphd
cmake --build build/ -j ${{ steps.cmake.outputs.t }}
ccache -s
- name: CTest
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
-DENABLE_COVERAGE=on \
-B build
echo "::set-output name=j::10"
echo "::set-output name=t::10"
echo "::set-output name=t::6"
;;
esac
;;
Expand All @@ -117,6 +117,7 @@ jobs:
- name: Make
run: |
ccache -z
cmake --build build/ -j $(nproc) --target nebula-metad nebula-storaged nebula-graphd
cmake --build build/ -j ${{ steps.cmake.outputs.t }}
ccache -s
- name: CTest
Expand Down
9 changes: 5 additions & 4 deletions cmake/CPackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ macro(package to_one name home_page scripts_dir)
set(HOST_SYSTEM_VER "Unknown")
endif()

message(STATUS "HOST_SYSTEM_NAME is ${HOST_SYSTEM_NAME}")
message(STATUS "HOST_SYSTEM_VER is ${HOST_SYSTEM_VER}")
message(STATUS "CPACK_GENERATOR is ${CPACK_GENERATOR}")
message(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR is ${CMAKE_HOST_SYSTEM_PROCESSOR}")
print_config(NEBULA_BUILD_VERSION)
print_config(HOST_SYSTEM_NAME)
print_config(HOST_SYSTEM_VER)
print_config(CPACK_GENERATOR)
print_config(CMAKE_HOST_SYSTEM_PROCESSOR)

set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${HOST_SYSTEM_VER}.${CMAKE_HOST_SYSTEM_PROCESSOR})
if (${to_one})
Expand Down
4 changes: 1 addition & 3 deletions src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2335,9 +2335,7 @@ folly::Future<StatusOr<bool>> MetaClient::heartbeat() {
req.set_host(options_.localHost_);
req.set_role(options_.role_);
req.set_git_info_sha(options_.gitInfoSHA_);
#if defined(NEBULA_BUILD_VERSION)
req.set_version(versionString(false));
#endif
req.set_version(getOriginVersion());
if (options_.role_ == cpp2::HostRole::STORAGE) {
if (options_.clusterId_.load() == 0) {
options_.clusterId_ = FileBasedClusterIdMan::getClusterIdFromFile(FLAGS_cluster_id_path);
Expand Down
10 changes: 5 additions & 5 deletions src/common/base/EitherOr.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class EitherOr {
template <typename U,
typename V,
typename = std::enable_if_t<std::is_constructible<LEFT, U>::value &&
std::is_constructible<RIGHT, V>::value> >
std::is_constructible<RIGHT, V>::value>>
EitherOr(const EitherOr<U, V>& rhs) noexcept {
switch (rhs.state_) {
case State::VOID:
Expand All @@ -178,7 +178,7 @@ class EitherOr {
template <typename U,
typename V,
typename = std::enable_if_t<std::is_constructible<LEFT, U>::value &&
std::is_constructible<RIGHT, V>::value> >
std::is_constructible<RIGHT, V>::value>>
EitherOr(EitherOr<U, V>&& rhs) noexcept {
switch (rhs.state_) {
case State::VOID:
Expand Down Expand Up @@ -218,7 +218,7 @@ class EitherOr {
// LEFT or RIGHT, not both
template <class... Args,
typename = std::enable_if_t<std::is_constructible<LEFT, Args...>::value ||
std::is_constructible<RIGHT, Args...>::value> >
std::is_constructible<RIGHT, Args...>::value>>
EitherOr(Args&&... v) noexcept { // NOLINT
new (&val_) Variant(convert_to_t<Args...>, std::forward<Args>(v)...);
state_ = convert_to_s<Args...>;
Expand All @@ -228,7 +228,7 @@ class EitherOr {
// So we use a type tag to force selecting LEFT
template <typename U,
typename = std::enable_if_t<std::is_constructible<LEFT, U>::value &&
std::is_constructible<RIGHT, U>::value> >
std::is_constructible<RIGHT, U>::value>>
EitherOr(const LeftType*, U&& v) noexcept {
new (&val_) Variant(kConstructLeft, std::forward<U>(v));
state_ = State::LEFT_TYPE;
Expand All @@ -238,7 +238,7 @@ class EitherOr {
// So we use a type tag to force selecting RIGHT
template <typename U,
typename = std::enable_if_t<std::is_constructible<LEFT, U>::value &&
std::is_constructible<RIGHT, U>::value> >
std::is_constructible<RIGHT, U>::value>>
EitherOr(const RightType*, U&& v) noexcept {
new (&val_) Variant(kConstructRight, std::forward<U>(v));
state_ = State::RIGHT_TYPE;
Expand Down
2 changes: 1 addition & 1 deletion src/common/base/ErrorOr.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace nebula {
template <typename ErrorCode,
typename ResultType,
typename = std::enable_if_t<std::is_integral<ErrorCode>::value ||
std::is_enum<ErrorCode>::value> >
std::is_enum<ErrorCode>::value>>
using ErrorOr = EitherOr<ErrorCode, ResultType>;

/***********************************************
Expand Down
24 changes: 12 additions & 12 deletions src/common/datatypes/DataSetOps-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ uint32_t Cpp2Ops<nebula::DataSet>::write(Protocol* proto, nebula::DataSet const*

xfer += proto->writeFieldBegin("column_names", protocol::T_LIST, 1);
xfer += detail::pm::protocol_methods<type_class::list<type_class::binary>,
std::vector<std::string> >::write(*proto, obj->colNames);
std::vector<std::string>>::write(*proto, obj->colNames);
xfer += proto->writeFieldEnd();

xfer += proto->writeFieldBegin("rows", apache::thrift::protocol::T_LIST, 2);
xfer += detail::pm::protocol_methods<type_class::list<type_class::structure>,
std::vector<nebula::Row> >::write(*proto, obj->rows);
std::vector<nebula::Row>>::write(*proto, obj->rows);
xfer += proto->writeFieldEnd();

xfer += proto->writeFieldStop();
Expand All @@ -81,7 +81,7 @@ void Cpp2Ops<nebula::DataSet>::read(Protocol* proto, nebula::DataSet* obj) {
_readField_column_names : {
obj->colNames = std::vector<std::string>();
detail::pm::protocol_methods<type_class::list<type_class::binary>,
std::vector<std::string> >::read(*proto, obj->colNames);
std::vector<std::string>>::read(*proto, obj->colNames);
}

if (UNLIKELY(!readState.advanceToNextField(proto, 1, 2, protocol::T_LIST))) {
Expand All @@ -91,7 +91,7 @@ _readField_column_names : {
_readField_rows : {
obj->rows = std::vector<nebula::Row>();
detail::pm::protocol_methods<type_class::list<type_class::structure>,
std::vector<nebula::Row> >::read(*proto, obj->rows);
std::vector<nebula::Row>>::read(*proto, obj->rows);
}

if (UNLIKELY(!readState.advanceToNextField(proto, 2, 0, protocol::T_STOP))) {
Expand Down Expand Up @@ -147,13 +147,13 @@ uint32_t Cpp2Ops<nebula::DataSet>::serializedSize(Protocol const* proto,
xfer += proto->serializedFieldSize("column_names", protocol::T_LIST, 1);
xfer +=
detail::pm::protocol_methods<type_class::list<type_class::binary>,
std::vector<std::string> >::serializedSize<false>(*proto,
obj->colNames);
std::vector<std::string>>::serializedSize<false>(*proto,
obj->colNames);

xfer += proto->serializedFieldSize("rows", apache::thrift::protocol::T_LIST, 2);
xfer += detail::pm::protocol_methods<type_class::list<type_class::structure>,
std::vector<nebula::Row> >::serializedSize<false>(*proto,
obj->rows);
std::vector<nebula::Row>>::serializedSize<false>(*proto,
obj->rows);

xfer += proto->serializedSizeStop();
return xfer;
Expand All @@ -168,13 +168,13 @@ uint32_t Cpp2Ops<nebula::DataSet>::serializedSizeZC(Protocol const* proto,
xfer += proto->serializedFieldSize("column_names", protocol::T_LIST, 1);
xfer +=
detail::pm::protocol_methods<type_class::list<type_class::binary>,
std::vector<std::string> >::serializedSize<false>(*proto,
obj->colNames);
std::vector<std::string>>::serializedSize<false>(*proto,
obj->colNames);

xfer += proto->serializedFieldSize("rows", protocol::T_LIST, 2);
xfer += detail::pm::protocol_methods<type_class::list<type_class::structure>,
std::vector<nebula::Row> >::serializedSize<false>(*proto,
obj->rows);
std::vector<nebula::Row>>::serializedSize<false>(*proto,
obj->rows);

xfer += proto->serializedSizeStop();
return xfer;
Expand Down
10 changes: 5 additions & 5 deletions src/common/datatypes/EdgeOps-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ uint32_t Cpp2Ops<nebula::Edge>::write(Protocol* proto, nebula::Edge const* obj)
xfer += proto->writeFieldBegin("props", apache::thrift::protocol::T_MAP, 6);
xfer += detail::pm::protocol_methods<
type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value> >::write(*proto, obj->props);
std::unordered_map<std::string, nebula::Value>>::write(*proto, obj->props);
xfer += proto->writeFieldEnd();

xfer += proto->writeFieldStop();
Expand Down Expand Up @@ -145,8 +145,8 @@ _readField_ranking : {
_readField_props : {
obj->props = std::unordered_map<std::string, nebula::Value>();
detail::pm::protocol_methods<type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value> >::read(*proto,
obj->props);
std::unordered_map<std::string, nebula::Value>>::read(*proto,
obj->props);
}

if (UNLIKELY(!readState.advanceToNextField(proto, 6, 0, protocol::T_STOP))) {
Expand Down Expand Up @@ -248,7 +248,7 @@ uint32_t Cpp2Ops<nebula::Edge>::serializedSize(Protocol const* proto, nebula::Ed
xfer += proto->serializedFieldSize("props", apache::thrift::protocol::T_MAP, 6);
xfer += detail::pm::protocol_methods<
type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value> >::serializedSize<false>(*proto, obj->props);
std::unordered_map<std::string, nebula::Value>>::serializedSize<false>(*proto, obj->props);

xfer += proto->serializedSizeStop();
return xfer;
Expand Down Expand Up @@ -281,7 +281,7 @@ uint32_t Cpp2Ops<nebula::Edge>::serializedSizeZC(Protocol const* proto, nebula::
xfer += proto->serializedFieldSize("props", apache::thrift::protocol::T_MAP, 6);
xfer += detail::pm::protocol_methods<
type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value> >::serializedSize<false>(*proto, obj->props);
std::unordered_map<std::string, nebula::Value>>::serializedSize<false>(*proto, obj->props);

xfer += proto->serializedSizeStop();
return xfer;
Expand Down
12 changes: 6 additions & 6 deletions src/common/datatypes/ListOps-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ uint32_t Cpp2Ops<nebula::List>::write(Protocol* proto, nebula::List const* obj)

xfer += proto->writeFieldBegin("values", apache::thrift::protocol::T_LIST, 1);
xfer += detail::pm::protocol_methods<type_class::list<type_class::structure>,
std::vector<nebula::Value> >::write(*proto, obj->values);
std::vector<nebula::Value>>::write(*proto, obj->values);
xfer += proto->writeFieldEnd();

xfer += proto->writeFieldStop();
Expand All @@ -68,7 +68,7 @@ void Cpp2Ops<nebula::List>::read(Protocol* proto, nebula::List* obj) {
_readField_values : {
obj->values = std::vector<nebula::Value>();
detail::pm::protocol_methods<type_class::list<type_class::structure>,
std::vector<nebula::Value> >::read(*proto, obj->values);
std::vector<nebula::Value>>::read(*proto, obj->values);
}

if (UNLIKELY(!readState.advanceToNextField(proto, 1, 0, protocol::T_STOP))) {
Expand Down Expand Up @@ -116,8 +116,8 @@ uint32_t Cpp2Ops<nebula::List>::serializedSize(Protocol const* proto, nebula::Li
xfer += proto->serializedFieldSize("values", apache::thrift::protocol::T_LIST, 1);
xfer +=
detail::pm::protocol_methods<type_class::list<type_class::structure>,
std::vector<nebula::Value> >::serializedSize<false>(*proto,
obj->values);
std::vector<nebula::Value>>::serializedSize<false>(*proto,
obj->values);
xfer += proto->serializedSizeStop();
return xfer;
}
Expand All @@ -130,8 +130,8 @@ uint32_t Cpp2Ops<nebula::List>::serializedSizeZC(Protocol const* proto, nebula::
xfer += proto->serializedFieldSize("values", apache::thrift::protocol::T_LIST, 1);
xfer +=
detail::pm::protocol_methods<type_class::list<type_class::structure>,
std::vector<nebula::Value> >::serializedSize<false>(*proto,
obj->values);
std::vector<nebula::Value>>::serializedSize<false>(*proto,
obj->values);
xfer += proto->serializedSizeStop();
return xfer;
}
Expand Down
15 changes: 8 additions & 7 deletions src/common/datatypes/MapOps-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ uint32_t Cpp2Ops<nebula::Map>::write(Protocol* proto, nebula::Map const* obj) {
xfer += proto->writeStructBegin("NMap");

xfer += proto->writeFieldBegin("kvs", apache::thrift::protocol::T_MAP, 1);
xfer += detail::pm::protocol_methods<
type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value> >::write(*proto, obj->kvs);
xfer +=
detail::pm::protocol_methods<type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value>>::write(*proto,
obj->kvs);
xfer += proto->writeFieldEnd();

xfer += proto->writeFieldStop();
Expand All @@ -69,8 +70,8 @@ void Cpp2Ops<nebula::Map>::read(Protocol* proto, nebula::Map* obj) {
_readField_kvs : {
obj->kvs = std::unordered_map<std::string, nebula::Value>();
detail::pm::protocol_methods<type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value> >::read(*proto,
obj->kvs);
std::unordered_map<std::string, nebula::Value>>::read(*proto,
obj->kvs);
}

if (UNLIKELY(!readState.advanceToNextField(proto, 1, 0, protocol::T_STOP))) {
Expand Down Expand Up @@ -118,7 +119,7 @@ uint32_t Cpp2Ops<nebula::Map>::serializedSize(Protocol const* proto, nebula::Map
xfer += proto->serializedFieldSize("kvs", apache::thrift::protocol::T_MAP, 1);
xfer += detail::pm::protocol_methods<
type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value> >::serializedSize<false>(*proto, obj->kvs);
std::unordered_map<std::string, nebula::Value>>::serializedSize<false>(*proto, obj->kvs);
xfer += proto->serializedSizeStop();
return xfer;
}
Expand All @@ -131,7 +132,7 @@ uint32_t Cpp2Ops<nebula::Map>::serializedSizeZC(Protocol const* proto, nebula::M
xfer += proto->serializedFieldSize("kvs", apache::thrift::protocol::T_MAP, 1);
xfer += detail::pm::protocol_methods<
type_class::map<type_class::binary, type_class::structure>,
std::unordered_map<std::string, nebula::Value> >::serializedSize<false>(*proto, obj->kvs);
std::unordered_map<std::string, nebula::Value>>::serializedSize<false>(*proto, obj->kvs);
xfer += proto->serializedSizeStop();
return xfer;
}
Expand Down
Loading

0 comments on commit e695a57

Please sign in to comment.