Skip to content

Commit

Permalink
Merge branch 'apache:master' into fix_slog_gc_crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ninsmiracle authored Feb 7, 2024
2 parents 775ced8 + 858433d commit 52395b5
Show file tree
Hide file tree
Showing 37 changed files with 459 additions and 518 deletions.
3 changes: 0 additions & 3 deletions scripts/pack_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,8 @@ pack_tools_lib() {
pack_system_lib "${pack}/lib" shell "$1"
}

pack_tools_lib snappy
pack_tools_lib crypto
pack_tools_lib ssl
pack_tools_lib zstd
pack_tools_lib lz4

chmod -x ${pack}/lib/*

Expand Down
153 changes: 0 additions & 153 deletions src/base/pegasus_const.cpp

This file was deleted.

97 changes: 0 additions & 97 deletions src/base/pegasus_const.h

This file was deleted.

7 changes: 3 additions & 4 deletions src/client_lib/pegasus_client_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#include <type_traits>
#include <utility>

#include "base/pegasus_const.h"
#include "absl/strings/string_view.h"
#include "common/common.h"
#include "common/replication_other_types.h"
#include "common/serialization_helper/dsn.layer2_types.h"
#include "pegasus/client.h"
Expand All @@ -40,10 +41,8 @@
#include "runtime/task/task_code.h"
#include "utils/error_code.h"
#include "utils/fmt_logging.h"
#include "absl/strings/string_view.h"
#include "utils/synchronize.h"
#include "utils/threadpool_code.h"
#include "utils/utils.h"

namespace dsn {
class message_ex;
Expand All @@ -65,7 +64,7 @@ pegasus_client_impl::pegasus_client_impl(const char *cluster_name, const char *a
{
std::vector<dsn::rpc_address> meta_servers;
dsn::replication::replica_helper::load_meta_servers(
meta_servers, PEGASUS_CLUSTER_SECTION_NAME.c_str(), cluster_name);
meta_servers, dsn::PEGASUS_CLUSTER_SECTION_NAME.c_str(), cluster_name);
CHECK_GT(meta_servers.size(), 0);
_meta_server.assign_group("meta-servers");
_meta_server.group_address()->add_list(meta_servers);
Expand Down
8 changes: 7 additions & 1 deletion src/client_lib/pegasus_scanner_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <utility>
#include <vector>

#include "base/pegasus_const.h"
#include "common/gpid.h"
#include "pegasus/client.h"
#include "pegasus/error.h"
Expand All @@ -52,6 +51,13 @@ using namespace pegasus;
namespace pegasus {
namespace client {

// TODO(yingchun): There are duplicate variables in src/server/pegasus_scan_context.h,
// because this is in client library, it's better to avoid including too many headers.
// We can move it to thrift which would be included by both server and client.
static const int SCAN_CONTEXT_ID_VALID_MIN = 0;
static const int SCAN_CONTEXT_ID_COMPLETED = -1;
static const int SCAN_CONTEXT_ID_NOT_EXIST = -2;

pegasus_client_impl::pegasus_scanner_impl::pegasus_scanner_impl(::dsn::apps::rrdb_client *client,
std::vector<uint64_t> &&hash,
const scan_options &options,
Expand Down
2 changes: 2 additions & 0 deletions src/common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ DSN_DEFINE_string(replication, cluster_name, "", "name of this cluster");
CHECK(!utils::is_empty(FLAGS_cluster_name), "cluster_name is not set");
return FLAGS_cluster_name;
}

const std::string PEGASUS_CLUSTER_SECTION_NAME("pegasus.clusters");
} // namespace dsn
4 changes: 4 additions & 0 deletions src/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@

#pragma once

#include <string>

namespace dsn {
/// Returns the cluster name (i.e, "onebox") if it's configured under
/// "replication" section:
/// [replication]
/// cluster_name = "onebox"
extern const char *get_current_cluster_name();

extern const std::string PEGASUS_CLUSTER_SECTION_NAME;
} // namespace dsn
Loading

0 comments on commit 52395b5

Please sign in to comment.