You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pegasus.apache.org by la...@apache.org on 2022/11/17 13:35:13 UTC

[incubator-pegasus] branch master updated: refactor: remove api_common.h and dlib.h header files (#1235)

This is an automated email from the ASF dual-hosted git repository.

laiyingchun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new 14995745b refactor: remove api_common.h and dlib.h header files (#1235)
14995745b is described below

commit 14995745bf4ff6407cc4e899ac43c50ef8b9b8a6
Author: Yingchun Lai <la...@apache.org>
AuthorDate: Thu Nov 17 21:35:07 2022 +0800

    refactor: remove api_common.h and dlib.h header files (#1235)
---
 src/aio/aio_provider.h                             |  6 +-
 src/aio/test/main.cpp                              |  1 -
 src/base/pegasus_value_schema.h                    |  1 -
 src/base/test/main.cpp                             |  1 -
 src/block_service/block_service.h                  |  1 -
 src/block_service/test/main.cpp                    |  1 -
 src/client/partition_resolver_simple.h             |  1 -
 src/client/replication_ddl_client.h                |  1 -
 src/common/api_common.h                            | 90 ----------------------
 src/common/fs_manager.h                            |  1 -
 src/common/replication_common.h                    |  1 -
 src/common/storage_serverlet.h                     |  1 -
 src/common/test/main.cpp                           |  1 -
 src/failure_detector/fd.code.definition.h          |  1 -
 src/failure_detector/test/failure_detector.cpp     |  1 -
 src/failure_detector/test/main.cpp                 |  1 -
 src/geo/lib/geo_client.cpp                         |  1 -
 src/geo/lib/latlng_codec.cpp                       |  1 -
 src/geo/test/main.cpp                              |  1 -
 src/meta/dump_file.h                               |  2 -
 src/meta/meta_data.cpp                             |  1 -
 src/meta/meta_options.h                            |  1 -
 src/meta/meta_service_app.cpp                      |  1 -
 src/meta/meta_state_service.h                      |  1 -
 src/meta/meta_state_service_utils.cpp              |  1 -
 src/meta/server_load_balancer.h                    |  1 -
 src/meta/test/backup_test.cpp                      |  1 -
 src/meta/test/balancer_validator.cpp               |  1 -
 src/meta/test/json_compacity.cpp                   |  6 --
 src/meta/test/main.cpp                             |  1 -
 src/meta/test/meta_app_operation_test.cpp          |  1 -
 src/meta/test/meta_partition_guardian_test.cpp     | 20 -----
 src/meta/test/meta_service_test_app.h              |  1 -
 src/meta/test/meta_split_service_test.cpp          |  1 -
 src/meta/test/meta_state/main.cpp                  |  1 -
 src/meta/test/meta_state_service_utils_test.cpp    |  1 -
 src/meta/test/misc/misc.h                          |  6 --
 src/meta/test/server_state_test.cpp                |  1 -
 src/meta/test/state_sync_test.cpp                  |  1 -
 src/meta/test/update_configuration_test.cpp        |  6 --
 src/nfs/test/main.cpp                              |  1 -
 src/perf_counter/perf_counter.h                    |  1 -
 src/perf_counter/perf_counters.h                   |  1 -
 src/perf_counter/test/main.cpp                     |  1 -
 src/redis_protocol/proxy_lib/proxy_layer.h         |  1 -
 src/replica/backup/test/main.cpp                   |  1 -
 src/replica/bulk_load/test/main.cpp                |  1 -
 src/replica/duplication/replica_duplicator.h       |  1 -
 src/replica/duplication/test/main.cpp              |  1 -
 src/replica/replication_app_base.cpp               |  1 -
 src/replica/split/test/main.cpp                    |  1 -
 src/replica/storage/simple_kv/test/common.h        |  1 -
 src/replica/storage/simple_kv/test/injector.cpp    |  1 -
 src/runtime/api_layer1.h                           | 29 ++++---
 src/runtime/api_task.h                             |  4 +-
 src/runtime/app_model.h                            | 10 +--
 src/runtime/env_provider.h                         |  1 -
 src/runtime/fault_injector.cpp                     |  1 -
 src/runtime/global_config.h                        | 25 +++---
 src/runtime/profiler.cpp                           |  1 -
 src/runtime/rpc/dsn_message_parser.cpp             |  1 -
 src/runtime/rpc/message_parser.cpp                 |  1 -
 src/runtime/rpc/message_parser.h                   |  7 +-
 src/runtime/rpc/network.h                          | 34 ++++----
 src/runtime/rpc/network.sim.cpp                    |  1 -
 src/runtime/rpc/raw_message_parser.cpp             |  1 -
 src/runtime/rpc/rpc_holder.h                       |  3 -
 src/runtime/rpc/rpc_message.h                      | 62 +++++++--------
 src/runtime/rpc/rpc_stream.h                       |  1 -
 src/runtime/rpc/thrift_message_parser.cpp          |  1 -
 src/runtime/scheduler.cpp                          |  1 -
 src/runtime/service_api_c.cpp                      | 41 ++++------
 src/runtime/service_app.h                          |  1 -
 src/runtime/task/async_calls.h                     |  1 -
 src/runtime/task/task.cpp                          |  1 -
 src/runtime/task/task_queue.h                      |  5 +-
 src/runtime/task/task_spec.cpp                     |  1 +
 src/runtime/task/task_spec.h                       | 37 +++++----
 src/runtime/task/task_worker.h                     | 24 +++---
 src/runtime/test/async_call.cpp                    |  1 -
 src/runtime/test/corrupt_message.cpp               |  1 -
 src/runtime/test/lpc.cpp                           |  1 -
 src/runtime/test/meta_access_controller_test.cpp   |  1 -
 src/runtime/test/netprovider.cpp                   |  1 -
 src/runtime/test/pipeline_test.cpp                 |  1 -
 .../test/replica_access_controller_test.cpp        |  1 -
 src/runtime/test/rpc.cpp                           |  1 -
 src/runtime/test/service_api_c.cpp                 |  1 -
 src/runtime/test/sim_lock.cpp                      |  1 -
 src/runtime/test/test_utils.h                      |  1 -
 src/runtime/tool_api.h                             | 61 ++++++++-------
 src/server/info_collector.h                        |  1 -
 src/server/info_collector_app.cpp                  |  1 -
 src/server/test/main.cpp                           |  1 -
 .../test_backup_and_restore.cpp                    |  1 -
 .../function_test/base_api_test/test_basic.cpp     |  1 -
 .../function_test/base_api_test/test_batch_get.cpp |  1 -
 .../base_api_test/test_check_and_mutate.cpp        |  1 -
 .../base_api_test/test_check_and_set.cpp           |  1 -
 src/test/function_test/base_api_test/test_copy.cpp |  1 -
 src/test/function_test/base_api_test/test_incr.cpp |  1 -
 .../base_api_test/test_range_read.cpp              |  1 -
 .../function_test/base_api_test/test_recall.cpp    |  1 -
 src/test/function_test/base_api_test/test_scan.cpp |  1 -
 .../bulk_load_test/test_bulk_load.cpp              |  1 -
 .../detect_hotspot_test/test_detect_hotspot.cpp    |  1 -
 .../function_test/recovery_test/test_recovery.cpp  |  1 -
 .../function_test/throttle_test/test_throttle.cpp  |  1 -
 src/test/kill_test/data_verifier.cpp               |  1 -
 src/test/kill_test/kill_testor.cpp                 |  1 -
 src/utils/api_utilities.h                          | 45 +++++------
 src/utils/clock.cpp                                |  3 +-
 src/utils/distributed_lock_service.h               |  1 -
 src/utils/dlib.h                                   | 52 -------------
 src/utils/latency_tracer.cpp                       |  1 -
 src/utils/logging.cpp                              | 40 +++++-----
 src/utils/logging_provider.h                       |  6 +-
 src/utils/sys_exit_hook.h                          |  2 +-
 src/utils/test/file_utils.cpp                      |  1 -
 src/utils/utils.cpp                                |  1 -
 src/zookeeper/test/distributed_lock_zookeeper.cpp  |  1 -
 src/zookeeper/test/main.cpp                        |  1 -
 src/zookeeper/zookeeper_session_mgr.h              |  1 -
 123 files changed, 213 insertions(+), 510 deletions(-)

diff --git a/src/aio/aio_provider.h b/src/aio/aio_provider.h
index 261560d3f..1c754c873 100644
--- a/src/aio/aio_provider.h
+++ b/src/aio/aio_provider.h
@@ -27,7 +27,6 @@
 #pragma once
 
 #include "aio/aio_task.h"
-#include "utils/dlib.h"
 #include "utils/factory_store.h"
 
 namespace dsn {
@@ -82,8 +81,9 @@ private:
 
 namespace tools {
 namespace internal_use_only {
-DSN_API bool
-register_component_provider(const char *name, aio_provider::factory f, dsn::provider_type type);
+bool register_component_provider(const char *name,
+                                 aio_provider::factory f,
+                                 dsn::provider_type type);
 } // namespace internal_use_only
 } // namespace tools
 
diff --git a/src/aio/test/main.cpp b/src/aio/test/main.cpp
index a20513893..9d7ebae30 100644
--- a/src/aio/test/main.cpp
+++ b/src/aio/test/main.cpp
@@ -16,7 +16,6 @@
 // under the License.
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/base/pegasus_value_schema.h b/src/base/pegasus_value_schema.h
index 6e48cb494..c014509df 100644
--- a/src/base/pegasus_value_schema.h
+++ b/src/base/pegasus_value_schema.h
@@ -26,7 +26,6 @@
 
 #include <rocksdb/slice.h>
 
-#include "common/api_common.h"
 #include "utils/api_utilities.h"
 #include "utils/blob.h"
 #include "utils/endians.h"
diff --git a/src/base/test/main.cpp b/src/base/test/main.cpp
index f16f05977..f931fe51e 100644
--- a/src/base/test/main.cpp
+++ b/src/base/test/main.cpp
@@ -19,7 +19,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/block_service/block_service.h b/src/block_service/block_service.h
index cda20f575..ed935fc39 100644
--- a/src/block_service/block_service.h
+++ b/src/block_service/block_service.h
@@ -21,7 +21,6 @@
 
 #include "runtime/task/task_code.h"
 #include "runtime/task/task_tracker.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/block_service/test/main.cpp b/src/block_service/test/main.cpp
index ca99692d0..16a31f3bb 100644
--- a/src/block_service/test/main.cpp
+++ b/src/block_service/test/main.cpp
@@ -17,7 +17,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/client/partition_resolver_simple.h b/src/client/partition_resolver_simple.h
index 72e718dbd..1fb966174 100644
--- a/src/client/partition_resolver_simple.h
+++ b/src/client/partition_resolver_simple.h
@@ -28,7 +28,6 @@
 
 #include "runtime/task/task_tracker.h"
 #include "utils/zlocks.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/client/replication_ddl_client.h b/src/client/replication_ddl_client.h
index ab107dc8d..843fcf2e5 100644
--- a/src/client/replication_ddl_client.h
+++ b/src/client/replication_ddl_client.h
@@ -26,7 +26,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/common/api_common.h b/src/common/api_common.h
deleted file mode 100644
index 1a1105fa7..000000000
--- a/src/common/api_common.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 Microsoft Corporation
- *
- * -=- Robust Distributed System Nucleus (rDSN) -=-
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-/*
- * Description:
- *     this file define the C Service API in rDSN
- *
- * ------------------------------------------------------------------------------
- *
- *  The service system call API for Zion
- * -------------------------------------------
- *  Summary:
- *  (1) rich API for common distributed system development
- *      - thread pools and tasking
- *      - thread synchronization
- *      - remote procedure calls
- *      - asynchnous file operations
- *      - envrionment inputs
- *      - rDSN app model, system and other utilities
- *  (2) portable
- *      - compilable on many platforms (currently linux, windows, FreeBSD, MacOS)
- *      - system calls are in C so that later language wrappers are possibles.
- *  (3) high performance
- *      - all low level components can be plugged with the tool API (in C++)
- *        besides the existing high performance providers;
- *      - developers can also configure thread pools, thread numbers, thread/task
- *        priorities, CPU core affinities, throttling policies etc. declaratively
- *        to build a best threading model for upper apps.
- *  (4) ease of intergration
- *      - support many languages through language wrappers based on this c interface
- *      - easy support for existing protocols (thrift/protobuf etc.)
- *      - integrate with existing platform infra with low level providers (plug-in),
- *        such as loggers, performance counters, etc.
- *  (5) rich debug, development tools and runtime policies support
- *      - tool API with task granularity semantic for further tool and runtime policy development.
- *      - rich existing tools, tracer, profiler, simulator, model checker, replayer, global checker
- *  (7) PRINCIPLE: all non-determinims must be go through these system calls so that powerful
- *      internal tools are possible - replay, model checking, replication, ...,
- *      AND, it is still OK to call other DETERMINISTIC APIs for applications.
- */
-
-// common data structures and macros
-
-#pragma once
-
-#include <stdint.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include "utils/dlib.h"
-
-#ifdef __cplusplus
-#define DEFAULT(value) = value
-#define NORETURN [[noreturn]]
-#else
-#define DEFAULT(value)
-#define NORETURN
-#include <stdbool.h>
-#endif
-
-#define DSN_MAX_TASK_CODE_NAME_LENGTH 48
-#define DSN_MAX_ERROR_CODE_NAME_LENGTH 48
-#define DSN_MAX_ADDRESS_NAME_LENGTH 48
-#define DSN_MAX_BUFFER_COUNT_IN_MESSAGE 64
-#define DSN_MAX_APP_TYPE_NAME_LENGTH 32
-#define DSN_MAX_CALLBAC_COUNT 32
-#define DSN_MAX_APP_COUNT_IN_SAME_PROCESS 256
-#define DSN_MAX_PATH 1024
diff --git a/src/common/fs_manager.h b/src/common/fs_manager.h
index b6f4dd636..572912aca 100644
--- a/src/common/fs_manager.h
+++ b/src/common/fs_manager.h
@@ -20,7 +20,6 @@
 #include <memory>
 
 #include "perf_counter/perf_counter_wrapper.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/common/replication_common.h b/src/common/replication_common.h
index f35763b79..cc6353731 100644
--- a/src/common/replication_common.h
+++ b/src/common/replication_common.h
@@ -26,7 +26,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/common/storage_serverlet.h b/src/common/storage_serverlet.h
index bd396eeb6..90947857b 100644
--- a/src/common/storage_serverlet.h
+++ b/src/common/storage_serverlet.h
@@ -30,7 +30,6 @@
 #include <unordered_map>
 #include <functional>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/common/test/main.cpp b/src/common/test/main.cpp
index 02fb61c11..be96d4c28 100644
--- a/src/common/test/main.cpp
+++ b/src/common/test/main.cpp
@@ -26,7 +26,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/failure_detector/fd.code.definition.h b/src/failure_detector/fd.code.definition.h
index eab6da990..bbe2bb7dd 100644
--- a/src/failure_detector/fd.code.definition.h
+++ b/src/failure_detector/fd.code.definition.h
@@ -27,7 +27,6 @@
 #pragma once
 
 #include "runtime/task/task_code.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/failure_detector/test/failure_detector.cpp b/src/failure_detector/test/failure_detector.cpp
index 42a7011b8..505fd2027 100644
--- a/src/failure_detector/test/failure_detector.cpp
+++ b/src/failure_detector/test/failure_detector.cpp
@@ -29,7 +29,6 @@
 #include "replica/replica_stub.h"
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/failure_detector/test/main.cpp b/src/failure_detector/test/main.cpp
index d6722c699..076922490 100644
--- a/src/failure_detector/test/main.cpp
+++ b/src/failure_detector/test/main.cpp
@@ -32,7 +32,6 @@
 #endif
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/geo/lib/geo_client.cpp b/src/geo/lib/geo_client.cpp
index 26ed99644..ad0e160f2 100644
--- a/src/geo/lib/geo_client.cpp
+++ b/src/geo/lib/geo_client.cpp
@@ -22,7 +22,6 @@
 #include <s2/s2earth.h>
 #include <s2/s2region_coverer.h>
 #include <s2/s2cap.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/geo/lib/latlng_codec.cpp b/src/geo/lib/latlng_codec.cpp
index 87b1f405c..8ed1c0a4c 100644
--- a/src/geo/lib/latlng_codec.cpp
+++ b/src/geo/lib/latlng_codec.cpp
@@ -19,7 +19,6 @@
 
 #include "latlng_codec.h"
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/geo/test/main.cpp b/src/geo/test/main.cpp
index e37b5ccdc..d3933b878 100644
--- a/src/geo/test/main.cpp
+++ b/src/geo/test/main.cpp
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/dump_file.h b/src/meta/dump_file.h
index edaef35d6..fe8bf3d8d 100644
--- a/src/meta/dump_file.h
+++ b/src/meta/dump_file.h
@@ -27,12 +27,10 @@
 #pragma once
 
 #include "utils/safe_strerror_posix.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
 #include "utils/api_utilities.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/meta_data.cpp b/src/meta/meta_data.cpp
index c192500f2..f9de71fa1 100644
--- a/src/meta/meta_data.cpp
+++ b/src/meta/meta_data.cpp
@@ -35,7 +35,6 @@
 #include <boost/lexical_cast.hpp>
 
 #include "utils/fmt_logging.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/meta_options.h b/src/meta/meta_options.h
index 835177682..9bb299429 100644
--- a/src/meta/meta_options.h
+++ b/src/meta/meta_options.h
@@ -35,7 +35,6 @@
 #pragma once
 
 #include <string>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/meta_service_app.cpp b/src/meta/meta_service_app.cpp
index af7c2b95a..69a7525a1 100644
--- a/src/meta/meta_service_app.cpp
+++ b/src/meta/meta_service_app.cpp
@@ -24,7 +24,6 @@
  * THE SOFTWARE.
  */
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/meta_state_service.h b/src/meta/meta_state_service.h
index d158a8f7b..fe604a3ff 100644
--- a/src/meta/meta_state_service.h
+++ b/src/meta/meta_state_service.h
@@ -43,7 +43,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/meta_state_service_utils.cpp b/src/meta/meta_state_service_utils.cpp
index 521de9236..0e659ea42 100644
--- a/src/meta/meta_state_service_utils.cpp
+++ b/src/meta/meta_state_service_utils.cpp
@@ -17,7 +17,6 @@
 
 #include "runtime/pipeline.h"
 #include "utils/fmt_logging.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/server_load_balancer.h b/src/meta/server_load_balancer.h
index 91f270644..c7a63553b 100644
--- a/src/meta/server_load_balancer.h
+++ b/src/meta/server_load_balancer.h
@@ -36,7 +36,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/backup_test.cpp b/src/meta/test/backup_test.cpp
index 0baaaa5ed..6c71611cc 100644
--- a/src/meta/test/backup_test.cpp
+++ b/src/meta/test/backup_test.cpp
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/balancer_validator.cpp b/src/meta/test/balancer_validator.cpp
index ffb117789..04d68e9b8 100644
--- a/src/meta/test/balancer_validator.cpp
+++ b/src/meta/test/balancer_validator.cpp
@@ -28,7 +28,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "common/gpid.h"
 #include "backup_types.h"
 #include "bulk_load_types.h"
diff --git a/src/meta/test/json_compacity.cpp b/src/meta/test/json_compacity.cpp
index 12e986007..7787365fb 100644
--- a/src/meta/test/json_compacity.cpp
+++ b/src/meta/test/json_compacity.cpp
@@ -26,12 +26,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
-#include "runtime/api_task.h"
-#include "runtime/api_layer1.h"
-#include "runtime/app_model.h"
-#include "utils/api_utilities.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/main.cpp b/src/meta/test/main.cpp
index 4f03b487d..4d6b93175 100644
--- a/src/meta/test/main.cpp
+++ b/src/meta/test/main.cpp
@@ -16,7 +16,6 @@
 // under the License.
 
 #include <cmath>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/meta_app_operation_test.cpp b/src/meta/test/meta_app_operation_test.cpp
index 094200d67..b9f034e32 100644
--- a/src/meta/test/meta_app_operation_test.cpp
+++ b/src/meta/test/meta_app_operation_test.cpp
@@ -18,7 +18,6 @@
 #include <gtest/gtest.h>
 #include "utils/fmt_logging.h"
 #include "common/replica_envs.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/meta_partition_guardian_test.cpp b/src/meta/test/meta_partition_guardian_test.cpp
index 50346b225..2ab2695e6 100644
--- a/src/meta/test/meta_partition_guardian_test.cpp
+++ b/src/meta/test/meta_partition_guardian_test.cpp
@@ -27,26 +27,6 @@
 #include <climits>
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
-#include "runtime/api_task.h"
-#include "runtime/api_layer1.h"
-#include "runtime/app_model.h"
-#include "utils/api_utilities.h"
-#include "common/api_common.h"
-#include "runtime/api_task.h"
-#include "runtime/api_layer1.h"
-#include "runtime/app_model.h"
-#include "utils/api_utilities.h"
-#include "utils/error_code.h"
-#include "utils/threadpool_code.h"
-#include "runtime/task/task_code.h"
-#include "common/gpid.h"
-#include "runtime/rpc/serialization.h"
-#include "runtime/rpc/rpc_stream.h"
-#include "runtime/serverlet.h"
-#include "runtime/service_app.h"
-#include "utils/rpc_address.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/meta_service_test_app.h b/src/meta/test/meta_service_test_app.h
index 0307579d4..81397558c 100644
--- a/src/meta/test/meta_service_test_app.h
+++ b/src/meta/test/meta_service_test_app.h
@@ -26,7 +26,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/meta_split_service_test.cpp b/src/meta/test/meta_split_service_test.cpp
index cbc78a494..cdd4d0ae9 100644
--- a/src/meta/test/meta_split_service_test.cpp
+++ b/src/meta/test/meta_split_service_test.cpp
@@ -25,7 +25,6 @@
  */
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/meta_state/main.cpp b/src/meta/test/meta_state/main.cpp
index 01d32c33f..1eb71d225 100644
--- a/src/meta/test/meta_state/main.cpp
+++ b/src/meta/test/meta_state/main.cpp
@@ -41,7 +41,6 @@
 #endif
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/meta_state_service_utils_test.cpp b/src/meta/test/meta_state_service_utils_test.cpp
index 200467afa..3452845d7 100644
--- a/src/meta/test/meta_state_service_utils_test.cpp
+++ b/src/meta/test/meta_state_service_utils_test.cpp
@@ -27,7 +27,6 @@
 #include <gtest/gtest.h>
 #include "meta/meta_state_service.h"
 #include <fmt/format.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/misc/misc.h b/src/meta/test/misc/misc.h
index af5d91639..c52676ed9 100644
--- a/src/meta/test/misc/misc.h
+++ b/src/meta/test/misc/misc.h
@@ -27,12 +27,6 @@
 #pragma once
 
 #include <vector>
-#include "common/api_common.h"
-#include "runtime/api_task.h"
-#include "runtime/api_layer1.h"
-#include "runtime/app_model.h"
-#include "utils/api_utilities.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/server_state_test.cpp b/src/meta/test/server_state_test.cpp
index 256dc2d7d..c3135612a 100644
--- a/src/meta/test/server_state_test.cpp
+++ b/src/meta/test/server_state_test.cpp
@@ -25,7 +25,6 @@
  */
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/state_sync_test.cpp b/src/meta/test/state_sync_test.cpp
index 86033ec68..0179de7be 100644
--- a/src/meta/test/state_sync_test.cpp
+++ b/src/meta/test/state_sync_test.cpp
@@ -30,7 +30,6 @@
 #include <iostream>
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/meta/test/update_configuration_test.cpp b/src/meta/test/update_configuration_test.cpp
index fbb501823..ef45f82dc 100644
--- a/src/meta/test/update_configuration_test.cpp
+++ b/src/meta/test/update_configuration_test.cpp
@@ -26,12 +26,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
-#include "runtime/api_task.h"
-#include "runtime/api_layer1.h"
-#include "runtime/app_model.h"
-#include "utils/api_utilities.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/nfs/test/main.cpp b/src/nfs/test/main.cpp
index 68fc10b5b..486833056 100644
--- a/src/nfs/test/main.cpp
+++ b/src/nfs/test/main.cpp
@@ -26,7 +26,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/perf_counter/perf_counter.h b/src/perf_counter/perf_counter.h
index fec74f240..339b2ad4e 100644
--- a/src/perf_counter/perf_counter.h
+++ b/src/perf_counter/perf_counter.h
@@ -32,7 +32,6 @@
 
 #include "utils/enum_helper.h"
 #include "utils/autoref_ptr.h"
-#include "utils/dlib.h"
 
 typedef enum dsn_perf_counter_type_t {
     COUNTER_TYPE_NUMBER,
diff --git a/src/perf_counter/perf_counters.h b/src/perf_counter/perf_counters.h
index 9aee6d512..763963ad7 100644
--- a/src/perf_counter/perf_counters.h
+++ b/src/perf_counter/perf_counters.h
@@ -32,7 +32,6 @@
 #include <sstream>
 #include <unordered_map>
 
-#include "common/api_common.h"
 #include "perf_counter.h"
 #include "utils/singleton.h"
 #include "utils/synchronize.h"
diff --git a/src/perf_counter/test/main.cpp b/src/perf_counter/test/main.cpp
index 1e60de841..644774962 100644
--- a/src/perf_counter/test/main.cpp
+++ b/src/perf_counter/test/main.cpp
@@ -16,7 +16,6 @@
 // under the License.
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/redis_protocol/proxy_lib/proxy_layer.h b/src/redis_protocol/proxy_lib/proxy_layer.h
index a83cb55fa..0599adf85 100644
--- a/src/redis_protocol/proxy_lib/proxy_layer.h
+++ b/src/redis_protocol/proxy_lib/proxy_layer.h
@@ -19,7 +19,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/replica/backup/test/main.cpp b/src/replica/backup/test/main.cpp
index ca99692d0..16a31f3bb 100644
--- a/src/replica/backup/test/main.cpp
+++ b/src/replica/backup/test/main.cpp
@@ -17,7 +17,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/replica/bulk_load/test/main.cpp b/src/replica/bulk_load/test/main.cpp
index ca99692d0..16a31f3bb 100644
--- a/src/replica/bulk_load/test/main.cpp
+++ b/src/replica/bulk_load/test/main.cpp
@@ -17,7 +17,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/replica/duplication/replica_duplicator.h b/src/replica/duplication/replica_duplicator.h
index a30e38a73..4159980f8 100644
--- a/src/replica/duplication/replica_duplicator.h
+++ b/src/replica/duplication/replica_duplicator.h
@@ -20,7 +20,6 @@
 #include "common//duplication_common.h"
 #include "runtime/pipeline.h"
 #include "replica/replica_base.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/replica/duplication/test/main.cpp b/src/replica/duplication/test/main.cpp
index ca99692d0..16a31f3bb 100644
--- a/src/replica/duplication/test/main.cpp
+++ b/src/replica/duplication/test/main.cpp
@@ -17,7 +17,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/replica/replication_app_base.cpp b/src/replica/replication_app_base.cpp
index 218308ad0..49975b989 100644
--- a/src/replica/replication_app_base.cpp
+++ b/src/replica/replication_app_base.cpp
@@ -35,7 +35,6 @@
 #include "utils/factory_store.h"
 #include "utils/filesystem.h"
 #include "utils/crc.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/replica/split/test/main.cpp b/src/replica/split/test/main.cpp
index ca99692d0..16a31f3bb 100644
--- a/src/replica/split/test/main.cpp
+++ b/src/replica/split/test/main.cpp
@@ -17,7 +17,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/replica/storage/simple_kv/test/common.h b/src/replica/storage/simple_kv/test/common.h
index 432dfeb59..29a971ff6 100644
--- a/src/replica/storage/simple_kv/test/common.h
+++ b/src/replica/storage/simple_kv/test/common.h
@@ -35,7 +35,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/replica/storage/simple_kv/test/injector.cpp b/src/replica/storage/simple_kv/test/injector.cpp
index 09d9fa7d0..fb8b0221a 100644
--- a/src/replica/storage/simple_kv/test/injector.cpp
+++ b/src/replica/storage/simple_kv/test/injector.cpp
@@ -38,7 +38,6 @@
 #include "case.h"
 
 #include "runtime/fault_injector.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/api_layer1.h b/src/runtime/api_layer1.h
index 91cc5dd00..193ed30a4 100644
--- a/src/runtime/api_layer1.h
+++ b/src/runtime/api_layer1.h
@@ -30,7 +30,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "common/gpid.h"
 #include "utils/rpc_address.h"
@@ -179,7 +178,7 @@ dsn_threadpool_code_register.
  @{
  */
 /*! cancel the later execution of the timer task inside the timer */
-extern DSN_API void dsn_task_cancel_current_timer();
+extern void dsn_task_cancel_current_timer();
 
 /*!
  check whether the task is currently running inside the given task
@@ -188,7 +187,7 @@ extern DSN_API void dsn_task_cancel_current_timer();
 
  \return true if it is.
  */
-extern DSN_API bool dsn_task_is_running_inside(dsn::task *t);
+extern bool dsn_task_is_running_inside(dsn::task *t);
 
 /*@}*/
 
@@ -214,7 +213,7 @@ replace the underneath implementation of the network (e.g., RDMA, simulated netw
 @{
 */
 
-extern DSN_API dsn::rpc_address dsn_primary_address();
+extern dsn::rpc_address dsn_primary_address();
 
 /*!
 @defgroup rpc-server Server-Side RPC Primitives
@@ -224,20 +223,19 @@ Server-Side RPC Primitives
  */
 
 /*! register callback to handle RPC request */
-extern DSN_API bool dsn_rpc_register_handler(dsn::task_code code,
-                                             const char *extra_name,
-                                             const dsn::rpc_request_handler &cb);
+extern bool dsn_rpc_register_handler(dsn::task_code code,
+                                     const char *extra_name,
+                                     const dsn::rpc_request_handler &cb);
 
 /*! unregister callback to handle RPC request, returns true if unregister ok, false if no handler
     was registered */
-extern DSN_API bool dsn_rpc_unregiser_handler(dsn::task_code code);
+extern bool dsn_rpc_unregiser_handler(dsn::task_code code);
 
 /*! reply with a response which is created using dsn::message_ex::create_response */
-extern DSN_API void dsn_rpc_reply(dsn::message_ex *response,
-                                  dsn::error_code err DEFAULT(dsn::ERR_OK));
+extern void dsn_rpc_reply(dsn::message_ex *response, dsn::error_code err = dsn::ERR_OK);
 
 /*! forward the request to another server instead */
-extern DSN_API void dsn_rpc_forward(dsn::message_ex *request, dsn::rpc_address addr);
+extern void dsn_rpc_forward(dsn::message_ex *request, dsn::rpc_address addr);
 
 /*@}*/
 
@@ -249,23 +247,22 @@ Client-Side RPC Primitives
 */
 
 /*! client invokes the RPC call */
-extern DSN_API void dsn_rpc_call(dsn::rpc_address server, dsn::rpc_response_task *rpc_call);
+extern void dsn_rpc_call(dsn::rpc_address server, dsn::rpc_response_task *rpc_call);
 
 /*!
    client invokes the RPC call and waits for its response, note
    returned msg must be explicitly released using \ref dsn::message_ex::release_ref
  */
-extern DSN_API dsn::message_ex *dsn_rpc_call_wait(dsn::rpc_address server,
-                                                  dsn::message_ex *request);
+extern dsn::message_ex *dsn_rpc_call_wait(dsn::rpc_address server, dsn::message_ex *request);
 
 /*! one-way RPC from client, no rpc response is expected */
-extern DSN_API void dsn_rpc_call_one_way(dsn::rpc_address server, dsn::message_ex *request);
+extern void dsn_rpc_call_one_way(dsn::rpc_address server, dsn::message_ex *request);
 
 /*@}*/
 
 /*@}*/
 
-extern DSN_API uint64_t dsn_now_ns();
+extern uint64_t dsn_now_ns();
 
 __inline uint64_t dsn_now_us() { return dsn_now_ns() / 1000; }
 __inline uint64_t dsn_now_ms() { return dsn_now_ns() / 1000000; }
diff --git a/src/runtime/api_task.h b/src/runtime/api_task.h
index e9f3e1c51..cd67f9518 100644
--- a/src/runtime/api_task.h
+++ b/src/runtime/api_task.h
@@ -29,7 +29,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "utils/error_code.h"
 #include "utils/threadpool_code.h"
 #include "runtime/task/task_code.h"
@@ -75,7 +74,6 @@ apps updates the value at dsn_task_queue_virtual_length_ptr(..) to control
 the length of a vitual queue (bound to current code + hash) to
 enable customized throttling, see spec of thread pool for more information
 */
-extern DSN_API volatile int *dsn_task_queue_virtual_length_ptr(dsn::task_code code,
-                                                               int hash DEFAULT(0));
+extern volatile int *dsn_task_queue_virtual_length_ptr(dsn::task_code code, int hash = 0);
 
 /*@}*/
diff --git a/src/runtime/app_model.h b/src/runtime/app_model.h
index 75810199d..fff43449f 100644
--- a/src/runtime/app_model.h
+++ b/src/runtime/app_model.h
@@ -28,8 +28,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
-
 /*!
  mimic an app as if the following execution in the current thread are
  executed in the target app's threads.
@@ -48,7 +46,7 @@
  in configuration file. See more details at \ref enable_default_app_mimic.
 
  */
-extern DSN_API bool dsn_mimic_app(const char *app_role, int index);
+extern bool dsn_mimic_app(const char *app_role, int index);
 
 /*!
  start the system with given configuration
@@ -58,7 +56,7 @@ extern DSN_API bool dsn_mimic_app(const char *app_role, int index);
 
  \return true if it succeeds, false if it fails.
  */
-extern DSN_API bool dsn_run_config(const char *config, bool is_server DEFAULT(false));
+extern bool dsn_run_config(const char *config, bool is_server = false);
 
 /*!
  start the system with given arguments
@@ -82,7 +80,7 @@ extern DSN_API bool dsn_run_config(const char *config, bool is_server DEFAULT(fa
 
  Note the argc, argv folllows the C main convention that argv[0] is the executable name.
  */
-extern DSN_API void dsn_run(int argc, char **argv, bool is_server DEFAULT(false));
+extern void dsn_run(int argc, char **argv, bool is_server = false);
 
 /*!
  exit the process with the given exit code
@@ -92,4 +90,4 @@ extern DSN_API void dsn_run(int argc, char **argv, bool is_server DEFAULT(false)
  rDSN runtime does not provide elegant exit routines. Thereafter, developers call dsn_exit
  to exit the current process to avoid exceptions happending during normal exit.
  */
-NORETURN extern DSN_API void dsn_exit(int code);
+[[noreturn]] extern void dsn_exit(int code);
diff --git a/src/runtime/env_provider.h b/src/runtime/env_provider.h
index 0cb0c01e5..92c41993a 100644
--- a/src/runtime/env_provider.h
+++ b/src/runtime/env_provider.h
@@ -28,7 +28,6 @@
 
 #include "utils/ports.h"
 #include "utils/utils.h"
-#include "utils/dlib.h"
 #include <random>
 
 namespace dsn {
diff --git a/src/runtime/fault_injector.cpp b/src/runtime/fault_injector.cpp
index e1e9bed97..0dccbedca 100644
--- a/src/runtime/fault_injector.cpp
+++ b/src/runtime/fault_injector.cpp
@@ -34,7 +34,6 @@
  */
 
 #include "runtime/fault_injector.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/global_config.h b/src/runtime/global_config.h
index 73150ec24..f9632c35b 100644
--- a/src/runtime/global_config.h
+++ b/src/runtime/global_config.h
@@ -41,7 +41,6 @@
 
 #include "runtime/task/task_spec.h"
 #include "utils/threadpool_spec.h"
-#include "utils/dlib.h"
 #include <string>
 #include <map>
 
@@ -56,7 +55,7 @@ struct network_client_config
     std::string factory_name;
     int message_buffer_block_size;
 
-    DSN_API network_client_config();
+    network_client_config();
 };
 
 typedef std::map<rpc_channel, network_client_config> network_client_configs;
@@ -71,10 +70,10 @@ struct network_server_config
     std::string factory_name;
     int message_buffer_block_size;
 
-    DSN_API network_server_config();
-    DSN_API network_server_config(int p, rpc_channel c);
-    DSN_API network_server_config(const network_server_config &r);
-    DSN_API bool operator<(const network_server_config &r) const;
+    network_server_config();
+    network_server_config(int p, rpc_channel c);
+    network_server_config(const network_server_config &r);
+    bool operator<(const network_server_config &r) const;
 };
 
 // <port,channel> => config
@@ -114,11 +113,11 @@ struct service_app_spec
 
     service_app_spec() {}
     /*service_app_spec(const service_app_spec& r);*/
-    DSN_API bool init(const char *section,
-                      const char *role_name_,
-                      service_app_spec *default_value,
-                      network_client_configs *default_client_nets = nullptr,
-                      network_server_configs *default_server_nets = nullptr);
+    bool init(const char *section,
+              const char *role_name_,
+              service_app_spec *default_value,
+              network_client_configs *default_client_nets = nullptr,
+              network_server_configs *default_server_nets = nullptr);
 };
 
 CONFIG_BEGIN(service_app_spec)
@@ -172,8 +171,8 @@ struct service_spec
     std::string dir_log;
 
     service_spec() {}
-    DSN_API bool init();
-    DSN_API bool init_app_specs();
+    bool init();
+    bool init_app_specs();
 };
 
 CONFIG_BEGIN(service_spec)
diff --git a/src/runtime/profiler.cpp b/src/runtime/profiler.cpp
index 4f43baef3..b83906ffa 100644
--- a/src/runtime/profiler.cpp
+++ b/src/runtime/profiler.cpp
@@ -48,7 +48,6 @@ START<== queue(server) == ENQUEUE <===== net(reply) ======= REPLY <=============
  END
 */
 #include "runtime/profiler.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/rpc/dsn_message_parser.cpp b/src/runtime/rpc/dsn_message_parser.cpp
index 6c1cb86b5..2c665b561 100644
--- a/src/runtime/rpc/dsn_message_parser.cpp
+++ b/src/runtime/rpc/dsn_message_parser.cpp
@@ -34,7 +34,6 @@
  */
 
 #include "dsn_message_parser.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/rpc/message_parser.cpp b/src/runtime/rpc/message_parser.cpp
index 9374484cf..17c29e049 100644
--- a/src/runtime/rpc/message_parser.cpp
+++ b/src/runtime/rpc/message_parser.cpp
@@ -34,7 +34,6 @@
  */
 
 #include "message_parser_manager.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/rpc/message_parser.h b/src/runtime/rpc/message_parser.h
index 215af8326..7154e7a3b 100644
--- a/src/runtime/rpc/message_parser.h
+++ b/src/runtime/rpc/message_parser.h
@@ -33,7 +33,6 @@
 #include "utils/autoref_ptr.h"
 #include "utils/utils.h"
 #include "utils/blob.h"
-#include "utils/dlib.h"
 #include <vector>
 
 namespace dsn {
@@ -49,7 +48,7 @@ public:
     }
 
     // called before read to extend read buffer
-    DSN_API char *read_buffer_ptr(unsigned int read_next);
+    char *read_buffer_ptr(unsigned int read_next);
 
     // get remaining buffer capacity
     unsigned int read_buffer_capacity() const { return _buffer.length() - _buffer_occupied; }
@@ -128,9 +127,9 @@ public:
     virtual int get_buffers_on_send(message_ex *msg, /*out*/ send_buf *buffers) = 0;
 
 public:
-    DSN_API static network_header_format
+    static network_header_format
     get_header_type(const char *bytes); // buffer size >= sizeof(uint32_t)
-    DSN_API static std::string get_debug_string(const char *bytes);
+    static std::string get_debug_string(const char *bytes);
 };
 
 } // namespace dsn
diff --git a/src/runtime/rpc/network.h b/src/runtime/rpc/network.h
index cb14f801a..847308aa1 100644
--- a/src/runtime/rpc/network.h
+++ b/src/runtime/rpc/network.h
@@ -32,7 +32,6 @@
 #include "runtime/rpc/message_parser.h"
 #include "utils/rpc_address.h"
 #include "utils/exp_delay.h"
-#include "utils/dlib.h"
 #include "perf_counter/perf_counter_wrapper.h"
 #include <atomic>
 
@@ -73,7 +72,7 @@ public:
     // tracing)
     //                  all downcalls should be redirected to the inner provider in the end
     //
-    DSN_API network(rpc_engine *srv, network *inner_provider);
+    network(rpc_engine *srv, network *inner_provider);
     virtual ~network() {}
 
     //
@@ -104,25 +103,25 @@ public:
     //
     // utilities
     //
-    DSN_API service_node *node() const;
+    service_node *node() const;
 
     //
     // called when network received a complete request message
     //
-    DSN_API void on_recv_request(message_ex *msg, int delay_ms);
+    void on_recv_request(message_ex *msg, int delay_ms);
 
     //
     // called when network received a complete reply message or network failed,
     // if network failed, the 'msg' will be nullptr
     //
-    DSN_API void on_recv_reply(uint64_t id, message_ex *msg, int delay_ms);
+    void on_recv_reply(uint64_t id, message_ex *msg, int delay_ms);
 
     //
     // create a message parser for
     //  (1) extracing blob from a RPC request message for low layer'
     //  (2) parsing a incoming blob message to get the rpc_message
     //
-    DSN_API message_parser *new_message_parser(network_header_format hdr_format);
+    message_parser *new_message_parser(network_header_format hdr_format);
 
     rpc_engine *engine() const { return _engine; }
     int max_buffer_block_count_per_send() const { return _max_buffer_block_count_per_send; }
@@ -130,7 +129,7 @@ public:
     network_header_format unknown_msg_hdr_format() const { return _unknown_msg_header_format; }
     int message_buffer_block_size() const { return _message_buffer_block_size; }
 
-    DSN_API static uint32_t get_local_ipv4();
+    static uint32_t get_local_ipv4();
 
 protected:
     rpc_engine *_engine;
@@ -142,8 +141,7 @@ protected:
 
 private:
     friend class rpc_engine;
-    DSN_API void reset_parser_attr(network_header_format client_hdr_format,
-                                   int message_buffer_block_size);
+    void reset_parser_attr(network_header_format client_hdr_format, int message_buffer_block_size);
 };
 
 /*!
@@ -152,27 +150,27 @@ private:
 class connection_oriented_network : public network
 {
 public:
-    DSN_API connection_oriented_network(rpc_engine *srv, network *inner_provider);
+    connection_oriented_network(rpc_engine *srv, network *inner_provider);
     virtual ~connection_oriented_network() {}
 
     // server session management
-    DSN_API rpc_session_ptr get_server_session(::dsn::rpc_address ep);
-    DSN_API void on_server_session_accepted(rpc_session_ptr &s);
-    DSN_API void on_server_session_disconnected(rpc_session_ptr &s);
+    rpc_session_ptr get_server_session(::dsn::rpc_address ep);
+    void on_server_session_accepted(rpc_session_ptr &s);
+    void on_server_session_disconnected(rpc_session_ptr &s);
 
     // Checks if IP of the incoming session has too much connections.
     // Related config: [network] conn_threshold_per_ip. No limit if the value is 0.
-    DSN_API bool check_if_conn_threshold_exceeded(::dsn::rpc_address ep);
+    bool check_if_conn_threshold_exceeded(::dsn::rpc_address ep);
 
     // client session management
-    DSN_API void on_client_session_connected(rpc_session_ptr &s);
-    DSN_API void on_client_session_disconnected(rpc_session_ptr &s);
+    void on_client_session_connected(rpc_session_ptr &s);
+    void on_client_session_disconnected(rpc_session_ptr &s);
 
     // called upon RPC call, rpc client session is created on demand
-    DSN_API virtual void send_message(message_ex *request) override;
+    virtual void send_message(message_ex *request) override;
 
     // called by rpc engine
-    DSN_API virtual void inject_drop_message(message_ex *msg, bool is_send) override;
+    virtual void inject_drop_message(message_ex *msg, bool is_send) override;
 
     // to be defined
     virtual rpc_session_ptr create_client_session(::dsn::rpc_address server_addr) = 0;
diff --git a/src/runtime/rpc/network.sim.cpp b/src/runtime/rpc/network.sim.cpp
index 37139c9f3..01c1525d1 100644
--- a/src/runtime/rpc/network.sim.cpp
+++ b/src/runtime/rpc/network.sim.cpp
@@ -34,7 +34,6 @@
  */
 
 #include <boost/asio.hpp>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/rpc/raw_message_parser.cpp b/src/runtime/rpc/raw_message_parser.cpp
index ff2fdf928..8c7c1443a 100644
--- a/src/runtime/rpc/raw_message_parser.cpp
+++ b/src/runtime/rpc/raw_message_parser.cpp
@@ -32,7 +32,6 @@
  *     xxxx-xx-xx, author, fix bug about xxx
  */
 #include "raw_message_parser.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/rpc/rpc_holder.h b/src/runtime/rpc/rpc_holder.h
index 59c536ce6..b9c1ae66b 100644
--- a/src/runtime/rpc/rpc_holder.h
+++ b/src/runtime/rpc/rpc_holder.h
@@ -17,11 +17,8 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_layer1.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
-#include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
 #include "utils/api_utilities.h"
 #include "utils/error_code.h"
diff --git a/src/runtime/rpc/rpc_message.h b/src/runtime/rpc/rpc_message.h
index c2b6329d2..79336e93c 100644
--- a/src/runtime/rpc/rpc_message.h
+++ b/src/runtime/rpc/rpc_message.h
@@ -38,7 +38,6 @@
 #include <atomic>
 #include "utils/ports.h"
 #include "utils/extensible_object.h"
-#include "utils/dlib.h"
 #include "utils/blob.h"
 #include "utils/link.h"
 #include "utils/error_code.h"
@@ -48,6 +47,9 @@
 #include "utils/rpc_address.h"
 #include "runtime/global_config.h"
 
+#define DSN_MAX_TASK_CODE_NAME_LENGTH 48
+#define DSN_MAX_ERROR_CODE_NAME_LENGTH 48
+
 namespace dsn {
 class rpc_session;
 typedef dsn::ref_ptr<rpc_session> rpc_session_ptr;
@@ -149,78 +151,78 @@ public:
 
 public:
     // message_ex(blob bb, bool parse_hdr = true); // read
-    DSN_API ~message_ex();
+    ~message_ex();
 
     //
     // utility routines
     //
-    DSN_API error_code error();
-    DSN_API task_code rpc_code();
+    error_code error();
+    task_code rpc_code();
     static uint64_t new_id() { return ++_id; }
     static unsigned int get_body_length(char *hdr) { return ((message_header *)hdr)->body_length; }
 
     //
     // routines for create messages
     //
-    DSN_API static message_ex *create_receive_message(const blob &data);
-    DSN_API static message_ex *create_request(dsn::task_code rpc_code,
-                                              int timeout_milliseconds = 0,
-                                              int thread_hash = 0,
-                                              uint64_t partition_hash = 0);
-
-    DSN_API static message_ex *create_received_request(dsn::task_code rpc_code,
-                                                       dsn_msg_serialize_format format,
-                                                       void *buffer,
-                                                       int size,
-                                                       int thread_hash = 0,
-                                                       uint64_t partition_hash = 0);
+    static message_ex *create_receive_message(const blob &data);
+    static message_ex *create_request(dsn::task_code rpc_code,
+                                      int timeout_milliseconds = 0,
+                                      int thread_hash = 0,
+                                      uint64_t partition_hash = 0);
+
+    static message_ex *create_received_request(dsn::task_code rpc_code,
+                                               dsn_msg_serialize_format format,
+                                               void *buffer,
+                                               int size,
+                                               int thread_hash = 0,
+                                               uint64_t partition_hash = 0);
 
     /// This method is only used for receiving request.
     /// The returned message:
     ///   - msg->buffers[0] = message_header
     ///   - msg->buffers[1] = data
     /// NOTE: the reference counter of returned message_ex is not added in this function
-    DSN_API static message_ex *create_receive_message_with_standalone_header(const blob &data);
+    static message_ex *create_receive_message_with_standalone_header(const blob &data);
 
     /// copy message without client information, it will not reply
     /// The returned message:
     ///   - msg->buffers[0] = message_header
     ///   - msg->buffers[1] = data
-    DSN_API static message_ex *copy_message_no_reply(const message_ex &old_msg);
+    static message_ex *copy_message_no_reply(const message_ex &old_msg);
 
     /// The returned message:
     ///   - msg->buffers[0] = message_header
     ///   - msg->_is_read = false
     ///   - msg->_rw_index = 0
     ///   - msg->_rw_offset = 48 (size of message_header)
-    DSN_API message_ex *create_response();
+    message_ex *create_response();
 
-    DSN_API message_ex *copy(bool clone_content, bool copy_for_receive);
-    DSN_API message_ex *copy_and_prepare_send(bool clone_content);
+    message_ex *copy(bool clone_content, bool copy_for_receive);
+    message_ex *copy_and_prepare_send(bool clone_content);
 
     //
     // routines for buffer management
     //
-    DSN_API void write_next(void **ptr, size_t *size, size_t min_size);
-    DSN_API void write_commit(size_t size);
-    DSN_API bool read_next(void **ptr, size_t *size);
+    void write_next(void **ptr, size_t *size, size_t min_size);
+    void write_commit(size_t size);
+    bool read_next(void **ptr, size_t *size);
     bool read_next(blob &data);
-    DSN_API void read_commit(size_t size);
+    void read_commit(size_t size);
     size_t body_size() { return (size_t)header->body_length; }
-    DSN_API void *rw_ptr(size_t offset_begin);
+    void *rw_ptr(size_t offset_begin);
 
     // rpc_read_stream can read a msg many times by restore()
     // rpc_read_stream stream1(msg)
     // msg->restore_read()
     // rpc_read_stream stream2(msg)
-    DSN_API void restore_read();
+    void restore_read();
 
     bool is_backup_request() const { return header->context.u.is_backup_request; }
 
 private:
-    DSN_API message_ex();
-    DSN_API void prepare_buffer_header();
-    DSN_API void release_buffer_header();
+    message_ex();
+    void prepare_buffer_header();
+    void release_buffer_header();
 
 private:
     static std::atomic<uint64_t> _id;
diff --git a/src/runtime/rpc/rpc_stream.h b/src/runtime/rpc/rpc_stream.h
index 6cfd78912..62dfc8228 100644
--- a/src/runtime/rpc/rpc_stream.h
+++ b/src/runtime/rpc/rpc_stream.h
@@ -26,7 +26,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "common/gpid.h"
 #include "runtime/api_layer1.h"
 #include "runtime/api_task.h"
diff --git a/src/runtime/rpc/thrift_message_parser.cpp b/src/runtime/rpc/thrift_message_parser.cpp
index 18de79958..c806ba257 100644
--- a/src/runtime/rpc/thrift_message_parser.cpp
+++ b/src/runtime/rpc/thrift_message_parser.cpp
@@ -26,7 +26,6 @@
 
 #include "thrift_message_parser.h"
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/scheduler.cpp b/src/runtime/scheduler.cpp
index f05315cd3..1480bdb85 100644
--- a/src/runtime/scheduler.cpp
+++ b/src/runtime/scheduler.cpp
@@ -35,7 +35,6 @@
 
 #include "utils/rand.h"
 #include "runtime/simulator.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp
index f8b34cb80..2c23899da 100644
--- a/src/runtime/service_api_c.cpp
+++ b/src/runtime/service_api_c.cpp
@@ -32,7 +32,6 @@
 
 #include <fstream>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
@@ -81,18 +80,15 @@ static struct _all_info_
 
 } dsn_all;
 
-DSN_API volatile int *dsn_task_queue_virtual_length_ptr(dsn::task_code code, int hash)
+volatile int *dsn_task_queue_virtual_length_ptr(dsn::task_code code, int hash)
 {
     return dsn::task::get_current_node()->computation()->get_task_queue_virtual_length_ptr(code,
                                                                                            hash);
 }
 
-DSN_API bool dsn_task_is_running_inside(dsn::task *t)
-{
-    return ::dsn::task::get_current_task() == t;
-}
+bool dsn_task_is_running_inside(dsn::task *t) { return ::dsn::task::get_current_task() == t; }
 
-DSN_API void dsn_coredump()
+void dsn_coredump()
 {
     ::dsn::utils::coredump::write();
     ::abort();
@@ -105,24 +101,21 @@ DSN_API void dsn_coredump()
 //------------------------------------------------------------------------------
 
 // rpc calls
-DSN_API dsn::rpc_address dsn_primary_address()
-{
-    return ::dsn::task::get_current_rpc()->primary_address();
-}
+dsn::rpc_address dsn_primary_address() { return ::dsn::task::get_current_rpc()->primary_address(); }
 
-DSN_API bool dsn_rpc_register_handler(dsn::task_code code,
-                                      const char *extra_name,
-                                      const dsn::rpc_request_handler &cb)
+bool dsn_rpc_register_handler(dsn::task_code code,
+                              const char *extra_name,
+                              const dsn::rpc_request_handler &cb)
 {
     return ::dsn::task::get_current_node()->rpc_register_handler(code, extra_name, cb);
 }
 
-DSN_API bool dsn_rpc_unregiser_handler(dsn::task_code code)
+bool dsn_rpc_unregiser_handler(dsn::task_code code)
 {
     return ::dsn::task::get_current_node()->rpc_unregister_handler(code);
 }
 
-DSN_API void dsn_rpc_call(dsn::rpc_address server, dsn::rpc_response_task *rpc_call)
+void dsn_rpc_call(dsn::rpc_address server, dsn::rpc_response_task *rpc_call)
 {
     CHECK_EQ_MSG(rpc_call->spec().type, TASK_TYPE_RPC_RESPONSE, "invalid task_type");
 
@@ -131,7 +124,7 @@ DSN_API void dsn_rpc_call(dsn::rpc_address server, dsn::rpc_response_task *rpc_c
     ::dsn::task::get_current_rpc()->call(msg, dsn::rpc_response_task_ptr(rpc_call));
 }
 
-DSN_API dsn::message_ex *dsn_rpc_call_wait(dsn::rpc_address server, dsn::message_ex *request)
+dsn::message_ex *dsn_rpc_call_wait(dsn::rpc_address server, dsn::message_ex *request)
 {
     auto msg = ((::dsn::message_ex *)request);
     msg->server_address = server;
@@ -151,7 +144,7 @@ DSN_API dsn::message_ex *dsn_rpc_call_wait(dsn::rpc_address server, dsn::message
     }
 }
 
-DSN_API void dsn_rpc_call_one_way(dsn::rpc_address server, dsn::message_ex *request)
+void dsn_rpc_call_one_way(dsn::rpc_address server, dsn::message_ex *request)
 {
     auto msg = ((::dsn::message_ex *)request);
     msg->server_address = server;
@@ -159,13 +152,13 @@ DSN_API void dsn_rpc_call_one_way(dsn::rpc_address server, dsn::message_ex *requ
     ::dsn::task::get_current_rpc()->call(msg, nullptr);
 }
 
-DSN_API void dsn_rpc_reply(dsn::message_ex *response, dsn::error_code err)
+void dsn_rpc_reply(dsn::message_ex *response, dsn::error_code err)
 {
     auto msg = ((::dsn::message_ex *)response);
     ::dsn::task::get_current_rpc()->reply(msg, err);
 }
 
-DSN_API void dsn_rpc_forward(dsn::message_ex *request, dsn::rpc_address addr)
+void dsn_rpc_forward(dsn::message_ex *request, dsn::rpc_address addr)
 {
     ::dsn::task::get_current_rpc()->forward((::dsn::message_ex *)(request),
                                             ::dsn::rpc_address(addr));
@@ -180,13 +173,13 @@ DSN_API void dsn_rpc_forward(dsn::message_ex *request, dsn::rpc_address addr)
 static bool
 run(const char *config_file, const char *config_arguments, bool is_server, std::string &app_list);
 
-DSN_API bool dsn_run_config(const char *config, bool is_server)
+bool dsn_run_config(const char *config, bool is_server)
 {
     std::string name;
     return run(config, nullptr, is_server, name);
 }
 
-NORETURN DSN_API void dsn_exit(int code)
+[[noreturn]] void dsn_exit(int code)
 {
     printf("dsn exit with code %d\n", code);
     fflush(stdout);
@@ -195,7 +188,7 @@ NORETURN DSN_API void dsn_exit(int code)
     _exit(code);
 }
 
-DSN_API bool dsn_mimic_app(const char *app_role, int index)
+bool dsn_mimic_app(const char *app_role, int index)
 {
     auto worker = ::dsn::task::get_current_worker2();
     CHECK(worker == nullptr, "cannot call dsn_mimic_app in rDSN threads");
@@ -234,7 +227,7 @@ DSN_API bool dsn_mimic_app(const char *app_role, int index)
 //       port variable specified in config.ini
 //       config.ini to start ALL apps as a new process
 //
-DSN_API void dsn_run(int argc, char **argv, bool is_server)
+void dsn_run(int argc, char **argv, bool is_server)
 {
     if (argc < 2) {
         printf(
diff --git a/src/runtime/service_app.h b/src/runtime/service_app.h
index e4fbc8cef..4bf686522 100644
--- a/src/runtime/service_app.h
+++ b/src/runtime/service_app.h
@@ -35,7 +35,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/task/async_calls.h b/src/runtime/task/async_calls.h
index 6ab3f3028..244a53530 100644
--- a/src/runtime/task/async_calls.h
+++ b/src/runtime/task/async_calls.h
@@ -26,7 +26,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/task/task.cpp b/src/runtime/task/task.cpp
index 32f824b8a..43e45138e 100644
--- a/src/runtime/task/task.cpp
+++ b/src/runtime/task/task.cpp
@@ -26,7 +26,6 @@
 
 #include "task.h"
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/task/task_queue.h b/src/runtime/task/task_queue.h
index 5019d305f..6e5c9633f 100644
--- a/src/runtime/task/task_queue.h
+++ b/src/runtime/task/task_queue.h
@@ -29,7 +29,6 @@
 #include "task.h"
 
 #include "perf_counter/perf_counter_wrapper.h"
-#include "utils/dlib.h"
 
 namespace dsn {
 
@@ -55,8 +54,8 @@ public:
     typedef task_queue *(*factory)(task_worker_pool *, int, task_queue *);
 
 public:
-    DSN_API task_queue(task_worker_pool *pool, int index, task_queue *inner_provider);
-    DSN_API virtual ~task_queue();
+    task_queue(task_worker_pool *pool, int index, task_queue *inner_provider);
+    virtual ~task_queue();
 
     virtual void enqueue(task *task) = 0;
     // dequeue may return more than 1 tasks, but there is a configured
diff --git a/src/runtime/task/task_spec.cpp b/src/runtime/task/task_spec.cpp
index 2db223b05..d34df2a68 100644
--- a/src/runtime/task/task_spec.cpp
+++ b/src/runtime/task/task_spec.cpp
@@ -28,6 +28,7 @@
 
 #include <array>
 
+#include "runtime/rpc/rpc_message.h"
 #include "utils/fmt_logging.h"
 #include "utils/command_manager.h"
 #include "utils/threadpool_spec.h"
diff --git a/src/runtime/task/task_spec.h b/src/runtime/task/task_spec.h
index 6a5762b77..f8d601347 100644
--- a/src/runtime/task/task_spec.h
+++ b/src/runtime/task/task_spec.h
@@ -42,7 +42,6 @@
 #include "utils/join_point.h"
 #include "utils/extensible_object.h"
 #include "utils/exp_delay.h"
-#include "utils/dlib.h"
 #include "perf_counter/perf_counter.h"
 #include "utils/error_code.h"
 #include "utils/threadpool_code.h"
@@ -145,19 +144,19 @@ std::set<dsn::task_code> &get_storage_rpc_req_codes();
 class task_spec : public extensible_object<task_spec, 4>
 {
 public:
-    DSN_API static task_spec *get(int ec);
-    DSN_API static void register_task_code(dsn::task_code code,
+    static task_spec *get(int ec);
+    static void register_task_code(dsn::task_code code,
+                                   dsn_task_type_t type,
+                                   dsn_task_priority_t pri,
+                                   dsn::threadpool_code pool);
+
+    static void register_storage_task_code(dsn::task_code code,
                                            dsn_task_type_t type,
                                            dsn_task_priority_t pri,
-                                           dsn::threadpool_code pool);
-
-    DSN_API static void register_storage_task_code(dsn::task_code code,
-                                                   dsn_task_type_t type,
-                                                   dsn_task_priority_t pri,
-                                                   dsn::threadpool_code pool,
-                                                   bool is_write_operation,
-                                                   bool allow_batch,
-                                                   bool is_idempotent);
+                                           dsn::threadpool_code pool,
+                                           bool is_write_operation,
+                                           bool allow_batch,
+                                           bool is_idempotent);
 
 public:
     // not configurable [
@@ -231,15 +230,15 @@ public:
     /*@}*/
 
 public:
-    DSN_API task_spec(int code,
-                      const char *name,
-                      dsn_task_type_t type,
-                      dsn_task_priority_t pri,
-                      dsn::threadpool_code pool);
+    task_spec(int code,
+              const char *name,
+              dsn_task_type_t type,
+              dsn_task_priority_t pri,
+              dsn::threadpool_code pool);
 
 public:
-    DSN_API static bool init();
-    DSN_API void init_profiling(bool profile);
+    static bool init();
+    void init_profiling(bool profile);
 };
 
 CONFIG_BEGIN(task_spec)
diff --git a/src/runtime/task/task_worker.h b/src/runtime/task/task_worker.h
index f625df014..3249d8eaa 100644
--- a/src/runtime/task/task_worker.h
+++ b/src/runtime/task/task_worker.h
@@ -38,7 +38,6 @@
 #include "task_queue.h"
 #include "utils/extensible_object.h"
 #include "utils/synchronize.h"
-#include "utils/dlib.h"
 #include "perf_counter/perf_counter.h"
 #include <thread>
 
@@ -64,15 +63,14 @@ public:
     typedef task_worker *(*factory)(task_worker_pool *, task_queue *, int, task_worker *);
 
 public:
-    DSN_API
     task_worker(task_worker_pool *pool, task_queue *q, int index, task_worker *inner_provider);
-    DSN_API virtual ~task_worker(void);
+    virtual ~task_worker(void);
 
     // service management
-    DSN_API void start();
-    DSN_API void stop();
+    void start();
+    void stop();
 
-    DSN_API virtual void loop(); // run tasks from _input_queue
+    virtual void loop(); // run tasks from _input_queue
 
     // inquery
     const std::string &name() const { return _name; }
@@ -80,8 +78,8 @@ public:
     int native_tid() const { return _native_tid; }
     task_worker_pool *pool() const { return _owner_pool; }
     task_queue *queue() const { return _input_queue; }
-    DSN_API const threadpool_spec &pool_spec() const;
-    DSN_API static task_worker *current();
+    const threadpool_spec &pool_spec() const;
+    static task_worker *current();
 
 private:
     task_worker_pool *_owner_pool;
@@ -95,9 +93,9 @@ private:
     int _processed_task_count;
 
 public:
-    DSN_API static void set_name(const char *name);
-    DSN_API static void set_priority(worker_priority_t pri);
-    DSN_API static void set_affinity(uint64_t affinity);
+    static void set_name(const char *name);
+    static void set_priority(worker_priority_t pri);
+    static void set_affinity(uint64_t affinity);
 
 private:
     void run_internal();
@@ -107,8 +105,8 @@ public:
     @addtogroup tool-api-hooks
     @{
     */
-    DSN_API static join_point<void, task_worker *> on_start;
-    DSN_API static join_point<void, task_worker *> on_create;
+    static join_point<void, task_worker *> on_start;
+    static join_point<void, task_worker *> on_create;
     /*@}*/
 };
 /*@}*/
diff --git a/src/runtime/test/async_call.cpp b/src/runtime/test/async_call.cpp
index 63ed5f113..aa850f3d9 100644
--- a/src/runtime/test/async_call.cpp
+++ b/src/runtime/test/async_call.cpp
@@ -35,7 +35,6 @@
 
 #include "runtime/task/async_calls.h"
 #include "utils/thread_access_checker.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/corrupt_message.cpp b/src/runtime/test/corrupt_message.cpp
index 333da4a9c..81e9f2738 100644
--- a/src/runtime/test/corrupt_message.cpp
+++ b/src/runtime/test/corrupt_message.cpp
@@ -27,7 +27,6 @@
 #include <string>
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/lpc.cpp b/src/runtime/test/lpc.cpp
index 82cdd57cc..2991619ab 100644
--- a/src/runtime/test/lpc.cpp
+++ b/src/runtime/test/lpc.cpp
@@ -34,7 +34,6 @@
  */
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/meta_access_controller_test.cpp b/src/runtime/test/meta_access_controller_test.cpp
index 2a7aa4b78..169a40a92 100644
--- a/src/runtime/test/meta_access_controller_test.cpp
+++ b/src/runtime/test/meta_access_controller_test.cpp
@@ -18,7 +18,6 @@
 #include <gtest/gtest.h>
 #include "utils/flags.h"
 #include "runtime/rpc/network.sim.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/netprovider.cpp b/src/runtime/test/netprovider.cpp
index 549c64638..cf188cfb4 100644
--- a/src/runtime/test/netprovider.cpp
+++ b/src/runtime/test/netprovider.cpp
@@ -38,7 +38,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/pipeline_test.cpp b/src/runtime/test/pipeline_test.cpp
index 6ab745d0e..7cc90f951 100644
--- a/src/runtime/test/pipeline_test.cpp
+++ b/src/runtime/test/pipeline_test.cpp
@@ -26,7 +26,6 @@
 
 #include <gtest/gtest.h>
 #include "runtime/pipeline.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/replica_access_controller_test.cpp b/src/runtime/test/replica_access_controller_test.cpp
index 345c03c61..0615c35ba 100644
--- a/src/runtime/test/replica_access_controller_test.cpp
+++ b/src/runtime/test/replica_access_controller_test.cpp
@@ -17,7 +17,6 @@
 
 #include <gtest/gtest.h>
 #include "utils/flags.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/rpc.cpp b/src/runtime/test/rpc.cpp
index ebf1c8821..1864fe4e7 100644
--- a/src/runtime/test/rpc.cpp
+++ b/src/runtime/test/rpc.cpp
@@ -31,7 +31,6 @@
 #include <boost/lexical_cast.hpp>
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/service_api_c.cpp b/src/runtime/test/service_api_c.cpp
index 25640e6ef..01ceffb3c 100644
--- a/src/runtime/test/service_api_c.cpp
+++ b/src/runtime/test/service_api_c.cpp
@@ -33,7 +33,6 @@
  *     xxxx-xx-xx, author, fix bug about xxx
  */
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/sim_lock.cpp b/src/runtime/test/sim_lock.cpp
index 26cf1abc0..3002cd899 100644
--- a/src/runtime/test/sim_lock.cpp
+++ b/src/runtime/test/sim_lock.cpp
@@ -33,7 +33,6 @@
  *     xxxx-xx-xx, author, fix bug about xxx
  */
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/test/test_utils.h b/src/runtime/test/test_utils.h
index b8ecae69a..50c47c79f 100644
--- a/src/runtime/test/test_utils.h
+++ b/src/runtime/test/test_utils.h
@@ -35,7 +35,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/runtime/tool_api.h b/src/runtime/tool_api.h
index 8876cfb2b..decaaf68c 100644
--- a/src/runtime/tool_api.h
+++ b/src/runtime/tool_api.h
@@ -73,7 +73,7 @@ class tool_base
 public:
     virtual ~tool_base() {}
 
-    DSN_API explicit tool_base(const char *name);
+    explicit tool_base(const char *name);
 
     const std::string &name() const { return _name; }
 
@@ -93,7 +93,7 @@ public:
     typedef toollet *(*factory)(const char *);
 
 public:
-    DSN_API toollet(const char *name);
+    toollet(const char *name);
 
     virtual void install(service_spec &spec) = 0;
 };
@@ -110,7 +110,7 @@ public:
     typedef tool_app *(*factory)(const char *);
 
 public:
-    DSN_API tool_app(const char *name);
+    tool_app(const char *name);
 
     virtual void install(service_spec &spec) = 0;
 
@@ -119,38 +119,41 @@ public:
     virtual void run() { start_all_apps(); }
 
 public:
-    DSN_API virtual void start_all_apps();
-    DSN_API virtual void stop_all_apps(bool cleanup);
+    virtual void start_all_apps();
+    virtual void stop_all_apps(bool cleanup);
 
-    DSN_API static const service_spec &get_service_spec();
+    static const service_spec &get_service_spec();
 };
 
 namespace internal_use_only {
-DSN_API bool
-register_component_provider(const char *name, timer_service::factory f, ::dsn::provider_type type);
-DSN_API bool
-register_component_provider(const char *name, task_queue::factory f, ::dsn::provider_type type);
-DSN_API bool
-register_component_provider(const char *name, task_worker::factory f, ::dsn::provider_type type);
-DSN_API bool
-register_component_provider(const char *name, network::factory f, ::dsn::provider_type type);
-DSN_API bool
-register_component_provider(const char *name, env_provider::factory f, ::dsn::provider_type type);
-DSN_API bool register_component_provider(network_header_format fmt,
-                                         const std::vector<const char *> &signatures,
-                                         message_parser::factory f,
-                                         size_t sz);
-DSN_API bool register_toollet(const char *name, toollet::factory f, ::dsn::provider_type type);
-DSN_API bool register_tool(const char *name, tool_app::factory f, ::dsn::provider_type type);
-DSN_API toollet *get_toollet(const char *name, ::dsn::provider_type type);
+bool register_component_provider(const char *name,
+                                 timer_service::factory f,
+                                 ::dsn::provider_type type);
+bool register_component_provider(const char *name,
+                                 task_queue::factory f,
+                                 ::dsn::provider_type type);
+bool register_component_provider(const char *name,
+                                 task_worker::factory f,
+                                 ::dsn::provider_type type);
+bool register_component_provider(const char *name, network::factory f, ::dsn::provider_type type);
+bool register_component_provider(const char *name,
+                                 env_provider::factory f,
+                                 ::dsn::provider_type type);
+bool register_component_provider(network_header_format fmt,
+                                 const std::vector<const char *> &signatures,
+                                 message_parser::factory f,
+                                 size_t sz);
+bool register_toollet(const char *name, toollet::factory f, ::dsn::provider_type type);
+bool register_tool(const char *name, tool_app::factory f, ::dsn::provider_type type);
+toollet *get_toollet(const char *name, ::dsn::provider_type type);
 } // namespace internal_use_only
 
 /*!
 @addtogroup tool-api-hooks
 @{
 */
-DSN_API extern join_point<void> sys_init_before_app_created;
-DSN_API extern join_point<void> sys_init_after_app_created;
+extern join_point<void> sys_init_before_app_created;
+extern join_point<void> sys_init_after_app_created;
 /*@}*/
 
 template <typename T>
@@ -193,10 +196,10 @@ T *get_toollet(const char *name)
 {
     return (T *)internal_use_only::get_toollet(name, ::dsn::PROVIDER_TYPE_MAIN);
 }
-DSN_API tool_app *get_current_tool();
-DSN_API const service_spec &spec();
-DSN_API const char *get_service_node_name(service_node *node);
-DSN_API bool is_engine_ready();
+tool_app *get_current_tool();
+const service_spec &spec();
+const char *get_service_node_name(service_node *node);
+bool is_engine_ready();
 
 /*
  @}
diff --git a/src/server/info_collector.h b/src/server/info_collector.h
index 707f38990..db595b6a9 100644
--- a/src/server/info_collector.h
+++ b/src/server/info_collector.h
@@ -20,7 +20,6 @@
 #pragma once
 
 #include "runtime/task/task_tracker.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/server/info_collector_app.cpp b/src/server/info_collector_app.cpp
index 959a62daa..c04a8faea 100644
--- a/src/server/info_collector_app.cpp
+++ b/src/server/info_collector_app.cpp
@@ -20,7 +20,6 @@
 #include "info_collector_app.h"
 #include "reporter/pegasus_counter_reporter.h"
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/server/test/main.cpp b/src/server/test/main.cpp
index dce80212d..23b0efaab 100644
--- a/src/server/test/main.cpp
+++ b/src/server/test/main.cpp
@@ -18,7 +18,6 @@
  */
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp b/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp
index 39c1cc154..2fcde5fc9 100644
--- a/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp
+++ b/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp
@@ -16,7 +16,6 @@
 // under the License.
 
 #include "client/replication_ddl_client.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_basic.cpp b/src/test/function_test/base_api_test/test_basic.cpp
index 018e3d6b6..b347df538 100644
--- a/src/test/function_test/base_api_test/test_basic.cpp
+++ b/src/test/function_test/base_api_test/test_basic.cpp
@@ -23,7 +23,6 @@
 #include <climits>
 #include <map>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_batch_get.cpp b/src/test/function_test/base_api_test/test_batch_get.cpp
index 064712d90..aca72f97f 100644
--- a/src/test/function_test/base_api_test/test_batch_get.cpp
+++ b/src/test/function_test/base_api_test/test_batch_get.cpp
@@ -22,7 +22,6 @@
 
 #include "base/pegasus_const.h"
 #include "base/pegasus_key_schema.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_check_and_mutate.cpp b/src/test/function_test/base_api_test/test_check_and_mutate.cpp
index 29878f403..8428984de 100644
--- a/src/test/function_test/base_api_test/test_check_and_mutate.cpp
+++ b/src/test/function_test/base_api_test/test_check_and_mutate.cpp
@@ -23,7 +23,6 @@
 #include <climits>
 #include <map>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_check_and_set.cpp b/src/test/function_test/base_api_test/test_check_and_set.cpp
index 56549f32e..dd6e1aead 100644
--- a/src/test/function_test/base_api_test/test_check_and_set.cpp
+++ b/src/test/function_test/base_api_test/test_check_and_set.cpp
@@ -23,7 +23,6 @@
 #include <climits>
 #include <map>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_copy.cpp b/src/test/function_test/base_api_test/test_copy.cpp
index 5145528bb..49e1ec539 100644
--- a/src/test/function_test/base_api_test/test_copy.cpp
+++ b/src/test/function_test/base_api_test/test_copy.cpp
@@ -24,7 +24,6 @@
 
 #include "utils/fmt_logging.h"
 #include "client/replication_ddl_client.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_incr.cpp b/src/test/function_test/base_api_test/test_incr.cpp
index edafe6406..9cdd4e5be 100644
--- a/src/test/function_test/base_api_test/test_incr.cpp
+++ b/src/test/function_test/base_api_test/test_incr.cpp
@@ -23,7 +23,6 @@
 #include <climits>
 #include <map>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_range_read.cpp b/src/test/function_test/base_api_test/test_range_read.cpp
index fb90ae31c..c10e12d70 100644
--- a/src/test/function_test/base_api_test/test_range_read.cpp
+++ b/src/test/function_test/base_api_test/test_range_read.cpp
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_recall.cpp b/src/test/function_test/base_api_test/test_recall.cpp
index f5db3a603..88b7a5101 100644
--- a/src/test/function_test/base_api_test/test_recall.cpp
+++ b/src/test/function_test/base_api_test/test_recall.cpp
@@ -24,7 +24,6 @@
 #include <map>
 #include <boost/lexical_cast.hpp>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/base_api_test/test_scan.cpp b/src/test/function_test/base_api_test/test_scan.cpp
index f5a3c9ddb..39b93387c 100644
--- a/src/test/function_test/base_api_test/test_scan.cpp
+++ b/src/test/function_test/base_api_test/test_scan.cpp
@@ -24,7 +24,6 @@
 #include <iostream>
 
 #include "client/replication_ddl_client.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/bulk_load_test/test_bulk_load.cpp b/src/test/function_test/bulk_load_test/test_bulk_load.cpp
index 20b5c4929..dd55b9f5c 100644
--- a/src/test/function_test/bulk_load_test/test_bulk_load.cpp
+++ b/src/test/function_test/bulk_load_test/test_bulk_load.cpp
@@ -17,7 +17,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp b/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp
index 3660adba7..97812fee2 100644
--- a/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp
+++ b/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp
@@ -19,7 +19,6 @@
 
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/recovery_test/test_recovery.cpp b/src/test/function_test/recovery_test/test_recovery.cpp
index d8e6b56f4..256ae4452 100644
--- a/src/test/function_test/recovery_test/test_recovery.cpp
+++ b/src/test/function_test/recovery_test/test_recovery.cpp
@@ -27,7 +27,6 @@
 #include <fmt/ostream.h>
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/function_test/throttle_test/test_throttle.cpp b/src/test/function_test/throttle_test/test_throttle.cpp
index a08721ce4..b53cbce29 100644
--- a/src/test/function_test/throttle_test/test_throttle.cpp
+++ b/src/test/function_test/throttle_test/test_throttle.cpp
@@ -24,7 +24,6 @@
 #include "include/pegasus/client.h"
 #include <gtest/gtest.h>
 #include "utils/TokenBucket.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/kill_test/data_verifier.cpp b/src/test/kill_test/data_verifier.cpp
index d4b5548f6..68a15c0fe 100644
--- a/src/test/kill_test/data_verifier.cpp
+++ b/src/test/kill_test/data_verifier.cpp
@@ -29,7 +29,6 @@
 #include <memory>
 #include <sys/time.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/test/kill_test/kill_testor.cpp b/src/test/kill_test/kill_testor.cpp
index 022dc684c..6f506b26d 100644
--- a/src/test/kill_test/kill_testor.cpp
+++ b/src/test/kill_test/kill_testor.cpp
@@ -20,7 +20,6 @@
 #include <list>
 
 #include "utils/api_utilities.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/utils/api_utilities.h b/src/utils/api_utilities.h
index 9767a7484..1d6c0026e 100644
--- a/src/utils/api_utilities.h
+++ b/src/utils/api_utilities.h
@@ -31,7 +31,8 @@
 
 #pragma once
 
-#include "common/api_common.h"
+#include <stdarg.h>
+
 #include "ports.h"
 
 /*!
@@ -57,27 +58,27 @@ typedef enum dsn_log_level_t {
 } dsn_log_level_t;
 
 // logs with level smaller than this start_level will not be logged
-extern DSN_API dsn_log_level_t dsn_log_start_level;
-extern DSN_API dsn_log_level_t dsn_log_get_start_level();
-extern DSN_API void dsn_log_set_start_level(dsn_log_level_t level);
-extern DSN_API void dsn_logv(const char *file,
-                             const char *function,
-                             const int line,
-                             dsn_log_level_t log_level,
-                             const char *fmt,
-                             va_list args);
-extern DSN_API void dsn_logf(const char *file,
-                             const char *function,
-                             const int line,
-                             dsn_log_level_t log_level,
-                             const char *fmt,
-                             ...);
-extern DSN_API void dsn_log(const char *file,
-                            const char *function,
-                            const int line,
-                            dsn_log_level_t log_level,
-                            const char *str);
-extern DSN_API void dsn_coredump();
+extern dsn_log_level_t dsn_log_start_level;
+extern dsn_log_level_t dsn_log_get_start_level();
+extern void dsn_log_set_start_level(dsn_log_level_t level);
+extern void dsn_logv(const char *file,
+                     const char *function,
+                     const int line,
+                     dsn_log_level_t log_level,
+                     const char *fmt,
+                     va_list args);
+extern void dsn_logf(const char *file,
+                     const char *function,
+                     const int line,
+                     dsn_log_level_t log_level,
+                     const char *fmt,
+                     ...);
+extern void dsn_log(const char *file,
+                    const char *function,
+                    const int line,
+                    dsn_log_level_t log_level,
+                    const char *str);
+extern void dsn_coredump();
 
 // __FILENAME__ macro comes from the cmake, in which we calculate a filename without path.
 #define dlog(level, ...)                                                                           \
diff --git a/src/utils/clock.cpp b/src/utils/clock.cpp
index 2ad9c0eeb..4df4bd2a5 100644
--- a/src/utils/clock.cpp
+++ b/src/utils/clock.cpp
@@ -18,10 +18,9 @@
 #include "clock.h"
 
 #include "time_utils.h"
-#include "dlib.h"
 #include "smart_pointers.h"
 
-DSN_API uint64_t dsn_now_ns() { return dsn::utils::clock::instance()->now_ns(); }
+uint64_t dsn_now_ns() { return dsn::utils::clock::instance()->now_ns(); }
 
 namespace dsn {
 namespace utils {
diff --git a/src/utils/distributed_lock_service.h b/src/utils/distributed_lock_service.h
index 58470797e..0517f067e 100644
--- a/src/utils/distributed_lock_service.h
+++ b/src/utils/distributed_lock_service.h
@@ -41,7 +41,6 @@
 
 #pragma once
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/utils/dlib.h b/src/utils/dlib.h
deleted file mode 100644
index 851e949e2..000000000
--- a/src/utils/dlib.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 Microsoft Corporation
- *
- * -=- Robust Distributed System Nucleus (rDSN) -=-
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-/*
- * Description:
- *     utilities for dynamic libraries
- *
- * Revision history:
- *     Jul., 2016, @imzhenyu (Zhenyu Guo), first version
- *     xxxx-xx-xx, author, fix bug about xxx
- */
-
-#pragma once
-
-#pragma once
-
-#if defined(DSN_IN_CORE)
-#if defined(_WIN32)
-#define DSN_API __declspec(dllexport)
-#else
-#define DSN_API __attribute__((visibility("default")))
-#endif
-#else
-#if defined(_WIN32)
-#define DSN_API __declspec(dllimport)
-#else
-#define DSN_API
-#endif
-#endif
diff --git a/src/utils/latency_tracer.cpp b/src/utils/latency_tracer.cpp
index 3266d1c88..8cb0d9f2e 100644
--- a/src/utils/latency_tracer.cpp
+++ b/src/utils/latency_tracer.cpp
@@ -17,7 +17,6 @@
 
 #include "utils/latency_tracer.h"
 #include "perf_counter/perf_counters.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/utils/logging.cpp b/src/utils/logging.cpp
index 38c7ebf8c..88ce66c02 100644
--- a/src/utils/logging.cpp
+++ b/src/utils/logging.cpp
@@ -34,7 +34,7 @@
 #include "utils/smart_pointers.h"
 #include "simple_logger.h"
 
-DSN_API dsn_log_level_t dsn_log_start_level = dsn_log_level_t::LOG_LEVEL_DEBUG;
+dsn_log_level_t dsn_log_start_level = dsn_log_level_t::LOG_LEVEL_DEBUG;
 DSN_DEFINE_string("core",
                   logging_start_level,
                   "LOG_LEVEL_DEBUG",
@@ -118,27 +118,27 @@ void dsn_log_init(const std::string &logging_factory_name,
     }
 }
 
-DSN_API dsn_log_level_t dsn_log_get_start_level() { return dsn_log_start_level; }
+dsn_log_level_t dsn_log_get_start_level() { return dsn_log_start_level; }
 
-DSN_API void dsn_log_set_start_level(dsn_log_level_t level) { dsn_log_start_level = level; }
+void dsn_log_set_start_level(dsn_log_level_t level) { dsn_log_start_level = level; }
 
-DSN_API void dsn_logv(const char *file,
-                      const char *function,
-                      const int line,
-                      dsn_log_level_t log_level,
-                      const char *fmt,
-                      va_list args)
+void dsn_logv(const char *file,
+              const char *function,
+              const int line,
+              dsn_log_level_t log_level,
+              const char *fmt,
+              va_list args)
 {
     dsn::logging_provider *logger = dsn::logging_provider::instance();
     logger->dsn_logv(file, function, line, log_level, fmt, args);
 }
 
-DSN_API void dsn_logf(const char *file,
-                      const char *function,
-                      const int line,
-                      dsn_log_level_t log_level,
-                      const char *fmt,
-                      ...)
+void dsn_logf(const char *file,
+              const char *function,
+              const int line,
+              dsn_log_level_t log_level,
+              const char *fmt,
+              ...)
 {
     va_list ap;
     va_start(ap, fmt);
@@ -146,11 +146,11 @@ DSN_API void dsn_logf(const char *file,
     va_end(ap);
 }
 
-DSN_API void dsn_log(const char *file,
-                     const char *function,
-                     const int line,
-                     dsn_log_level_t log_level,
-                     const char *str)
+void dsn_log(const char *file,
+             const char *function,
+             const int line,
+             dsn_log_level_t log_level,
+             const char *str)
 {
     dsn::logging_provider *logger = dsn::logging_provider::instance();
     logger->dsn_log(file, function, line, log_level, str);
diff --git a/src/utils/logging_provider.h b/src/utils/logging_provider.h
index 1357377a3..4c517f2a5 100644
--- a/src/utils/logging_provider.h
+++ b/src/utils/logging_provider.h
@@ -91,9 +91,9 @@ extern std::function<std::string()> log_prefixed_message_func;
 
 namespace tools {
 namespace internal_use_only {
-DSN_API bool register_component_provider(const char *name,
-                                         logging_provider::factory f,
-                                         ::dsn::provider_type type);
+bool register_component_provider(const char *name,
+                                 logging_provider::factory f,
+                                 ::dsn::provider_type type);
 } // namespace internal_use_only
 } // namespace tools
 } // namespace dsn
diff --git a/src/utils/sys_exit_hook.h b/src/utils/sys_exit_hook.h
index 29befb832..ae46fb49e 100644
--- a/src/utils/sys_exit_hook.h
+++ b/src/utils/sys_exit_hook.h
@@ -37,7 +37,7 @@ ENUM_REG(SYS_EXIT_EXCEPTION)
 ENUM_END(sys_exit_type)
 
 namespace tools {
-DSN_API extern join_point<void, sys_exit_type> sys_exit;
+extern join_point<void, sys_exit_type> sys_exit;
 }
 
 } // namespace dsn
diff --git a/src/utils/test/file_utils.cpp b/src/utils/test/file_utils.cpp
index 2ddabc0d6..0a567721a 100644
--- a/src/utils/test/file_utils.cpp
+++ b/src/utils/test/file_utils.cpp
@@ -25,7 +25,6 @@
  */
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp
index 0c1083e0c..874951420 100644
--- a/src/utils/utils.cpp
+++ b/src/utils/utils.cpp
@@ -47,7 +47,6 @@
 #include <memory>
 #include <random>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/zookeeper/test/distributed_lock_zookeeper.cpp b/src/zookeeper/test/distributed_lock_zookeeper.cpp
index 16c4a876f..b55f656e1 100644
--- a/src/zookeeper/test/distributed_lock_zookeeper.cpp
+++ b/src/zookeeper/test/distributed_lock_zookeeper.cpp
@@ -32,7 +32,6 @@
 #include <boost/lexical_cast.hpp>
 #include <gtest/gtest.h>
 
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/zookeeper/test/main.cpp b/src/zookeeper/test/main.cpp
index 87b7739cb..e9a80d00d 100644
--- a/src/zookeeper/test/main.cpp
+++ b/src/zookeeper/test/main.cpp
@@ -32,7 +32,6 @@
 #endif
 
 #include <gtest/gtest.h>
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"
diff --git a/src/zookeeper/zookeeper_session_mgr.h b/src/zookeeper/zookeeper_session_mgr.h
index d6df0e062..83e130bfb 100644
--- a/src/zookeeper/zookeeper_session_mgr.h
+++ b/src/zookeeper/zookeeper_session_mgr.h
@@ -34,7 +34,6 @@
  */
 
 #include "utils/singleton_store.h"
-#include "common/api_common.h"
 #include "runtime/api_task.h"
 #include "runtime/api_layer1.h"
 #include "runtime/app_model.h"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pegasus.apache.org
For additional commands, e-mail: commits-help@pegasus.apache.org