tsdbFile.h 835 字节
Newer Older
H
more  
Hongze Cheng 已提交
1 2 3
#if !defined(_TD_TSDB_FILE_H_)
#define _TD_TSDB_FILE_H_

H
more  
hzcheng 已提交
4 5
#include <stdint.h>
// #include "tstring.h"
H
more  
Hongze Cheng 已提交
6 7 8

typedef int32_t file_id_t;

H
Hongze Cheng 已提交
9 10 11 12 13
typedef enum {
  TSDB_FILE_TYPE_HEAD,  // .head file type
  TSDB_FILE_TYPE_DATA,  // .data file type
  TSDB_FILE_TYPE_LAST,  // .last file type
  TSDB_FILE_TYPE_META   // .meta file type
H
more  
Hongze Cheng 已提交
14 15
} TSDB_FILE_TYPE;

H
Hongze Cheng 已提交
16 17 18 19 20 21 22
const char *tsdbFileSuffix[] = {
  ".head",  // TSDB_FILE_TYPE_HEAD
  ".data",  // TSDB_FILE_TYPE_DATA
  ".last",  // TSDB_FILE_TYPE_LAST
  ".meta"   // TSDB_FILE_TYPE_META
};

H
more  
Hongze Cheng 已提交
23 24 25 26 27
typedef struct {
  int64_t fileSize;
} SFileInfo;

typedef struct {
H
more  
hzcheng 已提交
28
  char *    fname;
H
more  
Hongze Cheng 已提交
29
  SFileInfo fInfo;
H
more  
Hongze Cheng 已提交
30 31
} SFILE;

H
more  
Hongze Cheng 已提交
32 33 34 35 36 37 38
typedef struct {
  int64_t offset;
  int64_t skey;
  int64_t ekey;
  int16_t numOfBlocks;
} SDataBlock;

H
Hongze Cheng 已提交
39
char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type);
H
more  
Hongze Cheng 已提交
40 41

#endif  // _TD_TSDB_FILE_H_