Explorar el Código

async-conn: rename from async-connector. (#122)

Yang Shuang hace 1 año
padre
commit
7fc26e168d

+ 1 - 1
.github/workflows/build-and-test.yml

@@ -45,7 +45,7 @@ jobs:
           cp build/src/core/dtcd dockerfiles/devel/
           cp build/src/agent/dtcagent dockerfiles/devel/
           cp build/src/agent-watchdog/agent-watchdog dockerfiles/devel/
-          cp build/src/complex/async-connector dockerfiles/devel/
+          cp build/src/complex/async-conn dockerfiles/devel/
           cp build/src/connector/connector dockerfiles/devel/
           cp build/src/data_lifecycle/data-lifecycle-manager dockerfiles/devel/
           cp build/src/hwcserver/hwcserver dockerfiles/devel/

+ 1 - 1
.github/workflows/release.yml

@@ -45,7 +45,7 @@ jobs:
           mkdir dtc/stat
           cp src/agent/dtcagent dtc/bin/
           cp src/agent-watchdog/agent-watchdog dtc/bin/
-          cp src/complex/async-connector dtc/bin/
+          cp src/complex/async-conn dtc/bin/
           cp src/connector/connector dtc/bin/
           cp src/core/dtcd dtc/bin/
           cp src/data_lifecycle/data-lifecycle-manager dtc/bin/

+ 2 - 2
dockerfiles/devel/dockerfile

@@ -16,7 +16,7 @@ RUN mkdir -p $logpath
 COPY dtcd $binpath/dtcd
 COPY dtcagent $binpath/dtcagent
 COPY agent-watchdog $binpath/agent-watchdog
-COPY async-connector $binpath/async-connector
+COPY async-conn $binpath/async-conn
 COPY connector $binpath/connector
 COPY data-lifecycle-manager $binpath/data-lifecycle-manager
 COPY hwcserver $binpath/hwcserver
@@ -43,7 +43,7 @@ RUN chmod +x $binpath/dtcagent
 RUN chmod +x $binpath/connector
 RUN chmod +x $basepath/run.sh
 RUN chmod +x $binpath/conf-gen-utils
-RUN chmod +x $binpath/async-connector
+RUN chmod +x $binpath/async-conn
 RUN chmod +x $binpath/hwcserver
 
 ENV LD_LIBRARY_PATH=:/usr/local/lib

+ 1 - 1
docs/quickstart.md

@@ -93,7 +93,7 @@ chmod +x *
   -a, --agent                           : load agent module
   -c, --core                            : load dtc core module
   -l, --data-lifecycle                  : load data-lifecycle module
-  -y, --async-connector                 : load async-connector module
+  -y, --async-conn                 : load async-conn module
   -s, --sharding                        : load sharding module
   -r, --recovery mode                   : auto restart when crashed
 ```

+ 2 - 2
script/agent.sh

@@ -7,13 +7,13 @@ DTC_BIN="agent-watchdog"
 if [ "$1" = "stop" ] ; then
     pkill -9 $DTC_BIN
     pkill -9 dtcagent
-    pkill -9 async-connector
+    pkill -9 async-conn
     pkill -9 data-lifecycle
     ../sharding/bin/stop.sh
 elif [ "$1" = "restart" ]; then
     pkill -9 $DTC_BIN
     pkill -9 dtcagent
-    pkill -9 async-connector
+    pkill -9 async-conn
     pkill -9 data-lifecycle
     ../sharding/bin/stop.sh
     sleep 2

+ 1 - 1
src/agent-watchdog/async_conn_entry.cc

@@ -19,7 +19,7 @@
 #include "log.h"
 
 #define ROOT_PATH "../conf/"
-const char *fulldata_name = "async-connector";
+const char *fulldata_name = "async-conn";
 extern std::map<std::string, std::string> map_dtc_conf; //key:value --> dtc addr:conf file name
 
 AsyncConnEntry::AsyncConnEntry(WatchDog *watchdog, int sec)

+ 2 - 2
src/agent-watchdog/main.cc

@@ -47,7 +47,7 @@ static struct option long_options[] = {
 		{ "version", no_argument, NULL, 'v' },
 		{ "data-lifecycle", no_argument, NULL,'l' },
 		{ "agent", no_argument, NULL,'a' },
-		{ "async-connector", no_argument, NULL,'y' },
+		{ "async-conn", no_argument, NULL,'y' },
 		{ "sharding", no_argument, NULL,'s' },
 		{ "recovery", no_argument, NULL,'r' },
 		{ "core", no_argument, NULL,'c' },
@@ -112,7 +112,7 @@ static void show_usage(void) {
 	printf("  -a, --agent        			: load agent module\n");
 	printf("  -c, --core        			: load dtc core module\n");
 	printf("  -l, --data-lifecycle			: load data-lifecycle module\n");
-	printf("  -y, --async-connector			: load async-connector module\n");
+	printf("  -y, --async-conn			: load async-conn module\n");
 	printf("  -s, --sharding      			: load sharding module\n");
 	printf("  -r, --recovery mode  			: auto restart when crashed\n");
 

+ 3 - 3
src/complex/CMakeLists.txt

@@ -32,8 +32,8 @@ ADD_DEFINITIONS("-g -rdynamic -fPIC -D_CORE_ -fpermissive -std=gnu++11 -D_GLIBCX
 ADD_DEFINITIONS(-Wno-builtin-macro-redefined)
 
 #编译为.so/.a
-ADD_EXECUTABLE(async-connector ${SRC_LIST})
+ADD_EXECUTABLE(async-conn ${SRC_LIST})
 
 #将目标文件与库文件链接
-TARGET_LINK_LIBRARIES(async-connector libsqlparser.a liblog4cplus.a libyaml-cpp.a libnet.a libmysqlclient.a)
-redefine_file_macro(async-connector)
+TARGET_LINK_LIBRARIES(async-conn libsqlparser.a liblog4cplus.a libyaml-cpp.a libnet.a libmysqlclient.a)
+redefine_file_macro(async-conn)

+ 1 - 1
src/complex/global.h

@@ -14,7 +14,7 @@
 #include "waitqueue.h"
 #include "task_request.h"
 
-#define DEF_PID_FILE "async-connector.pid"
+#define DEF_PID_FILE "async-conn.pid"
 
 using namespace std;
 

+ 5 - 5
src/complex/main.cc

@@ -37,7 +37,7 @@ std::string conf_path = "../dtc.yaml";
 
 static int start_main_thread()
 {
-	workerThread = new PollerBase("async-connector");
+	workerThread = new PollerBase("async-conn");
 	if (workerThread->InitializeThread () == -1)
 		return -1;
 
@@ -177,7 +177,7 @@ int main(int argc, char* argv[])
 	int ret = 0;
 
 	init_log4cplus();
-	log4cplus_info("async-connector main entry.");
+	log4cplus_info("async-conn main entry.");
 
 	if(argc == 2)
 	{
@@ -213,17 +213,17 @@ int main(int argc, char* argv[])
 
     start_main_thread();
 
-    log4cplus_info("async-connector main running.");
+    log4cplus_info("async-conn main running.");
     while(!context.stop_flag){
     	sleep(10);
     }
-    log4cplus_info("async-connector main stoping.");
+    log4cplus_info("async-conn main stoping.");
 	
 	stop_main_thread();
 
 	cm_delete_pid();
 
-	log4cplus_info("async-connector main end.");
+	log4cplus_info("async-conn main end.");
 
     return ret;
 }

+ 2 - 2
src/complex/net_server.cc

@@ -27,7 +27,7 @@ CNetServerProcess::~CNetServerProcess()
 
 void CNetServerProcess::TaskNotify(CTaskRequest * cur)
 {
-    log4cplus_debug("async-connector: packet receiving.");
+    log4cplus_debug("async-conn: packet receiving.");
     //there is a race condition here:
     //curr may be deleted during process (in task->ReplyNotify())
 	CTransactionGroup* group = NULL;
@@ -39,7 +39,7 @@ void CNetServerProcess::TaskNotify(CTaskRequest * cur)
 
 	//TODO: Parsing input, adapting thread groups.
 	level = request->get_db_layer_level();
-	log4cplus_debug("async-connector: packet db layer:%d.", level);
+	log4cplus_debug("async-conn: packet db layer:%d.", level);
 	if(level == 3)
 		group = FullDBGroup;
 	else if(level == 2)

+ 2 - 2
src/complex/transaction_task.cc

@@ -849,7 +849,7 @@ int TransactionTask::request_db_query(std::string request_sql, CTaskRequest *req
 }
 
 int TransactionTask::Process(CTaskRequest *request) {
-	log4cplus_debug("async-connector: pop task process begin.");
+	log4cplus_debug("async-conn: pop task process begin.");
 
 	string request_sql = request->parse_request_sql();
 	log4cplus_debug("pop sql: len:%d,  %s", request_sql.length(), request_sql.c_str());
@@ -864,6 +864,6 @@ int TransactionTask::Process(CTaskRequest *request) {
 
 	int ret = request_db_query(request_sql, request);
 
-	log4cplus_debug("async-connector: pop task process end.");
+	log4cplus_debug("async-conn: pop task process end.");
 	return 0;
 }