提交 d72faa1e 编写于 作者: H Hongze Cheng

more

上级 f7a8ef26
...@@ -59,7 +59,7 @@ typedef struct { ...@@ -59,7 +59,7 @@ typedef struct {
struct STbOptions { struct STbOptions {
uint8_t type; uint8_t type;
char* name; char* name;
uint64_t ttl; // time to live uint32_t ttl; // time to live in (SECONDS)
SSMAOptions bsma; // Block-wise sma SSMAOptions bsma; // Block-wise sma
union { union {
SSTbOptions stbOptions; SSTbOptions stbOptions;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#include "metaDef.h" #include "metaDef.h"
#include "tcoding.h"
int metaValidateTbOptions(SMeta *pMeta, const STbOptions *pTbOptions) { int metaValidateTbOptions(SMeta *pMeta, const STbOptions *pTbOptions) {
// TODO // TODO
...@@ -21,6 +22,28 @@ int metaValidateTbOptions(SMeta *pMeta, const STbOptions *pTbOptions) { ...@@ -21,6 +22,28 @@ int metaValidateTbOptions(SMeta *pMeta, const STbOptions *pTbOptions) {
} }
size_t metaEncodeTbObjFromTbOptions(const STbOptions *pTbOptions, void *pBuf, size_t bsize) { size_t metaEncodeTbObjFromTbOptions(const STbOptions *pTbOptions, void *pBuf, size_t bsize) {
// TODO void **ppBuf = &pBuf;
return 0; int tlen = 0;
tlen += taosEncodeFixedU8(ppBuf, pTbOptions->type);
tlen += taosEncodeString(ppBuf, pTbOptions->name);
tlen += taosEncodeFixedU32(ppBuf, pTbOptions->ttl);
switch (pTbOptions->type) {
case META_SUPER_TABLE:
tlen += taosEncodeFixedU64(ppBuf, pTbOptions->stbOptions.uid);
tlen += tdEncodeSchema(ppBuf, pTbOptions->stbOptions.pTagSchema);
// TODO: encode schema version array
break;
case META_CHILD_TABLE:
tlen += taosEncodeFixedU64(ppBuf, pTbOptions->ctbOptions.suid);
break;
case META_NORMAL_TABLE:
// TODO: encode schema version array
break;
default:
break;
}
return tlen;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册