From 507ee7c3c7719454c22215354ba0248e62749908 Mon Sep 17 00:00:00 2001 From: slguan Date: Wed, 20 Nov 2019 19:36:35 +0800 Subject: [PATCH] [TBASE-1129] --- src/inc/tstatus.h | 12 ------------ src/os/linux/src/tlinux.c | 6 ++++-- src/util/src/tstatus.c | 17 ----------------- src/util/src/tutil.c | 2 +- 4 files changed, 5 insertions(+), 32 deletions(-) diff --git a/src/inc/tstatus.h b/src/inc/tstatus.h index 0f9bea5ae5..18900d3b29 100644 --- a/src/inc/tstatus.h +++ b/src/inc/tstatus.h @@ -73,23 +73,11 @@ enum _TSDB_VG_LB_STATUS { TSDB_VG_LB_STATUS_UPDATE }; -enum _TSDB_LB_TYPE { - TSDB_LB_TYPE_SCHEDULE, - TSDB_LB_TYPE_SOON, -}; - -enum _TSDB_LB_REASON { - TSDB_LB_REASON_PERIOD, - TSDB_LB_REASON_EVENT, -}; - const char* taosGetVnodeStatusStr(int vnodeStatus); const char* taosGetVnodeSyncStatusStr(int vnodeSyncStatus); const char* taosGetVnodeDropStatusStr(int dropping); const char* taosGetDnodeStatusStr(int dnodeStatus); const char* taosGetDnodeLbStatusStr(int dnodeBalanceStatus); -const char* taosGetBalanceTypeStr(int type); -const char* taosBalanceReasonStr(int reason); const char* taosGetVgroupLbStatusStr(int vglbStatus); #ifdef __cplusplus diff --git a/src/os/linux/src/tlinux.c b/src/os/linux/src/tlinux.c index 6a7225b476..c4d9425b40 100644 --- a/src/os/linux/src/tlinux.c +++ b/src/os/linux/src/tlinux.c @@ -287,8 +287,10 @@ ssize_t tsendfile(int dfd, int sfd, off_t *offset, size_t size) { ssize_t sentbytes; while (leftbytes > 0) { - // TODO : Think to check if file is larger than 1GB - if (leftbytes > 1000000000) leftbytes = 1000000000; + /* + * TODO : Think to check if file is larger than 1GB + */ + //if (leftbytes > 1000000000) leftbytes = 1000000000; sentbytes = sendfile(dfd, sfd, offset, leftbytes); if (sentbytes == -1) { if (errno == EINTR) { diff --git a/src/util/src/tstatus.c b/src/util/src/tstatus.c index 4e3141b13b..f38655ac45 100644 --- a/src/util/src/tstatus.c +++ b/src/util/src/tstatus.c @@ -73,20 +73,3 @@ const char* taosGetVgroupLbStatusStr(int vglbStatus) { default: return "undefined"; } } - -const char* taosGetBalanceTypeStr(int type) { - switch (type) { - case TSDB_LB_TYPE_SCHEDULE: return "schedule"; - case TSDB_LB_TYPE_SOON: return "soon"; - default: return "undefined"; - } -} - -const char* taosBalanceReasonStr(int reason) { - switch (reason) { - case TSDB_LB_REASON_PERIOD: return "period"; - case TSDB_LB_REASON_EVENT: return "event"; - default: return "undefined"; - } -} - diff --git a/src/util/src/tutil.c b/src/util/src/tutil.c index 8413294bcc..e0dcb0aa3f 100644 --- a/src/util/src/tutil.c +++ b/src/util/src/tutil.c @@ -490,7 +490,7 @@ char *taosIpStr(uint32_t ipInt) { static int ipStrIndex = 0; char *ipStr = ipStrArray[(ipStrIndex++) % 3]; - sprintf(ipStr, "0x%x:%d.%d.%d.%d", ipInt, ipInt & 0xFF, (ipInt >> 8) & 0xFF, (ipInt >> 16) & 0xFF, ipInt >> 24); + sprintf(ipStr, "0x%x:%u.%u.%u.%u", ipInt, ipInt & 0xFF, (ipInt >> 8) & 0xFF, (ipInt >> 16) & 0xFF, (uint8_t)(ipInt >> 24)); return ipStr; } -- GitLab