more
This commit is contained in:
parent
f7a8ef266c
commit
d72faa1e6b
|
@ -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 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#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) {
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
Loading…
Reference in New Issue