Merge pull request #10975 from taosdata/feature/3.0_wxy
SSubmitBlk add suid field
This commit is contained in:
commit
c67017ab8e
|
@ -215,7 +215,7 @@ typedef struct {
|
||||||
// Submit message for one table
|
// Submit message for one table
|
||||||
typedef struct SSubmitBlk {
|
typedef struct SSubmitBlk {
|
||||||
int64_t uid; // table unique id
|
int64_t uid; // table unique id
|
||||||
int32_t tid; // table id
|
int64_t suid; // stable id
|
||||||
int32_t padding; // TODO just for padding here
|
int32_t padding; // TODO just for padding here
|
||||||
int32_t sversion; // data schema version
|
int32_t sversion; // data schema version
|
||||||
int32_t dataLen; // data part length, not including the SSubmitBlk head
|
int32_t dataLen; // data part length, not including the SSubmitBlk head
|
||||||
|
|
|
@ -44,7 +44,7 @@ int32_t tqReadHandleSetMsg(STqReadHandle* pReadHandle, SSubmitReq* pMsg, int64_t
|
||||||
if (pReadHandle->pBlock == NULL) break;
|
if (pReadHandle->pBlock == NULL) break;
|
||||||
|
|
||||||
pReadHandle->pBlock->uid = htobe64(pReadHandle->pBlock->uid);
|
pReadHandle->pBlock->uid = htobe64(pReadHandle->pBlock->uid);
|
||||||
pReadHandle->pBlock->tid = htonl(pReadHandle->pBlock->tid);
|
pReadHandle->pBlock->suid = htobe64(pReadHandle->pBlock->suid);
|
||||||
pReadHandle->pBlock->sversion = htonl(pReadHandle->pBlock->sversion);
|
pReadHandle->pBlock->sversion = htonl(pReadHandle->pBlock->sversion);
|
||||||
pReadHandle->pBlock->dataLen = htonl(pReadHandle->pBlock->dataLen);
|
pReadHandle->pBlock->dataLen = htonl(pReadHandle->pBlock->dataLen);
|
||||||
pReadHandle->pBlock->schemaLen = htonl(pReadHandle->pBlock->schemaLen);
|
pReadHandle->pBlock->schemaLen = htonl(pReadHandle->pBlock->schemaLen);
|
||||||
|
|
|
@ -248,7 +248,7 @@ static int tsdbScanAndConvertSubmitMsg(STsdb *pTsdb, SSubmitReq *pMsg) {
|
||||||
if (pBlock == NULL) break;
|
if (pBlock == NULL) break;
|
||||||
|
|
||||||
pBlock->uid = htobe64(pBlock->uid);
|
pBlock->uid = htobe64(pBlock->uid);
|
||||||
pBlock->tid = htonl(pBlock->tid);
|
pBlock->suid = htobe64(pBlock->suid);
|
||||||
pBlock->sversion = htonl(pBlock->sversion);
|
pBlock->sversion = htonl(pBlock->sversion);
|
||||||
pBlock->dataLen = htonl(pBlock->dataLen);
|
pBlock->dataLen = htonl(pBlock->dataLen);
|
||||||
pBlock->schemaLen = htonl(pBlock->schemaLen);
|
pBlock->schemaLen = htonl(pBlock->schemaLen);
|
||||||
|
|
|
@ -118,7 +118,7 @@ static FORCE_INLINE void getMemRowAppendInfo(SSchema *pSchema, uint8_t rowType,
|
||||||
}
|
}
|
||||||
|
|
||||||
static FORCE_INLINE int32_t setBlockInfo(SSubmitBlk *pBlocks, STableDataBlocks* dataBuf, int32_t numOfRows) {
|
static FORCE_INLINE int32_t setBlockInfo(SSubmitBlk *pBlocks, STableDataBlocks* dataBuf, int32_t numOfRows) {
|
||||||
pBlocks->tid = dataBuf->pTableMeta->suid;
|
pBlocks->suid = (TSDB_NORMAL_TABLE == dataBuf->pTableMeta->tableType ? dataBuf->pTableMeta->uid : dataBuf->pTableMeta->suid);
|
||||||
pBlocks->uid = dataBuf->pTableMeta->uid;
|
pBlocks->uid = dataBuf->pTableMeta->uid;
|
||||||
pBlocks->sversion = dataBuf->pTableMeta->sversion;
|
pBlocks->sversion = dataBuf->pTableMeta->sversion;
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ static void buildMsgHeader(STableDataBlocks* src, SVgDataBlocks* blocks) {
|
||||||
while (numOfBlocks--) {
|
while (numOfBlocks--) {
|
||||||
int32_t dataLen = blk->dataLen;
|
int32_t dataLen = blk->dataLen;
|
||||||
blk->uid = htobe64(blk->uid);
|
blk->uid = htobe64(blk->uid);
|
||||||
blk->tid = htonl(blk->tid);
|
blk->suid = htobe64(blk->suid);
|
||||||
blk->padding = htonl(blk->padding);
|
blk->padding = htonl(blk->padding);
|
||||||
blk->sversion = htonl(blk->sversion);
|
blk->sversion = htonl(blk->sversion);
|
||||||
blk->dataLen = htonl(blk->dataLen);
|
blk->dataLen = htonl(blk->dataLen);
|
||||||
|
|
|
@ -72,7 +72,7 @@ protected:
|
||||||
SSubmitBlk* blk = (SSubmitBlk*)(submit + 1);
|
SSubmitBlk* blk = (SSubmitBlk*)(submit + 1);
|
||||||
for (int32_t i = 0; i < numOfBlocks; ++i) {
|
for (int32_t i = 0; i < numOfBlocks; ++i) {
|
||||||
cout << "Block:" << i << endl;
|
cout << "Block:" << i << endl;
|
||||||
cout << "\tuid:" << be64toh(blk->uid) << ", tid:" << ntohl(blk->tid) << ", padding:" << ntohl(blk->padding) << ", sversion:" << ntohl(blk->sversion)
|
cout << "\tuid:" << be64toh(blk->uid) << ", tid:" << be64toh(blk->suid) << ", padding:" << ntohl(blk->padding) << ", sversion:" << ntohl(blk->sversion)
|
||||||
<< ", dataLen:" << ntohl(blk->dataLen) << ", schemaLen:" << ntohl(blk->schemaLen) << ", numOfRows:" << ntohs(blk->numOfRows) << endl;
|
<< ", dataLen:" << ntohl(blk->dataLen) << ", schemaLen:" << ntohl(blk->schemaLen) << ", numOfRows:" << ntohs(blk->numOfRows) << endl;
|
||||||
blk = (SSubmitBlk*)(blk->data + ntohl(blk->dataLen));
|
blk = (SSubmitBlk*)(blk->data + ntohl(blk->dataLen));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue