Merge branch '3.0' of https://github.com/taosdata/TDengine into refact/submit_req
This commit is contained in:
commit
86b0dc98c3
|
@ -2,7 +2,7 @@
|
||||||
# taos-tools
|
# taos-tools
|
||||||
ExternalProject_Add(taos-tools
|
ExternalProject_Add(taos-tools
|
||||||
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
|
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
|
||||||
GIT_TAG b103d9b
|
GIT_TAG 5445810
|
||||||
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
|
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
|
||||||
BINARY_DIR ""
|
BINARY_DIR ""
|
||||||
#BUILD_IN_SOURCE TRUE
|
#BUILD_IN_SOURCE TRUE
|
||||||
|
|
|
@ -217,15 +217,10 @@ void taosArrayClear(SArray* pArray);
|
||||||
*/
|
*/
|
||||||
void taosArrayClearEx(SArray* pArray, void (*fp)(void*));
|
void taosArrayClearEx(SArray* pArray, void (*fp)(void*));
|
||||||
|
|
||||||
/**
|
|
||||||
* clear the array (remove all element)
|
|
||||||
* @param pArray
|
|
||||||
* @param fp
|
|
||||||
*/
|
|
||||||
void taosArrayClearP(SArray* pArray, FDelete fp);
|
|
||||||
|
|
||||||
void* taosArrayDestroy(SArray* pArray);
|
void* taosArrayDestroy(SArray* pArray);
|
||||||
|
|
||||||
void taosArrayDestroyP(SArray* pArray, FDelete fp);
|
void taosArrayDestroyP(SArray* pArray, FDelete fp);
|
||||||
|
|
||||||
void taosArrayDestroyEx(SArray* pArray, FDelete fp);
|
void taosArrayDestroyEx(SArray* pArray, FDelete fp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -235,12 +230,6 @@ void taosArrayDestroyEx(SArray* pArray, FDelete fp);
|
||||||
*/
|
*/
|
||||||
void taosArraySort(SArray* pArray, __compar_fn_t comparFn);
|
void taosArraySort(SArray* pArray, __compar_fn_t comparFn);
|
||||||
|
|
||||||
/**
|
|
||||||
* sort string array
|
|
||||||
* @param pArray
|
|
||||||
*/
|
|
||||||
void taosArraySortString(SArray* pArray, __compar_fn_t comparFn);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* search the array
|
* search the array
|
||||||
* @param pArray
|
* @param pArray
|
||||||
|
|
|
@ -538,7 +538,7 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
|
||||||
|
|
||||||
int32_t code = -1;
|
int32_t code = -1;
|
||||||
SArray *newSub = subscribe.topicNames;
|
SArray *newSub = subscribe.topicNames;
|
||||||
taosArraySortString(newSub, taosArrayCompareString);
|
taosArraySort(newSub, taosArrayCompareString);
|
||||||
taosArrayRemoveDuplicateP(newSub, taosArrayCompareString, taosMemoryFree);
|
taosArrayRemoveDuplicateP(newSub, taosArrayCompareString, taosMemoryFree);
|
||||||
|
|
||||||
int32_t newTopicNum = taosArrayGetSize(newSub);
|
int32_t newTopicNum = taosArrayGetSize(newSub);
|
||||||
|
@ -850,7 +850,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
||||||
|
|
||||||
// add to current topic
|
// add to current topic
|
||||||
taosArrayPush(pOldConsumer->currentTopics, &addedTopic);
|
taosArrayPush(pOldConsumer->currentTopics, &addedTopic);
|
||||||
taosArraySortString(pOldConsumer->currentTopics, taosArrayCompareString);
|
taosArraySort(pOldConsumer->currentTopics, taosArrayCompareString);
|
||||||
|
|
||||||
// set status
|
// set status
|
||||||
if (taosArrayGetSize(pOldConsumer->rebNewTopics) == 0 && taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0) {
|
if (taosArrayGetSize(pOldConsumer->rebNewTopics) == 0 && taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0) {
|
||||||
if (pOldConsumer->status == MQ_CONSUMER_STATUS__MODIFY ||
|
if (pOldConsumer->status == MQ_CONSUMER_STATUS__MODIFY ||
|
||||||
|
|
|
@ -2542,6 +2542,7 @@ int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, STsdbReader*
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: opt the perf of read del index
|
||||||
code = tsdbReadDelIdx(pDelFReader, aDelIdx);
|
code = tsdbReadDelIdx(pDelFReader, aDelIdx);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
taosArrayDestroy(aDelIdx);
|
taosArrayDestroy(aDelIdx);
|
||||||
|
|
|
@ -44,6 +44,11 @@ static void windowSBfAdd(SUpdateInfo *pInfo, uint64_t count) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void clearItemHelper(void* p) {
|
||||||
|
SScalableBf** pBf = p;
|
||||||
|
tScalableBfDestroy(*pBf);
|
||||||
|
}
|
||||||
|
|
||||||
static void windowSBfDelete(SUpdateInfo *pInfo, uint64_t count) {
|
static void windowSBfDelete(SUpdateInfo *pInfo, uint64_t count) {
|
||||||
if (count < pInfo->numSBFs) {
|
if (count < pInfo->numSBFs) {
|
||||||
for (uint64_t i = 0; i < count; ++i) {
|
for (uint64_t i = 0; i < count; ++i) {
|
||||||
|
@ -52,7 +57,7 @@ static void windowSBfDelete(SUpdateInfo *pInfo, uint64_t count) {
|
||||||
taosArrayRemove(pInfo->pTsSBFs, 0);
|
taosArrayRemove(pInfo->pTsSBFs, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
taosArrayClearP(pInfo->pTsSBFs, (FDelete)tScalableBfDestroy);
|
taosArrayClearEx(pInfo->pTsSBFs, clearItemHelper);
|
||||||
}
|
}
|
||||||
pInfo->minTS += pInfo->interval * count;
|
pInfo->minTS += pInfo->interval * count;
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,9 +415,7 @@ void taosArrayDestroyEx(SArray* pArray, FDelete fp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void taosArraySort(SArray* pArray, __compar_fn_t compar) {
|
void taosArraySort(SArray* pArray, __compar_fn_t compar) {
|
||||||
assert(pArray != NULL);
|
ASSERT(pArray != NULL && compar != NULL);
|
||||||
assert(compar != NULL);
|
|
||||||
|
|
||||||
taosSort(pArray->pData, pArray->size, pArray->elemSize, compar);
|
taosSort(pArray->pData, pArray->size, pArray->elemSize, compar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,11 +431,6 @@ int32_t taosArraySearchIdx(const SArray* pArray, const void* key, __compar_fn_t
|
||||||
return item == NULL ? -1 : (int32_t)((char*)item - (char*)pArray->pData) / pArray->elemSize;
|
return item == NULL ? -1 : (int32_t)((char*)item - (char*)pArray->pData) / pArray->elemSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void taosArraySortString(SArray* pArray, __compar_fn_t comparFn) {
|
|
||||||
assert(pArray != NULL);
|
|
||||||
taosSort(pArray->pData, pArray->size, pArray->elemSize, comparFn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int32_t taosArrayPartition(SArray* pArray, int32_t i, int32_t j, __ext_compar_fn_t fn, const void* userData) {
|
static int32_t taosArrayPartition(SArray* pArray, int32_t i, int32_t j, __ext_compar_fn_t fn, const void* userData) {
|
||||||
void* key = taosArrayGetP(pArray, i);
|
void* key = taosArrayGetP(pArray, i);
|
||||||
while (i < j) {
|
while (i < j) {
|
||||||
|
|
Loading…
Reference in New Issue