From 18c92c1cf4d7573210f866457428dd7bff13a9e0 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Tue, 9 Jun 2020 04:16:09 +0000 Subject: [PATCH] [TD-188] adjust format and remove some unnecessary code --- src/common/inc/tdataformat.h | 4 ++-- src/common/src/tdataformat.c | 4 ---- src/inc/tsdb.h | 8 ++++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/common/inc/tdataformat.h b/src/common/inc/tdataformat.h index 441af9a215..e1f17b09a9 100644 --- a/src/common/inc/tdataformat.h +++ b/src/common/inc/tdataformat.h @@ -69,8 +69,8 @@ typedef struct { int version; // version int numOfCols; // Number of columns appended int tlen; // maximum length of a SDataRow without the header part - int16_t flen; // First part length in a SDataRow after the header part - int16_t vlen; // pure value part length, excluded the overhead + int16_t flen; // First part length in a SDataRow after the header part + int16_t vlen; // pure value part length, excluded the overhead STColumn columns[]; } STSchema; diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index cb84c376eb..0e4ffda78b 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -37,7 +37,6 @@ void *tdEncodeSchema(void *dst, STSchema *pSchema) { T_APPEND_MEMBER(dst, pSchema, STSchema, version); T_APPEND_MEMBER(dst, pSchema, STSchema, numOfCols); - T_APPEND_MEMBER(dst, pSchema, STSchema, vlen); for (int i = 0; i < schemaNCols(pSchema); i++) { STColumn *pCol = schemaColAt(pSchema, i); T_APPEND_MEMBER(dst, pCol, STColumn, type); @@ -54,12 +53,10 @@ void *tdEncodeSchema(void *dst, STSchema *pSchema) { STSchema *tdDecodeSchema(void **psrc) { int totalCols = 0; int version = 0; - int16_t vlen = 0; STSchemaBuilder schemaBuilder = {0}; T_READ_MEMBER(*psrc, int, version); T_READ_MEMBER(*psrc, int, totalCols); - T_READ_MEMBER(*psrc, int16_t, vlen); if (tdInitTSchemaBuilder(&schemaBuilder, version) < 0) return NULL; @@ -78,7 +75,6 @@ STSchema *tdDecodeSchema(void **psrc) { } STSchema *pSchema = tdGetSchemaFromBuilder(&schemaBuilder); - pSchema->vlen = vlen; tdDestroyTSchemaBuilder(&schemaBuilder); return pSchema; } diff --git a/src/inc/tsdb.h b/src/inc/tsdb.h index bdb61e6ee1..add85d9438 100644 --- a/src/inc/tsdb.h +++ b/src/inc/tsdb.h @@ -67,10 +67,10 @@ typedef struct { // --------- TSDB REPOSITORY USAGE STATISTICS typedef struct { - int64_t totalStorage; //total bytes occupie - int64_t compStorage; - int64_t pointsWritten; //total data points written -}STsdbStat; + int64_t totalStorage; // total bytes occupie + int64_t compStorage; + int64_t pointsWritten; // total data points written +} STsdbStat; typedef void TsdbRepoT; // use void to hide implementation details from outside