more code format
This commit is contained in:
parent
d5255f1eb7
commit
63d9b85631
|
@ -48,7 +48,7 @@ double sifLeftVd = 21.0, sifRightVd = 10.0;
|
|||
void sifFreeDataBlock(void *block) { blockDataDestroy(*(SSDataBlock **)block); }
|
||||
|
||||
void sifInitLogFile() {
|
||||
const char * defaultLogFileNamePrefix = "taoslog";
|
||||
const char *defaultLogFileNamePrefix = "taoslog";
|
||||
const int32_t maxLogFileNum = 10;
|
||||
|
||||
tsAsyncLog = 0;
|
||||
|
@ -96,7 +96,7 @@ void sifAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t *sl
|
|||
}
|
||||
|
||||
void sifMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
|
||||
SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_VALUE);
|
||||
SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_VALUE);
|
||||
SValueNode *vnode = (SValueNode *)node;
|
||||
vnode->node.resType.type = dataType;
|
||||
|
||||
|
@ -113,7 +113,7 @@ void sifMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
|
|||
}
|
||||
|
||||
void sifMakeColumnNode(SNode **pNode, const char *db, const char *colName, EColumnType colType, uint8_t colValType) {
|
||||
SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_COLUMN);
|
||||
SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_COLUMN);
|
||||
SColumnNode *rnode = (SColumnNode *)node;
|
||||
memcpy(rnode->dbName, db, strlen(db));
|
||||
memcpy(rnode->colName, colName, strlen(colName));
|
||||
|
@ -125,7 +125,7 @@ void sifMakeColumnNode(SNode **pNode, const char *db, const char *colName, EColu
|
|||
}
|
||||
|
||||
void sifMakeOpNode(SNode **pNode, EOperatorType opType, int32_t resType, SNode *pLeft, SNode *pRight) {
|
||||
SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_OPERATOR);
|
||||
SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_OPERATOR);
|
||||
SOperatorNode *onode = (SOperatorNode *)node;
|
||||
onode->node.resType.type = resType;
|
||||
onode->node.resType.bytes = tDataTypes[resType].bytes;
|
||||
|
@ -138,7 +138,7 @@ void sifMakeOpNode(SNode **pNode, EOperatorType opType, int32_t resType, SNode *
|
|||
}
|
||||
|
||||
void sifMakeListNode(SNode **pNode, SNodeList *list, int32_t resType) {
|
||||
SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_NODE_LIST);
|
||||
SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_NODE_LIST);
|
||||
SNodeListNode *lnode = (SNodeListNode *)node;
|
||||
lnode->dataType.type = resType;
|
||||
lnode->pNodeList = list;
|
||||
|
@ -147,7 +147,7 @@ void sifMakeListNode(SNode **pNode, SNodeList *list, int32_t resType) {
|
|||
}
|
||||
|
||||
void sifMakeLogicNode(SNode **pNode, ELogicConditionType opType, SNode **nodeList, int32_t nodeNum) {
|
||||
SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_LOGIC_CONDITION);
|
||||
SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_LOGIC_CONDITION);
|
||||
SLogicConditionNode *onode = (SLogicConditionNode *)node;
|
||||
onode->condType = opType;
|
||||
onode->node.resType.type = TSDB_DATA_TYPE_BOOL;
|
||||
|
@ -162,7 +162,7 @@ void sifMakeLogicNode(SNode **pNode, ELogicConditionType opType, SNode **nodeLis
|
|||
}
|
||||
|
||||
void sifMakeTargetNode(SNode **pNode, int16_t dataBlockId, int16_t slotId, SNode *snode) {
|
||||
SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_TARGET);
|
||||
SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_TARGET);
|
||||
STargetNode *onode = (STargetNode *)node;
|
||||
onode->pExpr = snode;
|
||||
onode->dataBlockId = dataBlockId;
|
||||
|
|
|
@ -556,7 +556,7 @@ void monSendReport() {
|
|||
|
||||
char *pCont = tjsonToString(pMonitor->pJson);
|
||||
// uDebugL("report cont:%s\n", pCont);
|
||||
if (pCont != NULL) {
|
||||
if (pCont != NULL) {
|
||||
EHttpCompFlag flag = tsMonitor.cfg.comp ? HTTP_GZIP : HTTP_FLAT;
|
||||
if (taosSendHttpReport(tsMonitor.cfg.server, tsMonitor.cfg.port, pCont, strlen(pCont), flag) != 0) {
|
||||
uError("failed to send monitor msg");
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
#include "catalog.h"
|
||||
#include "os.h"
|
||||
#include "query.h"
|
||||
#include "tname.h"
|
||||
#include "ttypes.h"
|
||||
#include "query.h"
|
||||
|
||||
#define IS_DATA_COL_ORDERED(spd) ((spd->orderStatus) == (int8_t)ORDER_STATUS_ORDERED)
|
||||
|
||||
|
|
|
@ -174,13 +174,14 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) {
|
|||
if (res == TSDB_CODE_SUCCESS) {
|
||||
return false;
|
||||
} else {
|
||||
qDebug("===stream===Update close window sbf. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId,
|
||||
maxTs, *pMapMaxTs, ts);
|
||||
qDebug("===stream===Update close window sbf. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64
|
||||
", ts:%" PRIu64,
|
||||
tableId, maxTs, *pMapMaxTs, ts);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
qDebug("===stream===Update close window. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId,
|
||||
maxTs, *pMapMaxTs, ts);
|
||||
qDebug("===stream===Update close window. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64,
|
||||
tableId, maxTs, *pMapMaxTs, ts);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -202,8 +203,8 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) {
|
|||
}
|
||||
|
||||
if (ts < pInfo->minTS) {
|
||||
qDebug("===stream===Update min ts. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId,
|
||||
maxTs, *pMapMaxTs, ts);
|
||||
qDebug("===stream===Update min ts. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64,
|
||||
tableId, maxTs, *pMapMaxTs, ts);
|
||||
return true;
|
||||
} else if (res == TSDB_CODE_SUCCESS) {
|
||||
return false;
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
#include "ttime.h"
|
||||
|
||||
using namespace std;
|
||||
#define MAX_NUM_SCALABLE_BF 100000
|
||||
#define MAX_NUM_SCALABLE_BF 100000
|
||||
|
||||
bool equalSBF(SScalableBf* left, SScalableBf* right) {
|
||||
bool equalSBF(SScalableBf *left, SScalableBf *right) {
|
||||
if (left->growth != right->growth) return false;
|
||||
if (left->numBits != right->numBits) return false;
|
||||
int lsize = taosArrayGetSize(left->bfArray);
|
||||
int rsize = taosArrayGetSize(right->bfArray);
|
||||
if (lsize != rsize) return false;
|
||||
for (int32_t i = 0; i < lsize; i++) {
|
||||
SBloomFilter* pLeftBF = (SBloomFilter*)taosArrayGetP(left->bfArray, i);
|
||||
SBloomFilter* pRightBF = (SBloomFilter*)taosArrayGetP(right->bfArray, i);
|
||||
SBloomFilter *pLeftBF = (SBloomFilter *)taosArrayGetP(left->bfArray, i);
|
||||
SBloomFilter *pRightBF = (SBloomFilter *)taosArrayGetP(right->bfArray, i);
|
||||
if (pLeftBF->errorRate != pRightBF->errorRate) return false;
|
||||
if (pLeftBF->expectedEntries != pRightBF->expectedEntries) return false;
|
||||
if (pLeftBF->hashFn1 != pRightBF->hashFn1) return false;
|
||||
|
@ -23,8 +23,8 @@ bool equalSBF(SScalableBf* left, SScalableBf* right) {
|
|||
if (pLeftBF->numBits != pRightBF->numBits) return false;
|
||||
if (pLeftBF->numUnits != pRightBF->numUnits) return false;
|
||||
if (pLeftBF->size != pRightBF->size) return false;
|
||||
uint64_t* leftUint = (uint64_t*) pLeftBF->buffer;
|
||||
uint64_t* rightUint = (uint64_t*) pRightBF->buffer;
|
||||
uint64_t *leftUint = (uint64_t *)pLeftBF->buffer;
|
||||
uint64_t *rightUint = (uint64_t *)pRightBF->buffer;
|
||||
for (int32_t j = 0; j < pLeftBF->numUnits; j++) {
|
||||
if (leftUint[j] != rightUint[j]) return false;
|
||||
}
|
||||
|
@ -35,86 +35,86 @@ bool equalSBF(SScalableBf* left, SScalableBf* right) {
|
|||
TEST(TD_STREAM_UPDATE_TEST, update) {
|
||||
const int64_t interval = 20 * 1000;
|
||||
const int64_t watermark = 10 * 60 * 1000;
|
||||
SUpdateInfo *pSU = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,1, 0), false);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,1, -1), true);
|
||||
SUpdateInfo *pSU = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, 1, 0), false);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, 1, -1), true);
|
||||
|
||||
for(int i=0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 1), false);
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 1), false);
|
||||
}
|
||||
for(int i=0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 1), true);
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 1), true);
|
||||
}
|
||||
|
||||
for(int i=0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 2), false);
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 2), false);
|
||||
}
|
||||
for(int i=0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 2), true);
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 2), true);
|
||||
}
|
||||
|
||||
for(int i=0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 1), true);
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 1), true);
|
||||
}
|
||||
|
||||
TSKEY uid = 0;
|
||||
for(int i=3; i < 1024; i++) {
|
||||
for (int i = 3; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, uid, i), false);
|
||||
}
|
||||
GTEST_ASSERT_EQ(*(TSKEY*)taosHashGet(pSU->pMap, &uid, sizeof(uint64_t)), 1023);
|
||||
GTEST_ASSERT_EQ(*(TSKEY *)taosHashGet(pSU->pMap, &uid, sizeof(uint64_t)), 1023);
|
||||
|
||||
for(int i=3; i < 1024; i++) {
|
||||
for (int i = 3; i < 1024; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, uid, i), true);
|
||||
}
|
||||
GTEST_ASSERT_EQ(*(TSKEY*)taosHashGet(pSU->pMap, &uid, sizeof(uint64_t)), 1023);
|
||||
GTEST_ASSERT_EQ(*(TSKEY *)taosHashGet(pSU->pMap, &uid, sizeof(uint64_t)), 1023);
|
||||
|
||||
SUpdateInfo *pSU1 = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark);
|
||||
for(int i=1; i <= watermark / interval; i++) {
|
||||
for (int i = 1; i <= watermark / interval; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU1, 1, i * interval + 5), false);
|
||||
GTEST_ASSERT_EQ(pSU1->minTS, interval);
|
||||
GTEST_ASSERT_EQ(pSU1->numSBFs, watermark / interval);
|
||||
}
|
||||
for(int i=0; i < pSU1->numSBFs; i++) {
|
||||
SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU1->pTsSBFs, i);
|
||||
for (int i = 0; i < pSU1->numSBFs; i++) {
|
||||
SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU1->pTsSBFs, i);
|
||||
SBloomFilter *pBF = (SBloomFilter *)taosArrayGetP(pSBF->bfArray, 0);
|
||||
GTEST_ASSERT_EQ(pBF->size, 1);
|
||||
}
|
||||
|
||||
for(int i= watermark / interval + 1, j = 2 ; i <= watermark / interval + 10; i++,j++) {
|
||||
for (int i = watermark / interval + 1, j = 2; i <= watermark / interval + 10; i++, j++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU1, 1, i * interval + 5), false);
|
||||
GTEST_ASSERT_EQ(pSU1->minTS, interval*j);
|
||||
GTEST_ASSERT_EQ(pSU1->minTS, interval * j);
|
||||
GTEST_ASSERT_EQ(pSU1->numSBFs, watermark / interval);
|
||||
SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU1->pTsSBFs, pSU1->numSBFs - 1);
|
||||
SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU1->pTsSBFs, pSU1->numSBFs - 1);
|
||||
SBloomFilter *pBF = (SBloomFilter *)taosArrayGetP(pSBF->bfArray, 0);
|
||||
GTEST_ASSERT_EQ(pBF->size, 1);
|
||||
}
|
||||
|
||||
for(int i= watermark / interval * 100, j = 0; j < 10; i+= (watermark / interval * 2), j++) {
|
||||
for (int i = watermark / interval * 100, j = 0; j < 10; i += (watermark / interval * 2), j++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU1, 1, i * interval + 5), false);
|
||||
GTEST_ASSERT_EQ(pSU1->minTS, (i-(pSU1->numSBFs-1))*interval);
|
||||
GTEST_ASSERT_EQ(pSU1->minTS, (i - (pSU1->numSBFs - 1)) * interval);
|
||||
GTEST_ASSERT_EQ(pSU1->numSBFs, watermark / interval);
|
||||
}
|
||||
|
||||
SUpdateInfo *pSU2 = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU2, 1, 1 * interval + 5), false);
|
||||
GTEST_ASSERT_EQ(pSU2->minTS, interval);
|
||||
for(int i= watermark / interval * 100, j = 0; j < 10; i+= (watermark / interval * 10), j++) {
|
||||
for (int i = watermark / interval * 100, j = 0; j < 10; i += (watermark / interval * 10), j++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU2, 1, i * interval + 5), false);
|
||||
GTEST_ASSERT_EQ(pSU2->minTS, (i-(pSU2->numSBFs-1))*interval);
|
||||
GTEST_ASSERT_EQ(pSU2->minTS, (i - (pSU2->numSBFs - 1)) * interval);
|
||||
GTEST_ASSERT_EQ(pSU2->numSBFs, watermark / interval);
|
||||
TSKEY uid2 = 1;
|
||||
GTEST_ASSERT_EQ(*(TSKEY*)taosHashGet(pSU2->pMap, &uid2, sizeof(uint64_t)), i * interval + 5);
|
||||
GTEST_ASSERT_EQ(*(TSKEY *)taosHashGet(pSU2->pMap, &uid2, sizeof(uint64_t)), i * interval + 5);
|
||||
}
|
||||
|
||||
SUpdateInfo *pSU3 = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark);
|
||||
for(int j = 1; j < 100; j++) {
|
||||
for(int i = 0; i < pSU3->numSBFs; i++) {
|
||||
for (int j = 1; j < 100; j++) {
|
||||
for (int i = 0; i < pSU3->numSBFs; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU3, i, i * interval + 5 * j), false);
|
||||
GTEST_ASSERT_EQ(pSU3->minTS, 0);
|
||||
GTEST_ASSERT_EQ(pSU3->numSBFs, watermark / interval);
|
||||
uint64_t uid3 = i;
|
||||
GTEST_ASSERT_EQ(*(TSKEY*)taosHashGet(pSU3->pMap, &uid3, sizeof(uint64_t)), i * interval + 5 * j);
|
||||
SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU3->pTsSBFs, i);
|
||||
GTEST_ASSERT_EQ(*(TSKEY *)taosHashGet(pSU3->pMap, &uid3, sizeof(uint64_t)), i * interval + 5 * j);
|
||||
SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU3->pTsSBFs, i);
|
||||
SBloomFilter *pBF = (SBloomFilter *)taosArrayGetP(pSBF->bfArray, 0);
|
||||
GTEST_ASSERT_EQ(pBF->size, j);
|
||||
}
|
||||
|
@ -130,19 +130,19 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
|
|||
|
||||
SUpdateInfo *pSU7 = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark);
|
||||
updateInfoAddCloseWindowSBF(pSU7);
|
||||
for(int64_t i = 1; i < 2048000; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7,i, i), false);
|
||||
for (int64_t i = 1; i < 2048000; i++) {
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7, i, i), false);
|
||||
}
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7,100, 1), true);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7,110, 10), true);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7,200, 20), true);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7, 100, 1), true);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7, 110, 10), true);
|
||||
GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7, 200, 20), true);
|
||||
|
||||
int32_t bufLen = updateInfoSerialize(NULL, 0, pSU7);
|
||||
void* buf = taosMemoryCalloc(1, bufLen);
|
||||
void *buf = taosMemoryCalloc(1, bufLen);
|
||||
int32_t resSize = updateInfoSerialize(buf, bufLen, pSU7);
|
||||
|
||||
SUpdateInfo *pSU6 = updateInfoInit(0, TSDB_TIME_PRECISION_MILLI, 0);
|
||||
int32_t desSize = updateInfoDeserialize(buf, bufLen, pSU6);
|
||||
int32_t desSize = updateInfoDeserialize(buf, bufLen, pSU6);
|
||||
GTEST_ASSERT_EQ(desSize, 0);
|
||||
|
||||
GTEST_ASSERT_EQ(pSU7->interval, pSU6->interval);
|
||||
|
@ -150,7 +150,7 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
|
|||
GTEST_ASSERT_EQ(pSU7->minTS, pSU6->minTS);
|
||||
GTEST_ASSERT_EQ(pSU7->numBuckets, pSU6->numBuckets);
|
||||
GTEST_ASSERT_EQ(pSU7->numSBFs, pSU6->numSBFs);
|
||||
GTEST_ASSERT_EQ(pSU7->scanGroupId, pSU6->scanGroupId);
|
||||
GTEST_ASSERT_EQ(pSU7->scanGroupId, pSU6->scanGroupId);
|
||||
GTEST_ASSERT_EQ(pSU7->scanWindow.ekey, pSU6->scanWindow.ekey);
|
||||
GTEST_ASSERT_EQ(pSU7->scanWindow.skey, pSU6->scanWindow.skey);
|
||||
GTEST_ASSERT_EQ(pSU7->watermark, pSU6->watermark);
|
||||
|
@ -158,27 +158,27 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
|
|||
|
||||
int32_t mapSize = taosHashGetSize(pSU7->pMap);
|
||||
GTEST_ASSERT_EQ(mapSize, taosHashGetSize(pSU6->pMap));
|
||||
void* pIte = NULL;
|
||||
void *pIte = NULL;
|
||||
size_t keyLen = 0;
|
||||
while ((pIte = taosHashIterate(pSU7->pMap, pIte)) != NULL) {
|
||||
void* key = taosHashGetKey(pIte, &keyLen);
|
||||
void* value6 = taosHashGet(pSU6->pMap, key, keyLen);
|
||||
GTEST_ASSERT_EQ(*(TSKEY*)pIte, *(TSKEY*)value6);
|
||||
void *key = taosHashGetKey(pIte, &keyLen);
|
||||
void *value6 = taosHashGet(pSU6->pMap, key, keyLen);
|
||||
GTEST_ASSERT_EQ(*(TSKEY *)pIte, *(TSKEY *)value6);
|
||||
}
|
||||
|
||||
int32_t buSize = taosArrayGetSize(pSU7->pTsBuckets);
|
||||
GTEST_ASSERT_EQ(buSize, taosArrayGetSize(pSU6->pTsBuckets));
|
||||
for (int32_t i = 0; i < buSize; i++) {
|
||||
TSKEY ts1 = *(TSKEY*)taosArrayGet(pSU7->pTsBuckets, i);
|
||||
TSKEY ts2 = *(TSKEY*)taosArrayGet(pSU6->pTsBuckets, i);
|
||||
TSKEY ts1 = *(TSKEY *)taosArrayGet(pSU7->pTsBuckets, i);
|
||||
TSKEY ts2 = *(TSKEY *)taosArrayGet(pSU6->pTsBuckets, i);
|
||||
GTEST_ASSERT_EQ(ts1, ts2);
|
||||
}
|
||||
int32_t lSize = taosArrayGetSize(pSU7->pTsSBFs);
|
||||
int32_t rSize = taosArrayGetSize(pSU6->pTsSBFs);
|
||||
GTEST_ASSERT_EQ(lSize, rSize);
|
||||
for (int32_t i = 0; i < lSize; i++) {
|
||||
SScalableBf* pLeftSBF = (SScalableBf*)taosArrayGetP(pSU7->pTsSBFs, i);
|
||||
SScalableBf* pRightSBF = (SScalableBf*)taosArrayGetP(pSU6->pTsSBFs, i);
|
||||
SScalableBf *pLeftSBF = (SScalableBf *)taosArrayGetP(pSU7->pTsSBFs, i);
|
||||
SScalableBf *pRightSBF = (SScalableBf *)taosArrayGetP(pSU6->pTsSBFs, i);
|
||||
GTEST_ASSERT_EQ(equalSBF(pLeftSBF, pRightSBF), true);
|
||||
}
|
||||
|
||||
|
@ -190,10 +190,9 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
|
|||
updateInfoDestroy(pSU5);
|
||||
updateInfoDestroy(pSU6);
|
||||
updateInfoDestroy(pSU7);
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int main(int argc, char *argv[]) {
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
|
@ -99,7 +99,7 @@ class Client {
|
|||
private:
|
||||
tsem_t sem;
|
||||
SRpcInit rpcInit_;
|
||||
void * transCli;
|
||||
void *transCli;
|
||||
SRpcMsg resp;
|
||||
};
|
||||
class Server {
|
||||
|
@ -146,7 +146,7 @@ class Server {
|
|||
|
||||
private:
|
||||
SRpcInit rpcInit_;
|
||||
void * transSrv;
|
||||
void *transSrv;
|
||||
};
|
||||
static void processReq(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
||||
SRpcMsg rpcMsg = {0};
|
||||
|
@ -330,7 +330,7 @@ TEST_F(TransEnv, clientUserDefined) {
|
|||
|
||||
TEST_F(TransEnv, cliPersistHandle) {
|
||||
SRpcMsg resp = {0};
|
||||
void * handle = NULL;
|
||||
void *handle = NULL;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
SRpcMsg req = {0};
|
||||
req.info = resp.info;
|
||||
|
@ -366,7 +366,7 @@ TEST_F(TransEnv, srvReleaseHandle) {
|
|||
SRpcMsg resp = {0};
|
||||
tr->SetSrvContinueSend(processReleaseHandleCb);
|
||||
// tr->Restart(processReleaseHandleCb);
|
||||
void * handle = NULL;
|
||||
void *handle = NULL;
|
||||
SRpcMsg req = {0};
|
||||
for (int i = 0; i < 1; i++) {
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
|
|
@ -11,23 +11,23 @@
|
|||
|
||||
typedef struct SThreadObj {
|
||||
TdThread thread;
|
||||
uv_pipe_t * pipe;
|
||||
uv_loop_t * loop;
|
||||
uv_pipe_t *pipe;
|
||||
uv_loop_t *loop;
|
||||
uv_async_t *workerAsync; //
|
||||
int fd;
|
||||
} SThreadObj;
|
||||
|
||||
typedef struct SServerObj {
|
||||
uv_tcp_t server;
|
||||
uv_loop_t * loop;
|
||||
uv_loop_t *loop;
|
||||
int workerIdx;
|
||||
int numOfThread;
|
||||
SThreadObj **pThreadObj;
|
||||
uv_pipe_t ** pipe;
|
||||
uv_pipe_t **pipe;
|
||||
} SServerObj;
|
||||
|
||||
typedef struct SConnCtx {
|
||||
uv_tcp_t * pClient;
|
||||
uv_tcp_t *pClient;
|
||||
uv_timer_t *pTimer;
|
||||
uv_async_t *pWorkerAsync;
|
||||
int ref;
|
||||
|
|
|
@ -8,35 +8,42 @@ ORIGIN_DIR=$(pwd)
|
|||
cd ${PRJ_ROOT_DIR}
|
||||
|
||||
FORMAT_DIR_LIST=(
|
||||
"include"
|
||||
"source/os"
|
||||
"source/util"
|
||||
"source/common"
|
||||
"source/libs/cache"
|
||||
"source/libs/catalog"
|
||||
"source/libs/command"
|
||||
"source/libs/executor"
|
||||
# "source/libs/function"
|
||||
# "source/libs/index"
|
||||
# "source/libs/monitor"
|
||||
# "source/libs/nodes"
|
||||
# "source/libs/parser"
|
||||
# "source/libs/planner"
|
||||
# "source/libs/qcom"
|
||||
# "source/libs/qworker"
|
||||
# "source/libs/scalar"
|
||||
# "source/libs/stream"
|
||||
# "source/libs/sync"
|
||||
"source/libs/tdb"
|
||||
"source/libs/tfs"
|
||||
# "source/libs/transport"
|
||||
"source/libs/wal"
|
||||
# "source/client"
|
||||
"source/dnode"
|
||||
"${PRJ_ROOT_DIR}/include"
|
||||
"${PRJ_ROOT_DIR}/source/os"
|
||||
"${PRJ_ROOT_DIR}/source/util"
|
||||
"${PRJ_ROOT_DIR}/source/common"
|
||||
"${PRJ_ROOT_DIR}/source/libs/cache"
|
||||
"${PRJ_ROOT_DIR}/source/libs/catalog"
|
||||
"${PRJ_ROOT_DIR}/source/libs/command"
|
||||
"${PRJ_ROOT_DIR}/source/libs/executor"
|
||||
# "${PRJ_ROOT_DIR}/source/libs/function"
|
||||
"${PRJ_ROOT_DIR}/source/libs/index"
|
||||
"${PRJ_ROOT_DIR}/source/libs/monitor"
|
||||
"${PRJ_ROOT_DIR}/source/libs/nodes"
|
||||
# "${PRJ_ROOT_DIR}/source/libs/parser"
|
||||
"${PRJ_ROOT_DIR}/source/libs/planner"
|
||||
# "${PRJ_ROOT_DIR}/source/libs/qcom"
|
||||
# "${PRJ_ROOT_DIR}/source/libs/qworker"
|
||||
# "${PRJ_ROOT_DIR}/source/libs/scalar"
|
||||
"${PRJ_ROOT_DIR}/source/libs/stream"
|
||||
# "${PRJ_ROOT_DIR}/source/libs/sync"
|
||||
"${PRJ_ROOT_DIR}/source/libs/tdb"
|
||||
"${PRJ_ROOT_DIR}/source/libs/tfs"
|
||||
"${PRJ_ROOT_DIR}/source/libs/transport"
|
||||
"${PRJ_ROOT_DIR}/source/libs/wal"
|
||||
# "${PRJ_ROOT_DIR}/source/client"
|
||||
"${PRJ_ROOT_DIR}/source/dnode"
|
||||
)
|
||||
|
||||
EXCLUDE_DIR_LIST=(
|
||||
)
|
||||
|
||||
EXCLUDE_FILE_LIST=(
|
||||
"source/libs/parser/sql.c"
|
||||
)
|
||||
|
||||
for d in ${FORMAT_DIR_LIST[@]}; do
|
||||
for f in $(find ${PRJ_ROOT_DIR}/$d/ -regex '.*\.\(cpp\|hpp\|c\|h\)'); do
|
||||
for f in $(find $d -regex '.*\.\(cpp\|hpp\|c\|h\)'); do
|
||||
${FORMAT_BIN} -i $f
|
||||
done
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue