remove unused code
This commit is contained in:
parent
cc027f96a2
commit
57c1796e55
|
@ -151,7 +151,6 @@ typedef struct SCliThrd {
|
||||||
TdThreadMutex msgMtx;
|
TdThreadMutex msgMtx;
|
||||||
SDelayQueue* delayQueue;
|
SDelayQueue* delayQueue;
|
||||||
SDelayQueue* timeoutQueue;
|
SDelayQueue* timeoutQueue;
|
||||||
SDelayQueue* waitConnQueue;
|
|
||||||
uint64_t nextTimeout; // next timeout
|
uint64_t nextTimeout; // next timeout
|
||||||
STrans* pInst; //
|
STrans* pInst; //
|
||||||
|
|
||||||
|
@ -159,8 +158,6 @@ typedef struct SCliThrd {
|
||||||
SHashObj* fqdn2ipCache;
|
SHashObj* fqdn2ipCache;
|
||||||
SCvtAddr* pCvtAddr;
|
SCvtAddr* pCvtAddr;
|
||||||
|
|
||||||
SHashObj* failFastCache;
|
|
||||||
SHashObj* batchCache;
|
|
||||||
SHashObj* connHeapCache;
|
SHashObj* connHeapCache;
|
||||||
|
|
||||||
SCliReq* stopMsg;
|
SCliReq* stopMsg;
|
||||||
|
@ -2355,10 +2352,6 @@ static int32_t createThrdObj(void* trans, SCliThrd** ppThrd) {
|
||||||
TAOS_CHECK_GOTO(code, NULL, _end);
|
TAOS_CHECK_GOTO(code, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((code = transDQCreate(pThrd->loop, &pThrd->waitConnQueue)) != 0) {
|
|
||||||
TAOS_CHECK_GOTO(code, NULL, _end);
|
|
||||||
}
|
|
||||||
|
|
||||||
pThrd->destroyAhandleFp = pInst->destroyFp;
|
pThrd->destroyAhandleFp = pInst->destroyFp;
|
||||||
|
|
||||||
pThrd->fqdn2ipCache = taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
pThrd->fqdn2ipCache = taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||||
|
@ -2366,11 +2359,6 @@ static int32_t createThrdObj(void* trans, SCliThrd** ppThrd) {
|
||||||
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
pThrd->batchCache = taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
|
||||||
if (pThrd->batchCache == NULL) {
|
|
||||||
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
|
||||||
}
|
|
||||||
|
|
||||||
pThrd->connHeapCache = taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
pThrd->connHeapCache = taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||||
if (pThrd->connHeapCache == NULL) {
|
if (pThrd->connHeapCache == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
||||||
|
@ -2414,10 +2402,7 @@ _end:
|
||||||
|
|
||||||
transDQDestroy(pThrd->delayQueue, NULL);
|
transDQDestroy(pThrd->delayQueue, NULL);
|
||||||
transDQDestroy(pThrd->timeoutQueue, NULL);
|
transDQDestroy(pThrd->timeoutQueue, NULL);
|
||||||
transDQDestroy(pThrd->waitConnQueue, NULL);
|
|
||||||
taosHashCleanup(pThrd->fqdn2ipCache);
|
taosHashCleanup(pThrd->fqdn2ipCache);
|
||||||
taosHashCleanup(pThrd->failFastCache);
|
|
||||||
taosHashCleanup(pThrd->batchCache);
|
|
||||||
taosHashCleanup(pThrd->pIdConnTable);
|
taosHashCleanup(pThrd->pIdConnTable);
|
||||||
taosArrayDestroy(pThrd->pQIdBuf);
|
taosArrayDestroy(pThrd->pQIdBuf);
|
||||||
|
|
||||||
|
@ -2441,7 +2426,6 @@ static void destroyThrdObj(SCliThrd* pThrd) {
|
||||||
|
|
||||||
transDQDestroy(pThrd->delayQueue, destroyReqAndAhanlde);
|
transDQDestroy(pThrd->delayQueue, destroyReqAndAhanlde);
|
||||||
transDQDestroy(pThrd->timeoutQueue, NULL);
|
transDQDestroy(pThrd->timeoutQueue, NULL);
|
||||||
transDQDestroy(pThrd->waitConnQueue, NULL);
|
|
||||||
|
|
||||||
tDebug("thread destroy %" PRId64, pThrd->pid);
|
tDebug("thread destroy %" PRId64, pThrd->pid);
|
||||||
for (int i = 0; i < taosArrayGetSize(pThrd->timerList); i++) {
|
for (int i = 0; i < taosArrayGetSize(pThrd->timerList); i++) {
|
||||||
|
@ -2453,24 +2437,6 @@ static void destroyThrdObj(SCliThrd* pThrd) {
|
||||||
taosMemoryFree(pThrd->loop);
|
taosMemoryFree(pThrd->loop);
|
||||||
taosHashCleanup(pThrd->fqdn2ipCache);
|
taosHashCleanup(pThrd->fqdn2ipCache);
|
||||||
|
|
||||||
void** pIter = taosHashIterate(pThrd->batchCache, NULL);
|
|
||||||
while (pIter != NULL) {
|
|
||||||
SCliBatchList* pBatchList = (SCliBatchList*)(*pIter);
|
|
||||||
while (!QUEUE_IS_EMPTY(&pBatchList->wq)) {
|
|
||||||
queue* h = QUEUE_HEAD(&pBatchList->wq);
|
|
||||||
QUEUE_REMOVE(h);
|
|
||||||
|
|
||||||
SCliBatch* pBatch = QUEUE_DATA(h, SCliBatch, listq);
|
|
||||||
cliDestroyBatch(pBatch);
|
|
||||||
}
|
|
||||||
taosMemoryFree(pBatchList->ip);
|
|
||||||
taosMemoryFree(pBatchList->dst);
|
|
||||||
taosMemoryFree(pBatchList);
|
|
||||||
|
|
||||||
pIter = (void**)taosHashIterate(pThrd->batchCache, pIter);
|
|
||||||
}
|
|
||||||
taosHashCleanup(pThrd->batchCache);
|
|
||||||
|
|
||||||
void* pIter2 = taosHashIterate(pThrd->connHeapCache, NULL);
|
void* pIter2 = taosHashIterate(pThrd->connHeapCache, NULL);
|
||||||
while (pIter2 != NULL) {
|
while (pIter2 != NULL) {
|
||||||
SHeap* heap = (SHeap*)(pIter2);
|
SHeap* heap = (SHeap*)(pIter2);
|
||||||
|
|
Loading…
Reference in New Issue