提交 1f00a072 编写于 作者: W WeijieSun 提交者: neverchanje

pegasus/*: fix accordingly as rpc_address's c interface is remove in rdsn

上级 0a5cdb98
Subproject commit 282694fa61289f9182e99ec5343af33e36666e6a
Subproject commit ee4300526975c773804ceaa26f3c4db060053477
......@@ -8,7 +8,7 @@
#include <cctype>
#include <cstring>
#include <boost/lexical_cast.hpp>
#include <dsn/cpp/address.h>
#include <dsn/tool-api/rpc_address.h>
namespace pegasus {
namespace utils {
......
......@@ -8,6 +8,7 @@
#include <stdint.h>
#include <dsn/tool-api/auto_codes.h>
#include <dsn/tool-api/group_address.h>
#include <dsn/cpp/serialization_helper/dsn.layer2_types.h>
#include <rrdb/rrdb.code.definition.h>
#include <rrdb/rrdb.types.h>
......@@ -29,8 +30,8 @@ pegasus_client_impl::pegasus_client_impl(const char *cluster_name, const char *a
: _cluster_name(cluster_name), _app_name(app_name)
{
_server_uri = "dsn://" + _cluster_name + "/" + _app_name;
_server_address.assign_uri(dsn_uri_build(_server_uri.c_str()));
_client = new ::dsn::apps::rrdb_client(_server_address);
_server_uri_address.assign_uri(_server_uri.c_str());
_client = new ::dsn::apps::rrdb_client(_server_uri_address);
std::string section = "uri-resolver.dsn://" + _cluster_name;
std::string server_list = dsn_config_get_value_string(section.c_str(), "arguments", "", "");
......@@ -51,17 +52,13 @@ pegasus_client_impl::pegasus_client_impl(const char *cluster_name, const char *a
"no meta server specified in config [%s].arguments",
section.c_str());
_meta_server.assign_group(dsn_group_build("meta-servers"));
_meta_server.assign_group("meta-servers");
for (auto &ms : meta_servers) {
dsn_group_add(_meta_server.group_handle(), ms.c_addr());
_meta_server.group_address()->add(ms);
}
}
pegasus_client_impl::~pegasus_client_impl()
{
delete _client;
dsn_uri_destroy(_server_address.group_handle());
}
pegasus_client_impl::~pegasus_client_impl() { delete _client; }
const char *pegasus_client_impl::get_cluster_name() const { return _cluster_name.c_str(); }
......
......@@ -249,7 +249,7 @@ private:
std::string _cluster_name;
std::string _app_name;
std::string _server_uri;
::dsn::rpc_address _server_address;
::dsn::rpc_address _server_uri_address;
::dsn::rpc_address _meta_server;
::dsn::apps::rrdb_client *_client;
......
......@@ -2,6 +2,7 @@
// This source code is licensed under the Apache License Version 2.0, which
// can be found in the LICENSE file in the root directory of this source tree.
#include <dsn/tool-api/uri_address.h>
#include "proxy_layer.h"
namespace pegasus {
......@@ -10,7 +11,7 @@ namespace proxy {
proxy_stub::proxy_stub(const proxy_session::factory &factory, const char *uri)
: serverlet<proxy_stub>("proxy_stub"), _factory(factory)
{
_uri_address.assign_uri(dsn_uri_build(uri));
_uri_address.assign_uri(uri);
open_service();
}
......
......@@ -3,6 +3,7 @@
// can be found in the LICENSE file in the root directory of this source tree.
#include "info_collector.h"
#include <dsn/tool-api/group_address.h>
#include <pegasus_utils.h>
#include <iostream>
#include <functional>
......@@ -26,9 +27,9 @@ info_collector::info_collector()
std::vector<::dsn::rpc_address> meta_servers;
replica_helper::load_meta_servers(meta_servers);
_meta_servers.assign_group(dsn_group_build("meta-servers"));
_meta_servers.assign_group("meta-servers");
for (auto &ms : meta_servers) {
dsn_group_add(_meta_servers.group_handle(), ms.c_addr());
_meta_servers.group_address()->add(ms);
}
_cluster_name = dsn_config_get_value_string("pegasus.collector", "cluster", "", "cluster name");
......@@ -49,7 +50,6 @@ info_collector::~info_collector()
for (auto kv : _app_stat_counters) {
delete kv.second;
}
dsn_group_destroy(_meta_servers.group_handle());
}
void info_collector::start()
......
......@@ -187,7 +187,7 @@ void pegasus_counter_updater::start()
if (_report_timer != nullptr)
return;
rpc_address addr((dsn_address_t)dsn_primary_address());
rpc_address addr(dsn_primary_address());
char buf[1000];
pegasus::utils::addr2host(addr, buf, 1000);
_local_host = buf;
......
......@@ -6,7 +6,7 @@
#include <pegasus_key_schema.h>
#include <pegasus_value_schema.h>
#include <pegasus_utils.h>
#include <dsn/cpp/smart_pointers.h>
#include <dsn/utility/smart_pointers.h>
#include <dsn/utility/utils.h>
#include <dsn/utility/filesystem.h>
#include <rocksdb/utilities/checkpoint.h>
......
......@@ -9,6 +9,7 @@
#include <memory>
#include <dsn/utility/utils.h>
#include <dsn/tool-api/rpc_address.h>
#include <dsn/c/api_layer1.h>
#include <arpa/inet.h>
......@@ -52,7 +53,7 @@ void global_env::get_dirs()
void global_env::get_hostip()
{
uint32_t ip = dsn_ipv4_local("");
uint32_t ip = dsn::rpc_address::ipv4_from_network_interface("");
uint32_t ipnet = htonl(ip);
char buffer[512];
memset(buffer, 0, sizeof(buffer));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册