tsdbFile.h 1.3 KB
Newer Older
H
Hongze Cheng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _TSDB_FILE_H
#define _TSDB_FILE_H

#include "tsdb.h"

#ifdef __cplusplus
extern "C" {
#endif

H
Hongze Cheng 已提交
25
typedef enum {
H
Hongze Cheng 已提交
26 27
  TSDB_FTYPE_NONE = 0,  // NONE
  TSDB_FTYPE_HEAD,      // .head
H
Hongze Cheng 已提交
28 29 30
  TSDB_FTYPE_DATA,      // .data
  TSDB_FTYPE_SMA,       // .sma
  TSDB_FTYPE_TOMB,      // .tomb
H
Hongze Cheng 已提交
31
  TSDB_FTYPE_STT,       // .stt
H
Hongze Cheng 已提交
32
} tsdb_ftype_t;
H
Hongze Cheng 已提交
33

H
Hongze Cheng 已提交
34
struct STFile {
H
Hongze Cheng 已提交
35
  tsdb_ftype_t type;
H
Hongze Cheng 已提交
36 37 38 39
  SDiskID      diskId;
  int64_t      size;
  int64_t      cid;
  int32_t      fid;
H
Hongze Cheng 已提交
40 41 42

  int32_t ref;
  char    fname[TSDB_FILENAME_LEN];
H
Hongze Cheng 已提交
43
};
H
Hongze Cheng 已提交
44

H
Hongze Cheng 已提交
45 46 47
int32_t tsdbTFileInit(STsdb *pTsdb, struct STFile *pFile);
int32_t tsdbTFileClear(struct STFile *pFile);

H
Hongze Cheng 已提交
48 49 50 51 52
#ifdef __cplusplus
}
#endif

#endif /*_TSDB_FILE_H*/