diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 69f95237ef..e229f2b2c2 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -269,12 +269,15 @@ typedef struct SSchema { typedef struct { char name[TSDB_TABLE_FNAME_LEN]; int8_t igExists; + float xFilesFactor; + int32_t aggregationMethod; + int32_t delay; int32_t numOfColumns; int32_t numOfTags; int32_t commentLen; SArray* pColumns; SArray* pTags; - char *comment; + char* comment; } SMCreateStbReq; int32_t tSerializeSMCreateStbReq(void* buf, int32_t bufLen, SMCreateStbReq* pReq); diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index e5a0f2a28e..735bc67fcc 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -508,6 +508,9 @@ int32_t tSerializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pReq if (tStartEncode(&encoder) < 0) return -1; if (tEncodeCStr(&encoder, pReq->name) < 0) return -1; if (tEncodeI8(&encoder, pReq->igExists) < 0) return -1; + if (tEncodeFloat(&encoder, pReq->xFilesFactor) < 0) return -1; + if (tEncodeI32(&encoder, pReq->aggregationMethod) < 0) return -1; + if (tEncodeI32(&encoder, pReq->delay) < 0) return -1; if (tEncodeI32(&encoder, pReq->numOfColumns) < 0) return -1; if (tEncodeI32(&encoder, pReq->numOfTags) < 0) return -1; if (tEncodeI32(&encoder, pReq->commentLen) < 0) return -1; @@ -541,6 +544,9 @@ int32_t tDeserializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pR if (tStartDecode(&decoder) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->name) < 0) return -1; if (tDecodeI8(&decoder, &pReq->igExists) < 0) return -1; + if (tDecodeFloat(&decoder, &pReq->xFilesFactor) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->aggregationMethod) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->delay) < 0) return -1; if (tDecodeI32(&decoder, &pReq->numOfColumns) < 0) return -1; if (tDecodeI32(&decoder, &pReq->numOfTags) < 0) return -1; if (tDecodeI32(&decoder, &pReq->commentLen) < 0) return -1; diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index c5372f6875..56d904f9c2 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -341,6 +341,9 @@ typedef struct { int64_t dbUid; int32_t version; int32_t nextColId; + float xFilesFactor; + int32_t aggregationMethod; + int32_t delay; int32_t numOfColumns; int32_t numOfTags; int32_t commentLen; diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index e8d6157661..52a257eaeb 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -85,6 +85,9 @@ SSdbRaw *mndStbActionEncode(SStbObj *pStb) { SDB_SET_INT64(pRaw, dataPos, pStb->dbUid, STB_ENCODE_OVER) SDB_SET_INT32(pRaw, dataPos, pStb->version, STB_ENCODE_OVER) SDB_SET_INT32(pRaw, dataPos, pStb->nextColId, STB_ENCODE_OVER) + SDB_SET_INT32(pRaw, dataPos, (int32_t)(pStb->xFilesFactor * 10000), STB_ENCODE_OVER) + SDB_SET_INT32(pRaw, dataPos, pStb->aggregationMethod, STB_ENCODE_OVER) + SDB_SET_INT32(pRaw, dataPos, pStb->delay, STB_ENCODE_OVER) SDB_SET_INT32(pRaw, dataPos, pStb->numOfColumns, STB_ENCODE_OVER) SDB_SET_INT32(pRaw, dataPos, pStb->numOfTags, STB_ENCODE_OVER) SDB_SET_INT32(pRaw, dataPos, pStb->commentLen, STB_ENCODE_OVER) @@ -148,6 +151,11 @@ static SSdbRow *mndStbActionDecode(SSdbRaw *pRaw) { SDB_GET_INT64(pRaw, dataPos, &pStb->dbUid, STB_DECODE_OVER) SDB_GET_INT32(pRaw, dataPos, &pStb->version, STB_DECODE_OVER) SDB_GET_INT32(pRaw, dataPos, &pStb->nextColId, STB_DECODE_OVER) + int32_t xFilesFactor = 0; + SDB_GET_INT32(pRaw, dataPos, &xFilesFactor, STB_DECODE_OVER) + pStb->xFilesFactor = xFilesFactor / 10000.0f; + SDB_GET_INT32(pRaw, dataPos, &pStb->aggregationMethod, STB_DECODE_OVER) + SDB_GET_INT32(pRaw, dataPos, &pStb->delay, STB_DECODE_OVER) SDB_GET_INT32(pRaw, dataPos, &pStb->numOfColumns, STB_DECODE_OVER) SDB_GET_INT32(pRaw, dataPos, &pStb->numOfTags, STB_DECODE_OVER) SDB_GET_INT32(pRaw, dataPos, &pStb->commentLen, STB_DECODE_OVER)