Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
core: remove useless memory provider (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
shengofsun authored May 22, 2018
1 parent 9e06d6f commit 15cc231
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 147 deletions.
4 changes: 0 additions & 4 deletions include/dsn/tool-api/global_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ struct service_spec
std::string nfs_factory_name;
std::string perf_counter_factory_name;
std::string logging_factory_name;
std::string memory_factory_name; // for upper applications
std::string tools_memory_factory_name; // for rDSN itself and lower tools

std::list<std::string> network_aspects; // toollets compatible to the above network main
// providers in network configs
Expand Down Expand Up @@ -220,8 +218,6 @@ CONFIG_FLD_STRING(semaphore_factory_name, "", "semaphore provider")
CONFIG_FLD_STRING(nfs_factory_name, "", "nfs provider")
CONFIG_FLD_STRING(perf_counter_factory_name, "", "peformance counter provider")
CONFIG_FLD_STRING(logging_factory_name, "", "logging provider")
CONFIG_FLD_STRING(memory_factory_name, "", "memory management provider")
CONFIG_FLD_STRING(tools_memory_factory_name, "", "memory management provider for tools")

CONFIG_FLD_STRING_LIST(network_aspects, "network aspect providers, usually for tooling purpose")
CONFIG_FLD_STRING_LIST(aio_aspects, "aio aspect providers, usually for tooling purpose")
Expand Down
63 changes: 0 additions & 63 deletions include/dsn/tool-api/memory_provider.h

This file was deleted.

4 changes: 0 additions & 4 deletions include/dsn/tool_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Component providers define the interface for the local components (e.g., network
#include <dsn/tool-api/zlock_provider.h>
#include <dsn/tool-api/message_parser.h>
#include <dsn/tool-api/logging_provider.h>
#include <dsn/tool-api/memory_provider.h>
#include <dsn/tool-api/timer_service.h>

namespace dsn {
Expand Down Expand Up @@ -162,9 +161,6 @@ register_component_provider(const char *name, perf_counter::factory f, ::dsn::pr
DSN_API bool register_component_provider(const char *name,
logging_provider::factory f,
::dsn::provider_type type);
DSN_API bool register_component_provider(const char *name,
memory_provider::factory f,
::dsn::provider_type type);
DSN_API bool
register_component_provider(const char *name, nfs_node::factory f, ::dsn::provider_type type);
DSN_API bool register_component_provider(network_header_format fmt,
Expand Down
39 changes: 0 additions & 39 deletions src/core/core/memory_provider.cpp

This file was deleted.

4 changes: 0 additions & 4 deletions src/core/core/service_api_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ static struct _all_info_
::dsn::tools::tool_app *tool;
::dsn::service_engine *engine;
std::vector<::dsn::task_spec *> task_specs;
::dsn::memory_provider *memory;

bool is_config_completed() const { return magic == 0xdeadbeef && config_completed; }

Expand Down Expand Up @@ -689,7 +688,6 @@ bool run(const char *config_file,
dsn_all.config_completed = false;
dsn_all.tool = nullptr;
dsn_all.engine = &::dsn::service_engine::instance();
dsn_all.memory = nullptr;
dsn_all.magic = 0xdeadbeef;

if (!dsn_config_load(config_file, config_arguments)) {
Expand Down Expand Up @@ -766,8 +764,6 @@ bool run(const char *config_file,
1024, // 1 MB
"thread local transient memory buffer size (KB), default is 1024");
::dsn::tls_trans_mem_init(tls_trans_memory_KB * 1024);
dsn_all.memory = ::dsn::utils::factory_store<::dsn::memory_provider>::create(
spec.tools_memory_factory_name.c_str(), ::dsn::PROVIDER_TYPE_MAIN);

// prepare minimum necessary
::dsn::service_engine::fast_instance().init_before_toollets(spec);
Expand Down
4 changes: 0 additions & 4 deletions src/core/core/service_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "rpc_engine.h"
#include <dsn/tool-api/uri_address.h>
#include <dsn/tool-api/env_provider.h>
#include <dsn/tool-api/memory_provider.h>
#include <dsn/tool-api/nfs.h>
#include <dsn/utility/factory_store.h>
#include <dsn/utility/filesystem.h>
Expand Down Expand Up @@ -399,7 +398,6 @@ service_engine::service_engine(void)
{
_env = nullptr;
_logging = nullptr;
_memory = nullptr;

::dsn::command_manager::instance().register_command({"engine"},
"engine - get engine internal information",
Expand All @@ -419,8 +417,6 @@ void service_engine::init_before_toollets(const service_spec &spec)
// init common providers (first half)
_logging = factory_store<logging_provider>::create(
spec.logging_factory_name.c_str(), ::dsn::PROVIDER_TYPE_MAIN, spec.dir_log.c_str());
_memory = factory_store<memory_provider>::create(spec.memory_factory_name.c_str(),
::dsn::PROVIDER_TYPE_MAIN);

perf_counters::instance().register_factory(
factory_store<perf_counter>::get_factory<perf_counter::factory>(
Expand Down
3 changes: 0 additions & 3 deletions src/core/core/service_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class disk_engine;
class env_provider;
class logging_provider;
class nfs_node;
class memory_provider;
class task_queue;
class task_worker_pool;
class timer_service;
Expand Down Expand Up @@ -146,7 +145,6 @@ class service_engine : public utils::singleton<service_engine>
const service_spec &spec() const { return _spec; }
env_provider *env() const { return _env; }
logging_provider *logging() const { return _logging; }
memory_provider *memory() const { return _memory; }
static std::string get_runtime_info(const std::vector<std::string> &args);
static std::string get_queue_info(const std::vector<std::string> &args);

Expand All @@ -166,7 +164,6 @@ class service_engine : public utils::singleton<service_engine>
service_spec _spec;
env_provider *_env;
logging_provider *_logging;
memory_provider *_memory;

// <port, servicenode>
typedef std::map<int, service_node *>
Expand Down
7 changes: 0 additions & 7 deletions src/core/core/tool_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,6 @@ bool register_component_provider(const char *name,
return dsn::utils::factory_store<logging_provider>::register_factory(name, f, type);
}

bool register_component_provider(const char *name,
memory_provider::factory f,
::dsn::provider_type type)
{
return dsn::utils::factory_store<memory_provider>::register_factory(name, f, type);
}

bool register_component_provider(network_header_format fmt,
const std::vector<const char *> &signatures,
message_parser::factory f,
Expand Down
6 changes: 0 additions & 6 deletions src/core/tools/common/nativerun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ void nativerun::install(service_spec &spec)
if (spec.logging_factory_name == "")
spec.logging_factory_name = "dsn::tools::simple_logger";

if (spec.memory_factory_name == "")
spec.memory_factory_name = "dsn::default_memory_provider";

if (spec.tools_memory_factory_name == "")
spec.tools_memory_factory_name = "dsn::default_memory_provider";

if (spec.lock_factory_name == "")
spec.lock_factory_name = ("dsn::tools::std_lock_provider");

Expand Down
1 change: 0 additions & 1 deletion src/core/tools/common/providers.common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ namespace tools {
void register_common_providers()
{
register_component_provider<env_provider>("dsn::env_provider");
register_component_provider<memory_provider>("dsn::default_memory_provider");
register_component_provider<task_worker>("dsn::task_worker");
register_component_provider<screen_logger>("dsn::tools::screen_logger");
register_component_provider<simple_logger>("dsn::tools::simple_logger");
Expand Down
6 changes: 0 additions & 6 deletions src/core/tools/hpc/fastrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ void fastrun::install(service_spec &spec)
if (spec.logging_factory_name == "")
spec.logging_factory_name = "dsn::tools::hpc_logger";

if (spec.memory_factory_name == "")
spec.memory_factory_name = "dsn::default_memory_provider";

if (spec.tools_memory_factory_name == "")
spec.tools_memory_factory_name = "dsn::default_memory_provider";

if (spec.lock_factory_name == "")
spec.lock_factory_name = ("dsn::tools::std_lock_provider");

Expand Down
6 changes: 0 additions & 6 deletions src/core/tools/simulator/simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ void simulator::install(service_spec &spec)
if (spec.logging_factory_name == "")
spec.logging_factory_name = "dsn::tools::simple_logger";

if (spec.memory_factory_name == "")
spec.memory_factory_name = "dsn::default_memory_provider";

if (spec.tools_memory_factory_name == "")
spec.tools_memory_factory_name = "dsn::default_memory_provider";

if (spec.lock_factory_name == "")
spec.lock_factory_name = ("dsn::tools::sim_lock_provider");

Expand Down

0 comments on commit 15cc231

Please sign in to comment.