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

more code

上级 66aefc39
......@@ -21,25 +21,34 @@ typedef struct {
typedef struct {
SArray *aBlockIdx; // SArray<SBlockIdx>
SMapData mDataBlk; // SMapData<SDataBlk>
SBlockData bData
SBlockData bData;
int32_t iBlockIdx;
int32_t iDataBlk;
int32_t iRow;
} SDataDIter;
typedef struct {
SArray *aSttBlk; // SArray<SSttBlk>
SBlockData bData;
int32_t iSttBlk;
int32_t iRow;
} SSttDIter;
typedef struct {
STsdb *pTsdb;
STsdbFS fs;
int64_t cid;
int32_t fid;
SDFileSet *pDFileSet;
SRBTree rtree;
STsdb *pTsdb;
STsdbFS fs;
int64_t cid;
int32_t fid;
SDataFReader *pReader;
SDFileSet *pDFileSet;
SRBTree rtree;
} STsdbCompactor;
#define TSDB_FLG_DEEP_COMPACT 0x1
// ITER =========================
// COMPACT =========================
static int32_t tsdbBeginCompact(STsdb *pTsdb, STsdbCompactor *pCompactor) {
int32_t code = 0;
int32_t lino = 0;
......@@ -94,6 +103,11 @@ static int32_t tsdbDeepCompact(STsdbCompactor *pCompactor) {
STsdb *pTsdb = pCompactor->pTsdb;
code = tsdbDataFReaderOpen(&pCompactor->pReader, pTsdb, pCompactor->pDFileSet);
TSDB_CHECK_CODE(code, lino, _exit);
//
_exit:
if (code) {
tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
......@@ -107,8 +121,6 @@ static int32_t tsdbShallowCompact(STsdbCompactor *pCompactor) {
STsdb *pTsdb = pCompactor->pTsdb;
// TODO
_exit:
if (code) {
tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
......@@ -132,6 +144,8 @@ int32_t tsdbCompact(STsdb *pTsdb, int32_t flag) {
compactor.pDFileSet = (SDFileSet *)taosArraySearch(compactor.fs.aDFileSet, &compactor.fid, tDFileSetCmprFn, TD_GT);
if (compactor.pDFileSet == NULL) break;
compactor.fid = compactor.pDFileSet->fid;
if (flag & TSDB_FLG_DEEP_COMPACT) {
code = tsdbDeepCompact(&compactor);
TSDB_CHECK_CODE(code, lino, _exit);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册